2005-11-17 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-11-17  Martin Baulig  <martin@ximian.com>
2
3         * expression.cs (Indexers.GetIndexersForType): Added support for
4         generic parameters; fixes #76587.
5
6 2005-11-17  Martin Baulig  <martin@ximian.com>
7
8         * anonymous.cs
9         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
10         inherit the scope from our parent.  Fixes #76653.
11
12 2005-11-15  Martin Baulig  <martin@ximian.com>
13
14         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
15         instead of `ScopeTypeBuilder' to refer to the "current" type.
16         (AnonymousMethod.CreateScopeType): Correctly create the helper
17         class if we're inside a generic type definition.
18
19 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
20
21         * doc.cs : use Invocation.IsOverride() to do real override check.
22         * expression.cs : made Invocation.IsOverride() internal.
23
24 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
25
26         * doc.cs : use TypeManager.FindMembers() instead of (possible)
27           TypeBuilder.FindMembers() and filter overriden base members out.
28           Fixed bug #76990.
29
30 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
31
32         * doc.cs : ref/out parameters are represented as '@' (instead of
33           '&' in type FullName). Fixed bug #76630 (additionally crefs).
34
35 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
36
37         * doc.cs : when there was no '.' in cref to methods in doc comment,
38           then parameters were missing in the output. Fixed bug #76691.
39
40 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
41
42         * driver.cs : don't output docs when there is an error.
43           Fixed bug #76693.
44
45 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
46
47         * doc.cs :
48           Now it should detect indexers. Fixed primary concern in bug #76685.
49           Fixed CS0419 message to not show the identical member signature in
50           the message.
51
52 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
53
54         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
55           instead of Type.FindMembers() since it does not handle events.
56           Fixed bug #71604.
57
58 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
59
60         * codegen.cs: Fixed typo (speficied -> specified).
61
62 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
63
64         Fix #76369.
65         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
66
67 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
68
69         * attribute.cs: Changed error message.
70
71         * cs-tokenizer.cs: One more check.
72
73 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
74
75         * statement.cs (Block.Resolve): Ignore empty statement.
76
77 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
78
79         * report.cs: Made error/warning methods more strict to avoid
80         their misuse.
81
82         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
83         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
84         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
85         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
86
87 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
88
89         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
90         Use the more explicit AssemblyName.FullName instead of 
91         AssemblyName.Name to report errors.
92         
93 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
94
95         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
96         with mcs.
97
98 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
99
100         * class.cs,
101         * convert.cs,
102         * cs-parser.jay,
103         * decl.cs,
104         * enum.cs,
105         * expression.cs,
106         * generic.cs,
107         * pending.cs,
108         * report.cs: Fixed error reporting and typos.
109
110         * generic.cs (TypeParameter.GetSignatureForError): New method.
111         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
112
113         * typemanager.cs (GetFullName): Refactored.
114
115 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
116
117         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
118         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
119
120         * class.cs (TypeContainer.IsComImport): New property.
121         (Constructor.Define): Create proper ctor for ComImport types.
122
123         * expression.cs (New.CheckComImport): Fixed.
124
125 2005-11-07  Miguel de Icaza  <miguel@novell.com>
126
127         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
128         that a parameter has been captured does not mean that we do not
129         have to do the rest of the processing.  This fixes the second part
130         of #76592.  If there was another anonymous method capturing
131         values in the past, the Scope would never be set for the second
132         method that captured the same parameter.
133
134         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
135         properly manipulate the stack.   Second part of fix for #76592.
136
137         * expression.cs (New): Add support for invoking "new" on
138         interfaces that have been flagged with the ComImport attribute and
139         the CoClass.  Fixes #76637 
140
141         * statement.cs (Try.DoEmit): When a variable is captured, do not
142         try to emit the vi.LocalBuilder variable as it has been captured.
143         Create a temporary variable and store the results on the
144         FieldBuilder.  Fixes #76642
145
146 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
147
148         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
149
150         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
151
152         * expression.cs (Binary.DoResolve): Added && optimalization.
153     
154         * typemanager.cs (AddUserType): Removed useless argument.
155
156 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
157
158         * statement.cs (Block.variables): Uses ListDictionary.
159
160 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
161
162         Fix #75969.
163         * class.cs (PartialContainer.EmitType): Customized to emit
164         security attributes.
165         (ClassPart.ApplyAttributeBuilder): Transform security attribute
166         for partial classes.
167
168 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
169
170         Fix #76599.
171         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
172         access has to be fixed.
173         
174         * typemanager.cs (IsUnmanagedType): Wrong common field type.
175
176 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
177
178         Fix #76590.
179         * ecore.cs (NullCast.Reduce): Implemented.
180
181         * expression.cs (ArrayCreation.CheckIndices): Correcly check
182         constant type.
183         
184         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
185         properly.
186         (Foreach.Resolve): Catch null properly.
187
188 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
189  
190         * cs-tokenizer.cs: Warning text fix.
191
192         * driver.cs: AllWarningNumbers exposed on public interface.
193
194         * report.cs (): Reviewed warning numbers.
195         (IsValidWarning): Use binary search.
196
197 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
198  
199         * driver.cs: Implemeted resource visibility.
200         (Resources): New class for code sharing between /res: and
201         /linkres:
202  
203 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
204
205         decl.cs (CurrentTypeParameters): Fixed to be public.
206
207 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
208
209         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
210
211 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
212
213         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
214
215 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
216
217         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
218
219 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
220
221         Add friend assembly access support.
222         * typemanager.cs: assembly_internals_vis_attrs
223         cache for friend assembly access. 
224         (TypeManager.IsFriendAssembly): New method for
225         checking friend assembly access.
226         (TypeManager.Error_FriendAccessNameNotMatching): New
227         helper method.
228         (TypeManager.CompareKeyTokens): Likewise.
229         (TypeManager.Filter): Handle friend accessible
230         members.
231
232         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
233         friend accessible types.
234
235         * ecore.cs (Expression.IsAccessorAccessible): Handle
236         friend accessible properties.
237
238         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
239         accessible types.
240         
241 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
242
243         Fix #76568.
244         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
245         folding.
246         
247         * convert (Convert.ImplicitReferenceConversion): NullCast holds
248         contants only.
249         
250         * ecore.cs (NullCast): Child is contant only.
251         
252         * literal.cs (NullLiteral.Reduce): null can be converted to any
253         reference type.
254
255 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
256
257         * driver.cs: Use Encoding.Default as default code page instead
258           of ISO-28591.
259
260 2005-10-27  Raja R Harinath  <rharinath@novell.com>
261
262         Fix #76085.
263         * expression.cs (Invocation.Error_InvalidArguments): Handle
264         __arglist parameters.
265         (Invocation.VerifyArgumentsCompat): Likewise.
266         * support.cs (ReflectionParameters.GetSignatureForError): Print
267         __arglist parameters.
268         (InternalParamters.GetSignatureForError): Likewise.
269         * parameter.cs (Parameters.GetSignatureForError): Likewise.
270
271 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
272
273         * attribute.cs (GetPropertyValue): Made public.
274
275         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
276         Resolve.
277         Add new property WrapNonExceptionThrows to handle 2.0 assembly
278         attribute.
279         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
280         is not defined.
281         
282         * driver.cs: Reflect method name change.
283         
284         * statement.cs (Try.Resolve): Warn when try has both general
285         exception handlers.
286         
287         * typemanager.cs: runtime_compatibility_attr_type new predefined
288         type.
289
290 2005-10-26  Raja R Harinath  <harinath@gmail.com>
291
292         Fix #76419.
293         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
294         treat it as an empty parameter list.
295
296 2005-10-26  Raja R Harinath  <rharinath@novell.com>
297
298         Fix #76271.     
299         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
300         ResolveAsTypeStep silent.
301         * statement.cs (Block.AddConstant): Mark block as used.
302         (Block.ResolveMeta): Avoid piling on error messages
303         if a constant initializer resolution fails.
304
305 2005-10-25  Raja R Harinath  <rharinath@novell.com>
306
307         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
308         Remove.
309         (NamespaceEntry.VerifyAllUsing): New.
310         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
311         behaviour.  Delegates actual resolution of alias to ...
312         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
313         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
314         Update.
315         * driver.cs (Driver.MainDriver): Update.
316         
317         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
318         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
319         property.
320         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
321         Remove.
322         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
323         RootNamespace.DefineNamespacesForAll.
324
325 2005-10-24  Raja R Harinath  <harinath@gmail.com>
326
327         * typemanager.cs (assemblies, external_aliases, modules)
328         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
329         (ComputeNamespaces, GetRootNamespace): Remove extra staging
330         overhead.  Move resposibility ...
331         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
332         * driver.cs, attribute.cs, codegen.cs: Update to changes.
333
334 2005-10-23  Raja R Harinath  <harinath@gmail.com>
335
336         * namespace.cs (RootNamespace.all_namespaces): Renamed from
337         cached_namespaces.  Improve usage.
338         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
339         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
340         Move from GlobalRootNamespace and simplify.
341         (RootNamespace.Global): Make instance variable.
342         (RootNamespace.RootNamespace): Add "alias name" parameter.
343         (GlobalRootNamespace): Simplify drastically.
344         (Namespace.Lookup): Don't use GetNamespace.
345         * typemanager.cs (GetRootNamespace): Rename from
346         ComputeNamespaceForAlias.
347         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
348
349 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
350
351         * anonymous.cs (AnonymousContainer): Don't crash when container
352         doesn't exist.
353
354 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
355
356         * expression.cs (Binary.DoResolve): Warn when comparing same
357         values.
358
359 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
360
361         Fix #76486.
362         * expression.cs (Binary.DoResolve): It looks like there are no
363         convetsion rules in enum context.
364
365 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
366
367         Add support for extern alias qualifiers.
368         * typemanager.cs: Move some LookupTypeReflection code
369         to namespace.cs, to have cleaner code. Added some methods
370         to help us keep track of the extern aliased references.
371         * driver.cs: Add suport for extern alias assemblies on command
372         line and check for their warnings/errors. Also keep track of the
373         extern aliased assemblies.
374         * namespace.cs: Move the global functionality of Namespace
375         to GlobalRootNamespace/RootNamespace. Now the global namespace
376         is GlobalRootNamespace.Globa. Also the code moved from 
377         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
378         Finally added LocalAliasEntry (AliasEntry before) and
379         ExternAliasEntry, to handle alias statements.
380         * cs-parser.jay: Add support in the grammar for extern alias
381         statement.
382         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
383         Update callings to Namespace (now in GlobalRootNamespace).
384
385 2005-10-25  Martin Baulig  <martin@ximian.com>
386
387         * convert.cs (ImplicitTypeParameterConversion): Make base
388         interfaces actually work; fixes #76557.
389
390 2005-10-25  Martin Baulig  <martin@ximian.com>
391
392         * generic.cs
393         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
394         all the type parameters; fixes #76551.
395
396 2005-10-25  Martin Baulig  <martin@ximian.com>
397
398         Fix #76472.
399
400         * generic.cs
401         (GenericMethod.ctor): Added `Expression return_type' and
402         `Parameters parameters' arguments.
403         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
404         parameter and return types to check their constraints if they're
405         generic types.
406
407         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
408         boolean field.
409
410         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
411         constraints of a generic type if `ec.ResolvingGenericMethod'.
412
413         * class.cs (MethodCore.DoDefineParameters): Set
414         `ec.ResolvingGenericMethod' if we're a generic method.
415         (MemberBase.MemberType): Likewise.
416
417 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
418
419         * typemanager.cs (TypeManager): Added 
420         TypeManager.internals_visible_attr_type to cache
421         S.R.CompilerServices.InternalsVisibleToAttribute.
422
423         * codegen.cs (AssemblyClass): Added checks for 
424         InternalsVisibleToAttribute in new method 
425         CheckInternalsVisibleAttribute () and also cache the
426         AssemblyName in AssemblyClass.Name.
427         
428 2005-10-24  Martin Baulig  <martin@ximian.com>
429
430         * typemanager.cs
431         (TypeManager.ExpandInterfaces): Added overloaded version which
432         just takes a `Type[]' array.
433
434         * generic.cs
435         (Constraints.Resolve): Don't expand the interfaces here; ie. we
436         just use the interfaces which were explicitly specified and not
437         the interfaces they inherit.  Fixes #76482.
438         (TypeParameter.FindMembers): Expand the interfaces here.
439
440 2005-10-21  Martin Baulig  <martin@ximian.com>
441
442         * generic.cs
443         (Constraints.Resolve): Also resolve the actual types here.
444         (Constraints.ResolveTypes): Just check the constraints here.
445         Fixes #76363; see gtest-218.cs.
446
447 2005-10-21  Martin Baulig  <martin@ximian.com>
448
449         * convert.cs
450         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
451         instead of a `BoxedCast'; fixes gtest-217.cs.
452
453 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
454
455         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
456           1) "new()" is specified as generic parameter constraint and 2) the
457           type is TypeBuilder and 3) the type is abstract even if it has a
458           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
459
460 2005-10-20  Martin Baulig  <martin@ximian.com>
461
462         * generic.cs
463         (GenericConstraints.TypeParameter): New public property.
464         (TypeParameter.ctor): Also take a `DeclSpace' argument.
465         (TypeParameter.DeclSpace): New public property.
466         (TypeParameter.DefineType): Inflate the constraints if our
467         `DeclSpace' is an `Iterator'.   
468
469 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
470
471         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
472           GenericMethod argument to compare methods' generic type arguments.
473           Fixed bug #76382.
474
475 2005-10-19  Martin Baulig  <martin@ximian.com>
476
477         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
478         not ResolveType() when resolving the base type, so we're not
479         checking the constraints here.
480         (TypeContainer.ResolveType): Call ResolveType() on our base_type
481         if we have any.
482
483 2005-10-19  Martin Baulig  <martin@ximian.com>
484
485         * generic.cs (ConstructedType.CheckConstraints): Committing
486         untested fix for #76441.
487
488 2005-10-18  Raja R Harinath  <rharinath@novell.com>
489
490         Fix #76371.
491         * class.cs (TypeContainer.DefineType): Move updating of
492         topological sort earlier in the code.
493         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
494
495 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
496
497         Fix #76273.
498         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
499         
500         * constant.cs (Constant.TryReduce): Moved from Cast class.
501         (Reduce): Made little bit more OO and fixed missing conversions.
502         
503         * ecore.cs (Reduce): Implemented.
504         (Binary.EnumLiftUp): New method to upgrade values to enum values.
505         
506         * literal.cs (Reduce): Implemented.
507         
508         * class.cs: Reverted Miguel's wrong commit.
509
510 2005-10-14  Miguel de Icaza  <miguel@novell.com>
511
512         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
513
514 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
515
516         * cs-parser.jay, expression.cs : CS0214 was missing error location
517           for constants. Fixed bug #76404.
518
519 2005-10-10  Raja R Harinath  <rharinath@novell.com>
520
521         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
522         InstanceExpression.
523         (PropertyExpr.EmitCall): Likewise.
524         * expression.cs (Invocation.EmitArguments): Handle case where
525         arguments == null.
526         (Invocation.EmitCall): Avoid allocating temporary variable if
527         there are no arguments.
528
529 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
530
531         Fix #76370.
532         * convert.cs (ExplicitConversionCore): Fixed object->enum
533         conversion.
534
535 2005-10-07  Raja R Harinath  <rharinath@novell.com>
536
537         Fix #76323.
538         * convert.cs (ImplicitConversionStandard): Move conversion of
539         void* to arbitrary pointer types ...
540         (ExplicitConversionStandard): .. here.
541         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
542         error to always print typenames.
543
544 2005-10-07  Raja R Harinath  <rharinath@novell.com>
545
546         * convert.cs (GetConversionOperator): Rename from
547         GetConversionOperators.  Move operator selection code from ...
548         (UserDefinedConversion): ... here.
549
550 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
551
552         * convert.cs (ExplicitConversionCore): Removed duplicate enum
553         conversion.
554
555 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
556
557         * assign.cs (Assign.DoResolve): Error method changed.
558
559         * cfold.cs (DoConstantNumericPromotions): Error method changed.
560         
561         * const.cs (ResolveValue): Reset in_transit immediately.
562         
563         * constant.cs: Error method changed.
564         
565         * convert.cs: Removed useless location parameter.
566         (ExplicitNumericConversion): Don't do double enum check.
567         (ExplicitConversionCore): Renamed from ExplicitConversion.
568         (ExplicitUnsafe): Extracted from ExplicitConversion.
569         (ExplicitConversion): Uses for error reporting.
570         
571         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
572         error messages.
573         (ResolveBoolean): Uses common error method.
574         (CastToDecimal): Get rid of ec.
575         (CastFromDecimal): Optimized.
576         (ConvCast): Get rid of ec.
577         
578         * enum.cs (ResolveValue): Reset in_transit immediately.
579         (Emit): Return after first error.
580         
581         * expression.cs: Convert changes.
582         
583         * literal.cs: Error method changed.
584         
585         * statement.cs: Error method changed.
586
587 2005-10-06  Raja R Harinath  <rharinath@novell.com>
588
589         Fix gtest-131.cs and gtest-211.cs.
590         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
591         Only emit code for a label if it is used.  Unreachable code can
592         violate ECMA evaluation stack invariants.
593
594 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
595
596         * anonymous.cs: Implemented ExprClassName.
597         
598         * assign.cs (Assign.DoResolve): Don't chrash when type is not
599         delegate.
600         
601         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
602         check.
603         
604         * class.cs (StaticClass.DefineContainerMembers): Report protected
605         members as error.
606         
607         * codegen.cs: if(ed) PRODUCTION.
608         
609         * convert.cs (Error_CannotImplicitConversion): Better error
610         distinction.
611         
612         * cs-parser.jay: More error checks.
613         
614         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
615         
616         * driver.cs (CSCParseOption): Enabled wrong option check.
617         
618         * ecore.cs (Expression.ExprClassName): Turned to property.
619         (MemberExpr.CheckIntermediateModification): For checking boxed
620         value types     modification.
621         
622         * statement.cs (Fixed.Resolve): Expression type must be
623         convertible to fixed type.
624         (CollectionForeach.GetEnumeratorFilter,TryType):
625         Small refactoring for easier error checking.
626
627 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
628
629         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
630         attributes.
631         
632         * class.cs (GeneratedBaseInitializer): New class for customization
633         compiler generated initializers.
634         (MemberBase.DoDefine): Check Obsolete attribute here.
635         (FieldMember.DoDefine): Ditto.
636         
637         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
638         constants.
639         
640         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
641         (MemberCore.GetObsoleteAttribute): Removed argument.
642         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
643         (MemberCore.CheckObsoleteType): New helper.
644         
645         * delegate.cs,
646         * enum.cs,
647         * statement.cs: Updates after MemberCore changes.
648         
649         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
650         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
651         
652         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
653         obsolete attribute for compiler construct.
654         (As.DoResolve): Cache result.
655         
656         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
657
658 2005-10-01  Miguel de Icaza  <miguel@novell.com>
659
660         * expression.cs (Probe): instead of having a "Type probe_type"
661         keep the extra information as a TypeExpr probe_type_expr since the
662         "As" operator needs to perform some type checks.
663
664         * (As.DoResolve): If the type is a type parameter, ensure that it
665         is constrained by a class.
666
667 2005-09-22  Miguel de Icaza  <miguel@novell.com>
668
669         * statement.cs (Lock): Use the TemporaryVariable class instead of
670         manually using local variables as those do not work when variables
671         are captured.
672
673         * ecore.cs: Moved the TemporaryVariable class from being a nested
674         class inside Foreach to be a public class that can be employed in
675         other places. 
676
677 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
678
679         * cs-parser.jay: interface_accessors replaced by
680         accessor_declarations.
681
682         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
683         location.
684         
685         * statement.cs (GotoCase.Resolve): Convert null constant to
686         null case.
687         (SwitchLabel.ResolveAndReduce): Ditto.
688         (SwitchLabel.NullStringCase): Custom null stamp.
689         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
690         
691         typemanager.cs (CSharpSignature): Don't skip first argument
692         for full names.
693
694 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
695
696         * cfold.cs, constant.cs, convert.cs, ecore.cs,
697         expression.cs, iterators.cs, literal.cs: Store constants and
698         literals location.
699         
700         * class.cs (MemberBase.ShortName): Pass location.
701         
702         * cs-parser.jay: Some location fixes.
703         
704         * ecore.cs (Expression.Location): Made virtual.
705
706 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
707
708         Fix #72930.
709         * const.cs (Const.ResolveValue): Check for assigning non-null
710         value to reference type.
711
712 2005-09-26  Raja R Harinath  <rharinath@novell.com>
713
714         Fix #76133.
715         * expression.cs (This.VerifyFixed): In a value type T, the type of
716         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
717         value type R, 'this' is treated as a value parameter.
718
719 2005-09-05  Miguel de Icaza  <miguel@novell.com>
720
721         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
722         if the underlying types are the same, otherwise we need to produce
723         code that will do the proper cast.
724
725         This was exposed by Marek's constant rewrite which produced
726         invalid code for the call site:
727
728         enum X : long { a }
729         void Method (X v) {}
730
731         Method ((X) 5)
732
733         This fixes test-49.cs
734
735 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
736
737         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
738           Type/Object should be allowed as well. Fixed bug #75968.
739
740 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
741
742         * expression.cs : (Binary.DoResolve): when one is enum constant and
743           another is constant 0, then return enum one *as enum type*.
744           Fixed bug 74846.
745
746 2005-10-04  Martin Baulig  <martin@ximian.com>
747
748         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
749         `SetMemberIsUsed()' work for generics, too.
750
751 2005-10-04  Martin Baulig  <martin@ximian.com>
752
753         * expression.cs (DelegateInvocation.EmitStatement): Make this work
754         for corlib.  Fixes #75691.
755
756 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
757
758         Fix #76255.
759         * driver.cs: Fix compilation files with full root path.
760
761 2005-09-25  Miguel de Icaza  <miguel@novell.com>
762
763         * report.cs (SymbolRelatedToPreviousError): Format the output so
764         it does not use an open parenthesis that is never closed. 
765
766         * driver.cs: Follow coding guidelines
767
768 2005-09-18  Miguel de Icaza  <miguel@novell.com>
769
770         * driver.cs: Set InEmacs based on the environment variable EMACS. 
771
772         * location.cs (InEmacs): in this mode, do not report column
773         location as it confuses Emacs.
774
775 2005-10-03  Raja R Harinath  <rharinath@novell.com>
776
777         * support.cs (SeekableStreamReader.Position): Don't error out when
778         the requested position is just beyond the end of the current
779         buffered data.
780
781 2005-09-28  Raja R Harinath  <rharinath@novell.com>
782
783         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
784         try to keep in sync with the byte count of the underlying Stream.
785         However, this limits us to a window size of 2048 characters: i.e.,
786         the maximum lookahead of our lexer/parser can be 2048 characters.
787
788 2005-09-22  Martin Baulig  <martin@ximian.com>
789
790         * driver.cs: Removed a debugging FIXME.
791
792 2005-09-21  Raja R Harinath  <rharinath@novell.com>
793
794         * cs-parser.jay (type_arguments): Add CS1644 check.
795         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
796
797 2005-09-15  Raja R Harinath  <rharinath@novell.com>
798
799         * Makefile (PROGRAM): Make profile specific.
800         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
801         the current directory.
802
803         Fix test-455.cs.
804         * expression.cs (Invocation.EmitCall): Remove optimization on
805         this_call since it doesn't handle 'this' being a value type.
806
807 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
808
809         * driver.cs: Ensure file handles are closed after parsing
810
811 2005-09-05  Miguel de Icaza  <miguel@novell.com>
812
813         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
814         if the underlying types are the same, otherwise we need to produce
815         code that will do the proper cast.
816
817         This was exposed by Marek's constant rewrite which produced
818         invalid code for the call site:
819
820         enum X : long { a }
821         void Method (X v) {}
822
823         Method ((X) 5)
824
825         This fixes test-49.cs
826
827 2005-09-05  Martin Baulig  <martin@ximian.com>
828
829         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
830         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
831
832         * cs-parser.jay (delegate_declaration): Small fix for #75852.
833
834 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
835
836         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
837           to be a pointer type due to the spec 25.2, so check if declaring
838           type is generic type definition. Fixed bug #75772.
839
840 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
841
842         Fixed bug #75957.
843         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
844           both types are not defined by methods.
845         * expression.cs : (Invocation.IsApplicable): it should work when
846           the argument type is equal to the parameter type, not only when
847           ImplicitConversionExists() returns true.
848
849 2005-09-02  Raja R Harinath  <rharinath@novell.com>
850
851         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
852         internal.
853
854         Fix #75941.
855         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
856         flow-branching for LocalVariableReferences in case we were invoked
857         from a MemberAccess.
858         * expression.cs (LocalVariableReference.VerifyAssigned): New.
859         Carved out of ...
860         (LocalVariableReference.DoResolveBase): ... this.
861         (MemberAccess.Resolve): Do the check that was disabled during
862         SimpleNameResolve.
863
864 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
865
866         * class.cs :
867           (PartialContainer.Create): check abstract/sealed/static strictly
868           but abstract/sealed can exist only at one side. Fixed bug #75883.
869
870 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
871
872         Fix #75945.
873         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
874         specified, don't default to UnmanagedType.I4.
875
876 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
877
878         * expression.cs : conditional operator should check possibly
879           incorrect assign expression. Fixed bug #75946.
880
881 2005-08-30  Raja R Harinath  <rharinath@novell.com>
882
883         Fix #75934.
884         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
885         (ScopeInfo.EmitScopeType): Use it to construct field names from
886         names of captured locals.
887
888         Fix #75929.
889         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
890         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
891         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
892         (ExplicitConversion): Remove enum cases already handled by
893         implicit conversion.  Move implicit conversion check to the beginning.
894         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
895         * expression.cs (ArrayCreation.EmitDynamicInitializers):
896         Don't treat System.Enum as a struct.
897
898 2005-08-30  Jb Evain  <jbevain@gmail.com>
899
900         * attribute.cs: handles as expression in parameters.
901
902 2005-08-30  Raja R Harinath  <rharinath@novell.com>
903
904         Fix #75802.
905         * class.cs (TypeContainer.VerifyClsName): Don't use a
906         PartialContainer when verifying CLS compliance.
907         (AbstractPropertyEventMethod): Set Parent here, ...
908         (PropertyMethod): ... not here.
909
910 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
911
912         * attribute.cs : escaped attribute name should not be allowed to be
913           resolved (e.g. @class as classAttribute). Fixed bug #75930.
914
915 2005-08-29  Raja R Harinath  <rharinath@novell.com>
916
917         Fix #75927.
918         * convert.cs (ImplicitStandardConversionExists): Allow zero also
919         when converting a long constant to unsigned long.
920         * expression.cs (Invocation.OverloadResolve): Add sanity check to
921         detect where IsApplicable and VerifyArgumentsCompat disagree.
922
923 2005-08-29  Raja R Harinath  <rharinath@novell.com>
924         and Carlos Alberto Cortez  <carlos@unixmexico.org>
925
926         Fix #75848.
927         * class.cs (TypeContainer.CanElideInitializer): New helper.
928         (TypeContainer.EmitFieldInitializers): Use it to determine if we
929         can safely emitting the initializer of a field.
930
931 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
932
933         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
934           allowed inside a switch (without loop). Fixed bug #75433.
935
936 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
937
938         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
939         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
940
941 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
942
943         * driver.cs : kinda reverting the default encoding changes (not exact 
944           revert since I noticed that "codepage:reset" might not work fine).
945
946 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
947
948         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
949           Location. Now getter and setter store location correctly.
950           (errors/cs0111-12.cs now reports the expected location.)
951
952 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
953
954         * driver.cs : Use default encoding on the environment.
955           Removed (now that) extra parameter for SeekableStreamReader.
956         * support.cs : (SeekableStreamReader) third .ctor() argument for
957           StreamReader is not required (always true). preamble size could
958           be acquired in simpler and safe way.
959
960 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
961
962         * cs-parser.jay: report CS0642 at warning level 3
963           and report CS0642 for an if else statement also
964           fixes bug #74745. Patch by John Luke (and a bit
965           modified by me).
966           Removed extra CS0642 warning check for "while",
967           "for" and "fixed".
968         * statement.cs: In Block.Resolve(), CS0642 check
969           is reimplemented to check a sequence of an empty
970           statement and a block.
971
972           Both fix bug #66777.
973
974 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
975
976         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
977         detection until I fix it.
978         
979         * cs-tokenizer.cs: Changed error message.
980         
981         * cs-parser.jay: Fixed 2 error locations.
982         
983         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
984         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
985         properties.
986         
987         * enum.cs (GetSignatureForError): Fixed.
988         
989         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
990         method detection.
991         
992         * class.cs,
993         * typemanager.cs (RegisterProperty): Removed.
994         
995         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
996
997 2005-08-24  Raja R Harinath  <rharinath@novell.com>
998
999         Fix #75874.
1000         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1001         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1002
1003 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1004
1005         * expression.cs : tiny fix is required for not warning positive ulong.
1006           See test-441.cs.
1007
1008 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1009
1010         * expression.cs : add CS0652 check for constant and integral
1011           expression. Fixed bug #53974.
1012
1013 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1014
1015         * expression.cs : in DoNumericPromotions(), check if there is implicit
1016           conversion overload for string (to check CS0034). Fixed bug #52492.
1017
1018 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1019
1020         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1021
1022 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1023
1024         * ecore.cs : report location when it is *not* Null.
1025
1026 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1027
1028         * codegen.cs,
1029           ecore.cs,
1030           flowanalysis.cs,
1031           expression.cs:
1032           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1033           correctly. Fixed bug #75721.
1034
1035 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1036
1037         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1038         loop that performs 'min (pos, char_count)'.
1039
1040         Fix #75862.
1041         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1042         converted value in Operator.OnesComplement.
1043
1044 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1045
1046         * anonymous.cs: If the anon method is pulled into a helper class,
1047         it needs to be `internal' not `private'. Fixes runtime behavior on
1048         msft. bug #75704
1049
1050 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1051
1052         Fix #75803
1053         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1054         is a partial class.
1055
1056 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1057
1058         The big constants rewrite
1059         Fix #75746, #75685 and more
1060         As a side effect saved 1MB for MWF ;-)
1061         
1062         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1063         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1064         enum based for corlib compilation.
1065         
1066         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1067         subtractions.
1068         
1069         * class.cs (FixedField.Define): Use ResolveAsConstant.
1070         
1071         * const.cs (IConstant): Interface constants and enums.
1072         (Const.ResolveValue): New method for constant resolvning.
1073         (ExternalConstant): Constants from imported assemblies.
1074         
1075         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1076         conversion; like enums.
1077         (Constant.ToType): Converts this constant to different type.
1078         (Constant.Increment): Adds 1.
1079         
1080         * convert.cs (ImplicitConversionRequired): Simplified.
1081         
1082         * cs-parser.jay: Create EnumMember directly.
1083         
1084         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1085         
1086         * doc.cs (GenerateEnumDocComment): Removed.
1087         
1088         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1089         (ConvertIntLiteral): Removed.
1090         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1091         
1092         * enum.cs (EnumMember): Implement IConstant.
1093         (Enum.IsValidEnumConstant): Removed.
1094         (Enum.GetNextDefaultValue): Removed.
1095         (Enum.FindMembers): Updated.
1096         (Enum.GenerateDocComment): Iterate enum members.
1097         
1098         * expression.cs (Cast.TryReduce): Handle enums correctly.
1099         (New.Constantify): Made public.
1100         (MemberAccess.DoResolve): Removed contant specific if(s).
1101         
1102         * literal.cs (NullLiteral): Implement new abstract methods.
1103         
1104         * statement.cs (GotoCase.Resolve): Use new constant methods.
1105         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1106         
1107         * typemanager.cs (LookupEnum): Removed.
1108         (IsEnumType): Fixed to work with corlib.
1109         (RegisterConstant): Removed.
1110         (LookupConstant): Removed.
1111         (GetConstant): Changed to work with IConstant.
1112
1113 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1114
1115         * location.cs : Fixed overflown (>255) column number.
1116
1117 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1118
1119         First cut of the qualified-alias-member feature.
1120         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1121         token.
1122         * cs-parser.jay (DOUBLE_COLON): New token.
1123         (namespace_or_type_name): Add rule for recognizing
1124         qualified-alias-members.
1125         (primary_expression): Likewise.
1126         (element_access): Allow QualifiedAliasMember as a possible
1127         type-bearing expression.
1128         (local_variable_type, local_variable_pointer_type): Likewise.
1129         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1130         aliases in the current and enclosing namespace declarations.
1131         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1132         * decl.cs (MemberName.is_double_colon): New.
1133         (MemberName.MemberName): Add new constructor for alias-member.
1134         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1135         * expression.cs (QualifiedAliasMember): New expression type.
1136
1137 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1138
1139         * location.cs : it borked when no argument was specified.
1140
1141 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1142
1143         * location.cs : tiny ToString() format fix.
1144
1145 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1146
1147         * statement.cs : oops, it was missing.
1148
1149 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1150
1151         A set of fixes for precise line/column location.
1152
1153         * location.cs :
1154           "token" field now holds a file/line "delta", a line number offset 
1155           from the segment, and a column number. See also:
1156           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1157           December/009508.html
1158           Removed static IsNull. Use instance IsNull property instead.
1159         * cs-tokenizer.cs :
1160           For some tokens it stores Location. For Identifier it stores
1161           LocatedToken which is a pair of string name and location.
1162           Column numbers are adjusted only at getChar().
1163         * report.cs :
1164           Use Location.ToString() for reporting (it now contains column).
1165         * cs-parser.jay :
1166           Largely modified to use LocatedToken instead of
1167           string (IDENTIFIER), and to acquire Location from some tokens.
1168         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1169           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1170           codegen.cs :
1171           Now MemberName holds Location. DeclSpace.ctor() receives Location
1172           as a parameter. Removed extra parameters to all derived classes.
1173           Replaced Location.IsNull() with instance property.
1174         * assign.cs, expression.cs :
1175           Added .ctor() overload that omits Location.
1176         * attribute.cs :
1177           Added "nameEscaped" flag that indicates the identifier was escaped
1178           in the source file. This fixes bug #57047.
1179
1180 2005-09-02  Martin Baulig  <martin@ximian.com>
1181
1182         * class.cs: Make CS3005 a warning, not an error.
1183
1184 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1185
1186         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1187         New method, looking for lo-case imported cls type.
1188
1189         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1190         here.
1191
1192         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1193
1194         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1195
1196         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1197         all_imported_types.
1198         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1199
1200         Optimized to save 3.5 MB for SWF compilation.
1201
1202 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1203
1204         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1205         (PartialContainer.Create): Moved logic AddToContainer.
1206         (PartialContainer.MarkForDuplicationCheck): Shares name.
1207         
1208         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1209         place.
1210         
1211         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1212         initialization.
1213         (Namespace.GetSignatureForError): New method.
1214         
1215         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1216         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1217
1218 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1219
1220         Fix #75669.
1221         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1222         member lookup rather than qualifier_type, since qualifier_type can
1223         be null.
1224
1225 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1226
1227         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1228         enum member.
1229
1230 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1231
1232         * statement.cs: Copy the local exception into the exception
1233         captured local.  Fixes 75674
1234
1235 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1236
1237         Fix #75658.
1238         * expression.cs (Invocation.OverloadResolve): Don't report error
1239         CS1501 if error CS1502 has been reported.
1240         (New.DoResolve): Delegate CS1501 reporting to
1241         Invocation.OverloadResolve.
1242
1243         Fix #75656.
1244         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1245         invariant-meaning-in-block property in an enclosing block if
1246         necessary.
1247
1248 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1249
1250         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1251         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1252         (Switch.CheckSwitch): Just save 50kb for SWF.
1253
1254 2005-07-27  Martin Baulig  <martin@ximian.com>
1255
1256         * anonymous.cs (CaptureContext.AddField): Added
1257         `AnonymousContainer am' argument; compute its toplevel scope if
1258         it's not already computed.  Fixes #75649.
1259
1260 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1261
1262         Fix #75628.
1263         * class.cs (Constructor.Emit): Reset block to null if the block
1264         resolve fails.
1265
1266 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1267
1268         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1269
1270 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1271
1272         * class.cs (MethodData.Define): Check whether accessor implementing
1273         interface is public.
1274
1275         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1276
1277 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1278
1279         Fix #57245
1280         * namespace.cs (LookupType): Moved same type check to...
1281         
1282         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1283         with the same name.
1284
1285 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1286
1287         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1288         already found a typebuilder.
1289         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1290         MemberNames, not strings.
1291
1292         * const.cs (Error_ExpressionMustBeConst): 
1293         Rename from Error_EpressionMustBeConst.
1294         * const.cs, class.cs, statement.cd: Update.
1295
1296 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1297
1298         Fix #65573
1299
1300         * const.cs (Const.LookupConstantValue): Report missing contant expression
1301         everytime.
1302         (Error_EpressionMustBeConstant): Only one error method.
1303
1304         * class.cs, statement.c: Updated.
1305
1306 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1307
1308         * statement.cs (Block.Flags): Add back HasVarargs.
1309         (Block.flags): Make protected.
1310         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1311
1312         * typemanager.cs (types, typecontainers, user_types): Remove.
1313         (UserTypes, TypeContainers): Likewise.
1314         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1315         (CleanUp, Reset): Update.
1316         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1317         (GetNestedType): Use Type.GetNestedType.
1318         (CoreLookupType): Take two arguments, the namespace and the
1319         basename of the type.  Update to use the Namespace.Lookup
1320         mechanism.
1321         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1322         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1323         string concatenation and substring matches.
1324         * class.cs, enum.cs, delegate.cs: Update to changes.
1325
1326 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1327
1328         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1329         Expression and made virtual.
1330
1331         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1332         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1333
1334         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1335
1336         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1337         error message.
1338
1339         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1340         change.
1341
1342 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1343
1344         Fix #57707
1345         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1346         AssemblyCultureAttribute is not used on executable.
1347
1348         * rootcontext.cs,
1349         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1350
1351 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1352
1353         Fix #60638.
1354         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1355         New.  Reports CS0252/CS0253.
1356         Mostly taken from preliminary patch by Duncak Mak.
1357         (Binary.DoResolveOperator): Store results of operator lookup.
1358         Use them to detect if we need to warn about unintended reference
1359         comparisons.
1360
1361 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1362
1363         Fix #72969.
1364         * namespace.cs (Namespace.Lookup): Add back location parameter.
1365         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1366         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1367
1368         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1369         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1370         (Namespace.LookupType): ... this.
1371         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1372         of namespaces.
1373         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1374         purported to handle pointers.
1375         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1376         CoreLookupType.
1377
1378 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1379
1380         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1381         type as namespace.
1382
1383 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1384
1385         * namespace.cs (Namespace.Lookup): Drop location parameter.
1386         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1387         (NamespaceEntry.Lookup): ... this.
1388         (NamespaceEntry.Error_AmbiguousTypeReference):
1389         Move here from DeclSpace.
1390         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1391         names ...
1392         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1393         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1394         Move to NamespaceEntry.
1395         * delegate.cs, expression.cs: Update to changes.
1396
1397 2005-08-31  Martin Baulig  <martin@ximian.com>
1398
1399         Committing a patch from Atsushi Enomoto for #75850.
1400
1401         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
1402         Prefer a generic enumerator over a non-generic one.
1403
1404 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1405
1406         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1407         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1408
1409 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1410
1411         * driver.cs : reverting default encoding change as well as mcs.
1412
1413 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1414
1415         * driver.cs, support.cs : merged r48826.
1416           Marek Safer wrote:
1417           > could you integrate your mcs changes to gmcs otherwise
1418           > gmcs cannot compile some files.
1419
1420 2005-08-20  Martin Baulig  <martin@ximian.com>
1421
1422         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1423         scope if we don't already have it.
1424
1425         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1426         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1427         fixes #75867.
1428
1429 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1430
1431         * statement.cs: Copy the local exception into the exception
1432         captured local.  Fixes 75674
1433
1434 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1435
1436         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1437         type as namespace.
1438
1439 2005-08-12  Martin Baulig  <martin@ximian.com>
1440
1441         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1442         for nested types here to avoid hitting the cache too early.
1443
1444 2005-08-09  Miguel de Icaza  <miguel@novell.com>
1445
1446         * enum.cs: On the new compiler CLS error 3005 is now a warning not
1447         an error. 
1448
1449 2005-08-03  Martin Baulig  <martin@ximian.com>
1450
1451         Make iterators in generic methods work; see gtest-191.cs.
1452
1453         * generic.cs
1454         (Constraints.Resolve): Protect against being called twice.
1455
1456         * class.cs
1457         (TypeContainer.GetClassBases): Make this `protected virtual'.
1458
1459         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1460         (Iterator.GetClassBases): Override this and compute the base
1461         classes here.
1462         (Iterator.DefineNestedTypes): If we're a generic method, all our
1463         method type parameters become class type parameters on the proxy
1464         class.
1465
1466         * statement.cs
1467         (ToplevelBlock.Parameters): Make this a property, not a field.
1468         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1469
1470 2005-08-03  Martin Baulig  <martin@ximian.com>
1471
1472         * typemanager.cs (TypeManager.IsSubclassOf): Use
1473         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1474         (TypeManager.GetFullName_recursed): Improved.
1475
1476 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1477
1478         Fix #75417
1479         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1480         Private accessor case, using TypeManager.IsPrivateAccessible instead of
1481         invocation_type == mi.DeclaringType, since the first one also checks
1482         other condition used by generic instances.
1483         
1484 2005-07-27  Martin Baulig  <martin@ximian.com>
1485
1486         * anonymous.cs (CaptureContext.AddField): Added
1487         `AnonymousContainer am' argument; compute its toplevel scope if
1488         it's not already computed.  Fixes #75649.
1489
1490 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1491
1492         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1493         CheckAttributeType and refactored.
1494         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1495         ResolveAsTypeTerminal error handling.
1496         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1497         handling.
1498         (GetSignatureForError): Print errors in same way.
1499
1500         * class.cs,
1501         * codegen.cs: Reflect attribute GetSignatureForError change.
1502
1503         * ecore.cs,
1504         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1505
1506         * namespace.cs (UsingEntry): Refactored to make fields private.
1507
1508         * assign.cs,
1509         statement.cs: Error_UnexpectedKind has extra parameter.
1510
1511 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1512
1513         * ecore.cs (IAlias): Remove.
1514         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1515         that implement the interface.
1516         * namespace.cs (Namespace): Likewise.
1517         (Namespace.declspaces): Renamed from 'defined_names'.
1518         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1519         DeclSpace instead of an IAlias.
1520         * tree.cs (Tree.AddDecl): Update.
1521
1522 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1523
1524         * statement.cs (Block.Flags); Remove HasVarargs.
1525         (Block.HasVarargs): Move to ToplevelBlock.
1526         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1527         (Block.Variables): Make protected.  Initialize variable hashtable
1528         if necessary.
1529         (Block.AddVariable): Update.
1530         (Block.Resolve): Update to changes.
1531         (ToplevelBlock.HasVarargs): New boolean.
1532         (ToplevelBlock.ThisVariable): Move here from Block.
1533         (ToplevelBlock.AddThisVariable): Likewise.
1534         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1535         * expression.cs (This.ResolveBase): Update to changes.
1536         (ArglistAccess.DoResolve): Likewise.
1537
1538 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1539
1540         Fix #75321
1541         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1542
1543         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1544         not used and not used & assigned.
1545         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1546
1547 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1548
1549         Fix #75053
1550         * expression.cs (Is.DoResolve): null is never provided type.
1551
1552 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1553
1554         Fix #52496
1555         * cs-parser.jay: Less strict event error rule to catch more errors.
1556
1557 2005-07-11  Martin Baulig  <martin@ximian.com>
1558
1559         * generic.cs (ConstructedType.CheckConstraints): Improve the check
1560         for the constructor constraint: we do not only have to check
1561         whether the class has a public constructor, but also ensure that
1562         it's parameterless.  Fixes #75492.
1563
1564 2005-07-11  Martin Baulig  <martin@ximian.com>
1565
1566         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1567         between type parameters if they either have the reference type
1568         constraint or the class constraint.
1569
1570 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
1571
1572         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1573
1574 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1575
1576         Fix #74975
1577         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1578         (ExtractSecurityPermissionSet): Cope with self referencing security
1579         attributes properly.
1580
1581         * driver.cs (SetOutputFile): Made public property OutputFile.
1582
1583 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1584
1585         Fix #75486.
1586         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1587         has_nonstatic_fields.  Make into a FieldBase pointer.
1588         (TypeContainer.AddField): Add CS0282 check.
1589         (TypeContainer.EmitType): Update.
1590
1591 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1592
1593         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1594         compare if they start with __.
1595
1596 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1597
1598         * statement.cs (Switch.SwitchGoverningType): Only look at
1599         UserCasts that don't need implicit standard conversions to one of
1600         the allowed switch types (Fixes test-322.cs).
1601         (LocalInfo.Resolve): Re-enable sanity-test.
1602
1603 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1604
1605         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1606         
1607         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1608         
1609         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1610
1611 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1612
1613         Fix #75472.
1614         * ecore.cs (SimpleName.GetSignatureForError): Add.
1615         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1616         (MemberAccess.GetSignatureForError): Add.
1617
1618 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1619  
1620         The big error and warning messages review.
1621         
1622         * anonymous.cs,
1623         * assign.cs,
1624         * attribute.cs,
1625         * class.cs,
1626         * codegen.cs,
1627         * convert.cs,
1628         * cs-parser.jay,
1629         * cs-tokenizer.cs,
1630         * decl.cs,
1631         * delegate.cs,
1632         * doc.cs,
1633         * driver.cs,
1634         * ecore.cs,
1635         * enum.cs,
1636         * expression.cs,
1637         * flowanalysis.cs,
1638         * iterators.cs,
1639         * literal.cs,
1640         * location.cs,
1641         * modifiers.cs,
1642         * namespace.cs,
1643         * parameter.cs,
1644         * pending.cs,
1645         * report.cs,
1646         * rootcontext.cs,
1647         * statement.cs,
1648         * support.cs,
1649         * tree.cs,
1650         * typemanager.cs: Updated.
1651         
1652         * class.cs: (MethodCore.SetYields): Moved here to share.
1653         (PropertyMethod.Define): Moved iterator setup here.
1654         
1655         * iterators.cs: Add orig_method to have full access to parent
1656         container.
1657
1658 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1659
1660         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1661         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1662         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1663         variable of struct type.
1664         * expression.cs (Unary.ResolveOperator): Update to change.
1665         (Indirection.VerifyFixed): Likewise.
1666         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1667         (ParameterReference.VerifyFixed): Value parameters are fixed.
1668         (This.VerifyFixed): Treat 'this' as a value parameter.
1669         * statement.cs (LocalInfo.IsFixed): Remove.
1670
1671 2005-07-01  Martin Baulig  <martin@ximian.com>
1672
1673         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1674         `ec.EmitThis ()' to get the correct scope.
1675
1676 2005-07-01  Martin Baulig  <martin@ximian.com>
1677
1678         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1679         instance is a ParameterReference; fixes #75299.
1680
1681 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1682
1683         Fix #75412.
1684         * expression.cs (Indexers.map): Remove.
1685         (Indexers.Append): Filter out inaccessible setters and getters.
1686         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1687
1688         Fix #75283.
1689         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1690         Refactored from ...
1691         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1692         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1693         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1694         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1695
1696 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1697
1698         Fix #75322
1699         * class.cs (FieldBase.GetInitializerExpression): One more field
1700         for backup.
1701
1702 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1703
1704         * pending.cs: Do not define a proxy if the base method is virtual,
1705         it will be picked up by the runtime (bug 75270).
1706
1707 2005-07-08  Martin Baulig  <martin@ximian.com>
1708
1709         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1710         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1711
1712 2005-07-07  Martin Baulig  <martin@ximian.com>
1713
1714         * generic.cs (ConstructedType.CheckConstraint): Use
1715         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1716         called recursively; fixes #75329.
1717
1718 2005-07-06  Martin Baulig  <martin@ximian.com>
1719
1720         * generic.cs (TypeManager.InferTypeArguments): Added support for
1721         anonymous methods; fixes #75461.
1722
1723 2005-07-01  Martin Baulig  <martin@ximian.com>
1724
1725         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1726         `ec.EmitThis ()' to get the correct scope.
1727
1728 2005-07-01  Martin Baulig  <martin@ximian.com>
1729
1730         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1731         instance is `This'; fixes #75299.
1732
1733 2005-06-30  Martin Baulig  <martin@ximian.com>
1734
1735         * class.cs (Indexer): Implement IIteratorContainer; added support
1736         for iterators in indexers.
1737
1738         * codegen.cs
1739         (EmitContext.CurrentIterator): Make this a property, not a field.
1740
1741         * anonymous.cs (AnonymousContainer.Iterator): New public property.
1742
1743 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1744
1745         * pending.cs: Do not define a proxy if the base method is virtual,
1746         it will be picked up by the runtime (bug 75270).
1747
1748 2005-06-28  Martin Baulig  <martin@ximian.com>
1749
1750         * cs-parser.jay (interface_method_declaration): Avoid a
1751         reduce/reduce conflict by moving some of the code into a separate
1752         `interface_method_declaration_body' rule; fixes #75368.
1753
1754 2005-06-28  Martin Baulig  <martin@ximian.com>
1755
1756         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1757         array check after the check for TypeBuilder's.
1758
1759 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1760
1761         * convert.cs (FindMostEncompassedType): Add two trivial special
1762         cases (number_of_types == 0 || number_of_types == 1).
1763         (FindMostEncompasingType): Likewise.
1764
1765 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1766
1767         Some cleanups preparing for the fix of #75283.
1768         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1769         error testing.
1770         (EventExpr.InstanceResolve): Likewise.
1771         (EventExpr.DoResolve): Remove redundant checks.
1772
1773 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1774
1775         * class.cs: Small fix.
1776
1777 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1778
1779         Fix #75160.
1780         * class.cs (GetPartialBases): Fix return value check of
1781         part.GetClassBases.
1782
1783 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1784
1785         Ensure that partial classes are registered in their enclosing
1786         namespace.  Initial part of fix of #75160.
1787         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1788         Register declspace with namespace here, not in
1789         DeclSpace.RecordDecl.
1790         * cs-parser.jay: Pass namespace to RecordDecl.
1791         * class.cs (PartialContainer.Create): Likewise.
1792         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1793         called.
1794         * decl.cs (Declspace.RecordDecl): Remove.
1795         * namespace.cs (NamespaceEntry.DefineName): Remove.
1796
1797 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1798
1799         * rootcontext.cs: Reset TargetExt as well.
1800
1801 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1802
1803         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1804         -langversion:ISO-1.
1805
1806 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1807
1808         Fix #75080, cs0119.cs.
1809         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1810         of ...
1811         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1812         allowing ExprClass.Type and ExprClass.Namespace for
1813         ResolveFlags.VariableOrValue.
1814         (Expression.Resolve) [1-argument variant]: Change default resolve
1815         flags based on language version.
1816         (Expression.Error_UnexpectedKind): Use a simple string array
1817         rather than an ArrayList.
1818         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1819         not ExprClass.Type.
1820         (TypeOfVoid.DoResolve): Likewise.
1821         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1822         flags argument -- it always has the same value.
1823
1824 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1825
1826         Fix #75081.
1827         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1828         Use it in the error message.
1829         * assign.cs, expression.cs, statement.cs: Update.
1830
1831 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1832
1833         Fix #75088.
1834         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1835         the "almostMatchedMember" case too.
1836         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1837         that failed the accessibility checks to 'almost_match'.
1838
1839 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1840
1841         * attribute.cs: Use internal MethodBuilder methods to set
1842         ExactSpelling and SetLastError on PInvoke methods, instead
1843         of passing them via charset.  Fixes #75060.
1844
1845 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1846
1847         * parameter.cs (Parameter): Remove TODO comment.
1848         (Parameter.DefineParameter): Remove Location parameter.
1849         (Parameters.LabelParameters): Likewise.
1850         * class.cs (Constructor.Emit): Update to change.
1851         (MethodData.Emit): Likewise.
1852         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1853         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1854
1855 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1856
1857         * parameter.cs,
1858           Removed Parameters.Location and added Parameter.Location instead.
1859           Removed Location parameter from Emit() and GetSignature().
1860         * anonymous.cs,
1861           class.cs,
1862           cs-parser.jay,
1863           delegate.cs,
1864           iterators.cs,
1865           statement.cs :
1866           Modified all related calls.
1867
1868 2005-06-21  Martin Baulig  <martin@ximian.com>
1869
1870         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1871         left-hand side is not a nullable type; fixes #75328.
1872
1873 2005-06-21  Martin Baulig  <martin@ximian.com>
1874
1875         * typemanager.cs
1876         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1877         (TypeManager.GetFullNameSignature): Likewise.
1878
1879         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1880         `source.FullName' and `target.FullName' to check whether there are
1881         two conflicting definitions.
1882
1883 2005-06-21  Martin Baulig  <martin@ximian.com>
1884
1885         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1886         a BoxedCast - also for reference types - to be compatible with csc.
1887
1888 2005-06-21  Martin Baulig  <martin@ximian.com>
1889
1890         * expression.cs (MemberAccess.DoResolve): Add support for nested
1891         types in a generic instance; fixes #75320.
1892
1893 2005-06-20  Martin Baulig  <martin@ximian.com>
1894
1895         * generic.cs (TypeManager.InferType): Also walk the class
1896         hierarchy for generic instances; fixes #75261.
1897
1898 2005-06-17  Martin Baulig  <martin@ximian.com>
1899
1900         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1901         to make things work for corlib.
1902
1903 2005-06-15  Martin Baulig  <martin@ximian.com>
1904
1905         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1906         obsolete `SecurityAction' values.
1907
1908 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1909
1910         * rootcontext.cs: Reset TargetExt as well.
1911         
1912 2005-06-09  Martin Baulig  <martin@ximian.com>
1913
1914         * delegate.cs (Delegate.VerifyMethod): Added
1915         `MethodGroupExpr old_mg' argument; inherit its
1916         `HasTypeParameters'; fix #75085.
1917
1918 2005-06-09  Martin Baulig  <martin@ximian.com>
1919
1920         * expression.cs (Invocation.OverloadResolve): Correctly handle
1921         generic methods for the SetMemberIsUsed(); fix #75064.
1922
1923 2005-06-09  Martin Baulig  <martin@ximian.com>
1924
1925         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1926         fixes #75062.
1927
1928 2005-06-08  Martin Baulig  <martin@ximian.com>
1929
1930         * cs-parser.jay (nullable_type_or_conditional): If we put the
1931         nullable back and our `type' is a `ComposedCast', remove the
1932         nullable from it.  Fixes #75156.
1933
1934         * expression.cs (ComposedCast.RemoveNullable): New public method.
1935
1936 2005-06-08  Martin Baulig  <martin@ximian.com>
1937
1938         The big Iterators rewrite :-)
1939
1940         * iterators.cs: Rewrite this to use the anonymous methods framework.
1941
1942         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1943         before the TypeContainers; see 2test-21.cs.
1944
1945         * class.cs
1946         (TypeContainer.DefineType): Don't create a new EmitContext if we
1947         already have one (this only happens if we're an Iterator).
1948         (TypeContainer.Define): Also call Define() on all our iterators.
1949         (Method.CreateEmitContext): Added support for iterators.
1950
1951         * anonymous.cs
1952         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1953         (AnonymousContainer.CreateMethodHost): Moved here from
1954         AnonymousMethod and made abstract.
1955         (AnonymousContainer.CreateScopeType): New abstract method.
1956         (AnonymousContainer.IsIterator): New public property.
1957         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1958         get the ScopeTypeBuilder rather than manually defining it here. 
1959         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1960         iterators here.
1961
1962         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1963         before RootContext.DefineTypes().
1964
1965         * codegen.cs (EmitContext.RemapToProxy): Removed.
1966         (EmitContext.CurrentAnonymousMethod): Changed type from
1967         AnonymousMethod -> AnonymousContainer.
1968         (EmitContext.ResolveTopBlock): Protect from being called twice.
1969         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1970         (EmitContext.EmitThis): Removed the iterators hacks; use the
1971         anonymous methods framework for that.
1972
1973         * statement.cs
1974         (ToplevelBlock.Container): Make this a property, not a field.
1975         (ToplevelBlock.ReParent): New public method; move the
1976         ToplevelBlock into a new container.
1977         (Foreach.TemporaryVariable): Simplify.
1978
1979 2005-06-05  Martin Baulig  <martin@ximian.com>
1980
1981         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1982         (Block.AddTemporaryVariable): New public method; creates a new
1983         `LocalInfo' for a temporary variable.
1984         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1985         variables here.
1986         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1987         non-iterator variables.
1988
1989 2005-06-05  Martin Baulig  <martin@ximian.com>
1990
1991         * statement.cs (Foreach.TemporaryVariable): Create the
1992         LocalBuilder in the Emit phase and not in Resolve since in some
1993         situations, we don't have an ILGenerator during Resolve; see
1994         2test-19.cs for an example.
1995
1996 2005-06-04  Martin Baulig  <martin@ximian.com>
1997
1998         The big Foreach rewrite - Part II.
1999
2000         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2001         with `PropertyInfo ienumerator_getcurrent'.
2002
2003         * codegen.cs (VariableStorage): Removed.
2004
2005         * statement.cs
2006         (Foreach): Derive from Statement, not ExceptionStatement.
2007         (Foreach.CollectionForeach): New nested class.  Moved all the code
2008         dealing with collection foreach here.
2009         (Foreach.ForeachHelperMethods): Removed.
2010         (Foreach.TemporaryVariable): Implement IMemoryLocation.
2011
2012 2005-05-23  Martin Baulig  <martin@ximian.com>
2013
2014         * statement.cs (Try.DoResolve): Don't create a `finally' if we
2015         don't need to.  Fix #75014.
2016
2017 2005-05-26  Raja R Harinath  <rharinath@novell.com>
2018
2019         Improve user-defined conversion handling.
2020         * convert.cs (GetConversionOperators): Rewrite.  Return only the
2021         applicable operators.
2022         (AddConversionOperators): New.  Helper for GetConversionOperators.
2023         (FindMostEncompassedType, FindMostEncompassingType): Verify that
2024         there is only one most encompassed/encompassing type.
2025         (FindMostSpecificSource, FindMostSpecificTarget): Remove
2026         "applicable operator" handling.
2027         (UserConversion): Move cache here from GetConversionOperators.
2028         Directly cache the chosen operator, rather than the whole
2029         MethodGroup.
2030         (ExplicitNumericConversion): Fix buggy implementation of Decimal
2031         case.  Allow conversion of decimal to sbyte and byte too.
2032         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2033         New static methods.  Used to avoid allocating EmptyExpressions in
2034         convert.cs.
2035
2036 2005-05-24  Duncan Mak  <duncan@novell.com>
2037
2038         * ecore.cs (CastFromDecimal): New class for casting a decimal to
2039         another class, used in Convert.ExplicitNumericConversion.
2040         (CastToDecimal): New class, similar to above, but casts to
2041         System.Decimal, used in Convert.ImplicitNumericConversion and also
2042         in explicit convesion from double/float to decimal.
2043
2044         * convert.cs (ImplicitNumericConversion): Handle implicit
2045         conversions to System.Decimal.
2046         (ExplicitNumericConversion): handle explicit conversions to
2047         System.Decimal.
2048
2049         This fixes #68711.
2050         
2051 2005-05-20  Miguel de Icaza  <miguel@novell.com>
2052
2053         * typemanager.cs: Do not throw an exception in the TypeBuilder
2054         case, we take care of it on the TypeCode.
2055
2056 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2057         
2058         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2059         is back.
2060         
2061         * cs-parser.jay: Catch more lexical errors.
2062         
2063         * report.cs: Add one more Error method.
2064         
2065         * rootcontext.cs,
2066         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2067
2068 2005-05-20  Martin Baulig  <martin@ximian.com>
2069
2070         * class.cs (TypeContainer.CircularDepException): Removed.
2071         (TypeContainer.DefineType): Removed the `InTransit' stuff.
2072         (TypeContainer.CheckRecursiveDefinition): Check for circular class
2073         (CS0146) and interface (CS0529) dependencies here.
2074
2075 2005-05-20  Martin Baulig  <martin@ximian.com>
2076
2077         * expression.cs (New.DoResolve): Move the CS0712 check above the
2078         CS0144 check; otherwise it can never be reached.
2079
2080 2005-05-20  Martin Baulig  <martin@ximian.com>
2081
2082         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2083
2084 2005-05-20  Martin Baulig  <martin@ximian.com>
2085
2086         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2087
2088         * typemanager.cs (TypeManager.IsAttributeType): New public method.
2089
2090 2005-05-19  Martin Baulig  <martin@ximian.com>
2091
2092         * delegate.cs
2093         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2094         to disable error reporting.
2095
2096         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2097         here since we don't want to report an error; see the new test-336.cs.
2098
2099 2005-05-19  Raja R Harinath  <rharinath@novell.com>
2100
2101         * statement.cs (ToplevelBlock.GetParameterReference)
2102         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2103         Move here from class Block.
2104         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2105         * expression.cs (ParameterReference.DoResolveBase): Likewise.
2106
2107 2005-05-18  Martin Baulig  <martin@ximian.com>
2108
2109         Fix #74978.
2110
2111         * flowanalysis.cs
2112         (FlowBranching.Reachability): Add non-static public And() and Or()
2113         methods.
2114         (FlowBranchingSwitch): New class; do the `break_origins' thing
2115         like in FlowBranchingLoop.
2116         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2117         reachability, not just locals and parameters.
2118         (FlowBranching.MergeChild): Remove some of the hacks for loop and
2119         switch; MergeBreakOrigins() now takes care of that.
2120
2121 2005-05-18  Martin Baulig  <martin@ximian.com>
2122
2123         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2124         a loop and may leave it, reset the barrier; fixes #74974.
2125
2126 2005-05-16  Raja R Harinath  <rharinath@novell.com>
2127
2128         Fix test-382.cs.  Emit values of decimal constants.
2129         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2130         Carved out of ...
2131         (TypeContainer.AddField): ... this.
2132         (TypeContainer.EmitFieldInitializers): Allow the list of fields
2133         with initializers to include 'Const's.
2134         (ClassPart.RegisterFieldForInitialization): Forward to
2135         PartialContainer.
2136         * const.cs (Const.Const): Pass initializer to base class.
2137         (Const.Define): In case of decimal constants, register them for
2138         initialization in a static constructor.
2139
2140 2005-05-14  Martin Baulig  <martin@ximian.com>
2141
2142         * statement.cs (Block.Resolve): Correctly handle unreachable code;
2143         do not call ResolveUnreachable() on unreachable statements in
2144         here, see the comment in the source code.
2145
2146 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2147
2148         Fix #74934.
2149         * expression.cs (BinaryResolveOperator): If one of the operands of
2150         an equality comparison is 'null' and the other is a pointer type,
2151         convert the null to a NullPointer.
2152         * convert.cs (ImplicitReferenceConversion): If the expression is a
2153         NullLiteral and the target type is a pointer type, return a
2154         NullPointer instead.
2155         (ImplicitConversionStandard): Likewise.
2156
2157 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
2158         
2159         * cs-parser.jay: Set readonly context based on special constructs.
2160         
2161         * expression.cs (LocalVariableReference.DoResolveBase): Improved
2162         readonly variable error handling.
2163         
2164         * rootcontext.cs (EmitCode): Don't verify members when error
2165         occurred.
2166         
2167         * statement.cs (LocalInfo): Add reaodnly context information.
2168         (SetReadOnlyContext, GetReadOnlyContext): New methods.
2169
2170 2005-05-17  Martin Baulig  <martin@ximian.com>
2171
2172         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2173         #70970. 
2174
2175 2005-05-13  Martin Baulig  <martin@ximian.com>
2176
2177         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
2178         handle unreachable blocks.
2179
2180 2005-05-13  Martin Baulig  <martin@ximian.com>
2181
2182         * class.cs
2183         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
2184         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
2185         #74905. 
2186
2187 2005-05-13  Martin Baulig  <martin@ximian.com>
2188
2189         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2190         instance variable, not a local.  Fix #74873.
2191         (Block.ResolveUnreachable): Set it to true here.
2192
2193 2005-05-12  Martin Baulig  <martin@ximian.com>
2194
2195         * cs-parser.jay (property_declaration): Pass the `current_class',
2196         not the `current_container' to Property's .ctor.  Fixes #74912.
2197
2198 2005-05-11  Martin Baulig  <martin@ximian.com>
2199
2200         * typemanager.cs (Closure): Copy this from MCS and merge all the
2201         GMCS-specific changes into it.
2202
2203 2005-05-12  Raja R Harinath  <harinath@gmail.com>
2204
2205         Fix #74920.
2206         * typemanager.cs (unmanaged_enclosing_types): New.
2207         (IsUnmanagedType): Avoid infloops by using
2208         'unmanaged_enclosing_types' to talk with recursive invocations.
2209
2210 2005-05-11  Duncan Mak  <duncan@novell.com>
2211
2212         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2213         continuing to process for 'arg'.
2214         (handle_preprocessing_directive): Check the argument of the #endif
2215         directive and report error CS1025 if there are any trailing
2216         characters.
2217
2218         According to the C# spec, having even whitespace after the #endif
2219         directive is illegal; however, because we call arg.TrimEnd ()
2220         beforehand, we have the same behavior as csc, allowing whitespace
2221         after the directive.
2222
2223         Fixes #74892.
2224
2225 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
2226
2227         Fix #74863.
2228         
2229         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2230         (Constructor.GetObsoleteAttribute): Implemented correctly.
2231
2232 2005-05-10  Martin Baulig  <martin@ximian.com>
2233
2234         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
2235         resolve the type; fixes #74864.
2236         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
2237         in DoResolve(); fixes #74862.
2238
2239 2005-05-10  Martin Baulig  <martin@ximian.com>
2240
2241         * support.cs (ReflectionParameters.ParameterModifier): Use
2242         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2243         and `ParameterAttributes.In'.  Fixes #74884.
2244
2245 2005-05-10  Martin Baulig  <martin@ximian.com>
2246
2247         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
2248         the cache if we're just looking for `MemberTypes.NestedType' in a
2249         generic instance.
2250
2251         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2252         constraints if we're still resolving the type tree.
2253         (Expression.MemberLookup): If we're resolving the type tree, only
2254         look for `MemberTypes.NestedType' since we're only interested in
2255         getting types.
2256
2257         * class.cs (TypeContainer.DefineType): Don't resolve the type
2258         parameters here; do this later in ResolveType() after the type
2259         tree has been resolved.
2260         (TypeContainer.ResolveType): New public method; this is called
2261         after the type tree is resolved and before the types are being
2262         populated.  We resolve the generic constraints here.
2263         (TypeContainer.DoDefineMember): Check the constraints on our base
2264         class and interfaces.
2265
2266         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
2267         set the `ResolvingTypeTree' flag on the EmitContext.
2268
2269         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
2270
2271 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
2272
2273         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2274         
2275         * expression.cs (Argument.GetParameterModifier): Turned to property.
2276         (Invocation.Error_InvalidArguments): Add more descriptive errors.
2277         
2278         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2279         its C# equivalent.
2280         
2281 2005-05-09  Raja R Harinath  <rharinath@novell.com>
2282
2283         Fix #74852.
2284         * decl.cs (MemberCache.AddMethods): Register override methods,
2285         rather than non-override methods.
2286         * typemanager.cs (RegisterOverride): New.
2287         (IsOverride): Update.
2288
2289 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2290
2291         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
2292
2293 2005-05-06  Martin Baulig  <martin@ximian.com>
2294
2295         * attribute.cs
2296         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
2297         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
2298
2299 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2300
2301         Fix #73105.
2302         
2303         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2304         recursive declaration.
2305         
2306         * statement.cs (Block.ResolveMeta): Report any error in resolving.
2307         
2308 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
2309
2310         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2311         
2312         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2313
2314 2005-05-05  Raja R Harinath  <rharinath@novell.com>
2315
2316         Fix #74797.
2317         * decl.cs (DeclSpace.FamilyAccessible): 
2318         Use TypeManager.IsNestedFamilyAccessible.
2319
2320         Fix reopened #64812.
2321         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2322         internal'.
2323
2324 2005-05-04  Raja R Harinath  <rharinath@novell.com>
2325             Abin Thomas  <projectmonokochi@rediffmail.com>
2326             Anoob V E  <projectmonokochi@rediffmail.com>
2327             Harilal P R  <projectmonokochi@rediffmail.com>
2328
2329         Fix #64812.
2330         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2331         allow access to all static members.
2332
2333 2005-05-04  Martin Baulig  <martin@ximian.com>
2334
2335         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2336
2337 2005-05-04  Martin Baulig  <martin@ximian.com>
2338
2339         Fix #74655.
2340
2341         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2342         section at the end; make things work if `default' is not the last
2343         section.        
2344
2345 2005-05-04  Martin Baulig  <martin@ximian.com>
2346
2347         Fix #70400.
2348
2349         * statement.cs (Switch): Replaced the `got_default' field with a
2350         `default_section' one.
2351         (Switch.CheckSwitch): Set `default_section' here.
2352         (Switch.Resolve): If we're a constant switch and the constant is
2353         not found, use the default section.
2354
2355 2005-05-03  Martin Baulig  <martin@ximian.com>
2356
2357         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2358
2359         * statement.cs (Foreach.ArrayForeach): New nested class.
2360         (Foreach.TemporaryVariable): New nested class.
2361         (Foreach.EmitArrayForeach): Removed; this is now in the new
2362         ArrayForeach class.
2363
2364 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2365
2366         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2367         more conservative.
2368         (VerifyPendingMethods): Revert change below.
2369
2370         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2371         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2372         that used to trigger warning -28.  Remove warning -28.
2373         * expression.cs (Invocation.OverloadResolve): Use
2374         TypeManager.IsOverride to distinguish override methods.
2375
2376         Fix #74773.
2377         * pending.cs (VerifyPendingMethods): If a base type implements the
2378         requested interface, don't bother checking individual methods of
2379         the base type.  As a side-effect, this prevents the creation of
2380         unnecessary proxies.
2381
2382 2005-05-02  Martin Baulig  <martin@ximian.com>
2383
2384         Fix #70182.
2385
2386         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2387         Also `And' the locals if the old vector is null.
2388         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2389         null; in this case we basically reset all the variables.        
2390
2391 2005-05-02  Martin Baulig  <martin@ximian.com>
2392
2393         Fix #74529.
2394
2395         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2396         Added `FlowBranching branching' argument; always `and' the
2397         variables instead of `or'ing them unless we're an infinite loop.
2398
2399         * statement.cs (While.Resolve): Create a new sibling unless we're
2400         infinite.       
2401
2402 2005-05-02  Martin Baulig  <martin@ximian.com>
2403
2404         Fix #70140.
2405
2406         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2407         arguments; use it instead of creating a new TopLevelBlock.
2408         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2409         our ConstructorInitializer.
2410
2411         * statement.cs
2412         (TopLevelBlock.TopLevelBranching): New public property.
2413         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2414         and create our `TopLevelBranching'.
2415
2416         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2417         anonymous method host, use `block.TopLevelBranching' rather than
2418         creating a new branching.
2419
2420 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2421
2422         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2423         a ScopeInfo, if any of the current children is a child of the new
2424         entry, move those children there.
2425
2426 2005-04-30  Martin Baulig  <martin@ximian.com>
2427
2428         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2429         at the beginning of a SwitchSection.  Fix #73335.
2430
2431 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2432
2433         Fix #74378
2434         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2435         
2436         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2437         (FieldExpr.DoResolve): Obsolete members are ignored for field
2438         initializers.
2439         
2440 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2441
2442         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2443         of arrays detection.
2444
2445         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2446         verification.
2447         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2448
2449         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2450         arrays report.
2451
2452 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2453
2454         * cs-parser.jay: Use the prefered version of -unsafe in error
2455         message.
2456
2457 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2458
2459         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2460         circumstances.
2461
2462 2005-04-20  John Luke  <john.luke@gmail.com>
2463
2464         * driver.cs: fix typo in error message, --outout to --output
2465
2466 2005-04-30  Martin Baulig  <martin@ximian.com>
2467
2468         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2469         handle the .NET 2.x security attributes.
2470
2471 2005-04-30  Martin Baulig  <martin@ximian.com>
2472
2473         * typemanager.cs
2474         (TypeManager.ExpandInterfaces): Don't add things twice.
2475
2476         * class.cs
2477         (TypeContainer.VerifyClsCompliance): Allow generic instances.
2478
2479 2005-04-29  Martin Baulig  <martin@ximian.com>
2480
2481         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2482
2483         * anonymous.cs: Added support for anonymous generic methods.
2484
2485 2005-04-29  Martin Baulig  <martin@ximian.com>
2486
2487         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2488         generic instances.
2489
2490 2005-04-29  Martin Baulig  <martin@ximian.com>
2491
2492         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2493
2494         * expression.cs (New.DoResolve): Fix the CS0304 check.
2495
2496 2005-04-29  Martin Baulig  <martin@ximian.com>
2497
2498         * typemanager.cs (TypeManager.GetFullName): Updated to the new
2499         naming schema.
2500
2501         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2502         explicit interface implementation, compare the interface types.
2503         (MethodData.Define): Use the new naming scheme from the latest
2504         .NET 2.x beta2.
2505         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2506
2507         * decl.cs (MemberName.GetMemberName): Removed.
2508         (MemberName.MethodName, FullName): New properties.
2509
2510 2005-04-25  Raja R Harinath  <rharinath@novell.com>
2511
2512         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
2513
2514 2005-04-22  Martin Baulig  <martin@ximian.com>
2515
2516         * generic.cs (GenericMethod): Create the EmitContext in the
2517         `Define()'; in `Define(MethodBuilder)', create the type parameters
2518         before calling `Define()'.  Fixes #73933.
2519
2520 2005-04-22  Martin Baulig  <martin@ximian.com>
2521
2522         * generic.cs
2523         (Constraints.Resolve): Make things work wrt. the new type lookup system.
2524         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2525
2526         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2527         ConstructedType, check its constraints.
2528
2529 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2530
2531         * codegen.cs (InRefOutArgumentResolving): New field.
2532         
2533         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2534         fields outside contructor.
2535         
2536         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2537         
2538 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2539
2540         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2541         parameter code was not completed ever, so it was not as up-to-date
2542         as local variables.  Must finish it.
2543
2544         The bug fix was to compare the Toplevel of the block, not the
2545         current block.  Thanks for Ben for pointing this out. 
2546
2547 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2548
2549         * decl.cs (AddMethods): Use the declaring type of the problem
2550         method to determine if we want to squash a warning.
2551
2552 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2553
2554         * attribute.cs: Removed debug output.
2555
2556         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2557         
2558         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2559         Report.Stderr.
2560         
2561 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2562
2563         Fix #74481.
2564         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2565         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2566         all null comparisons against reference types.
2567
2568 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2569
2570         Fix# 74565
2571         * class.cs (TypeContainer.CircularDepException) New nested
2572         exception class.
2573         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2574         (TypeContainer.DefineType): Removed error, reset InTransit before
2575         exit.
2576         (Class.DefineType): Throw exception when is in Transit.
2577         Catch exception and report error.
2578         (Struct.DefineType): Throw exception when is in Transit.
2579         Catch exception and report error.
2580         (Interface.DefineType): Throw exception when is in Transit.
2581         Catch exception and report error.
2582
2583         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2584         handle nested exception handlers.
2585
2586         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2587         a catch.
2588
2589         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2590         InFinally and InCatch storage.
2591
2592         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2593         (Catch.Resolve): Set and Restore ec.InCatch.
2594         (Try.Resolve): Set and Restore ec.InFinally.
2595         (Try.HasCatch): True when try has catch.
2596
2597 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2598
2599         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2600           for the same event member, so exclude such cases from warning 419.
2601           Fixed bug #74633.
2602
2603 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2604
2605         * expression.cs (Binary.ResolveOperator): Apply patch from John
2606         Luke to fix bug 59864: operators &, | and ^ on enumerations
2607         require that the same enum type on both sides.
2608
2609         * driver.cs: Add warnings to old flag usage, this is to assist
2610         people who produce Makefiles and hope that the Makefiles will be
2611         used on Windows.
2612
2613         * class.cs (TypeContainer.EmitType): Moved the definition of the
2614         special $PRIVATE$ field from the resolve phase to the Emit phase.
2615         During resolve we do not know if we are a struct with
2616         HasExplicitLayout, we know this only after the attributes for the
2617         type are emitted.
2618
2619         Set the FieldOffset to zero on the dummy field that we create for
2620         the class.   Fixes 74590.
2621
2622 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2623
2624         Fix #73834.
2625         * ecore.cs (PropertyExpr.resolved): New.
2626         (DoResolve): Use it to handle a case of double resolution here.
2627         Handle a case of identical-name-and-type-name.
2628         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2629         resolution by storing the results of expression resolution back
2630         into the "probes" array.
2631
2632 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2633
2634         Fix cs0208-7.cs and cs0208-8.cs.
2635         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2636         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2637         error reporting to point out the reason a struct is not unmanaged.
2638
2639 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2640
2641         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2642           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2643
2644 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2645
2646         Fix #74528.
2647         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2648         IdenticalNameAndTypeName here.
2649         (EventExpr.InstanceResolve): Likewise.
2650
2651 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2652
2653         C# 2.0 DefaultCharSetAttribute implementation
2654         
2655         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2656         which allows us to set GlobalNamespace for every resolve.
2657         (Attribute.ResolveArguments): Cut from Resolve.
2658         (Attribute.GetCharSetValue): Returns CharSet named argument.
2659         (Attribute.DefinePInvokeMethod): Gets default charset from
2660         module settings.
2661         (GlobalAttribute.ResolveAsTypeStep): Override.
2662         (GlobalAttribute.ResolveArguments): Override.
2663         
2664         * class.cs (TypeAttr): Is protected.
2665         
2666         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2667         (ModuleClass.DefaultCharSetType): New memeber.
2668         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2669         
2670         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2671         charset from module.
2672         
2673         * delegate.cs (TypeAttr): Override.
2674         (Delegate.DefineType): Use this TypeAttr.
2675         
2676         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2677         at very early stage (before types are defined) to resolve model
2678         module attributes. It will probably not work with corlib but it
2679         should be ok.
2680         
2681         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2682         charset from module.
2683         
2684         * typemanager.cs (default_charset_type): New type.
2685
2686 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2687
2688         * decl.cs (MemberCache.AddMethods): Don't warn if
2689         System.Object.Finalize has buggy MethodAttributes.
2690
2691         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2692         removed below.
2693
2694 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2695
2696         * doc.cs : detect ambiguous reference to overloaded members.
2697           Fixed bug #71603. MS 1.1 csc does not detect it.
2698
2699 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2700
2701         * doc.cs : delegates must not be referenced with parameters.
2702           Fixed bug #71605.
2703
2704 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2705
2706         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2707
2708 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2709
2710         * driver.cs (MainDriver): Stop processing if the CLS stage found
2711         errors. 
2712
2713         (CompilerCallableEntryPoint.InvokeCompiler): Always
2714         reset after execution;   Take a TextWriter argument for the
2715         output.
2716
2717         * report.cs: Use the error stream instead of hardcoding stderr. 
2718
2719 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2720
2721         * class.cs: Reduce code paths to test, too small of an
2722         optimization to make it worth the extra testing.  Always perform
2723         it. 
2724
2725 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2726
2727         Fix #74510.
2728         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2729         operators that had errors reported on them.
2730
2731 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2732
2733         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2734         argument types.
2735         (Attribute.Resolve): Add named argument type checking.
2736         
2737         * class.cs (FixedField.Define): Use IsPrimitiveType
2738         
2739         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2740         
2741         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2742         unsafe parameter types.
2743         
2744         * statement.cs (Using.ResolveExpression): Add better error description.
2745         
2746         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2747         
2748 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2749
2750         Fix #74484.
2751         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2752         AttributeUsageAttribute in the emitcontext of the attribute class,
2753         not in the emitcontext of the attributable entity it was attached to.
2754         * cs-parser.jay: Use 'current_class', not 'current_container',
2755         when creating a GlobalAttribute.
2756
2757 2005-04-08  Alp Toker  <alp@atoker.com>
2758
2759         * pending.cs: The fix to #58413 failed to compile methods implementing
2760         interfaces with/without params modifiers and vice versa, even though
2761         params modifiers aren't part of the signature. Make the modifier check
2762         less strict as in csc.
2763
2764 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2765             Anoob V E  <projectmonokochi@rediffmail.com>
2766             Harilal P R  <projectmonokochi@rediffmail.com>
2767
2768         Fix #58413.
2769         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2770         modifiers of pending methods.
2771         (PendingImplementation.PendingImplementation): Initialize it.
2772         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2773         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2774         with ParameterData.  Add check for modifiers.
2775         * class.cs (MethodData.Define): Update to changes.
2776
2777 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2778
2779         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2780
2781 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2782
2783         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2784         property.
2785         
2786         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2787         
2788         * rootcontext.cs,
2789         * typemanager.cs: Registered RequiredAttributeAttribute.
2790         
2791 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2792
2793         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2794         Warning CS0169 is back at level 3.
2795         (IMethodData.SetMemberIsUsed): New method.
2796         
2797         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2798         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2799         
2800         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2801
2802         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2803         contants.
2804         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2805         is used.
2806         
2807         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2808         is used.
2809         
2810         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2811         to avoid the problems with nested types.
2812
2813 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2814             Anoob V.E  <projectmonokochi@rediffmail.com>
2815             Harilal P.R  <projectmonokochi@rediffmail.com>
2816             Raja R Harinath  <rharinath@novell.com>
2817
2818         Fix #73820.
2819         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2820         attribute.
2821         * typemanager (GetConstructor): Make public.
2822
2823 2005-04-05  John Luke  <john.luke@gmail.com>
2824             Raja R Harinath  <rharinath@novell.com>
2825
2826         Fix #62232.
2827         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2828         struct too.  Return false quicker in a few cases.
2829         (VerifyUnManaged): Use it.
2830
2831 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2832
2833         Fix #74041.
2834         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2835         not 'unreachable_seen'.
2836
2837 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2838
2839         * attribute.cs (Attribute.GetValue): Removed unused.
2840         
2841         * codegen.cs (CodeGen.TrimExt): Removed unused.
2842         
2843         * cs-parser.jay (output): Removed unused.
2844         
2845         * cs-tokenizer.cs (hex_digits): Removed unused.
2846         
2847         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2848         
2849         * expression.cs (Indirection.LoadExprValue): Removed unused.
2850         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2851         
2852         * iterators.cs (Iterator.param_types): Removed unused.
2853         
2854         * statement.cs (Goto.block): Removed unused.
2855         (ToplevelBlock.did): Removed unused.
2856         (Switch.ResolveConstantSwitch): Removed unused.
2857
2858 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2859
2860         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2861         resetting thingy.
2862
2863 2005-04-19  Martin Baulig  <martin@ximian.com>
2864
2865         Merged r42462 from MCS and made it work for GMCS.
2866
2867         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2868
2869         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2870
2871 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2872
2873         Fix #74232 and cs0208-3.cs.
2874         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2875         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2876         unmanaged type.  Don't use FieldBuilders when 't' is a
2877         TypeBuilder.  Use ModFlags and MemberType fields.
2878         * class.cs (MemberBase.member_type): Rename from MemberType.
2879         (MemberBase.MemberType): New property.  Determines member_type on
2880         demand.
2881         (MemberBase.DoDefine): Don't initialize MemberType here.
2882         (FieldMember.Define): Likewise.
2883
2884 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2885
2886         Fix #74241
2887         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2888         Attributes are emitted there.
2889         
2890 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2891
2892         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2893         keyword in 'partial enum' too.
2894         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2895         is not allowed).
2896         Report from Kamil Skalski <nazgul@omega.pl>.
2897
2898         Fix #74309.
2899         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2900         have partial containers too.
2901
2902         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2903         in block' checks to Block.CheckInvariantMeaningInBlock.
2904         * statement.cs (Block.GetKnownVariableInfo): Make private.
2905         (Block.IsVariableUsedInChildBlock): Remove.
2906         (Block.IsVariableUsedInBlock): Likewise.
2907         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2908         conflicting declaration.
2909         (Block.AddVariable): Make error messages less long-winded and more
2910         specific.  Show location of conflicting declaration.
2911         * parameter.cs (Parameters.Location): New readonly property.
2912
2913 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2914
2915         Clean up semantics of invoking ResolveMemberAccess.
2916         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2917         can have an instance, ensure that we pass in a non-TypeExpression
2918         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2919         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2920         argument.  Update to changes and simplify.
2921         (FieldExpr.Emitinstance): Remove CS0120 check.
2922         (PropertyExpr.EmitInstance): Likewise.
2923         * expression.cs (Argument.Resolve): Likewise.
2924         (Invocation.DoResolve): Update to changes in semantics of
2925         InstanceExpression.
2926
2927 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2928
2929         Fix #74241
2930         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2931         customization.
2932         
2933         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2934
2935 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2936
2937         Fix difference in behaviour with commandline invocation.
2938         * driver.cs (Driver.Reset): New.
2939         (CompilerCallableEntryPoint): Call it.
2940
2941         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2942         variable" warnings if the boolean expression failed to resolve.
2943
2944 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2945
2946         * attribute.cs: Fix the union of several permissions when some of them
2947         are unrestricted (so the result isn't an unrestricted permission set).
2948         Fix #74036.
2949
2950 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2951
2952         * ecore.cs (MemberExpr): New class.  Convert from interface
2953         IMemberExpr.
2954         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2955         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2956         error checks.
2957         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2958         (MethodGroupExpr.IsExplicitImpl): Remove.
2959         (Expression.GetFieldFromEvent): Remove.
2960         (SimpleName.MemberStaticCheck): Remove.
2961         (SimpleName.DoSimpleNameResolve): Update to changes.
2962         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2963         (MemberAccess.IdenticalNameAndTypeName): Remove.
2964         (MemberAccess.error176): Move to MemberExpr.
2965         (MemberAccess.DoResolve): Update to changes.
2966         (BaseAccess.DoResolve): Likewise.
2967
2968 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2969
2970         C# 2.0 Conditional attribute class implementation
2971         
2972         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2973         Analyzes class whether it has attribute which has ConditionalAttribute
2974         and its condition is not defined.
2975         
2976         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2977         (Class.IsExcluded): New method. Search for at least one defined
2978         condition in ConditionalAttribute of attribute class.
2979
2980 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2981
2982         * ecore.cs (PropertyExpr): Derive from Expression, not
2983         ExpressionStatement.
2984         (PropertyExpr.EmitStatement): Remove.
2985
2986 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2987
2988         Fix #74060.
2989         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2990         internal field "value__" of an enum be private.  The examples for
2991         "value__" that I found on MSDN all used FieldAttributes.Private.
2992
2993         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2994         Don't mention IL method attribute names.
2995
2996         Fix #47991.  Remove a TODO.
2997         * statement.cs (Block.Toplevel): Make into a field.
2998         (Block.Parameters): Move into ToplevelBlock.
2999         (Block.known_variables): Rename from child_variable_names.
3000         (Block.Block): Remove variants that take Parameters.  Initialize
3001         'Toplevel' with the immediately surrounding toplevel block.
3002         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
3003         LocalInfo parameter.
3004         (Block.GetKnownVariableInfo): New.
3005         (Block.IsVariableNameUsedInChildBlock): Update.
3006         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
3007         the block, even though it may not be in scope.
3008         (Block.AddVariable): Remove Parameters parameter.  Use
3009         Toplevel.Parameters instead.
3010         (Block.AddConstant): Remove Parameters parameter.
3011         (Block.GetParameterReference): Update to use Toplevel.Parameters.
3012         (Block.IsParamaterReference): Likewise.
3013         (Block.IsLocalParameter): Likewise.  Simplify a lot.
3014         (ToplevelBlock.Parameters): New.  Moved from Block.
3015         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
3016         initialize Parameters to a non-null value.
3017         * cs-parser.jay: Update to changes.
3018         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3019         simple names that mean different things in the same block.  Use
3020         Block.IsVariableNameUsedInBlock.
3021
3022 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3023
3024         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3025
3026 2005-03-26  Raja R Harinath  <harinath@acm.org>
3027
3028         Fix #73038.
3029         * assign.cs (Assign.DoResolve): When the RHS of an assignment
3030         fails to resolve, ensure that the LHS is still resolved as an
3031         lvalue.
3032
3033 2005-03-25  Raja R Harinath  <harinath@acm.org>
3034
3035         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3036         ec.ContainerType.
3037         (Enum.current_ec): Remove.
3038         (Enum.LookupEnumValue): Remove EmitContext argument.
3039         Just uses the one created during DefineType.
3040         (Enum.FindMembers): Update.
3041         * expression.cs (MemberAccess.DoResolve): Update.
3042
3043 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
3044
3045         * assign.cs (Assign.DoResolve): Check for CS1717 when
3046         source and target are same (uses Equals).
3047
3048         * expression.cs (LocalVariableReference, ParameterReference,
3049         This): Implemented Equals, GetHashCode.
3050
3051         * statement.cs (Block.GetParameterReference): Removed useless
3052         local variable.
3053
3054 2005-03-22  Raja R Harinath  <rharinath@novell.com>
3055
3056         Fix cs0128.cs
3057         * statement.cs (Block.AddVariable): Ensure that we skip implicit
3058         blocks before deciding whether the error is cs0136 or cs0128.
3059
3060         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3061         (using_alias_directive, using_namespace_directive): Pass
3062         MemberName, not an expression to Namespace.UsingAlias and
3063         Namespace.Using.
3064         (MakeName): Use the MemberName of the namespace.
3065         * namespace.cs (Namespace.MemberName): New.
3066         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3067         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3068         Likewise.
3069         * decl.cs (MemberName.Name): Make readonly.
3070         (MemberName.FromDotted): New "constructor".
3071         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3072         (MemberCore.Name): Compute from MemberName on demand.
3073         (MemberCore.SetMemberName): Provide a way to change the
3074         MemberName.
3075         (MemberCore.AddToContainer): Don't take a fullname parameter.
3076         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3077         fully qualified name of the container to the member name.
3078         (TypeContainer.AddToTypeContainer): Use a fully qualified name
3079         only if the type is a member of the root container.
3080         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3081         MemberName.Left rather than searching for an embedded ".".
3082         (PartialContainer.CreatePart): Update to changes in RootContext.
3083         (MemberBase.ShortName): Turn into a property.  Use
3084         MemberCore.SetMemberName.
3085         (MemberBase.ExplicitInterfaceName): Remove.
3086         (MemberBase.UpdateMemberName): Remove.
3087         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3088         (PropertyBase.SetMemberName): New override.
3089         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3090         (Tree.GetDecl): New.
3091         (Tree.AllDecls): Rename from Decls.
3092         * attribute.cs, enum.cs, report.cs: Update to changes.
3093         * driver.cs (MainDriver): Use MemberName.FromDotted on
3094         RootContext.MainClass.
3095
3096 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
3097
3098         * class.cs (FixedField.Define): Check for CS1664 and more sanity
3099         checks.
3100
3101         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3102
3103 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
3104
3105         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3106         property accessor modifiers.
3107
3108         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3109         fixed buffer attribute (CS1716).
3110         (PropertyMethod.HasCustomAccessModifier): When property accessor
3111         has custom modifier.
3112
3113         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3114         modifiers.
3115         (PropertyExpr.DoResolveLValue): Add CS0272.
3116
3117 2005-03-17  Miguel de Icaza  <miguel@novell.com>
3118
3119         * convert.cs: When converting to a pointer, use the proper Conv.U
3120         or Conv.I depending on the source data type.
3121
3122         * cs-tokenizer.cs: Make the size for large decimal constants,
3123         fixes #72957.
3124
3125 2005-03-17  Martin Baulig  <martin@ximian.com>
3126
3127         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3128         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3129
3130 2005-03-17  Martin Baulig  <martin@ximian.com>
3131
3132         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3133         to bool so we can return an error condition.
3134         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3135         returned an error.
3136
3137 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
3138
3139         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3140         attributes.
3141
3142 2005-03-16  Raja R Harinath  <rharinath@novell.com>
3143
3144         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3145         Refactor to avoid traversing the list of assemblies, and to avoid
3146         string concatenation.
3147         * typemanager.cs (guid_attr_type): Remove.
3148         (negative_hits, pointers, references): Remove hashes.
3149         (type_hash): New.
3150         (GetConstructedType): New.  Uses type_hash to handle constructed
3151         types (arrays, references, pointers).
3152         (GetReferenceType, GetPointerType): Use it.
3153         (GetNestedType): New.  Uses type_hash to handle nested types of
3154         reflected types.
3155         (LookupType, LookupTypeDirect): Remove.
3156         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
3157         'types' hash and LookupTypeReflection directly.
3158         (params_string, params_object): Use GetConstructedType.
3159         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
3160         top-level types.
3161         (Namespace.Lookup): Use cached_types.
3162         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
3163         provided by old TypeManager.LookupType.
3164         * rootcontext.cs (MakeFQN): Remove.
3165         * decl.cs (DeclSpace.MakeFQN): Likewise.
3166         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
3167         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
3168         TypeManager.GetConstructedType.
3169         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
3170
3171 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
3172
3173         * cs-parser.jay: Fix build.
3174
3175 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
3176
3177         * class.cs (TypeContainer.CircularDepException) New nested
3178         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
3179
3180         * cs-parser.jay: Reports CS1527 for any namespace element.
3181
3182         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
3183         Added CS0407.
3184
3185         * expression.cs (ParameterReference.IsAssigned): Changed error to
3186         CS0269.
3187         (Error_WrongNumArguments): Moved CS0245 detection here.
3188
3189         * statement.cs (Return.Resolve): Add CS1622 report.
3190
3191 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
3192
3193         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
3194
3195 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
3196
3197         * attribute.cs expression.cs: Get rid of some allocations.
3198
3199 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
3200
3201         * doc.cs : just eliminate the latest change.
3202
3203 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3204
3205         * doc.cs : commented out the latest change. It breaks xml-030.cs
3206
3207 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3208
3209         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
3210           fail. So invoke CreateType() in FindDocumentedType().
3211
3212 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3213
3214         * cs-tokenizer.cs : added IsKeyword().
3215         * doc.cs : Detect keyword incorrectly used as identifier.
3216           Allow identifiers prefixed by @.
3217
3218 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
3219
3220         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
3221         It caused exception in namespace resolving (again!).
3222         
3223         * class.cs (Class.ctor): Removed exit.
3224         (PropertyMethod.ctor): ditto.
3225         
3226         * codegen.cs (Codegen.Reset): Reset static data.
3227         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
3228         
3229         * cs-tokenizer.cs (Cleanup): Removed.
3230         
3231         * driver.cs (GetSystemDir): Rewrote to one line command.
3232         It caused problem with unloaded dynamic modules.
3233         (UnixParseOption): Removed Exit.
3234         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3235         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3236         Now can be mcs used as library.
3237         
3238         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3239         empty location.
3240         
3241         * location.cs (Reset): Reset static data.
3242         
3243         * namespace.cs (Reset): Reset static data.
3244         
3245         * report.cs (Report.Reset): Reset static data.
3246         
3247         * rootcontext.cs (RootContext.Reset): Reset static data.
3248         
3249         * tree.cs (RootTypes.ctor): Use Location.Null
3250         
3251         * typemanager.cs (TypeManager.Reset): Reset static data.
3252         (CoreLookupType): Removed Exit.
3253         (TypeHandle.Reset): Reset static data.
3254         
3255 2005-03-10  Raja R Harinath  <rharinath@novell.com>
3256
3257         Fix #73516.
3258         * typemanager.cs (ComputeNamespaces): Import namespaces from
3259         referenced modules too.
3260
3261 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3262
3263         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
3264         than '.'.
3265
3266 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3267
3268         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
3269         enclosing DeclSpace.  This ensures that a name-lookup populates
3270         more caches and there are fewer 'TypeExpression's.  Carve out
3271         nested type lookup into ...
3272         (LookupNestedTypeInHierarchy): ... this.
3273
3274 2005-04-15  Martin Baulig  <martin@ximian.com>
3275
3276         Merged r41590 from MCS and make it work in the generics land.
3277
3278         * generic.cs (TypeParameter.UpdateConstraints): Removed the
3279         `check' argument.
3280
3281         * class.cs (PartialContainer.UpdateConstraints): Removed.
3282         (PartialContainer.CheckConstraints): Removed.
3283         (PartialContainer.SetParameterInfo): Store the constraints here.
3284         (PartialContainer.DefineTypeParameters): New public method;
3285         resolve the type parameter's constraints here.  Note that the
3286         PartialContainer doesn't have an EmitContext anymore, so we must
3287         do this in the ClassPart.
3288
3289 2005-03-09  Raja R Harinath  <rharinath@novell.com>
3290
3291         Clean up a few partial-class semantics.  
3292         Fixes test-357.cs and cs1618-2.cs.
3293         * cs-parser.jay (struct_declaration): Use 'current_class' as
3294         parent of newly-created struct.  Remove call to Register ().
3295         Use 'pop_current_class' to complete handing the current struct.
3296         (interface_declaration): Likewise.
3297         (class_declaration): Likewise.
3298         (enum_declaration): Use 'current_class' as parent of newly created
3299         enum.
3300         (delegate_declaration): Likewise.
3301         (pop_current_class): New function.  This is used to handle closing
3302         up the 'current_class' and 'current_container', and pointing them
3303         to the enclosing class/container.
3304         (CSharpParser): Initialize 'current_class' too.
3305         * decl.cs (MemberCore): Add check for invariant: a partial
3306         container is not a parsed entity, and thus does not enclose any
3307         parsed members.
3308         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3309         (DeclSpace.BaseTypeExpr): Use it.
3310         (DeclSpace.LookupType): Add check for invariant.
3311         * class.cs (TypeContainer): Add check for invariant: a nested
3312         class should have the same NamespaceEntry as its enclosing class.
3313         (TypeContainer.EmitFieldInitializers): Make virtual.
3314         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3315         MemberCore.
3316         (TypeContainer.Register): Remove.
3317         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3318         null.  Use TypeResolveEmitContext for resolving base types and
3319         interfaces.  Move initialization of Parts.TypeBuilder here from
3320         ...
3321         (TypeContainer.DefineNestedTypes): ... here.
3322         (PartialContainer): Take a Namespace not a NamespaceEntry.
3323         (PartialContainer.Create): Don't use Register.  Call the
3324         appropriate Add... function directly.
3325         (ClassPart): Take both the PartialContainer and the enclosing
3326         class as constructor arguments.
3327         (ClassPart.EmitFieldInitializers): Override.
3328         (ClassPart.PartFindNestedTypes): Remove.
3329         (FieldBase.GetInitializerExpression): Resolve the initializer
3330         expression in the emit context of the enclosing class.
3331         * tree.cs (RootTypes): Remove Register ().
3332         
3333 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
3334
3335         * cs-parser.jay: Removed CS0134.
3336         
3337         * driver.cs: Removed CS1901.
3338         
3339         * expression.cs (SizeOf.DoResolve): Don't report CS0233
3340         for predefined types.
3341
3342 2005-03-07  Duncan Mak  <duncan@novell.com>
3343
3344         * codegen.cs (Save):  Catch UnauthorizedAccessException as
3345         well. Fixes bug #73454.
3346
3347 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
3348
3349         * cs-tokenizer.cs (xtoken): Add CS1035.
3350         
3351         * class.cs (MethodData.Define): Add CS0683.
3352         (FieldMember.ctor): Add CS0681.
3353
3354 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3355
3356         * ecore.cs (SimpleName.DoResolve): Rename from
3357         SimpleName.DoResolveAllowStatic.
3358         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3359         Pass 'intermediate' flag to MemberStaticCheck.
3360         (SimpleName.MemberStaticCheck): Skip "static check" only in case
3361         of "intermediate" lookups via MemberAccess.
3362         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
3363         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3364
3365 2005-03-07  Raja R Harinath  <rharinath@novell.com>
3366
3367         Fix #73394.
3368         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3369         slipped in because of variable names that are identical to a
3370         builtin type's BCL equivalent ('string String;', 'int Int32;').
3371         (PropertyExpr.EmitInstance): Likewise.
3372
3373 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3374
3375         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3376         
3377         * report.cs (warning_ignore_table): Made public.
3378
3379 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3380
3381         Fix #73282.
3382         * class.cs (MethodData.Emit): Pass 'container' to
3383         container.GetObsoleteAttribute instead of 'container.Parent'.
3384
3385 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3386
3387         * cs-parser.jay: Add 1534 error test.
3388
3389         * iterators.cs (Yield.CheckContext): Add error 1629.
3390         (Iterator.ctor): Save unsafe modifier.
3391         (MoveNextMethod.DoEmit): Restore unsafe context.
3392
3393         * namespace.cs (UsingAlias): Better error message.
3394
3395 2005-03-03  Dan Winship  <danw@novell.com>
3396
3397         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3398         the warning message [#73219]
3399
3400 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3401
3402         Fix compile with MCS 1.0.0.0.
3403         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3404         w_restore to not depend on string constant folding.
3405
3406 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3407
3408         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3409         CS0246 check to users who passed 'silent = false'.
3410         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3411         check.
3412         (SimpleName.SimpleNameResolve): Update.
3413         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3414         (MemberAccess.IdenticalNameAndTypeName): Update.
3415         * doc.cs (FindDocumentedTypeNonArray): Update.
3416
3417 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3418
3419         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3420         * parameters.cs (ComputeAndDefineParameters): Remove.
3421         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3422         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3423         Use GetParameterInfo.
3424
3425 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3426
3427         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3428
3429 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3430
3431         Unify DeclSpace.LookupType and DeclSpace.FindType.
3432         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3433         is in charge of defining nested types on demand.
3434         (DeclSpace.LookupType): Use it when the current_type is a
3435         TypeBuilder.  Use LookupTypeDirect for reflected types.
3436         (DeclSpace.FindType): Remove.
3437         (DeclSpace.LookupInterfaceOrClass): Likewise.
3438         (DeclSpace.DefineTypeAndParents): Likewise.
3439         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3440         DeclSpace.LookupType.
3441         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3442         * typemanager.cs (LookupType): Simplify.
3443         (AddUserType): Remove type from negative_hits.
3444         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3445         * class.cs (TypeContainer.FindMembers): Move handling of nested
3446         types ...
3447         (TypeContainer.FindMembers_NestedTypes): ... here.
3448         (TypeContainer.FindNestedType): Implement override.
3449         (ClassPart.FindNestedType): Delegate to PartialContainer.
3450         (ClassPart.PartFindNestedType): Looks up the nested types of the
3451         part alone.
3452
3453 2005-04-14  Martin Baulig  <martin@ximian.com>
3454
3455         * generic.cs (ConstructedType): Moved all the type lookup and
3456         nested class logic into SimpleName.
3457         (ConstructedType.ResolveConstructedType): Our underlying type is
3458         already fully resolved; all the type lookup stuff is in
3459         SimpleName.
3460
3461         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3462         constructed types here instead of in ConstructedType.
3463
3464         * decl.cs (MemberName.GetTypeExpression): Always create a
3465         SimpleName, not a ConstructedType.
3466         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3467
3468 2005-03-02  Martin Baulig  <martin@ximian.com>
3469
3470         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3471         static constructor in static classes.
3472
3473 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3474
3475         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3476         sizeParamIndex is not specified.
3477
3478 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3479
3480         Fix #73117
3481         * report.cs (WarningMessage.IsEnabled): Missing null check.
3482
3483 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3484
3485         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3486         in the fields and not in the properties.
3487
3488 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3489
3490         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3491         fields as well.
3492
3493 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3494
3495         * attribute.cs: Small refactoring (improved robustness).
3496         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3497         (ValidateGuid): Removed.
3498         (Resolve): Removed referenced to above mentioned.
3499         (GetAttributeUsage): Made private and changed to work without
3500         class assistance.
3501         (GetIndexerAttributeValue): Don't crash.
3502         (GetConditionalAttributeValue): Ditto.
3503         (GetClsCompliantAttributeValue): Ditto.
3504         (ExtractSecurityPermissionSet): All attributes exceptions are
3505         error 648.
3506         (GetPropertyValue): New helper.
3507         (GetMethodImplOptions): New method.
3508         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3509         some missing properties.
3510         
3511         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3512         (Method.ApplyAttributeBuilder): Updated.
3513         
3514         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3515         exception.
3516
3517 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3518
3519         Fix #73052.
3520         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3521         non-simple types (array, pointer, reference).
3522
3523 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3524
3525         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3526
3527         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3528         for operators.
3529         (Method.CheckBase): Catch wrong destructor here.
3530         (MethodData.Define): Add errors 550, 668.
3531
3532         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3533
3534         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3535
3536         * pending.cs (VerifyPendingMethods): Add error 551.
3537
3538         * typemanager.cs (CSharpName): Next error report helper.
3539
3540 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3541
3542         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3543         attributes. Removed useless attribute double check.
3544         It saves almost 2MBs for corlib.
3545
3546 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3547
3548         Fix #72924.
3549         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3550         called twice in case of error.
3551
3552 2005-02-23  Chris Toshok  <toshok@ximian.com>
3553
3554         Fix compiler portions of #72827.
3555         * statement.cs (Block.Emit): call Begin/EndScope on the
3556         EmitContext instead of the ILGenerator.
3557
3558         * codegen.cs (EmitContext.BeginScope): new method, call
3559         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3560         we have one.)
3561         (EmitContext.BeginScope): same, but EndScope and CloseScope
3562
3563         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3564         offset and call the superclass's OpenScope(int) with it.
3565         (SymbolWriter.CloseScope): get the current il
3566         offset and call superclass's CloseScope(int) with it.
3567
3568 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3569
3570         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3571         CS1677 for out and ref as well.
3572
3573         * class.cs (Method.Define): Add error CS1599 detection.
3574         
3575         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3576         
3577         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3578         
3579         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3580         
3581         * support.cs.cs (ModifierDesc): New helper method.
3582
3583 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3584             Abin Thomas  <projectmonokochi@rediffmail.com>
3585             Anoob V E  <projectmonokochi@rediffmail.com>
3586             Harilal P R  <projectmonokochi@rediffmail.com>
3587
3588         Fix #57851, #72718.
3589         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3590         MemberLookup (used for error reporting) actually returns a result.
3591         Fix error report number (122, not 112).
3592
3593 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3594             Anoob V E  <projectmonokochi@rediffmail.com>
3595             Harilal P R  <projectmonokochi@rediffmail.com>
3596
3597         Fix #71134.
3598         * pending.cs (PendingImplementation.GetAbstractMethods):
3599         Find NonPublic members too.
3600
3601 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3602
3603         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3604         Fixed error 217.
3605         
3606         * class.cs (MethodCore.CheckMethodAgainstBase):
3607         Add error 239 report.
3608
3609 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3610
3611         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3612         
3613         * class.cs (Operator.Define): Add error 217 report.
3614         
3615 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3616
3617         Fix #68955.
3618         * expression.cs (Invocation.IsApplicable): Make public.
3619         (Invocation.IsParamsMethodApplicable): Likewise.
3620         * delegate.cs (Delegate.VerifyApplicability): Don't use
3621         Invocation.VerifyArgumentCompat for parameter applicability
3622         testing.  Use Invocation.IsApplicable and
3623         Invocation.IsParamsMethodApplicable.
3624
3625 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3626
3627         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3628         
3629         * class.cs (Operator.Define): Add error 217 report.
3630         
3631 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3632
3633         * namespace.cs (UsingEntry.Resolve): Undo change below.
3634
3635 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3636
3637         Fix #72756.
3638         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3639         disable the error message when the extended MemberLookup also
3640         fails.
3641         (Expression.MemberLookupFinal): Update.
3642         (SimpleName.DoSimpleNameResolve): Update.
3643         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3644         Don't use MemberLookupFinal.
3645         (New.DoResolve): Update.
3646         (BaseAccess.CommonResolve): Update.
3647
3648 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3649
3650         Fix #72732.
3651         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3652         occured previously, don't resolve again.
3653
3654 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3655
3656         Fix #69949
3657         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3658         argument. Call ResolveAttributeUsage for unresolved.
3659         when types doesn't match ctor arguments.
3660         
3661         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3662         for nested attribute classes.
3663         (Class.attribute_usage): Removed.
3664         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3665         for attribute class.
3666         
3667         * ecore.cs (IsAttribute): Removed.
3668         
3669         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3670         
3671         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3672         now normal types.
3673         (attribute_types): Removed.
3674         (EmitCode): Global attributes are emited as the latest.
3675
3676 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3677
3678         * class.cs (EmitFieldInitializers): Don't emit field initializer
3679         for default values when optimilization is on.
3680         
3681         * constant.cs (Constant.IsDefaultValue): New property.
3682         
3683         * driver.cs: Add /optimize handling.
3684         
3685         * constant.cs,
3686         * ecore.cs,
3687         * literal.cs: Implement new IsDefaultValue property.
3688         
3689         * rootcontext.cs (Optimize): New field, holds /optimize option.
3690
3691 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3692
3693         Fix crasher in re-opened #72347.
3694         * namespace.cs (Namespace.Lookup): Return null if
3695         DeclSpace.DefineType returns null.
3696
3697         Fix #72678.
3698         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3699
3700 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3701
3702         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3703         now returns null if it cannot resolve to an lvalue.
3704         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3705         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3706         returned null.  Remove check for SimpleName.
3707         (EventExpr.DoResolveLValue): New.
3708         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3709         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3710         error from ...
3711         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3712         avoid CS0131 error.
3713         (Unary.ResolveOperator): Move CS0211 check ...
3714         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3715         CS0131 error.
3716         (Unary.DoResolveLValue): Simplify.
3717         (AddressOf.DoResolveLValue): New.
3718         (ArrayAccess.DoResolveLValue): New.
3719
3720 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3721
3722         * attribute.cs (Attribute.Resolve): Add arguments casting for
3723         when types doesn't match ctor arguments.
3724
3725 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3726
3727         Fix parts of #63202.
3728         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3729         lookup of operator in base type.  Ensure that all checks happen
3730         when the operator resolves to an "op_..." method.
3731
3732 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3733
3734         Fix #71992.
3735         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3736         'ignore_cs0104' parameter.  Pass it to ...
3737         (NamespaceEntry.Lookup): ... this.
3738         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3739         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3740         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3741         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3742         Update.  Request that cs0104 errors be ignored.
3743         (ComposedCast.ResolveAsTypeStep): Update.
3744
3745 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3746
3747         Fix #59209.
3748         * expression.cs (Invocation.BetterFunction): Remove support for
3749         comparing virtual functions and their overrides.
3750         (Invocation.IsOverride): New.
3751         (Invocation.OverloadResolve): Don't consider 'override' functions
3752         during candidate selection.  Store them in a lookaside list.
3753         If the selected method is a 'virtual' function, use the list to
3754         find any overrides that are closer to the LHS type.
3755
3756 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3757
3758         * expression.cs (New.DoResolve): Add complex core type reduction.
3759         (New.Constantify): Converts complex core type syntax like 'new int ()'
3760         to simple constant.
3761         
3762 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3763
3764         * decl.cs (EntryType.EntryType): New constructor to create an
3765         updated copy of a cache entry.
3766         (MemberCache.AddMethods): Use it.
3767         (MemberCache.ClearDeclaredOnly): Remove.
3768         (MemberCache.MemberCache): Update.
3769
3770 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3771
3772         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3773         variable.  This one is represents the actual low-level declaration
3774         of the method, as opposed to the semantic level `IsStatic'.   
3775
3776         An anonymous method which is hosted into a static method might be
3777         actually an instance method.  IsStatic would reflect the
3778         container, while MethodIsStatic represents the actual code
3779         generated.
3780
3781         * expression.cs (ParameterReference): Use the new MethodIsStatic
3782         instead of IsStatic.
3783
3784         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3785         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3786         set on the current EmitContext. 
3787
3788         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3789         resolve our casted expression as an LValue.  This triggers the
3790         proper LValue processing that is later required by Assign.
3791
3792         This fixes 72347.
3793
3794         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3795
3796 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3797
3798         C# 2.0 Fixed buffer implementation
3799
3800         * anonymous.cs: Update after RegisterHelperClass renaming.
3801
3802         * attribute.cs (AttributeTester.fixed_buffer_cache):
3803         Cache of external fixed buffers.
3804         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3805         implementation if field is fixed buffer else null.
3806
3807         * class.cs
3808         (TypeContainer.AddField): Accept FieldMember instead of Field.
3809         (FieldBase.IsFieldClsCompliant): Extracted code from
3810         VerifyClsCompliance descendant customization.
3811         (FixedField): New class handles fixed buffer fields.
3812         (FixedFieldExternal): Keeps information about imported fixed
3813         buffer.
3814         (IFixedField): Make access to internal or external fixed buffer
3815         same.
3816
3817         * cs-parser.jay: Add fixed buffer parsing.
3818
3819         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3820         buffer.
3821
3822         * expression.cs (Indirection): Extended implementation to accept
3823         fixed buffer field.
3824         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3825         (ElementAccess.MakePointerAccess): Get type as parameter.
3826         (DoResolve): Add fixed buffer field expression conversion.
3827         (DoResolveLValue): Ditto.
3828         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3829         (ArrayPtr): Derives from FixedBufferPtr.
3830         (ArrayPtr.Emit): Add extra emit for array elements.
3831
3832         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3833
3834         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3835         for compiler generated types.
3836         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3837
3838         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3839         and consume less memory.
3840         (Fixed.Resolve): Add fixed buffer case.
3841
3842         * typemanager.cs (compiler_generated_attr_ctor,
3843         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3844         (HasElementType): Add our own implementation to work on every
3845         runtime.
3846
3847 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3848
3849         * anonymous.cs (CaptureContext): Track whether `this' has been
3850         referenced.   
3851
3852         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3853         only captured `this' if it was implicitly done (instance
3854         methods/variables were used). 
3855
3856         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3857         `this' must be captured.
3858
3859 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3860  
3861         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3862         is null it means that there has been no need to capture anything,
3863         so we just create a sibling.
3864
3865         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3866
3867         Just a partial fix.  The other half is fairly elusive.
3868         
3869 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3870
3871         Fix #52586, cs0121-4.cs.
3872         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3873         and return a hashtable.
3874         (MemberCache.ClearDeclaredOnly): New.
3875         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3876         the method_hash of a base type too.
3877         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3878         type methods.  Overwrite entries with the same MethodHandle so
3879         that the ReflectedType is correct.  The process leaves in base
3880         virtual functions and their overrides as distinct entries.
3881         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3882         matters since it was boxed in a ArrayList before.
3883         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3884         modifier.
3885         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3886         case of a virtual function and its override (choose the overload
3887         as better).
3888         (Invocation.OverloadResolve): Avoid 'override' members during
3889         'applicable_type' calculation.
3890
3891 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3892
3893         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3894         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3895         GetTypeHandle.  It is possible for a reflected type to derive from
3896         a TypeBuilder (e.g., int[] derives from the TypeBuilder
3897         System.Array during mscorlib compilation).
3898         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3899         contain a method_hash, don't create one either.  Don't create a
3900         deep copy of the base cache's method_hash.
3901         (MemberCache.SetupCache): Rename back from DeepCopy.
3902         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3903         already initialized.  If we see an override function, add its
3904         underlying base virtual function to the member_hash too.
3905
3906 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3907
3908         Combine two near-redundant caches.
3909         * typemanager.cs (method_params): Rename from method_internal_params.
3910         (TypeManager.GetParameterData): New.  Replace
3911         Invocation.GetParameterData.
3912         (TypeManager.LookupParametersByBuilder): Remove.
3913         * expression.cs (Invocation.method_parameter_cache): Remove.
3914         (Invocation.GetParameterData): Remove.
3915         Update to changes.
3916         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3917         Update to changes.
3918
3919 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3920
3921         Fix #72015.
3922         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3923         TypeManager.multicast_delegate_type is null, resolve it by looking
3924         up "System.MulticastDelegate".
3925         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3926
3927 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3928             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3929             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3930
3931         Fix cs0164.cs.
3932         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3933         (LabeledStatement.AddReference): New.  Set 'referenced'.
3934         (Goto.Resolve): Use it.
3935
3936 2005-02-05  John Luke  <john.luke@gmail.com>
3937
3938         * driver.cs: remove duplicate -doc line in Usage ()
3939
3940 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3941
3942         * location.cs (Location.AddFile): Fix CS2002 error report.
3943
3944 2005-02-02  Martin Baulig  <martin@ximian.com>
3945
3946         * delegate.cs (Delegate.DefineType): Report an internal error if
3947         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3948         details.        
3949
3950 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3951
3952         Fix a crasher in a variant of #31984.
3953         * const.cs (Constant.CheckBase): New override that defers the
3954         new-or-override check in case the base type hasn't been populated
3955         yet.
3956         (Constant.Define): Ensure the new-or-override check is performed.
3957
3958 2005-02-01  Duncan Mak  <duncan@ximian.com>
3959
3960         * const.cs (LookupConstantValue): Check that `ce' is not null
3961         before calling GetValue ().
3962
3963 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3964
3965         Fix test-334.cs (#69519).
3966         * cs-parser.jay (using_alias_directive): Pass in an expression to
3967         NamespaceEntry.UsingAlias.
3968         (using_namespace_directive): Pass in an expression to
3969         NamespaceEntry.Using.
3970         (namespace_name): Don't flatten to a string.
3971         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3972         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3973         ResolveAsTypeStep.
3974         (NamespaceEntry.UsingEntry): Likewise.
3975         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3976         changes.
3977         (NamespaceEntry.LookupForUsing): Remove.
3978         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3979         names.
3980         (NamespaceEntry.Lookup): Remove support for dotted names.
3981
3982 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3983
3984         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3985         split into two.
3986         (NamespaceEntry.ImplicitParent): Compute on demand.
3987         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3988         parallels the current.
3989         (NamespaceEntry.LookupForUsing): Use it.
3990         (NamespaceEntry.Lookup): If the current namespace-entry is
3991         implicit, don't search aliases and using tables.
3992
3993 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3994
3995         Fix #31984.
3996         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3997         BaseCache here.
3998         (TypeContainer.BaseCache): Compute on demand.
3999         (TypeContainer.FindMembers): Define constants and types if they're
4000         not already created.
4001         (FieldMember.Define): Move resetting of ec.InUnsafe before error
4002         check.
4003         * const.cs (Constant.Define): Make idempotent.
4004
4005 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4006
4007         * pending.cs: Produce better code (no nops produced by using Ldarg
4008         + value).
4009         
4010         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4011         i - 1' it should be arg + 1.
4012
4013         Fixes bug #71819.
4014
4015 2005-01-28  Raja R Harinath  <rharinath@novell.com>
4016
4017         * attribute.cs (Attribute.CheckAttributeType): Make private
4018         non-virtual.
4019         (Attribute.ResolveType): Make virtual.
4020         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4021         handling of RootContext.Tree.Types.
4022
4023 2005-01-27  Raja R Harinath  <rharinath@novell.com>
4024
4025         Update attribute-handling to use the SimpleName/MemberAccess
4026         mechanisms.
4027         * cs-parser.jay (attribute): Pass in an expression to the
4028         constructors of Attribute and GlobalAttribute.
4029         * attribute.cs (Attribute): Take an expression for the name.
4030         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
4031         passed in attribute name expression.
4032         (Attribute.CheckAttributeType): Use it.
4033         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4034         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4035         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
4036         argument to prevent error messages if the lookup fails.
4037
4038 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
4039
4040         * expression.cs (Indirection): Implemented IVariable interface
4041         to support indirection in AddressOf operator.
4042         (PointerArithmetic.Emit): Add optimalization for case where
4043         result can be precomputed.
4044
4045 2005-01-26  Martin Baulig  <martin@ximian.com>
4046
4047         * class.cs (TypeContainer.AttributeTargets): Return the correct
4048         AttributeTargets depending on our `Kind' instead of throwing an
4049         exception; fixes #71632.
4050
4051 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
4052
4053         Fix #71257
4054         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4055         constant members.
4056
4057 2005-03-17  Martin Baulig  <martin@ximian.com>
4058
4059         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4060         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4061
4062 2005-03-17  Martin Baulig  <martin@ximian.com>
4063
4064         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4065         to bool so we can return an error condition.
4066         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4067         returned an error.
4068
4069 2005-03-17  Martin Baulig  <martin@ximian.com>
4070
4071         * generic.cs (TypeMananager.IsIEnumerable): New public method.
4072
4073         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4074         converting from an array-type of T to `IEnumerable<T>'.
4075
4076 2005-03-16  Martin Baulig  <martin@ximian.com>
4077
4078         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4079         (Nullable.LiftedUnaryMutator): New public class.
4080
4081         * expression.cs (UnaryMutator.DoResolve): Added support for
4082         Nullable Types.
4083
4084 2005-03-14  Martin Baulig  <martin@ximian.com>
4085
4086         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4087
4088 2005-03-14  Martin Baulig  <martin@ximian.com>
4089
4090         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4091         the comparision operators `<', `>', `<=' and `>='.
4092
4093 2005-03-13  Martin Baulig  <martin@ximian.com>
4094
4095         * generic.cs
4096         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4097         avoid confusion with the `NullLiteral'.
4098         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4099
4100 2005-03-13  Martin Baulig  <martin@ximian.com>
4101
4102         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4103         comparing arbitrary types with the null literal.
4104
4105 2005-03-13  Martin Baulig  <martin@ximian.com>
4106
4107         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4108         boolean operators '&&', '||', '&' and '|'.
4109         (Nullable.OperatorTrueOrFalse): New public class.
4110
4111         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4112         instead of a `StaticCallExpr'; added support for nullables.
4113
4114 2005-03-10  Martin Baulig  <martin@ximian.com>
4115
4116         * expression.cs
4117         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4118         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
4119
4120 2005-03-07  Martin Baulig  <martin@ximian.com>
4121
4122         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4123         it work if `expr' is not an IMemoryLocation.
4124         (Nullable.Lifted): Implement IMemoryLocation.
4125         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4126         target type.
4127
4128 2005-03-05  Martin Baulig  <martin@ximian.com>
4129
4130         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4131         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4132         (Nullable): Added support for lifted unary and binary operators.
4133
4134         * expression.cs (Unary.DoResolve): Added support for nullable types.
4135         (Binary.DoResolve): Likewise.
4136         (Conditional.DoResolve): Likewise.
4137
4138 2005-03-02  Martin Baulig  <martin@ximian.com>
4139
4140         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4141
4142         * class.cs (ClassPart.SetParameterInfo): Override this.
4143         (PartialContainer.SetParameterInfo): Override this.
4144         (TypeContainer.CheckConstraints): New protected method.
4145         (PartialContainer.CheckConstraints): Override this and check
4146         whether the same contraints were specified in all parts of a
4147         partial generic type definition.
4148         (PartialContainer.UpdateConstraints): New public method.
4149
4150         * generic.cs (TypeParameter.UpdateConstraints): New public method.
4151
4152 2005-03-02  Martin Baulig  <martin@ximian.com>
4153
4154         Committing a patch from Carlos Alberto Cortez to fix #72887.
4155
4156         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
4157         casts from `T []' to `int []'.
4158
4159 2005-03-02  Martin Baulig  <martin@ximian.com>
4160
4161         * generic.cs (TypeManager.IsEqual): Make this symmetric.
4162
4163         * expression.cs (Binary.ResolveOperator): When resolving a
4164         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
4165         `=='.  Fixes #71866.  See gen-127.cs.
4166
4167 2005-03-02  Martin Baulig  <martin@ximian.com>
4168
4169         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4170         static constructor in static classes.
4171
4172 2005-03-02  Martin Baulig  <martin@ximian.com>
4173
4174         * generic.cs
4175         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
4176         (Nullable.LiftedConversion): Added support for user-defined
4177         conversions.
4178
4179         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
4180
4181         * cs-parser.jay: Use ComposedCast everywhere instead of
4182         NullableType, so we don't need to check for NullableType
4183         everywhere.
4184         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
4185         case where we'll be resolved into a `parenthesized_expression_0'
4186         afterwards.
4187
4188         * convert.cs
4189         (Convert.UserDefinedConversion): Added nullable conversions.
4190
4191 2005-02-28  Martin Baulig  <martin@ximian.com>
4192
4193         * generic.cs (TypeManager.IsNullableType): New static method.
4194         (Nullable): New abstract class.
4195         (Nullable.NullLiteral): New public class.
4196         (Nullable.LiftedConversion): New public class.
4197
4198         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
4199         `builtin_types opt_nullable'.
4200
4201         * convert.cs
4202         (Convert.ImplicitConversionStandard): Added nullable conversions.
4203         (Convert.ExplicitConversionStandard): Likewise.
4204         (Convert.ExplicitConversion): Likewise.
4205
4206 2005-02-26  Martin Baulig  <martin@ximian.com>
4207
4208         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
4209         begin with a "?", for instance "?[]".  Don't do a type lookup if
4210         `dim' is empty.
4211
4212 2005-02-25  Martin Baulig  <martin@ximian.com>
4213
4214         The first part of Nullable Types :-)
4215
4216         * generic.cs (NullableType): New public class.
4217         (NullCoalescingOperator): New public class.
4218         (TypeArguments.Resolve): Add a CS0306 check.
4219
4220         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
4221         (opt_nullable): New rule.
4222         (type): Added `opt_nullable' to `namespace_or_type_name',
4223         `builtin_types' and `pointer_type'.
4224         (array_type): Added `opt_nullable'.
4225         (opt_rank_specifier_or_nullable): New rule; this is the
4226         combination of `opt_rank_specifier' and `opt_nullable'.
4227         (opt_error): New rule; catch errors here.
4228         (nullable_type_or_conditional): New rule; we use this to check for
4229         nullable and still detect the conditional operator.
4230         (local_variable_type): Use `opt_rank_specifier_or_nullable'
4231         instead `opt_rank_specifier'.
4232
4233         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
4234         for nullables.
4235
4236 2005-02-24  Martin Baulig  <martin@ximian.com>
4237
4238         * README, README.Changes: Removed; they're old and obsolete.
4239
4240 2005-02-22  Martin Baulig  <martin@ximian.com>
4241
4242         * generic.cs (TypeParameter.Resolve): If resolving the constraints
4243         returned an error, set `constraints' to null to avoid a crash
4244         later on.
4245         (TypeParameter.ResolveType): Likewise.
4246
4247 2005-02-22  Martin Baulig  <martin@ximian.com>
4248
4249         * generic.cs
4250         (Constraints.ResolveTypes): Protect against being called twice.
4251         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
4252         (TypeParameter.ResolveType): New public method; calls
4253         constraints.ResolveTypes().
4254         (TypeParameter.DefineType): Moved constraints.ResolveType() out
4255         into the new ResolveType().
4256         (GenericMethod.Define): Call ResolveType() on all our
4257         TypeParameter's.        
4258
4259 2005-02-21  Martin Baulig  <martin@ximian.com>
4260
4261         * generic.cs
4262         (TypeManager.generic_nullable_type): New static public field.
4263         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
4264
4265         * rootcontext.cs
4266         (RootContext.ResolveCore): Resolve "System.Nullable`1".
4267
4268 2005-02-15  Martin Baulig  <martin@ximian.com>
4269
4270         * generic.cs (ConstructedType.Constraints): Correctly check
4271         constraints if the argument type is a type parameter; fixes
4272         #72326. 
4273
4274 2005-02-02  Martin Baulig  <martin@ximian.com>
4275
4276         * delegate.cs (Delegate.DefineType): Report an internal error if
4277         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4278         details.        
4279
4280 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4281
4282         * pending.cs: Produce better code (no nops produced by using Ldarg
4283         + value).
4284         
4285         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4286         i - 1' it should be arg + 1.
4287
4288         Fixes bug #71819.
4289         
4290 2005-01-26  Martin Baulig  <martin@ximian.com>
4291
4292         * cs-parser.jay (indexer_declarator): Don't report an error if we
4293         have type parameters since we can be an explicit interface
4294         implementation; fixes #71449.
4295
4296 2005-01-26  Martin Baulig  <martin@ximian.com>
4297
4298         * class.cs (TypeContainer.AttributeTargets): Return the correct
4299         AttributeTargets depending on our `Kind' instead of throwing an
4300         exception; fixes #71632.
4301
4302 2005-01-26  Martin Baulig  <martin@ximian.com>
4303
4304         * delegate.cs (Delegate.DefineType): Correctly define our type
4305         parameters.  Fixes #71483.
4306
4307 2005-01-25  Raja R Harinath  <rharinath@novell.com>
4308
4309         Fix #71602.
4310         * expression.cs (MemberAccess.DoResolve): Don't complain with
4311         cs0572 when the LHS of a member access has identical name and type
4312         name.
4313
4314 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
4315
4316         Fix #71651, #71675
4317         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
4318         CreatePermission.
4319         Create custom PermissionSet only for PermissionSetAttribute.
4320
4321 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
4322
4323         Fix #71649
4324         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
4325         delegates in static class.
4326
4327 2005-01-24  Martin Baulig  <martin@ximian.com>
4328
4329         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4330         merging an implicit block, just use its reachability.
4331
4332         * statement.cs (Block.Resolve): Make the unreachable code check
4333         work wrt. implicit blocks; see test-337 from #63842.
4334
4335 2005-01-21  Alp Toker  <alp@atoker.com>
4336  
4337         * cs-parser.jay: destructor_declaration's container is PartialContainer
4338         not Class when partial types are used, so use Kind prop instead of
4339         'is'.
4340         
4341 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
4342
4343         * cs-parser.jay: Improve error reporting when an interface
4344         declares new types.
4345
4346 2005-01-20  Dick Porter  <dick@ximian.com>
4347
4348         * support.cs: SeekableStreamReader fix from Sandor Dobos
4349         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4350         chars are read.  Fixes bug 70369.
4351
4352 2005-01-20  Raja R Harinath  <rharinath@novell.com>
4353
4354         * cs-parser.jay (catch_clause): Simplify current_block handling
4355         somewhat.
4356
4357 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
4358
4359         * convert.cs (ImplicitStandardConversionExists): Synchronize the
4360         code with ImplicitStandardConversion to handle the implicit
4361         conversion of method groups into valid delegate invocations. 
4362
4363         The problem is that in parameter handling we were using this code
4364         path.  Fixes bug #64698
4365
4366 2005-01-19  Raja R Harinath  <rharinath@novell.com>
4367
4368         * cs-parser.jay: Fix several infelicities.
4369         - Avoid assigning to the parser value stack.  Code like 
4370           '$3 = null' is unclean.  Synthesize a value for the code block
4371           instead. 
4372         - Avoid using oob_stack for storing location information.  Use ...
4373         (_mark_): ... this.  New (empty) rule.  Saves the current location
4374         in $$.
4375         (foreach_statement): Avoid using oob_stack for current_block
4376         handling.  Use technique used in for_statement and
4377         using_statement.  Synthesize a value for the code block to store
4378         additional intermediate information.
4379
4380 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
4381
4382         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4383         of a different type is only allowed to private fields of a
4384         containing type, not on fields of a base class.
4385
4386         See test-174.cs and error cs0122-9.cs
4387
4388 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4389
4390         Fix test-335.cs (bug #58126).
4391         * cs-parser.jay (argument): Split out non-expression parts of the
4392         rule into 'non_simple_argument'.
4393         (invocation_expression): Support parenthesized invocations with
4394         multiple arguments, and with single non-simple arguments.
4395
4396 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4397
4398         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4399         places.
4400
4401 2005-01-12  Raja R Harinath  <rharinath@novell.com>
4402
4403         Fix cs0038-1.cs, cs1640-6.cs.
4404         * ecore.cs (Expression.Resolve): Remove special-case for
4405         SimpleName in error-handling.
4406         (Expression.almostMatchedMembers): Relax access permission to
4407         protected.
4408         (Expression.MemberLookupFailed): Handle duplicates in
4409         almostMatchedMembers list.
4410         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4411         * expression.cs (New.DoResolve): Report CS1540 for more cases.
4412         * typemanager.cs (GetFullNameSignature): Use the MethodBase
4413         overload if the passed in MemberInfo is a MethodBase.
4414
4415 2005-01-25  Martin Baulig  <martin@ximian.com>
4416
4417         * doc.cs
4418         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4419
4420 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
4421
4422         Fix #70749
4423         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4424         for non-CAS & merge permission sets properly.
4425
4426 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4427
4428         Improve standard-compliance of simple name and member access 
4429         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
4430         * ecore.cs (FullNamedExpression): New abstract base class 
4431         for Namespaces and TypeExpressions.
4432         (ResolveFlags.SimpleName): Remove.
4433         (SimpleName): Remove support for dotted names.
4434         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
4435         DeclSpace.FindType and DeclSpace.LookupType.
4436         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4437         (Expression.ExprClassName): Make member function.
4438         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4439         a namespace.  Remove creation of dotted "SimpleName"s.
4440         (MemberAccess.DoResolve): Likewise.
4441         * decl.cs (DeclSpace.Cache): Make private.
4442         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4443         (DeclSpace.FindType): Update.
4444         (DeclSpace.LookupType): Move here from RootContext.  Return a 
4445         FullNamedExpression.
4446         * namespace.cs (Namespace): Derive from FullNamedExpression
4447         so that it can be part of expression resolution.
4448         (Namespace.Lookup): Return an FullNamedExpression.
4449         (NamespaceEntry.LookupAlias): Lookup aliases only in current
4450         namespace.
4451         * rootcontext.cs (NamespaceLookup): Remove.
4452         (LookupType): Move to DeclSpace.
4453         * attribute.cs (CheckAttributeType): Update.
4454         * doc.cs (FindDocumentedType): Remove allowAlias argument.
4455         (FindDocumentedTypeNonArray): Likewise.
4456
4457 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4458
4459         Fix cs0509.cs, cs1632.cs.
4460         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4461         is the same as IsInterface.
4462         (TypeContainer.GetClassBases): Likewise.
4463         * statement.cs (LabeledStatement.ig): New field.
4464         (LabeledStatement.LabelTarget): Save ILGenerator which created the
4465         label.
4466         (LabeledStatement.DoEmit): Check that the label was created with
4467         the same ILGenerator.
4468
4469 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4470
4471         Fix #71058
4472         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4473         accessors to its properties.
4474
4475         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4476         from accessors to property.
4477         
4478 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4479
4480         Fix #70722
4481         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4482         only for overrides.
4483         
4484 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
4485
4486         * attribute.cs: Check for null and empty strings.  
4487
4488         I have lost another battle to Paolo.
4489
4490 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
4491
4492         Fix #70942
4493         * class.cs (PropertyMethod): Set Parent field in ctors.
4494         (SetMethod.InternalParameters): Add unsafe switch hack.
4495         Override MarkForDuplicationCheck where it is appropriate.
4496
4497         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4498         It says whether container allows members with the same name.
4499         Base default is no.
4500         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4501         Removed is_method parameter.
4502
4503 2005-01-06  Duncan Mak  <duncan@ximian.com>
4504
4505         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4506         because the previous change led to incorrect reporting of CS1032
4507         ("Cannot define/undefine preprocessor symbols after first token in
4508         file"). Instead of using `tokens_seen' as the only flag that
4509         triggers CS1040, introduce `comments_seen'. This new flag is used
4510         to signify having seen comments on the current line, so it is
4511         unset after a newline.
4512
4513 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4514
4515         * doc.cs : When searching for a type, find nested type too.
4516           This fixes bug #71040.
4517
4518 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4519
4520         * doc.cs :
4521           - Warn missing member comment on those classes which also does not
4522             have doc comments. Fixed bug #71041.
4523           - Don't warn missing doc comment on default constructor.
4524             Fixed bug #71042.
4525
4526 2005-01-06  Duncan Mak  <duncan@ximian.com>
4527
4528         * cs-tokenizer.cs (xtoken): After handling traditional C-style
4529         comments, set `tokens_seen' to true. This allows us to detect
4530         misplaced preprocessor directives (i.e. not at the beginning of
4531         the a line, nor after whitespaces). In that case, report error
4532         CS1040. This fixes bug #56460.
4533
4534         * cs-parser.jay (interface_member_declaration): Add checks for
4535         IsExplicitImpl, and report CS0541 error if an interface member is
4536         defined as an explicit interface declaration.
4537
4538 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
4539
4540         Fix #70817
4541         * class.cs (PropertyMethod): Set Parent field in ctors.
4542         (SetMethod.InternalParameters): Add unsafe switch hack.
4543         
4544         * decl.cs (MemberCore.Parent): Cannot be readonly.
4545
4546 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4547
4548         * decl.cs (DeclSpace.ResolveType): Remove.
4549         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4550         Merge in code from ...
4551         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4552         * class.cs, enum.cs: Update to changes.
4553
4554 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4555
4556         * anonymous.cs: Ensure that we init the scope of our parent if it
4557         has not been initialized yet.
4558
4559 2004-12-30  Duncan Mak  <duncan@ximian.com>
4560
4561         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4562         if field.FieldBuilder is null. Fixes #70758.
4563
4564         * convert.cs: Fixed some typos and updated some of the comments.
4565         (ImplicitStandardConversionExists):
4566         (TryImplicitIntConversion): If `target_type' is an interface and
4567         the type of `ic' implements this interface, return true or a new
4568         BoxedCast instead of null. This fixes #70468.
4569
4570 2004-12-29  Duncan Mak  <duncan@ximian.com>
4571
4572         * expression.cs (Argument.Emit): Check that Expr is
4573         IMemoryLocation before casting to it, and report CS1510 otherwise.
4574
4575         This fixes #70402.
4576
4577 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
4578
4579         * statement.cs (Block.ThisVariable): remove the recursion here, to
4580         make the --profile more sane.
4581
4582 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4583
4584         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4585         assembly, by JB Evain.
4586
4587 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4588
4589         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4590           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4591         "parent" refers to enclosing type/class.  "base" refers to superclass.
4592
4593 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4594
4595         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4596         Ensure that we only have GlobalAttributes.
4597         * attribute.cs (Attribute.Emit): Make non-virtual.
4598         (GlobalAttribute.Emit): Remove.
4599         (Attribute.Resolve): Make virtual.
4600         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4601         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4602         the argument. Don't create one.
4603         (Attribute.GetObsoleteAttribute): Likewise.
4604         (Attribute.GetClsCompliantAttributeValue): Likewise.
4605         * class.cs, decl.cs: Update to changes.
4606
4607 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4608
4609         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4610         
4611         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4612         
4613         * statement.cs (Foreach.Resolve): Add error 186 report.
4614
4615 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4616
4617         * expression.cs (Conditional.DoResolve): Add warning 429.
4618         
4619         * statement.cs (If.Resolve): Add warning 665.
4620
4621 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4622
4623         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4624         except when in the parser, and in GlobalAttribute.
4625         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4626         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4627         RootContext.Tree.Types.NamespaceEntry once work is done.
4628         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4629         and resets RootContext.Tree.Types.NamespaceEntry.
4630
4631 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4632
4633         * cs-parser.jay: Don't create a block for every variable.
4634
4635 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4636
4637         * location.cs: Provide extra information.
4638
4639         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4640         variables from the captured environment, it is the ldarg_0.
4641
4642 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4643
4644         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4645         find a conclusion.
4646         
4647         * class.cs: Changed warning level for 169 to avoid developer
4648         displeasure from warning flooding. It will be changed back when they
4649         fix most of current BCL warnings.
4650         
4651         * RootContext.cs: Pushed default WarningLevel to 3.
4652         
4653         * statement.cs: Removed unused variable.
4654
4655 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4656
4657         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4658         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4659         Add error 502 report.
4660         (StaticClass.DefineType): Add error 441 report.
4661         (Class.AllowedModifiersProp): New virtual property as temporary
4662         extension to AllowedModifiers.
4663         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4664         to share implementation with StaticClass and don't call virtual
4665         methods from ctor.
4666         
4667         * driver.cs (MainDriver): Add error 1558 test.
4668
4669         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4670         report. Moved error 36 test here.
4671
4672         * statement.cs (Throw.Resolve): Add error 724 report.
4673
4674         * typemanager.cs: Add out_attribute_type core type.
4675         
4676 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4677
4678         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4679         3018 report.
4680         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4681
4682         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4683         3017 report.
4684         
4685         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4686
4687         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4688         Add error 3023 report.
4689         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4690
4691         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4692         implementation.
4693
4694 2004-12-12  John Luke  <john.luke@gmail.com>
4695
4696         * driver.cs (AddArgs): take -- into account when
4697         adding arguments, fixes bug 65710 
4698
4699 2004-12-12  Martin Baulig  <martin@ximian.com>
4700
4701         * expression.cs (Unary.TryReduceNegative): Added support for
4702         SByteConstant and ByteConstant.
4703         (Unary.Reduce): Check error values from TryReduceNegative().
4704
4705 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4706
4707         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4708         and report exception as error 182.
4709
4710 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4711
4712         * driver.cs (Main): Fix message when there are warnings.
4713
4714 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4715
4716         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4717
4718 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4719
4720         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4721         Reduced number of warnings.
4722         
4723         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4724
4725 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4726
4727         * driver.cs: Removed message.
4728
4729         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4730
4731 2004-12-08    <vargaz@freemail.hu>
4732
4733         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4734
4735 2004-12-08  Martin Baulig  <martin@ximian.com>
4736
4737         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4738         instead of a CS3002 for properties and indexer.
4739
4740 2004-12-08  Martin Baulig  <martin@ximian.com>
4741
4742         * decl.cs (MemberName.ToString): Make this work again.
4743
4744 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4745
4746         * attribute.cs (Resolve): Add error 591 detection.
4747
4748         * class.cs (FieldMember.Define): Add error 1547 detection.
4749         (Indexer.Define): Add error 620 detection.
4750         (Operator.Define): Add error 590 detection.
4751
4752         * ecore.cs: Missing argument for error 79.
4753
4754         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4755         detection.
4756
4757 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4758
4759         Fix #70106
4760         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4761         only.
4762
4763 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4764
4765         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4766           Some operator comments were suppressed.
4767         * doc.cs : Implicit/explicit operator name in doc comments are like
4768           "op_Explicit(type)~returnType", so added suffix handling.
4769
4770 2005-01-21  Alp Toker  <alp@atoker.com>
4771
4772         * cs-parser.jay: destructor_declaration's container is PartialContainer
4773         not Class when partial types are used, so use Kind prop instead of 'is'.
4774
4775 2004-12-12  Martin Baulig  <martin@ximian.com>
4776
4777         * expression.cs (Unary.TryReduceNegative): Added support for
4778         SByteConstant and ByteConstant.
4779         (Unary.Reduce): Check error values from TryReduceNegative().
4780
4781 2004-12-11  Martin Baulig  <martin@ximian.com>
4782
4783         * support.cs (ReflectionParameters.ParameterName): If we have a
4784         `gpd', call `ParameterName' on it.
4785
4786         * parameter.cs (Parameter.GetParameterAttributes): New static method.
4787
4788         * pending.cs (PendingImplementation.DefineProxy): Call
4789         DefineParameter() for all of the MethodBuilder's arguments.
4790
4791 2004-12-09  Martin Baulig  <martin@ximian.com>
4792
4793         * doc.cs (DocUtil): Make this a static class.
4794
4795 2004-12-09  Martin Baulig  <martin@ximian.com>
4796
4797         * expression.cs (Invocation.InferType): Moved the type inference
4798         implementation into TypeManager.
4799
4800         * generics.cs (TypeManager): Moved the type inference
4801         implementation here.
4802
4803 2004-12-09  Martin Baulig  <martin@ximian.com>
4804
4805         * typemanager.cs (TypeManager): Make this a partial class.
4806
4807         * generics.cs
4808         (TypeManager): Move the generics part of `TypeManager' here.
4809
4810 2004-12-08  Martin Baulig  <martin@ximian.com>
4811
4812         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4813         instead of a CS3002 for properties and indexer.  Added CS3024
4814         check for generic interfaces.
4815
4816         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4817         instances are not CLS-compliant.
4818
4819 2004-12-08  Martin Baulig  <martin@ximian.com>
4820
4821         * cs-parser.jay
4822         (void_pointer_expression): New rule for `void*', `void**' etc.
4823         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
4824
4825 2004-12-08  Martin Baulig  <martin@ximian.com>
4826
4827         * expression.cs (Invocation.InferType): Removed the hack for
4828         MethodCore.MayUnify().  
4829
4830         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4831         this actually work.
4832
4833         * class.cs (MethodCore.MayUnify): Use
4834         TypeManager.MayBecomeEqualGenericTypes().       
4835
4836 2004-12-08  Martin Baulig  <martin@ximian.com>
4837
4838         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4839         parameter, box it.  Fixes #69233.
4840
4841 2004-12-08  Martin Baulig  <martin@ximian.com>
4842
4843         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4844         have the ctor constraint.  Fixes #68326.
4845
4846 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4847
4848         * cs-parser.jay : interface comment was not consumed because of
4849           extra opt_semicolon before doc handling.
4850
4851 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4852
4853         Fix test-327.cs, test-328.cs, and put in early infrastructure
4854         for eventually fixing #52697.
4855         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4856         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4857         from other methods.
4858         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4859         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4860         (VerifyUsing, error246): Update.
4861         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4862         'NamespaceEntry.LookupNamespaceOrType'.
4863
4864 2004-12-07  Martin Baulig  <martin@ximian.com>
4865
4866         * driver.cs: Call it "BETA SOFTWARE" :-)
4867
4868 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4869
4870         Fix crash on cs0657-17.cs.
4871         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4872         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4873         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4874         the case where the NamespaceEntry gets overwritten.
4875
4876 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4877
4878         Fixed #69195, #56821
4879         * ecore.cs (ResolveBoolean): Tiny refactoring.
4880
4881         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4882         of right expression resolving when left is false constant and
4883         operator is LogicalAnd OR true constant and operator is LogicalOr.
4884
4885         * statement.cs (ResolveUnreachable): Always reports warning.
4886
4887 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4888
4889         * class.cs: Distinguish between 1721 and 1722 (just a little help
4890         for the programmer).
4891
4892 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4893
4894         * delegate.cs: Only allow this on new versions of the language. 
4895
4896 2004-12-02  Duncan Mak  <duncan@ximian.com>
4897
4898         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4899         Expression class.
4900         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4901         here as a static method. Take an additional bool out parameter
4902         `must_do_cs1540_check' for signaling to InstanceResolve.
4903         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4904         member field from PropertyExpr class and made it an argument of
4905         the method instead.
4906         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4907         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4908         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4909         and `remove_accessor' as well as InstanceResolve: report CS0122
4910         where applicable.
4911
4912         Fixes #70129.
4913
4914 2004-12-07  Martin Baulig  <martin@ximian.com>
4915
4916         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4917         and CS0692 where appropriate.
4918
4919 2004-12-06  Martin Baulig  <martin@ximian.com>
4920
4921         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4922         IsDuplicateImplementation() and improved it.
4923
4924         * expression.cs (Invocation.InferTypeArguments): Added
4925         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4926         and removed the "ref" modifier from `infered_types'.
4927
4928         * decl.cs (MemberName.ToString): Removed the exception.
4929
4930 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4931
4932         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4933           comments are allowed.
4934
4935 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4936
4937         * delegate.cs: Add checks for subtypes in paramaters and return values
4938         in VerifyMethod () to add support for Covariance/Contravariance
4939         in delegates.
4940         
4941 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4942
4943         * report.cs: Remove extra closing parenthesis.
4944
4945         * convert.cs (Error_CannotImplicitConversion): If the name of the
4946         types are the same, provide some extra information.
4947
4948 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4949
4950         Fix bug #70102
4951         * attribute.cs (Resolve): Improved implementation of params
4952         attribute arguments.
4953
4954         * support.cs (ParameterData): Add HasParams to be faster.
4955
4956 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4957
4958         all things are for /doc support:
4959
4960         * doc.cs: new file that supports XML documentation generation.
4961         * mcs.exe.sources: added doc.cs.
4962         * driver.cs:
4963           Handle /doc command line option.
4964           Report error 2006 instead of 5 for missing file name for /doc.
4965           Generate XML documentation when required, after type resolution.
4966         * cs-tokenizer.cs:
4967           Added support for picking up documentation (/// and /** ... */),
4968           including a new XmlCommentState enumeration.
4969         * cs-parser.jay:
4970           Added lines to fill Documentation element for field, constant,
4971           property, indexer, method, constructor, destructor, operator, event
4972           and class, struct, interface, delegate, enum.
4973           Added lines to warn incorrect comment.
4974         * rootcontext.cs :
4975           Added Documentation field (passed only when /doc was specified).
4976         * decl.cs:
4977           Added DocComment, DocCommentHeader, GenerateDocComment() and
4978           OnGenerateDocComment() and some supporting private members for
4979           /doc feature to MemberCore.
4980         * class.cs:
4981           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4982         * delegate.cs:
4983           Added overriden DocCommentHeader.
4984         * enum.cs:
4985           Added overriden DocCommentHeader and GenerateDocComment().
4986
4987 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4988
4989         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4990         unwrapping the enumeration values, chain to
4991         DoConstantNumericPromotions again, so we can promote things to the
4992         fundamental types (takes care of enums that are bytes, sbytes).
4993
4994         Fixes bug #62054.
4995
4996 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4997
4998         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4999         Fix long-standing bug in type-lookup.  Use FindType instead of
5000         LookupType when ec.ResolvingTypeTree.
5001         (Attribute.ResolveType, Attribute.Resolve)
5002         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5003         Update to changes.
5004         (Attributes.Search): Remove internal version.  Update.
5005         (Attributes.SearchMulti): Update.
5006         (Attributes.GetClsCompliantAttribute): Remove.
5007         (Attributes.GetIndexerNameAttribute): Remove.
5008         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5009         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5010         * class.cs (Indexer.Define): Likewise.
5011
5012 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5013
5014         Fix bug #68790
5015         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5016         MarshallByReference members access.
5017
5018         * expression.cs: Use CheckMarshallByRefAccess;
5019         Better error CS0197 message.
5020
5021         * report.cs: Print whole related error message.
5022
5023 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5024
5025         * class (GetClassBases): Better error 60 report.
5026         (EventProperty): Disabled warning 67 detection.
5027
5028 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5029
5030         Fix bug #60324
5031         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5032
5033         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5034         precise values.
5035
5036 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5037
5038         Fix bug #49488
5039         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5040
5041         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5042
5043 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5044
5045         * attribute.cs (Attribute.Resolve): Refine error reporting and
5046         report a cs0117 if the identifier does not exist, to distinguish
5047         from 0617 which is a miss-use of the actual identifier.
5048
5049         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5050         between cs0070 and cs0079.
5051
5052         * class.cs (MemberBase.DoDefine): When reporting a wrong
5053         accessibility level, we use MethodCore to compare instead of
5054         Method (this was a regression in some refactoring effort).
5055
5056         So now we correctly report cs0056 again.
5057
5058         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5059         testing the target_type (which was known to be object_type) and
5060         not the source type (which is anonymous_method).
5061
5062         Fixed reporting of error cs1660.
5063
5064         * expression.cs (UserCast.Source): Expose the underlying cast.
5065
5066         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5067         allowed types to find a match to int32 first (most common).
5068
5069         In addition, it ignores any ImplicitUserConversions that did an
5070         internal implicit conversion (as the switch statement allows only
5071         one integral conversion to exist).
5072
5073         * class.cs (PartialContainer.Create): rename `name' to
5074         `member_name' for clarity.  Then replace the string calls with a
5075         call to MemberName.GetPartialName, as now using
5076         MemberName.ToString is an error (this is due to the side effects
5077         it had, that were fixed in the past).
5078
5079         This will restore the error reporting on a number of partial class
5080         errors that were missusing this (and getting an exception as a
5081         results, which is now just a plain textual warning, because
5082         yyparse debug output would crash otherwise).
5083
5084 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5085
5086         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5087
5088 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5089
5090         * rootcontext.cs (LookupType): Make sure to cache lookups that
5091         don't give us a negative result. This saves about 5% of corlib
5092         compilation time.
5093
5094 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5095
5096         * report.cs (AbstractMessage.Print): messages are sent to stderr
5097
5098         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5099         non-interface in the list of interfaces (at this point, either
5100         parent was properly set, or a base class is being listed in the
5101         interfaces section).
5102
5103         This flags error 1722, and resolves the crash from bug 69259.
5104
5105 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5106
5107         * statement.cs (Using.EmitExpressionFinally): make this work right
5108         for valuetypes. Fixes 69926.
5109
5110 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5111
5112         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5113         converted to an enum" here, before we try to change the underlying
5114         type.  This code exists, but it is a different code path than the
5115         one used while encoding constants.
5116
5117         (ImplicitReferenceConversionExists): In addition, resynchronized
5118         the code here, so it matches the same code in
5119         ImplicitReferenceConversionExists for the `from any class-type S
5120         to any interface-type T'.       
5121
5122 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5123
5124         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5125
5126 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5127
5128         * cs-parser.jay: Use verbosity accordingly. 
5129
5130 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5131
5132         * expression.cs (Unary.ResolveOperator): Do not report warning;
5133         AddressOf reads from variable.
5134         
5135         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5136
5137 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5138
5139         Fix bug #69462
5140
5141         * attribute.cs (Attributable): Removed CheckTargets.
5142         (Attributes.Emit): Explicit attribute targets are tested here.
5143
5144         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5145         not enabled for interfaces.
5146
5147         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5148         (GetAssemblyName): Ouch next bug there.
5149
5150 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5151
5152         * expression.cs: Error 275 added.
5153         
5154 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
5155
5156         Fix bug #69177 (Implemented decimal constant support)
5157
5158         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5159         (BinaryFold): Add DecimalConstant.
5160
5161         * const.cs (Define): Decimal constant 
5162         (is not constant.
5163         (ChangeType): Add decimal type handling.
5164         (LookupConstantValue): Don't set value for decimal type but
5165         emit DecimalConstantAttribute. Needed for constant optimization.
5166
5167         * constant.cs (ToDecimal): New method.
5168         (ConvertToDecimal): New method.
5169         (IntConstant): Implemented ConvertToDecimal.
5170         (DecimalConstant.Emit): Emit optimized version for decimals in
5171         int range.
5172
5173         * expression.cs (ResolveOperator): Changed order of constant
5174         reduction to work correctly with native types which have
5175         overloaded operators.
5176         (ResolveMemberAccess): Extract constant value from attribute
5177         for decimal type.
5178
5179         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5180
5181         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5182         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5183         (ChangeType): Decimal is special.
5184         (TypeToCoreType): Add decimal type.
5185
5186 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5187
5188         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5189         decimal types.
5190
5191 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5192
5193         * class.cs (EventField.ApplyAttributeBuilder): Fix error
5194         test cs1667-5.cs.
5195
5196 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5197
5198         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5199
5200         * pending.cs (PendingImplementation): Grab only interfaces.
5201
5202 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5203
5204         * statement.cs (ForeachHelperMethods): Add location member and
5205         error 202 detection.
5206
5207 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
5208
5209         * expression.cs (DoResolveBase): Fixed wrong warning for out
5210         variables.
5211
5212 2004-12-04  Martin Baulig  <martin@ximian.com>
5213
5214         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
5215         to check whether the conversion is ok.
5216
5217         * typemanager.cs (TypeManager.GetTypeArguments): Just return
5218         `Type.EmptyTypes' if we're not a generic TypeContainer.
5219
5220 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5221
5222         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5223         old bug: when converting from the null literal to a pointer,
5224         return an EmptyCast, not the NullLiteral.
5225
5226         This fixes #69921, the recent null_type changes probably made this
5227         bug more prominent.
5228
5229 2004-12-03  Martin Baulig  <martin@ximian.com>
5230
5231         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5232         method as our child, call AnonymousMethod.Compatible() on it.
5233
5234 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5235
5236         * class.cs (FieldBase): Use an unused bit field from the field to
5237         encode the `has_offset' property from the FieldMember.  This saves
5238         a couple of Ks on bootstrap compilation.
5239
5240         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5241         method as our child, return the AnonymousMethod resolved
5242         expression.
5243
5244         * expression.cs (New.DoResolve): Allow return values from
5245         NewDelegate to also include AnonymousMethods.
5246
5247         Fixes #70150.
5248
5249 2004-11-29  Raja R Harinath  <rharinath@novell.com>
5250
5251         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
5252         cs1648 report.
5253         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
5254         System.Runtime.InteropServices._Exception, since it's a base
5255         interface of the core type System.Exception in the net_2_0 profile.
5256
5257 2004-11-27  Martin Baulig  <martin@ximian.com>
5258
5259         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
5260
5261 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5262
5263         * Makefile: Convert to use executable.make.
5264         * gmcs.exe.sources: New.
5265
5266 2004-11-25  Martin Baulig  <martin@ximian.com>
5267
5268         * expression.cs (Invocation.InferType): Added support for byref types.
5269
5270 2004-11-25  Martin Baulig  <martin@ximian.com>
5271
5272         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
5273         in TypeManager.TypeToCoreType().
5274
5275 2004-11-25  Martin Baulig  <martin@ximian.com>
5276
5277         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
5278         "Dispose" method from the `current_type'.
5279         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
5280         DoDefineMembers() instead of using the MethodBuilder; this is
5281         required for generic iterators.
5282
5283         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
5284
5285 2004-11-24  Martin Baulig  <martin@ximian.com>
5286
5287         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
5288
5289 2004-11-20  Martin Baulig  <martin@ximian.com>
5290
5291         * expression.cs (Invocation.InferType): Correctly infer generic
5292         instances; see gen-103.cs.
5293         (Invocation.InferTypeArguments): If a generic method doesn't have
5294         any unbound type parameters, we don't need to infer anything.
5295
5296 2004-11-19  Raja R Harinath  <rharinath@novell.com>
5297
5298         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
5299
5300 2004-11-17  Raja R Harinath  <rharinath@novell.com>
5301
5302         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5303         (TypeHandle.GetMemberCache): New.
5304         (TypeHandle.TypeHandle): Update.
5305         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5306         (TypeManager.LookupParentInterfacesCache):
5307         Rename from LookupInterfaceCache.  Optimize slightly.
5308         (TypeManager.MemberLookup_FindMembers): Update.
5309         * decl.cs (MemberCache.MemberCache): Set Container to null in the
5310         multi-type variant.
5311         (AddCacheContents): Rename from AddHashtable.
5312         * class.cs (TypeContainer.parent_container): Remove.
5313         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5314         (TypeContainer.DoDefineMembers): Don't initialize it.
5315         Update to name changes.
5316         
5317 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
5318
5319         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5320         that factors the code to check access modifiers on override.  
5321
5322         (PropertyBase): Use the code here.
5323
5324         Patch from Lluis S'anchez, fixes bug #69361.
5325
5326 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
5327
5328         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5329         routine that is used to report the use of a captured variable
5330         whose address has been taken.
5331
5332         There are two checks: one when variables are being captured and
5333         the other check is when the address of a variable is taken. 
5334         
5335         (because an anonymous methods might be resolved before *or* after
5336         the address has been taken) and 
5337
5338         * expression.cs (Conditional.DoResolve): Remove the special
5339         casing that Martin added to trueExpr and falseExpr being both
5340         NullLiteral.  We get the right behavior now just by introducing
5341         the null_type into the compiler. 
5342
5343         * convert.cs (ExplicitConversion): Change the code to use
5344         null_type instead of testing `expr is NullLiteral'.
5345         (ImplicitConversionStandard): use null_type too.
5346         (ImplicitReferenceConversionExists): use null_type too.
5347         (ImplicitReferenceConversion): use null_type too.
5348
5349         * literal.cs: The type of `NullLiteral' is now null_type instead
5350         of object_type. 
5351         (Resolve): Set the type here.
5352
5353         * typemanager.cs: Introduce null_type.
5354
5355 2004-11-18  Martin Baulig  <martin@ximian.com>
5356
5357         * rootcontext.cs
5358         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
5359
5360 2004-11-18  Martin Baulig  <martin@ximian.com>
5361
5362         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
5363
5364 2004-11-18  Martin Baulig  <martin@ximian.com>
5365
5366         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
5367         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
5368         call ResolveConstructedType() on it to resolve it without checking
5369         constraints.
5370         (Constraints.ResolveTypes): Check them here.
5371         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
5372         but don't check constraints.
5373         (ConstructedType.ResolveAsTypeTerminal): Override this and also
5374         check constraints here.
5375         (ConstructedType.ResolveConstructedType): New public method.  This
5376         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
5377         resolve ourselves without checking constraints.
5378
5379         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
5380
5381 2004-11-18  Martin Baulig  <martin@ximian.com>
5382
5383         * decl.cs
5384         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
5385
5386         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
5387
5388 2004-11-18  Martin Baulig  <martin@ximian.com>
5389
5390         * ecore.cs (TypeExpr.ResolveType): Removed.
5391         (Expression.ResolveAsTypeTerminal): We always return a fully
5392         resolved `TypeExpr', so we can just access its `Type'.
5393
5394         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
5395
5396 2004-11-17  Martin Baulig  <martin@ximian.com>
5397
5398         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
5399         sure we don't return any unresolved TypeExpr's.
5400         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
5401         a `TypeExpr'.
5402         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
5403
5404         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
5405         unresolved `ConstructedType's.
5406
5407 2004-11-17  Martin Baulig  <martin@ximian.com>
5408
5409         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
5410
5411 2004-11-17  Martin Baulig  <martin@ximian.com>
5412
5413         * ecore.cs
5414         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
5415
5416         * decl.cs (DeclSpace.ResolveType): Removed.
5417         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5418
5419 2004-11-17  Martin Baulig  <martin@ximian.com>
5420
5421         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5422         direction, like FindMembers() does.  Fixes #69546, testcase is in
5423         test-315.cs.    
5424
5425 2004-11-16  Martin Baulig  <martin@ximian.com>
5426
5427         This is based on a patch from Marek Safar, see bug #69082.
5428         Fixes bugs #63705 and #67130.
5429
5430         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5431         method; create a MemberCache for an interface type and cache the
5432         result.
5433
5434         * decl.cs (IMemberContainer.ParentContainer): Removed.
5435         (IMemberContainer.ParentCache): New property.
5436         (MemberCache.SetupCacheForInterface): Removed.
5437         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5438         to create a cache for an interface's "parent".
5439
5440         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5441         interfaces too.
5442
5443 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
5444
5445         * statement.cs: Avoid adding bools to a hashtable.
5446
5447 2004-11-15  Martin Baulig  <martin@ximian.com>
5448
5449         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5450
5451 2004-11-11  Martin Baulig  <martin@ximian.com>
5452
5453         * typemanager.cs (TypeManager.GetMethodName): New method.
5454
5455         * class.cs (MethodData.Define): Include the generic arity in the
5456         name of an explicit interface; also add it to the method name.
5457
5458         * pending.cs (PendingImplementation.InterfaceMethod): The method
5459         name now includes the generic arity.
5460
5461 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
5462
5463         * expression.cs (Invocation.OverloadResolve): Flag error if we are
5464         calling an unsafe method from a safe location.
5465
5466 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
5467
5468         Fix #69167
5469         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5470
5471 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
5472
5473         * namespace.cs (VerifyUsing): use GetPartialName instead of
5474         ToString. 
5475
5476 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
5477
5478         * statement.cs (Return.Resolve): Fix regression in typo: if
5479         `in_exc', we have to request a NeedReturnLabel, this was a typo
5480         introduced in the anonymous method check-in.  Fixes #69131.
5481
5482         * Indexers were using the ShortName when defining themselves,
5483         causing a regression in the compiler bootstrap when applying the
5484         patch from 2004-11-02 (first part), now they use their full name
5485         and the bug is gone.
5486
5487 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
5488
5489         * driver.cs: Strip the path from the names of embedded resources. Fixes
5490         #68519.
5491
5492 2004-11-04  Raja R Harinath  <rharinath@novell.com>
5493
5494         Fix error message regression: cs0104-2.cs.
5495         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5496         (AliasEntry.Resolve): Update.
5497         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
5498         'silent' flag.
5499         (RootContext.LookupType): Update.
5500
5501 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
5502
5503         * cs-parser.jay: Add support for handling accessor modifiers
5504         * class: Add support port accessor modifiers and error checking,
5505         define PropertyMethod.Define as virtual (not abstract anymore)
5506         * ecore.cs: Add checking for proeprties access with access modifiers
5507         * iterators.cs: Modify Accessor constructor call based in the modified
5508         constructor
5509 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
5510
5511         * expression.cs (StringConcat): Handle being called twice,
5512         as when we have a concat in a field init with more than two
5513         ctors in the class
5514
5515 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
5516
5517         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5518         special case explicit implementations, we should always produce
5519         the .property or .event declaration.
5520         
5521         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5522         since it will not return correct data if people use this
5523         unresolved in the presence of using statements (see test-313).
5524
5525         * class.cs (MethodData.Define): If we are an explicit interface
5526         implementation, set the method name to the full name of the
5527         interface plus the name of the method.  
5528
5529         Notice that using the method.MethodName.GetFullName() does not
5530         work, as it will only contain the name as declared on the source
5531         file (it can be a shorthand in the presence of using statements)
5532         and not the fully qualifed type name, for example:
5533
5534         using System;
5535
5536         class D : ICloneable {
5537                 object ICloneable.Clone ()  {
5538                 }
5539         }
5540
5541         Would produce a method called `ICloneable.Clone' instead of
5542         `System.ICloneable.Clone'.
5543
5544         * namespace.cs (Alias.Resolve): Use GetPartialName.
5545         
5546 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5547
5548         * cs-parser.jay: Add error 1055 report.
5549
5550 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
5551
5552         * assign.cs (Assign.DoResolve): Only do the transform of
5553         assignment into a New if the types are compatible, if not, fall
5554         through and let the implicit code deal with the errors and with
5555         the necessary conversions. 
5556
5557 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5558
5559         * cs-parser.jay: Add error 1031 report.
5560
5561         * cs-tokenizer.cs: Add location for error 1038.
5562
5563 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5564
5565         * cs-parser.jay: Add error 1016 report.
5566
5567 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5568
5569         * cs-parser.jay: Add errors 1575,1611 report.
5570
5571 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5572
5573         * cs-parser.jay: Add error 1001 report.
5574
5575 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5576
5577         Fix #68850
5578         * attribute.cs (GetMarshal): Add method argument for
5579         caller identification.
5580
5581         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5582         agument for GetMarshal and RuntimeMissingSupport.
5583
5584 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5585
5586         * attribute.cs (ExtractSecurityPermissionSet): Removed
5587         TypeManager.code_access_permission_type.
5588
5589         * typemanager.cs: Removed TypeManager.code_access_permission_type.
5590
5591 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
5592
5593         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5594         for obsolete use of a variable here.   Fixes regression on errors
5595         cs0619-25 and cs0619-26.
5596
5597 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5598
5599         Fix #62358, implemented security attribute encoding.
5600
5601         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5602         Tests permitted SecurityAction for assembly or other types.
5603         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5604         data from SecurityPermissionAttribute to PermisionSet class.
5605
5606         * class.cs (ApplyAttributeBuilder): Added special handling
5607         for System.Security.Permissions.SecurityAttribute based types.
5608
5609         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5610         special handling for System.Security.Permissions.SecurityAttribute
5611         based types.
5612
5613         * enum.cs (ApplyAttributeBuilder): Added special handling
5614         for System.Security.Permissions.SecurityAttribute based types.
5615
5616         * parameter.cs (ApplyAttributeBuilder): Added special handling
5617         for System.Security.Permissions.SecurityAttribute based types.
5618
5619         * rootcontext.cs: Next 2 core types.
5620
5621         * typemanager.cs (TypeManager.security_permission_attr_type):
5622         Built in type for the SecurityPermission Attribute.
5623         (code_access_permission_type): Build in type.
5624
5625 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5626
5627         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5628         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5629         all of this information into
5630         EmitContext.EmitCapturedVariableInstance.
5631         
5632         * codegen.cs (EmitCapturedVariableInstance): move here the
5633         funcionality of emitting an ldarg.0 in the presence of a
5634         remapping.   This centralizes the instance emit code.
5635
5636         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5637         then emit a load of this: it means that we have reached the
5638         topmost ScopeInfo: the one that contains the pointer to the
5639         instance of the class hosting the anonymous method.
5640
5641         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5642         captures to the topmost CaptureContext.
5643
5644 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5645
5646         * expression.cs (LocalVariableReference): Move the knowledge about
5647         the iterators into codegen's EmitCapturedVariableInstance.
5648
5649 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5650
5651         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5652         all code paths return a value from an anonymous method (it is the
5653         same as the 161 error, but for anonymous methods).
5654
5655 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5656
5657         The introduction of anonymous methods in the compiler changed
5658         various ways of doing things in the compiler.  The most
5659         significant one is the hard split between the resolution phase
5660         and the emission phases of the compiler.
5661
5662         For instance, routines that referenced local variables no
5663         longer can safely create temporary variables during the
5664         resolution phase: they must do so from the emission phase,
5665         since the variable might have been "captured", hence access to
5666         it can not be done with the local-variable operations from the runtime.
5667         
5668         * statement.cs 
5669
5670         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5671         is a toplevel block.
5672
5673         (ToplevelBlock): A new kind of Block, these are the blocks that
5674         are created by the parser for all toplevel method bodies.  These
5675         include methods, accessors and anonymous methods.
5676
5677         These contain some extra information not found in regular blocks:
5678         A pointer to an optional CaptureContext (for tracking captured
5679         local variables and parameters).  A pointer to the parent
5680         ToplevelBlock.
5681         
5682         (Return.Resolve): Catch missmatches when returning a value from an
5683         anonymous method (error 1662).
5684         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5685         phase.
5686
5687         (Break.Resolve): ditto.
5688
5689         (SwitchLabel): instead of defining the labels during the
5690         resolution phase, we now turned the public ILLabel and ILLabelCode
5691         labels into methods called GetILLabelCode() and GetILLabel() that
5692         only define the label during the Emit phase.
5693
5694         (GotoCase): Track the SwitchLabel instead of the computed label
5695         (its contained therein).  Emit the code by using
5696         SwitchLabel.GetILLabelCode ().
5697
5698         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5699         whether the Local has been captured or not.
5700
5701         (LocalInfo.IsCaptured): New property, used to tell whether the
5702         local has been captured.
5703         
5704         * anonymous.cs: Vastly updated to contain the anonymous method
5705         support.
5706
5707         The main classes here are: CaptureContext which tracks any
5708         captured information for a toplevel block and ScopeInfo used to
5709         track the activation frames for various local variables.   
5710
5711         Each toplevel block has an optional capture context associated
5712         with it.  When a method contains an anonymous method both the
5713         toplevel method and the anonymous method will create a capture
5714         context.   When variables or parameters are captured, they are
5715         recorded on the CaptureContext that owns them, for example:
5716
5717         void Demo () {
5718              int a;
5719              MyDelegate d = delegate {
5720                  a = 1;
5721              }
5722         }
5723
5724         Here `a' will be recorded as captured on the toplevel
5725         CapturedContext, the inner captured context will not have anything
5726         (it will only have data if local variables or parameters from it
5727         are captured in a nested anonymous method.
5728
5729         The ScopeInfo is used to track the activation frames for local
5730         variables, for example:
5731
5732         for (int i = 0; i < 10; i++)
5733                 for (int j = 0; j < 10; j++){
5734                    MyDelegate d = delegate {
5735                         call (i, j);
5736                    }
5737                 }
5738
5739         At runtime this captures a single captured variable `i', but it
5740         captures 10 different versions of the variable `j'.  The variable
5741         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5742         recorded on a child.  
5743
5744         The toplevel ScopeInfo will also track information like the `this'
5745         pointer if instance variables were referenced (this is necessary
5746         as the anonymous method lives inside a nested class in the host
5747         type of the method). 
5748
5749         (AnonymousMethod): Expanded to track the Toplevel, implement
5750         `AnonymousMethod.Compatible' to tell whether an anonymous method
5751         can be converted to a target delegate type. 
5752
5753         The routine now also produces the anonymous method content
5754
5755         (AnonymousDelegate): A helper class that derives from
5756         DelegateCreation, this is used to generate the code necessary to
5757         produce the delegate for the anonymous method that was created. 
5758
5759         * assign.cs: API adjustments for new changes in
5760         Convert.ImplicitStandardConversionExists.
5761
5762         * class.cs: Adjustments to cope with the fact that now toplevel
5763         blocks are of type `ToplevelBlock'. 
5764
5765         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5766         insteda of standard blocks.
5767
5768         Flag errors if params arguments are passed to anonymous methods.
5769
5770         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5771         `CurrentAnonymousMethod' which points to the current Anonymous
5772         Method.  The variable points to the AnonymousMethod class that
5773         holds the code being compiled.  It is set in the new EmitContext
5774         created for the anonymous method.
5775
5776         (EmitContext.Phase): Introduce a variable and an enumeration to
5777         assist in enforcing some rules about when and where we are allowed
5778         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5779         only one that enfonces this right now).
5780
5781         (EmitContext.HaveCaptureInfo): new helper method that returns
5782         whether we have a CapturedContext initialized.
5783
5784         (EmitContext.CaptureVariable): New method used to register that a
5785         LocalInfo must be flagged for capturing. 
5786
5787         (EmitContext.CapturedParameter): New method used to register that a
5788         parameters must be flagged for capturing. 
5789         
5790         (EmitContext.CapturedField): New method used to register that a
5791         field must be flagged for capturing. 
5792
5793         (EmitContext.HaveCapturedVariables,
5794         EmitContext.HaveCapturedFields): Return whether there are captured
5795         variables or fields. 
5796
5797         (EmitContext.EmitMethodHostInstance): This is used to emit the
5798         instance for the anonymous method.  The instance might be null
5799         (static methods), this (for anonymous methods that capture nothing
5800         and happen to live side-by-side with the current method body) or a
5801         more complicated expression if the method has a CaptureContext.
5802
5803         (EmitContext.EmitTopBlock): Routine that drives the emission of
5804         code: it will first resolve the top block, then emit any metadata
5805         and then emit the code.  The split is done so that we can extract
5806         any anonymous methods and flag any captured variables/parameters.
5807         
5808         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5809         during this phase, the ILGenerator should not be used as labels
5810         and local variables declared here might not be accessible to any
5811         code that is part of an anonymous method.  
5812
5813         Exceptions to this include the temporary variables that are
5814         created by some statements internally for holding temporary
5815         variables. 
5816         
5817         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5818         metadata for a cb
5819
5820         (EmitContext.TemporaryReturn): This method is typically called
5821         from the Emit phase, and its the only place where we allow the
5822         ReturnLabel to be defined other than the EmitMeta.  The reason is
5823         that otherwise we would have to duplicate a lot of logic in the
5824         Resolve phases of various methods that today is on the Emit
5825         phase. 
5826
5827         (EmitContext.NeedReturnLabel): This no longer creates the label,
5828         as the ILGenerator is not valid during the resolve phase.
5829
5830         (EmitContext.EmitThis): Extended the knowledge in this class to
5831         work in anonymous methods in addition to iterators. 
5832
5833         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5834         code is necessary on the stack to access the instance to a local
5835         variable (the variable will be accessed as a field).
5836
5837         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5838         EmitContext.EmitAddressOfParameter): Routines to support
5839         parameters (not completed at this point). 
5840         
5841         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5842         will also remove the parameters.
5843
5844         * convert.cs (Convert): Define a `ConstantEC' which points to a
5845         null.  This is just to prefity some code that uses
5846         ImplicitStandardConversion code and do not have an EmitContext
5847         handy.
5848
5849         The idea is to flag explicitly that at that point in time, it is
5850         known that the conversion will not trigger the delegate checking
5851         code in implicit conversions (which requires a valid
5852         EmitContext). 
5853
5854         Everywhere: pass new EmitContext parameter since
5855         ImplicitStandardConversionExists now requires it to check for
5856         anonymous method conversions. 
5857
5858         (Convert.ImplicitStandardConversionExists): If the type of an
5859         expression is the anonymous_method_type, and the type is a
5860         delegate, we invoke the AnonymousMethod.Compatible method to check
5861         whether an implicit conversion is possible. 
5862
5863         (Convert.ImplicitConversionStandard): Only do implicit method
5864         group conversions if the language level is not ISO_1.
5865
5866         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5867         MethodInfo for the Invoke method.  used by Delegate and
5868         AnonymousDelegate.
5869
5870         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5871         method conversions if the target type is a delegate.
5872
5873         Removed extra debugging nops.
5874
5875         (LocalVariableReference): Turn the `local_info' into a public
5876         field. 
5877
5878         Add `prepared' field, the same hack used for FieldExprs to cope
5879         with composed assignments, as Local variables do not necessarily
5880         operate purely on the stack as they used to: they can be captured
5881         fields. 
5882
5883         Add `temp' for a temporary result, like fields.
5884
5885         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5886
5887         It now copes with Local variables that are captured and emits the
5888         proper instance variable to load it from a field in the captured
5889         case. 
5890
5891         (ParameterReference.DoResolveBase): During the resolve phase,
5892         capture parameters if we are in an anonymous method.
5893
5894         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5895         anonymous method, use the EmitContext helper routines to emit the
5896         parameter reference.
5897
5898         * iterators.cs: Set RemapToProxy to true/false during the
5899         EmitDispose class.
5900
5901         * parameters.cs (GetParameterByName): New helper method. 
5902
5903         * typemanager.cs (anonymous_method_type) a new type that
5904         represents an anonyous method.  This is always an internal type,
5905         used as a fencepost to test against the anonymous-methodness of an
5906         expression. 
5907         
5908 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5909
5910         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5911         561 report.
5912         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5913
5914 2004-11-10  Martin Baulig  <martin@ximian.com>
5915
5916         * expression.cs (Invocation.BetterFunction): If two methods have
5917         equal parameter types, but only one of them is generic, the
5918         non-generic one wins.
5919         (New.DoResolve): Don't set `is_struct' to false if we're a generic
5920         instance; just use `Type.IsValueType' to determine whether
5921         something is a struct or not.
5922         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5923         so we can be called multiple times.
5924
5925 2004-11-10  Martin Baulig  <martin@ximian.com>
5926
5927         * generic.cs (TypeParameter.DefineConstraints): New public method.
5928         (TypeParameter.CheckAccessLevel): Override this and return true.
5929         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5930         override ResolveType() anymore.
5931         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5932
5933 2004-11-10  Martin Baulig  <martin@ximian.com>
5934
5935         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5936         call DeclSpace.ResolveNestedType() on it.
5937
5938 2004-11-10  Martin Baulig  <martin@ximian.com>
5939
5940         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5941         non-null, call ParameterModifier() on it.
5942
5943 2004-11-10  Martin Baulig  <martin@ximian.com>
5944
5945         * iterators.cs
5946         (Iterators): Added `current_type' and `this_type' fields.
5947         (Iterators.DefineIterator): Create a new EmitContext and store it
5948         in `ec'; compute `this_type'.
5949
5950 2004-11-10  Martin Baulig  <martin@ximian.com>
5951
5952         * typemanager.cs
5953         (TypeManager.IsPrivateAccessible): New public method.
5954         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5955
5956 2004-11-10  Martin Baulig  <martin@ximian.com>
5957
5958         * class.cs (TypeContainer.DefineType): Call
5959         TypeBuilder.DefineGenericParameters() before resolving the type
5960         parameters.
5961         (MethodData.parent_method): New protected field.
5962         (MethodData..ctor): Added `MethodInfo parent_method' argument.
5963         (MethodData.Define): Compute `parent_method'.
5964
5965         * decl.cs
5966         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5967         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5968         (DeclSpace.ec): New protected field; store the EmitContext here.
5969         (DeclSpace.EmitContext): New public property.
5970         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5971         (DeclSpace.ResolveNestedType): New public method.
5972         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5973         (DeclSpace.NestedAccessible): Added `Type tb' argument.
5974         (DeclSpace.FamilyAccessible): Likewise.
5975         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5976         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5977         EmitContext.
5978
5979         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5980         field.
5981
5982         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5983         (Enum.Emit): Don't create a new EmitContext.
5984
5985 2004-10-18  Martin Baulig  <martin@ximian.com>
5986
5987         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5988         `Type' directly, but call ResolveType() on it.
5989         (Catch.Resolve): Likewise.
5990         (Foreach.Resolve): Likewise.
5991
5992 2004-10-18  Martin Baulig  <martin@ximian.com>
5993
5994         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5995         `Type' directly, but call ResolveType() on it.
5996         (Probe.DoResolve): Likewise.
5997         (ArrayCreation.LookupType): Likewise.
5998         (TypeOf.DoResolve): Likewise.
5999         (SizeOf.DoResolve): Likewise.
6000
6001 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6002
6003         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6004         the ResolveType.
6005
6006 2004-10-17  John Luke  <john.luke@gmail.com>
6007
6008         * class.cs (Operator.GetSignatureForError): use CSharpName
6009
6010         * parameter.cs (Parameter.GetSignatureForError): Returns
6011         correct name even if was not defined.
6012
6013 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6014
6015         Fix #65816.
6016         * class.cs (TypeContainer.EmitContext): New property.
6017         (DefineNestedTypes): Create an emitcontext for each part.
6018         (MethodCore.DoDefineParameters): Use container's emitcontext.
6019         Pass type array to InternalParameters.
6020         (MemberBase.DoDefine): Use container's emitcontext.
6021         (FieldMember.Define): Likewise.
6022         (Event.Define): Likewise.
6023         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6024         Pass type array to InternalParameters.
6025         (SetIndexerMethod.GetParameterInfo): Likewise.
6026         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6027         * delegate.cs (Define): Pass emitcontext to
6028         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6029         array to InternalParameters.
6030         * expression.cs (ParameterReference.DoResolveBase): Pass
6031         emitcontext to GetParameterInfo.
6032         (ComposedCast.DoResolveAsTypeStep): Remove check on
6033         ec.ResolvingTypeTree.
6034         * parameter.cs (Parameter.Resolve): Change argument to
6035         EmitContext.  Use ResolveAsTypeTerminal.
6036         (Parameter.GetSignature): Change argument to EmitContext.
6037         (Parameters.ComputeSignature): Likewise.
6038         (Parameters.ComputeParameterTypes): Likewise.
6039         (Parameters.GetParameterInfo): Likewise.
6040         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6041         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6042         * support.cs (InternalParameters..ctor): Remove variant that takes
6043         a DeclSpace.
6044         * typemanager.cs (system_intptr_expr): New.
6045         (InitExpressionTypes): Initialize it.
6046
6047 2004-10-12  Chris Toshok  <toshok@ximian.com>
6048
6049         * cs-parser.jay: fix location for try_statement and catch_clause.
6050
6051 2004-10-18  Martin Baulig  <martin@ximian.com>
6052
6053         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6054         `Type' directly, but call ResolveType() on it.
6055         (MemberBase.DoDefine): Likewise.
6056
6057         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6058         `Type' directly, but call ResolveType() on it.
6059         (ComposedCast.DoResolveAsTypeStep): Likewise.
6060
6061         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6062         `Type' directly, but call ResolveType() on it.
6063
6064 2004-10-17  John Luke  <john.luke@gmail.com>
6065
6066         * class.cs (Operator.GetSignatureForError): use CSharpName
6067
6068         * parameter.cs (Parameter.GetSignatureForError): Returns
6069         correct name even if was not defined.
6070
6071 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6072
6073         Fix #65816.
6074         * class.cs (TypeContainer.EmitContext): New property.
6075         (DefineNestedTypes): Create an emitcontext for each part.
6076         (MethodCore.DoDefineParameters): Use container's emitcontext.
6077         Pass type array to InternalParameters.
6078         (MemberBase.DoDefine): Use container's emitcontext.
6079         (FieldMember.Define): Likewise.
6080         (Event.Define): Likewise.
6081         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6082         Pass type array to InternalParameters.
6083         (SetIndexerMethod.GetParameterInfo): Likewise.
6084         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6085         * delegate.cs (Define): Pass emitcontext to
6086         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6087         array to InternalParameters.
6088         * expression.cs (ParameterReference.DoResolveBase): Pass
6089         emitcontext to GetParameterInfo.
6090         (ComposedCast.DoResolveAsTypeStep): Remove check on
6091         ec.ResolvingTypeTree.
6092         * parameter.cs (Parameter.Resolve): Change argument to
6093         EmitContext.  Use ResolveAsTypeTerminal.
6094         (Parameter.GetSignature): Change argument to EmitContext.
6095         (Parameters.ComputeSignature): Likewise.
6096         (Parameters.ComputeParameterTypes): Likewise.
6097         (Parameters.GetParameterInfo): Likewise.
6098         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6099         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6100         * support.cs (InternalParameters..ctor): Remove variant that takes
6101         a DeclSpace.
6102         * typemanager.cs (system_intptr_expr): New.
6103         (InitExpressionTypes): Initialize it.
6104
6105 2004-10-12  Chris Toshok  <toshok@ximian.com>
6106
6107         * cs-parser.jay: fix location for try_statement and catch_clause.
6108
6109 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6110
6111         More DeclSpace.ResolveType avoidance.
6112         * decl.cs (MemberCore.InUnsafe): New property.
6113         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6114         with newly created EmitContext.
6115         (FieldMember.Define): Likewise.
6116         * delegate.cs (Delegate.Define): Likewise.
6117         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6118         only if normal name-lookup fails.
6119         (TypeExpr.DoResolve): Enable error-checking.
6120         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6121         (SizeOf.DoResolve): Likewise.
6122         (ComposedCast.DoResolveAsTypeStep): Likewise.
6123         (StackAlloc.DoResolve): Likewise.
6124         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6125         (Block.Unsafe): New property.
6126         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6127         (Unsafe): Set 'unsafe' flag of contained block.
6128         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6129         (Fixed.Resolve): Likewise.
6130         (Catch.Resolve): Likewise.
6131         (Using.ResolveLocalVariableDecls): Likewise.
6132         (Foreach.Resolve): Likewise.
6133
6134 2004-10-05  John Luke <john.luke@gmail.com>
6135
6136         * cs-parser.jay: add location to error CS0175
6137
6138 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
6139
6140         * ecore.cs (Expression.Constantity): Add support for turning null
6141         into a constant.
6142
6143         * const.cs (Const.Define): Allow constants to be reference types
6144         as long as the value is Null.
6145
6146 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
6147
6148         * namespace.cs (NamespaceEntry.Using): No matter which warning
6149         level is set, check if this namespace name has already been added.
6150
6151 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
6152
6153         * expression.cs: reftype [!=]= null should always use br[true,false].
6154         # 67410
6155
6156 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
6157
6158         Fix #67108
6159         * attribute.cs: Enum conversion moved to 
6160         GetAttributeArgumentExpression to be applied to the all
6161         expressions.
6162
6163 2004-10-01  Raja R Harinath  <rharinath@novell.com>
6164
6165         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6166         * class.c (TypeContainer.DefineType): Flag error if
6167         base types aren't accessible due to access permissions.
6168         * decl.cs (DeclSpace.ResolveType): Move logic to
6169         Expression.ResolveAsTypeTerminal.
6170         (DeclSpace.ResolveTypeExpr): Thin layer over
6171         Expression.ResolveAsTypeTerminal.
6172         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6173         Refactor code into NestedAccess.  Use it.
6174         (DeclSpace.NestedAccess): New.
6175         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6176         argument to silence errors.  Check access permissions.
6177         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6178         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6179         (Cast.DoResolve): Likewise.
6180         (New.DoResolve): Likewise.
6181         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6182         (TypeOf.DoResolve): Likewise.
6183
6184         * expression.cs (Invocation.BetterConversion): Return the Type of
6185         the better conversion.  Implement section 14.4.2.3 more faithfully.
6186         (Invocation.BetterFunction): Make boolean.  Make correspondence to
6187         section 14.4.2.2 explicit.
6188         (Invocation.OverloadResolve): Update.
6189         (Invocation): Remove is_base field.
6190         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
6191         (Invocation.Emit): Likewise.
6192
6193 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
6194
6195         * cs-parser.jay: Reverted 642 warning fix.
6196
6197 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6198
6199         Fix bug #66615
6200         * decl.cs (FindMemberWithSameName): Indexer can have more than
6201         1 argument.
6202
6203 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6204
6205         * expression.cs (LocalVariableReference.DoResolveLValue):
6206         Do not report warning 219 for out values.
6207         (EmptyExpression.Null): New member to avoid extra allocations.
6208
6209 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6210
6211         * cs-parser.jay: Fix wrong warning 642 report.
6212
6213         * cs-tokenizer.cs (CheckNextToken): New helper;
6214         Inspect next character if is same as expected.
6215
6216 2004-09-23  Martin Baulig  <martin@ximian.com>
6217
6218         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6219         (Convert.ImplicitReferenceConversionExists): Likewise.
6220
6221 2004-11-09  Raja R Harinath  <rharinath@novell.com>
6222
6223         * Makefile (DISTFILES): Comment out a few missing files.
6224
6225 2004-10-29  Raja R Harinath  <rharinath@novell.com>
6226
6227         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
6228         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
6229         (gmcs.exe): Invoke bootstrap-libs.
6230         (clean-local): Clean the net_2_0_bootstrap profile too.
6231         (PROGRAM_INSTALL_DIR): New.
6232         (install-local): Use it.
6233
6234 2004-10-13  Martin Baulig  <martin@ximian.com>
6235
6236         * generic.cs (TypeManager.InflatedConstraints): New nested class.
6237         (TypeParameter.DefineType): If we're a method type parameter and
6238         that method is overriding something, "inflate" its constraints.
6239
6240 2004-10-12  Martin Baulig  <martin@ximian.com>
6241
6242         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
6243         and have type arguments, create and resolve a ConstructedType.
6244
6245 2004-10-12  Martin Baulig  <martin@ximian.com>
6246
6247         * decl.cs (MemberCache.FindMemberToOverride): Use
6248         TypeManager.IsEqual() to compare the parameters and Type.Equals()
6249         to compare the invocationType.
6250
6251         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
6252         When comparing two type parameters, only do the signature-only
6253         comparision for method type parameters.
6254
6255 2004-10-11  Martin Baulig  <martin@ximian.com>
6256
6257         * report.cs: Don't make --fatal abort on warnings, we have
6258         -warnaserror for that.
6259
6260 2004-10-11  Martin Baulig  <martin@ximian.com>
6261
6262         * typemanager.cs
6263         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
6264         (TypeManager.IsEqual): Call ourself recursively instead of using
6265         Type.IsEqual(). 
6266
6267 2004-10-11  Martin Baulig  <martin@ximian.com>
6268
6269         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
6270         on our own type parameters, not on the ones we inherit from a containing
6271         class.
6272
6273         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
6274         the comparision.
6275
6276         * generic.cs (TypeParameter.Define): We may only be called once.
6277
6278         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
6279         instead of TypeManager.IsEqual().
6280
6281 2004-09-28  Martin Baulig  <martin@ximian.com>
6282
6283         * generic.cs
6284         (GenericConstraints.EffectiveBaseClass): New public property.
6285         (TypeParameter.GenericConstraints): New public property.
6286         (ConstructedType.CheckConstraints): Improved.
6287
6288         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
6289         (Convert.TypeParameterConversion): New private method; use this in
6290         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
6291         for all conversions related to type parameters.
6292
6293 2004-09-24  Martin Baulig  <martin@ximian.com>
6294
6295         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
6296         type parameter conversions for type parameters which are known to
6297         be reference types.
6298
6299 2004-09-24  Martin Baulig  <martin@ximian.com>
6300
6301         * generic.cs (GenericConstraints): Added `IsReferenceType' and
6302         `IsValueType' properties.
6303
6304         * support.cs (ReflectionConstraints): Use
6305         Type.GetGenericParameterConstraints() instead of the old hack.
6306
6307 2004-09-24  Martin Baulig  <martin@ximian.com>
6308
6309         * generic.cs (GenericConstraints): Moved here and made it an
6310         abstract class.
6311
6312         * support.cs (GenericConstraints): Moved to generic.cs.
6313
6314 2004-09-24  Martin Baulig  <martin@ximian.com>
6315
6316         * support.cs
6317         (ReflectionConstraints): Un-nested this class and made it public.
6318
6319         * typemanager.cs
6320         (TypeManager.GetTypeParameterConstraints): New public method.
6321         (TypeManager.HasConstructorConstraint): Use the attributes.
6322
6323 2004-09-24  Martin Baulig  <martin@ximian.com>
6324
6325         * support.cs (GenericConstraints): Replaced `HasConstructor',
6326         `IsReferenceType' and `IsValueType' with `Attributes'.
6327         (ReflectionParameters.ReflectionConstraints): Removed the Create()
6328         method and made the .ctor public.
6329
6330         * generic.cs (Constraints.Attributes): New public property.
6331         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
6332         `IsReferenceType' -> `HasReferenceTypeConstraint' and
6333         `IsValueType' -> `HasValueTypeConstraint'.
6334
6335 2004-09-23  Martin Baulig  <martin@ximian.com>
6336
6337         * generic.cs (Constraints): Reflect latest runtime changes.
6338
6339 2004-09-23  Martin Baulig  <martin@ximian.com>
6340
6341         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6342         (Convert.ImplicitReferenceConversionExists): Likewise.
6343
6344 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6345
6346         * class.cs (Operator.Define): Add error 448 and 559 report.
6347         
6348 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6349
6350         * class.cs (MemberBase.IsTypePermitted): New protected
6351         method for checking error CS0610.
6352
6353 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6354
6355         * class.cs (TypeContainer.HasExplicitLayout): New property
6356         Returns whether container has StructLayout attribute set Explicit.
6357         (FieldMember): New abstract class for consts and fields.
6358         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6359         (Field): Reuse FieldMember.
6360
6361         * const.cs (Const): Reuse FieldMember.
6362
6363         * rootcontext.cs: EmitConstants call moved to class.
6364
6365 2004-09-22  Martin Baulig  <martin@ximian.com>
6366
6367         Marek and me just fixed one of our oldest bugs: #28562 :-)
6368
6369         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6370
6371         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6372         we're an EnumConstant, just return that.
6373         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6374         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
6375         to get the value which'll actually be written into the attribute.
6376         However, we have to use GetValue() to access the attribute's value
6377         in the compiler.        
6378
6379 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6380
6381         * constant.cs (Constant.IsNegative): New abstract property
6382         IsNegative.
6383
6384         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6385         (StackAlloc.DoResolve): Reused IsNegative.
6386
6387 2004-09-22  Martin Baulig  <martin@ximian.com>
6388
6389         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
6390         public method; like LookupTypeContainer, but also works for
6391         generic instances.
6392
6393         * report.cs (Report.SymbolRelatedToPreviousError): Use
6394         TypeManager.LookupGenericTypeContainer().       
6395
6396 2004-09-22  Martin Baulig  <martin@ximian.com>
6397
6398         Thanks to Peter Sestoft for this bug report.
6399
6400         * expression.cs (Conditional): If both the `trueExpr' and the
6401         `falseExpr' is a NullLiteral, return a NullLiteral.
6402
6403 2004-09-22  Martin Baulig  <martin@ximian.com>
6404
6405         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6406         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6407         for the "get_Current" call.
6408
6409 2004-09-21  Martin Baulig  <martin@ximian.com>
6410
6411         * convert.cs (Convert.ImplicitReferenceConversion): When
6412         converting to an interface type, first check whether we're
6413         converting from a reference type.
6414
6415 2004-09-14  Martin Baulig  <martin@ximian.com>
6416
6417         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6418
6419 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6420
6421         Fixed bug #61902
6422         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6423         called and is obsolete then this member suppress message
6424         when call is inside next [Obsolete] method or type.
6425
6426         * expression.cs: Use TestObsoleteMethodUsage member.
6427
6428 2004-09-14  Martin Baulig  <martin@ximian.com>
6429
6430         * genericparser.cs: Removed.
6431
6432 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
6433
6434         * class.cs (MethodCore.CheckBase): Fix bug #65757.
6435
6436 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6437
6438         * attribute.cs (Attribute.Resolve): Add error 653 report.
6439
6440         * class.cs (Class.ApplyAttributeBuilder): Add error 641
6441         report.
6442         (Method.ApplyAttributeBuilder): Add error 685 report.
6443         (Operator.Define): Add error 564 report.
6444
6445         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6446
6447         * expression.cs (Invocation.DoResolve): Add error
6448         245 and 250 report.
6449
6450         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6451         error 674 report.
6452
6453 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6454
6455         * class.cs (ConstructorInitializer.Resolve):
6456         Wrong error number (515->516).
6457
6458 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6459
6460         * class.cs (Indexer.Define): Add error 631 report.
6461
6462 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6463
6464         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6465
6466 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6467
6468         * expression.cs (Probe.DoResolve): Add error CS0241 report.
6469
6470 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
6471
6472         * cs-parser.jay: Added error CS0241 report.
6473
6474 2004-09-10  Raja R Harinath  <rharinath@novell.com>
6475
6476         * cs-parser.jay (fixed_statement): Introduce a scope for the
6477         declaration in the 'fixed' statement.
6478
6479 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6480
6481         * cs-parser.jay: Added CS0230 error report.
6482
6483 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6484
6485         * cs-parser.jay: Added errors CS0231 and CS0257 report.
6486
6487 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6488
6489         * expression.cs (Argument.Resolve): Added error CS0192 and
6490         CS0199 report.
6491
6492 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6493
6494         C# 2.0 #pragma warning feature
6495
6496         * cs-tokenizer.cs (PreProcessPragma): New method; 
6497         Handles #pragma directive.
6498
6499         * report.cs (WarningRegions): New class; Support
6500         class for #pragma warning directive. It tests whether
6501         warning is enabled for a given line.
6502
6503 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
6504
6505         * const.cs: Add more descriptive error report, tahnks to
6506         Sebastien. 
6507
6508 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
6509
6510         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6511
6512 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
6513
6514         * expression.cs: Apply patch from Ben: Remove dead code from
6515         ArrayCreation, and remove the TurnintoConstant call in const.cs,
6516         as that code just threw an exception anwyays.
6517
6518         * const.cs: Remove the call to the turnintoconstant, for details
6519         see bug: #63144
6520         
6521         * literal.cs: The type of the null-literal is the null type;  So
6522         we use a placeholder type (literal.cs:System.Null, defined here)
6523         for it.
6524
6525         * expression.cs (Conditional.DoResolve): Remove some old code that
6526         is no longer needed, conversions have been fixed.
6527
6528         (ArrayCreationExpression.DoResolve): Return false if we fail to
6529         resolve the inner expression.
6530
6531 2004-09-07  Raja R Harinath  <rharinath@novell.com>
6532
6533         Fix test-290.cs.
6534         * cs-parser.jay (delegate_declaration): Record a delegate
6535         declaration as a type declaration.
6536         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6537
6538 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
6539
6540         * parameter.cs: Do not crash if the type can not be resolved. 
6541
6542         * expression.cs: Report errors with unsafe pointers, fixes #64896
6543
6544 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6545
6546         * expression.cs: Pointer arith always needs to do a conv.i
6547         if the operand is a long. fix 65320
6548
6549 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6550
6551         Fixed cs0619-37.cs, cs0619-38.cs
6552
6553         * enum.cs (GetObsoleteAttribute): Removed.
6554
6555         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6556         on Enum member is double staged. The first is tested member
6557         and then enum.
6558
6559 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6560
6561         Fixed #56986, #63631, #65231
6562
6563         * class.cs: (TypeContainer.AddToMemberContainer): New method,
6564         adds member to name container.
6565         (TypeContainer.AddToTypeContainer): New method, adds type to
6566         name container.
6567         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6568         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6569         AddOperator): Simplified by reusing AddToMemberContainer.
6570         (TypeContainer.UserDefinedStaticConstructor): Changed to property
6571         instead of field.
6572         (Method.CheckForDuplications): Fixed implementation to test all
6573         possibilities.
6574         (MemberBase): Detection whether member is explicit interface
6575         implementation is now in constructor.
6576         (MemberBase.UpdateMemberName): Handles IndexerName.
6577         (Accessor): Changed to keep also location information.
6578         (AbstractPropertyEventMethod): Is derived from MemberCore.
6579         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6580         will be emited or not.
6581         (PropertyBase.AreAccessorsDuplicateImplementation):
6582         Tests whether accessors are not in collision with some method.
6583         (Operator): Is derived from MethodCore to simplify common
6584         operations.
6585
6586         * decl.cs (Flags.TestMethodDuplication): Test for duplication
6587         must be performed.
6588         (DeclSpace.AddToContainer): Adds the member to defined_names
6589         table. It tests for duplications and enclosing name conflicts.
6590
6591         * enum.cs (EnumMember): Clean up to reuse the base structures
6592
6593 2004-09-03  Martin Baulig  <martin@ximian.com>
6594
6595         Merged latest changes into gmcs.  Please keep this comment in
6596         here, it makes it easier for me to see what changed in MCS since
6597         the last time I merged.
6598
6599 2004-09-03  Martin Baulig  <martin@ximian.com>
6600
6601         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6602         into TypeContainer, to make partial classes work again.
6603
6604 2004-09-03  Martin Baulig  <martin@ximian.com>
6605
6606         * rootcontext.cs (RootContext.V2): Removed.
6607
6608 2004-03-23  Martin Baulig  <martin@ximian.com>
6609
6610         * expression.cs (Invocation.OverloadResolve): Added `bool
6611         may_fail' argument and use it instead of the Location.IsNull() hack.
6612
6613 2004-09-09  Martin Baulig  <martin@ximian.com>
6614
6615         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6616
6617 2004-09-09  Martin Baulig  <martin@ximian.com>
6618
6619         * generic.cs (TypeParameter.DefineType): Added support for
6620         explicit interface methods.
6621
6622 2004-09-09  Martin Baulig  <martin@ximian.com>
6623
6624         * README.Changes: New document.  Started to list important changes
6625         between MCS and GMCS here.
6626
6627 2004-09-08  Martin Baulig  <martin@ximian.com>
6628
6629         * class.cs
6630         (TypeContainer.CheckRecursiveDefinition): New protected method.
6631         (TypeContainer.DefineType): Move the CS0146 check into
6632         CheckRecursiveDefinition().     
6633
6634 2004-09-06  Martin Baulig  <martin@ximian.com>
6635
6636         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6637         types for the constructor constraint.
6638
6639 2004-09-03  Martin Baulig  <martin@ximian.com>
6640
6641         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6642         into TypeContainer, to make partial classes work again.
6643
6644 2004-09-03  Martin Baulig  <martin@ximian.com>
6645
6646         * rootcontext.cs (RootContext.V2): Removed.
6647
6648 2004-03-23  Martin Baulig  <martin@ximian.com>
6649
6650         * expression.cs (Invocation.OverloadResolve): Added `bool
6651         may_fail' argument and use it instead of the Location.IsNull() hack.
6652
6653 2004-09-03  Martin Baulig  <martin@ximian.com>
6654
6655         Merged latest changes into gmcs.  Please keep this comment in
6656         here, it makes it easier for me to see what changed in MCS since
6657         the last time I merged.
6658
6659 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6660
6661         Fix #61128.
6662         * expression.cs (BetterConversion): Don't allow either conversion 
6663         to be null.  Remove redundant implicit conversion test when 'q ==
6664         null' -- when this function is invoked, we already know that the
6665         implicit conversion exists.
6666         (BetterFunction): Assume that 'best' is non-null.  Remove
6667         redundant reimplementation of IsApplicable when 'best' is null.
6668         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6669         number of arguments.
6670         (IsAncestralType): Extract from OverloadResolve.
6671         (OverloadResolve): Make robust to the MethodGroupExpr being
6672         unsorted.  Implement all the logic of Section 14.5.5.1, and
6673         support overloading of methods from multiple applicable types.
6674         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6675
6676         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6677         (RealError, Warning): Append type of report to related symbol.
6678
6679 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6680
6681         * enum.cs: Fixed CLS-Compliance checks for enum members.
6682         Error tests cs3008-8.cs, cs3014-8.cs
6683
6684 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6685
6686         Fixed bug #62342, #63102
6687         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6688         like ImplementMethod.
6689
6690 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6691
6692         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6693         Fixed bug #65170.
6694
6695 2004-09-02  Martin Baulig  <martin@ximian.com>
6696
6697         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6698         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6699         on the MethodBase.
6700
6701 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6702
6703         C# 2.0 Static classes implemented
6704
6705         * class.cs (TypeContainer): instance_constructors,
6706         initialized_fields, initialized_static_fields,
6707         default_constructor, base_inteface_types are protected to be
6708         accessible from StaticClass.
6709         (TypeContainer.DefineDefaultConstructor): New virtual method
6710         for custom default constructor generating
6711         (StaticClass): New class to handle "Static classes" feature.
6712
6713         * cs-parser.jay: Handle static keyword on class like instance
6714         of StaticClass.
6715
6716         * driver.cs: Added "/langversion" command line switch with two
6717         options (iso-1, default).
6718
6719 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6720
6721         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6722
6723 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6724
6725         * delegate.cs: Style.
6726
6727 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6728
6729         * delegate.cs: Add seperate instance expr field for miguel.
6730
6731 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6732
6733         * PointerArithmetic (Resolve): make sure we are not doing
6734         pointer arith on void*. Also, make sure we are resolved
6735         by not setting eclass until resolve.
6736
6737         All callers: Make sure that PointerArithmetic gets resolved.
6738
6739 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6740
6741         * ArrayCreation (LookupType): If the type does not resolve 
6742         to an array, give an error.
6743
6744 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6745
6746         * statement.cs (Try.Resolve): Fixed bug #64222
6747
6748 2004-08-27  Martin Baulig  <martin@ximian.com>
6749
6750         * class.cs
6751         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6752         crash here.     
6753
6754 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6755
6756         * ecore.cs (Constantify): Get underlying type via
6757         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6758         Windows in special cases.
6759
6760 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6761
6762         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6763         for obtaining also private methods.
6764         (GetRemoveMethod): Used GetRemoveMethod (true)
6765         for obtaining also private methods.
6766
6767 2004-09-02  Martin Baulig  <martin@ximian.com>
6768
6769         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6770         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6771         on the MethodBase.
6772
6773 2004-08-27  Martin Baulig  <martin@ximian.com>
6774
6775         * class.cs
6776         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6777         crash here.     
6778
6779 2004-08-25  Martin Baulig  <martin@ximian.com>
6780
6781         * support.cs (ReflectionParameters..ctor): If this is a generic
6782         method, retrieve and store its type parameters.
6783         (InternalParameters..ctor): Added `TypeParameter[]' argument.
6784         (ReflectionParameters.GenericConstraints): The argument specifies
6785         the type parameter, not the method parameter.
6786         (InternalParameters.GenericConstraints): Likewise.
6787
6788         * generic.cs (TypeParameter.DefineType): Correctly handle
6789         constraints wrt. generic methods in interfaces and their
6790         implementations.        
6791
6792 2004-08-24  Martin Baulig  <martin@ximian.com>
6793
6794         * generic.cs (TypeParameter.IsSubclassOf): New public method.
6795         (Constraints.IsSubclassOf): New internal method.
6796
6797         * typemanager.cs (TypeManager.FindMembers): Added special support
6798         for GenericTypeParameterBuilder's.      
6799         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6800         type parameters.
6801
6802 2004-08-24  Martin Baulig  <martin@ximian.com>
6803
6804         * typemanager.cs
6805         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6806         this for accessibility checks.
6807         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6808         IsNestedFamilyAccessible.
6809         (TypeManager.IsSubclassOf): New method, do what the name actually
6810         says.   
6811
6812 2004-08-24  Martin Baulig  <martin@ximian.com>
6813
6814         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6815         as a SimpleName, include the generic arity.
6816
6817 2004-08-24  Martin Baulig  <martin@ximian.com>
6818
6819         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6820         MethodAttributes.HideBySig for operators.
6821
6822 2004-08-23  Martin Baulig  <martin@ximian.com>
6823
6824         Back to the old error reporting system :-)
6825
6826         * report.cs (Message): Removed.
6827         (Report.MessageData, ErrorData, WarningData): Removed.
6828         (Report.Error, Warning): Back to the old system.
6829
6830 2004-08-23  Martin Baulig  <martin@ximian.com>
6831
6832         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6833
6834         * class.cs (TypeContainer.ParentContainer): New public virtual
6835         method; replaces the explicit interface implementation.
6836         (ClassPart.ParentContainer): Override.
6837
6838 2004-08-23  Martin Baulig  <martin@ximian.com>
6839
6840         * statement.cs (Switch): Added support for constant switches; see
6841         #59428 or test-285.cs.
6842
6843 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6844
6845         Fixed bug #62740.
6846         * statement.cs (GetEnumeratorFilter): Removed useless
6847         logic because C# specs is strict. GetEnumerator must be
6848         public.
6849
6850 2004-08-22  Martin Baulig  <martin@ximian.com>
6851
6852         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6853         a switch and may break, reset the barrier.  Fixes #59867.
6854
6855 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6856
6857         CLS-Compliance speed up (~5% for corlib)
6858
6859         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6860         New method. Tests container for CLS-Compliant names
6861
6862         * class.cs (TypeContainer.VerifyClsName): New method.
6863         Checks whether container name is CLS Compliant.
6864         (Constructor): Implements IMethodData.
6865
6866         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6867         low-case table for CLS Compliance test.
6868         (MemberCache.VerifyClsParameterConflict): New method.
6869         Checks method parameters for CS3006 error.
6870
6871         * enum.cs (EnumMember): Is derived from MemberCore.
6872         (Enum.VerifyClsName): Optimized for better performance.
6873
6874 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6875
6876         * report.cs: Renamed Error_T to Error and changed all
6877         references.
6878
6879 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6880
6881         * class.cs (TypeContainer.IndexerArrayList): New inner class
6882         container for indexers.
6883         (TypeContainer.DefaultIndexerName): New constant for default
6884         indexer name. Replaced all "Item" with this constant.
6885         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6886
6887         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6888         DefaultMemberAttribute constructor.
6889
6890 2004-08-05  Martin Baulig  <martin@ximian.com>
6891
6892         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6893         Fix bug #59429.
6894
6895 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6896
6897         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6898         multi platforms problem.
6899
6900         * compiler.csproj: Included shared files.
6901
6902 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6903
6904         Fix bug 60333, 55971 in the more general way
6905         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6906         Added arg_type argument for constant conversion.
6907         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6908
6909 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6910
6911         Fix bug #59760
6912         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6913         OperatorArrayList, MethodCoreArrayList for typecontainer
6914         containers. Changed class member types to these new types.
6915         (MethodArrayList.DefineMembers): Added test for CS0659.
6916
6917 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6918
6919         * cfold.cs: Synchronize the folding with the code in expression.cs
6920         Binary.DoNumericPromotions for uint operands.
6921
6922         * attribute.cs: Revert patch from Raja, it introduced a regression
6923         while building Blam-1.2.1 (hard to isolate a test case).
6924
6925 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6926
6927         Fix for #55382
6928         * class.cs:
6929         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6930         name collision.
6931         (MethodCore.parent_method): New member. The method we're overriding
6932         if this is an override method.
6933         (MethodCore.CheckBase): Moved from Method class and made common.
6934         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6935         private.
6936         (MethodCore.CheckForDuplications): New abstract method. For custom
6937         member duplication search in a container
6938         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6939         method and its return type.
6940         (Event.conflict_symbol): New member. Symbol with same name in the
6941         parent class.
6942
6943         * decl.cs:
6944         (MemberCache.FindMemberWithSameName): New method. The method
6945         is looking for conflict with inherited symbols.
6946
6947 2004-08-04  Martin Baulig  <martin@ximian.com>
6948
6949         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6950
6951         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6952
6953 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6954
6955         * report.cs (Message): New enum for better error, warning reference in
6956         the code.
6957         (MessageData): New inner abstract class. It generally handles printing of
6958         error and warning messages.
6959         Removed unused Error, Warning, Message methods.
6960
6961 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6962
6963         Fix for cs0592-8.cs test
6964         * attribute.cs
6965         (Attributable.ValidAttributeTargets): Made public.
6966         (Attribute.ExplicitTarget): New member for explicit target value.
6967         (Attribute.CheckTargets): Now we translate explicit attribute
6968         target to Target here.
6969
6970 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6971
6972         * ecore.cs (MethodGroupExpr): new IsBase property.
6973
6974         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6975
6976         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6977         rather than an instance expr.
6978
6979         (DelegateCreation.Emit): Use the method group rather than
6980         the instance expression. Also, if you have base.Foo as the
6981         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6982
6983         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6984
6985         (NewDelegate.DoResolve): Only check for the existance of Invoke
6986         if the method is going to be needed. Use MethodGroupExpr.
6987
6988         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6989
6990         * expression.cs: For pointer arith., make sure to use
6991         the size of the type, not the size of the pointer to
6992         the type.
6993
6994 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6995
6996         Fix for #60722
6997         * class.cs (Class): Added error CS0502 test.
6998
6999 2004-08-03  John Luke  <jluke@cfl.rr.com>
7000             Raja R Harinath  <rharinath@novell.com>
7001
7002         Fix for #60997.
7003         * attribute.cs (Attribute.complained_before): New flag.
7004         (Attribute.ResolveType, Attribute.Resolve),
7005         (Attribute.DefinePInvokeMethod): Set it.
7006         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7007         
7008 2004-08-03  Martin Baulig  <martin@ximian.com>
7009
7010         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7011         use a user-defined operator; we still need to do numeric
7012         promotions in case one argument is a builtin type and the other
7013         one has an implicit conversion to that type.  Fixes #62322.
7014
7015 2004-08-18  Martin Baulig  <martin@ximian.com>
7016
7017         * class.cs (Method.Define): Use the correct method name when
7018         creating the MethodBuilder for a generic method.
7019
7020 2004-08-17  Martin Baulig  <martin@ximian.com>
7021
7022         * generic.cs (Constraints): Support type parameter constraints.
7023
7024 2004-08-16  Martin Baulig  <martin@ximian.com>
7025
7026         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7027         (Token.GENERIC_DIMENSION): New token; this is returned if we
7028         encounter an unbound generic type in a typeof() expression.
7029
7030         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7031         this token is only generated while parsing a typeof() expression.
7032         (typeof_expression): Removed the old unbound_type hack.
7033
7034         * generic.cs (TypeArguments.IsUnbound): New public property.
7035
7036         * decl.cs (MemberName): Added support for unbound types.
7037
7038 2004-08-14  Martin Baulig  <martin@ximian.com>
7039
7040         * typemanager.cs
7041         (TypeManager.IsEqualGenericInstance): New static method.
7042         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7043         just used to check accessibility, so follow the rules of 26.1.6.        
7044
7045         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7046         ConstructedType instead of a TypeExpression if we have type arguments.
7047
7048         * cs-parser.jay (typeof_expression): Support unbound generic types.
7049
7050         * ecore.cs (UnboundTypeExpression): New public class.
7051
7052 2004-08-12  Martin Baulig  <martin@ximian.com>
7053
7054         * typemanager.cs (TypeManager.IsNestedChildOf): Use
7055         TypeManager.IsEqual() rather than `=='.
7056
7057         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7058         generic instances as well.
7059
7060 2004-08-12  Martin Baulig  <martin@ximian.com>
7061
7062         * expression.cs (Invocation.InferType): We can only infer method
7063         type parameters.  Fixes #62647.
7064
7065 2004-08-11  Martin Baulig  <martin@ximian.com>
7066
7067         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7068         before resolving the base classes.
7069
7070 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7071
7072         * Makefile: install .mdb file too.
7073
7074 2004-08-05  Martin Baulig  <martin@ximian.com>
7075
7076         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7077         initializer, the current type is just the TypeBuilder, not the
7078         instantiated generic type.
7079         (FieldExpr.IsFieldInitializer): New public property.
7080
7081 2004-08-04  Martin Baulig  <martin@ximian.com>
7082
7083         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7084
7085         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7086
7087 2004-08-03  Martin Baulig  <martin@ximian.com>
7088
7089         * class.cs (MethodData.Define): If we're an explicit
7090         implementation, remove the generic arity from the type name.
7091
7092 2004-08-03  Martin Baulig  <martin@ximian.com>
7093
7094         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7095         use a user-defined operator; we still need to do numeric
7096         promotions in case one argument is a builtin type and the other
7097         one has an implicit conversion to that type.  Fixes #62322.
7098
7099 2004-08-02  Martin Baulig  <martin@ximian.com>
7100
7101         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7102         `TypeExpr[]' array.
7103         (TypeContainer.GetClassBases): Return the unexpanded list of
7104         interfaces; we expand them later.
7105         (TypeContainer.DefineType): After creating the TypeBuilder, call
7106         TypeManager.ExpandInterfaces() to get an expanded and resolved
7107         list of interfaces.
7108
7109         * ecore.cs (TypeExpr.GetInterfaces): Removed
7110
7111         * generics.cs (Constraints.InterfaceConstraints): Remove.
7112         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7113         register the interface constraints.
7114
7115         * typemanager.cs
7116         (TypeManager.AddUserType): Removed the `ifaces' argument.
7117         (TypeManager.AddTypeParameter): Likewise.
7118         (TypeManager.AddUserInterface): Removed, was unused.
7119         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7120         `TypeExpr[]' array for the interfaces.
7121         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7122         has been defined, returns a list of the resolved interfaces types.
7123         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7124         (TypeManager.GetExplicitInterfaces): Likewise.  
7125
7126 2004-08-02  Martin Baulig  <martin@ximian.com>
7127
7128         * expression.cs (Invocation.EmitCall): If we're invoking a method
7129         on a type parameter, use the new `Constrained' prefix opcode.
7130
7131 2004-08-02  Martin Baulig  <martin@ximian.com>
7132
7133         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7134         (LocalInfo.IsThis): New public property.
7135         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7136
7137 2004-08-01  Martin Baulig  <martin@ximian.com>
7138
7139         * class.cs (TypeContainer.GetClassBases): Don't set the default
7140         here since we may get called from GetPartialBases().
7141         (TypeContainer.DefineType): If GetClassBases() didn't return a
7142         parent, use the default one.
7143
7144 2004-07-30  Martin Baulig  <martin@ximian.com>
7145
7146         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7147
7148         * class.cs (SourceMethod): New public class, derive from the
7149         symbol writer's ISourceMethod.
7150         (Method): Use the new symbol writer API.
7151
7152         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7153         as argument and use the new symbol writer.
7154
7155         * location.cs
7156         (SourceFile): Implement the symbol writer's ISourceFile.
7157         (Location.SymbolDocument): Removed.
7158         (Location.SourceFile): New public property.
7159
7160         * symbolwriter.cs: Use the new symbol writer API.
7161
7162 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7163
7164         * Makefile (install-local): Remove.  Functionality moved to
7165         executable.make.
7166
7167 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7168
7169         * Makefile: Install mcs.exe.config file together with mcs.exe.
7170         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7171         correct runtime version.
7172         
7173 2004-07-25  Martin Baulig  <martin@ximian.com>
7174
7175         * class.cs
7176         (TypeContainer.RegisterOrder): Removed, this was unused.
7177         (TypeContainer, interface_order): Removed.
7178         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7179         TypeContainer as argument since we can also be called with a
7180         `PartialContainer' for a partial class/struct/interface.
7181         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7182         of checking whether we're an `Interface' - we could be a
7183         `PartialContainer'.
7184         (PartialContainer.Register): Override; call
7185         AddClass()/AddStruct()/AddInterface() on our parent.
7186
7187         * cs-parser.jay (interface_member_declaration): Add things to the
7188         `current_container', not the `current_class'.
7189
7190         * rootcontext.cs (RegisterOrder): The overloaded version which
7191         takes an `Interface' was unused, removed.
7192
7193         * typemanager.cs (TypeManager.LookupInterface): Return a
7194         `TypeContainer', not an `Interface'.
7195         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7196         contain a `PartialContainer' for an interface, so check it's
7197         `Kind' to figure out what it is.
7198
7199 2004-07-25  Martin Baulig  <martin@ximian.com>
7200
7201         * class.cs (Class.DefaultTypeAttributes): New public constant.
7202         (Struct.DefaultTypeAttributes): Likewise.
7203         (Interface.DefaultTypeAttributes): Likewise.
7204         (PartialContainer.TypeAttr): Override this and add the
7205         DefaultTypeAttributes.
7206
7207 2004-07-25  Martin Baulig  <martin@ximian.com>
7208
7209         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7210         we can just use the `Parent' field instead.
7211
7212 2004-07-25  Martin Baulig  <martin@ximian.com>
7213
7214         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7215
7216 2004-07-25  Martin Baulig  <martin@ximian.com>
7217
7218         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7219         our parts before defining any methods.
7220         (TypeContainer.VerifyImplements): Make this virtual.
7221         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7222         on our PartialContainer.
7223
7224 2004-07-25  Martin Baulig  <martin@ximian.com>
7225
7226         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7227
7228         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7229         argument, we can just use the `Parent' field instead.
7230
7231         * class.cs
7232         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7233         (MemberBase.DoDefine): Likewise.
7234
7235 2004-07-24  Martin Baulig  <martin@ximian.com>
7236
7237         * decl.cs (MemberCore.Parent): New public field.
7238         (DeclSpace.Parent): Moved to MemberCore.
7239
7240         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7241         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7242         parent's .ctor.
7243         (FieldBase, Field, Operator): Likewise.
7244         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7245         (EventField, Event): Likewise.
7246
7247 2004-07-23  Martin Baulig  <martin@ximian.com>
7248
7249         * class.cs (PartialContainer): New public class.
7250         (ClassPart): New public class.
7251         (TypeContainer): Added support for partial classes.
7252         (TypeContainer.GetClassBases): Splitted some of the functionality
7253         out into GetNormalBases() and GetPartialBases().
7254
7255         * cs-tokenizer.cs (Token.PARTIAL): New token.
7256         (Tokenizer.consume_identifier): Added some hacks to recognize
7257         `partial', but only if it's immediately followed by `class',
7258         `struct' or `interface'.
7259
7260         * cs-parser.jay: Added support for partial clases.
7261
7262 2004-07-23  Martin Baulig  <martin@ximian.com>
7263
7264         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7265         a `DeclSpace' and also made it readonly.
7266         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7267         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7268         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7269
7270         * cs-parser.jay: Pass the `current_class', not the
7271         `current_container' (at the moment, this is still the same thing)
7272         to a new Method, Property, Event, Indexer or Constructor.
7273
7274 2004-07-23  Martin Baulig  <martin@ximian.com>
7275
7276         * cs-parser.jay (CSharpParser): Added a new `current_class' field
7277         and removed the `current_interface' one.
7278         (struct_declaration, class_declaration, interface_declaration):
7279         Set `current_class' to the newly created class/struct/interface;
7280         set their `Bases' and call Register() before parsing their body.
7281
7282 2004-07-23  Martin Baulig  <martin@ximian.com>
7283
7284         * class.cs (Kind): New public enum.
7285         (TypeContainer): Made this class abstract.
7286         (TypeContainer.Kind): New public readonly field.
7287         (TypeContainer.CheckDef): New public method; moved here from
7288         cs-parser.jay.
7289         (TypeContainer.Register): New public abstract method.
7290         (TypeContainer.GetPendingImplementations): New public abstract
7291         method.
7292         (TypeContainer.GetClassBases): Removed the `is_class' and
7293         `is_iface' parameters.
7294         (TypeContainer.DefineNestedTypes): Formerly known as
7295         DoDefineType().
7296         (ClassOrStruct): Made this class abstract.
7297
7298         * tree.cs (RootTypes): New public type. 
7299
7300 2004-07-20  Martin Baulig  <martin@ximian.com>
7301
7302         * tree.cs (Tree.RecordNamespace): Removed.
7303         (Tree.Namespaces): Removed.
7304
7305         * rootcontext.cs (RootContext.IsNamespace): Removed.
7306
7307         * cs-parser.jay (namespace_declaration): Just create a new
7308         NamespaceEntry here.
7309
7310 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
7311
7312         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
7313         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
7314         entry to make sure it runs in the correct runtime version.
7315         
7316 2004-07-18  Martin Baulig  <martin@ximian.com>
7317
7318         * generic.cs (ConstructedType.CheckConstraints): Improved
7319         constraints checking.
7320
7321 2004-07-18  Martin Baulig  <martin@ximian.com>
7322
7323         * expression.cs (Invocation.BetterMethod): Call
7324         TypeManager.TypeToCoreType() on all types and removed my previous
7325         hack; we're already doig the right thing here.
7326
7327 2004-07-17  Martin Baulig  <martin@ximian.com>
7328
7329         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
7330
7331 2004-07-16  Martin Baulig  <martin@ximian.com>
7332
7333         * iterators.cs: Added generics support.
7334
7335 2004-07-16  Martin Baulig  <martin@ximian.com>
7336
7337         * iterators.cs: Rewrote this.  We're now using one single Proxy
7338         class for both the IEnumerable and the IEnumerator interface and
7339         `Iterator' derives from Class so we can use the high-level API.
7340
7341         * class.cs (TypeContainer.AddIterator): New method.
7342         (TypeContainer.DoDefineType): New protected virtual method, which
7343         is called from DefineType().
7344         (TypeContainer.DoDefineMembers): Call DefineType() and
7345         DefineMembers() on all our iterators.
7346         (TypeContainer.Emit): Call Emit() on all our iterators.
7347         (TypeContainer.CloseType): Call CloseType() on all our iterators.
7348
7349         * codegen.cs (EmitContext.CurrentIterator): New public field.
7350
7351 2004-07-15  Martin Baulig  <martin@ximian.com>
7352
7353         * typemanager.cs
7354         (TypeManager.not_supported_exception_type): New type.   
7355
7356 2004-07-14  Martin Baulig  <martin@ximian.com>
7357
7358         * typemanager.cs
7359         (TypeManager.generic_ienumerable_type): New type.
7360         (TypeManager.generic_ienumerator_type): New type.
7361
7362         * rootcontext.cs
7363         (RootContext.interfaces_first_stage): Added
7364         "System.Collections.Generic.IEnumerator`1" and
7365         "System.Collections.Generic.IEnumerable`1".     
7366
7367 2004-07-14  Martin Baulig  <martin@ximian.com>
7368
7369         * iterators.cs: Use real error numbers.
7370
7371 2004-07-14  Martin Baulig  <martin@ximian.com>
7372
7373         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7374         requires this to be a System.Collection.IEnumerable and not a
7375         class implementing that interface.
7376         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
7377
7378 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
7379
7380         * class.cs: Fixed previous fix, it broke some error tests.
7381
7382 2004-07-12  Martin Baulig  <martin@ximian.com>
7383
7384         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7385         Fixes #61293.
7386
7387 2004-07-14  Martin Baulig  <martin@ximian.com>
7388
7389         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
7390         an exclamation mark (!) for the generic arity to reflect the
7391         latest spec changes; ie. use "System.Collections.Generic.IList`1".
7392
7393 2004-07-13  Martin Baulig  <martin@ximian.com>
7394
7395         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
7396         specifiers being part of a type argument.
7397
7398 2004-07-13  Martin Baulig  <martin@ximian.com>
7399
7400         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
7401         name for generic types.
7402
7403 2004-07-13  Martin Baulig  <martin@ximian.com>
7404
7405         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
7406         bit to fix #60119.
7407
7408 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
7409
7410         * assign.cs (LocalTemporary): Add new argument: is_address,If
7411         `is_address' is true, then the value that we store is the address
7412         to the real value, and not the value itself.
7413         
7414         * ecore.cs (PropertyExpr): use the new local temporary
7415         stuff to allow us to handle X.Y += z (where X is a struct)
7416
7417 2004-07-08  Martin Baulig  <martin@ximian.com>
7418
7419         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7420         not always return, just like we're doing in Using.Resolve().
7421
7422 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
7423
7424         * cs-parser.jay (fixed_statement): flag this as Pinned.
7425
7426 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
7427
7428         * typemanager.cs (TypeManager): Removed MakePinned method, this
7429         mechanism is replaced with the .NET 2.x compatible mechanism of
7430         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7431
7432         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
7433         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7434         `IsFixed' property which has a different meaning.
7435
7436 2004-07-02  Raja R Harinath  <rharinath@novell.com>
7437
7438         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7439         visible from inside a nested class, not just the names of the
7440         immediately enclosing class.
7441         Fix for bug #60730.
7442
7443 2004-06-24  Raja R Harinath  <rharinath@novell.com>
7444
7445         * expression.cs (BetterConversion): Remove buggy special-case
7446         handling of "implicit constant expression conversions".  At this
7447         point, we already know that the conversion is possible -- we're
7448         only checking to see which is better.
7449
7450 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7451
7452         * cs-parser.jay: Added error CS0210 test.
7453
7454 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7455
7456         * cs-parser.jay: Added error CS0134 test.
7457
7458 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7459
7460         Fix bug #52507
7461         * cs-parser.jay: Added error CS0145 test.
7462
7463 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7464
7465         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7466
7467 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
7468         
7469         * expression.cs (StackAlloc.Resolve): The argument may not
7470         be a constant; deal with this case.
7471         
7472 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
7473
7474         * attribute.cs (IndexerName_GetIndexerName): Renamed to
7475         GetIndexerAttributeValue.
7476         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7477
7478         * class.cs (Indexer.Define): Added error tests for CS0415,
7479         CS0609.
7480
7481 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
7482
7483         * attribute.cs (Attribute.Resolve): Keep field code in sync with
7484         property code.
7485
7486 2004-06-23  Martin Baulig  <martin@ximian.com>
7487
7488         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7489         neither return nor throw, reset the barrier as well.  Fixes #60457.
7490
7491 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
7492
7493         * class.cs : EventAttributes is now set to None by default.
7494           This fixes bug #60459.
7495
7496 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7497
7498         Fix bug #60219
7499         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7500         Don't throw exception but return null (it's sufficient now).
7501
7502 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7503
7504         * typemanager.cs (GetArgumentTypes): Faster implementation.
7505
7506 2004-06-18  Martin Baulig  <martin@ximian.com>
7507
7508         * attribute.cs (Attribute.Resolve): Check whether we're an
7509         EmptyCast which a Constant child.  Fixes #60333.
7510
7511 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7512
7513         * statement.cs (EmitCollectionForeach): Account for the fact that
7514         not all valuetypes are in areas which we can take the address of.
7515         For these variables, we store to a temporary variable. Also, make
7516         sure that we dont emit a `callvirt' on a valuetype method.
7517
7518 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7519
7520         * expression.cs (StackAlloc.DoReSolve): Added test for
7521         negative parameter (CS0247).
7522
7523 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7524
7525         Fix bug #59792
7526         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7527
7528 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7529
7530         Fix bug #59781
7531         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7532         ulong.
7533
7534 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7535
7536         Fix bug #58254 & cs1555.cs, cs1556.cs
7537         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7538
7539 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7540
7541         * cs-parser.jay: Added error CS1669 test for indexers.
7542
7543 2004-06-18  Martin Baulig  <martin@ximian.com>
7544
7545         * generics.cs (GenericMethod.ctor): Don't take an Attributes
7546         argument.  Fixes #60441.
7547
7548 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
7549         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7550         The name needs to have the actual name of the method in order
7551         for other tests (such as the one in OverloadResolve for Invoke
7552         on a delegate) to work. As well, it does not really help
7553         error reporting because the method group had multiple methods.
7554         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7555         Make profiling work.
7556         
7557 2004-06-13  Martin Baulig  <martin@ximian.com>
7558
7559         * cs-parser.jay: Don't allow generic attributes.
7560
7561 2004-06-13  Martin Baulig  <martin@ximian.com>
7562
7563         * class.cs (MemberBase.DoDefineBase): New protected method.
7564         (MemberBase.DoDefine): Compute the `flags' in the new
7565         DoDefineBase() which must be called first.
7566         (Method.Define): Call DoDefineBase() first so we have the flags
7567         when defining the generic method.
7568
7569         * cs-parser.jay (interface_method_declaration): Support generic methods.
7570
7571 2004-06-13  Martin Baulig  <martin@ximian.com>
7572
7573         * decl.cs (TypeName): Removed.
7574         (MemberName): Removed TypeName and MemberNow; now we just have
7575         MemberName.
7576
7577         * cs-parser.jay: Don't distinguish between type arguments and type
7578         parameters in the grammar and simplified the rules a bit.  The
7579         reduce/reduce conflicts are now gone (except the one we inherited
7580         from mcs).
7581
7582 2004-06-11  Martin Baulig  <martin@ximian.com>
7583
7584         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7585         call this twice: for params and varargs methods.
7586
7587 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7588
7589         * class.cs:
7590         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7591
7592 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7593
7594         * attribute.cs (Attribute.GetValidTargets): Made public.
7595
7596         * class.cs: 
7597         (AbstractPropertyEventMethod): New class for better code sharing.
7598         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7599         CS1667 report.
7600         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7601
7602 2004-06-09  Martin Baulig  <martin@ximian.com>
7603
7604         * cs-parser.jay: Removed a reduce/reduce conflict.
7605
7606 2004-06-03  Martin Baulig  <martin@ximian.com>
7607
7608         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7609         GetSimpleName() and return a SimpleName.
7610
7611         * ecore.cs (SimpleName.Arguments): New public field.
7612         (SimpleName): Added overloaded ctor which takes an additional
7613         TypeArguments argument.
7614         (SimpleName.SimpleNameResolve): Added support for generic methods.
7615         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
7616         formerly in MemberAccess.DoResolve(), but we also need it in
7617         SimpleNameResolve().
7618
7619         * expression.cs (MemberAccess.DoResolve): Use the new
7620         MethodGroupExpr.ResolveGeneric().       
7621
7622 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7623
7624         * decl.cs: If possible, use lookuptypedirect here. We can only do
7625         this if there is no `.' after the namespace. Avoids using
7626         LookupType, which does lots of slow processing.
7627         (FindNestedType) New method, does what it says :-).
7628         * namespace.cs: use LookupTypeDirect.
7629         * rootcontext.cs: use membercache, if possible.
7630         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7631
7632 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7633
7634         * expression.cs:
7635         According to the spec, 
7636
7637         In a member access of the form E.I, if E is a single identifier,
7638         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7639         field, property, localvariable, or parameter with the same type as
7640         the meaning of E as a type-name (§3.8), then both possible
7641         meanings of E are permitted.
7642
7643         We did not check that E as a simple-name had the same type as E as
7644         a type name.
7645
7646         This trivial check gives us 5-7% on bootstrap time.
7647
7648 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7649
7650         * expression.cs (Invocation.OverloadResolve): Avoid the
7651         use of hashtables and boxing here by allocating on demand.
7652
7653 2004-05-30  Martin Baulig  <martin@ximian.com>
7654
7655         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7656         we're doing a silent lookup.  Don't try to lookup nested types in
7657         TypeManager.object_type (thanks to Ben Maurer).
7658
7659 2004-05-30  Martin Baulig  <martin@ximian.com>
7660
7661         Committing a patch from Ben Maurer.
7662
7663         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7664
7665 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7666
7667         * convert.cs: add a trivial cache for overload operator resolution.
7668
7669 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
7670
7671         * attribute.cs
7672         (AttributeTester.GetObsoleteAttribute): Returns instance of
7673         ObsoleteAttribute when type is obsolete.
7674
7675         * class.cs
7676         (TypeContainer.VerifyObsoleteAttribute): Override.
7677         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7678         (MethodCode.VerifyObsoleteAttribute): Override.
7679         (MemberBase.VerifyObsoleteAttribute): Override.
7680
7681         * decl.cs
7682         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7683         and report proper error.
7684
7685         *delegate.cs
7686         (Delegate.VerifyObsoleteAttribute): Override.
7687
7688         * ecore.cs
7689         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7690         and report proper error.
7691         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7692
7693         * enum.cs
7694         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7695         and enum member.
7696
7697         * expression.cs
7698         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7699         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7700         Added test for ObsoleteAttribute.
7701
7702         * statement.cs
7703         (Catch): Derived from Statement.
7704
7705 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7706
7707         * decl.cs: If possible, use lookuptypedirect here. We can only do
7708         this if there is no `.' after the namespace. Avoids using
7709         LookupType, which does lots of slow processing.
7710         (FindNestedType) New method, does what it says :-).
7711         * namespace.cs: use LookupTypeDirect.
7712         * rootcontext.cs: use membercache, if possible.
7713         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7714
7715 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7716
7717         * expression.cs:
7718         According to the spec, 
7719
7720         In a member access of the form E.I, if E is a single identifier,
7721         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7722         field, property, localvariable, or parameter with the same type as
7723         the meaning of E as a type-name (§3.8), then both possible
7724         meanings of E are permitted.
7725
7726         We did not check that E as a simple-name had the same type as E as
7727         a type name.
7728
7729         This trivial check gives us 5-7% on bootstrap time.
7730
7731 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7732
7733         Fixed bug #59071 & cs0160.cs
7734         * statement.cs (Try.Resolve): Check here whether order of catch
7735         clauses matches their dependencies.
7736
7737 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7738
7739         Fixed bug #58624
7740         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7741         unsafe type.
7742
7743 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7744
7745         * expression.cs (Invocation.OverloadResolve): Avoid the
7746         use of hashtables and boxing here by allocating on demand.
7747
7748 2004-05-30  Martin Baulig  <martin@ximian.com>
7749
7750         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7751         we're doing a silent lookup.  Don't try to lookup nested types in
7752         TypeManager.object_type (thanks to Ben Maurer).
7753
7754 2004-05-30  Martin Baulig  <martin@ximian.com>
7755
7756         Committing a patch from Ben Maurer.
7757
7758         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
7759
7760 2004-05-29  Martin Baulig  <martin@ximian.com>
7761
7762         * class.cs (IMethodData.ShouldIgnore): New method.
7763
7764         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7765         `Location' argument, we don't need it anywhere.  Use
7766         `IMethodData.ShouldIgnore ()' instead of
7767         `MethodData.GetMethodFlags ()'.
7768         (TypeManager.AddMethod): Removed.
7769         (TypeManager.AddMethod2): Renamed to AddMethod.
7770
7771 2004-05-29  Martin Baulig  <martin@ximian.com>
7772
7773         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7774
7775         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7776         converting from a class type S to an interface type and we already
7777         have an object on the stack, don't box it again.  Fixes #52578.
7778
7779 2004-05-29  Martin Baulig  <martin@ximian.com>
7780
7781         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7782         Added support for `params' parameters.  Fixes #59267.
7783
7784 2004-05-29  Martin Baulig  <martin@ximian.com>
7785
7786         * literal.cs (NullPointer): Provide a private .ctor which sets
7787         `type' to TypeManager.object_type.  Fixes #59048.
7788
7789 2004-05-29  Martin Baulig  <martin@ximian.com>
7790
7791         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7792         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7793
7794         * ecore.cs (EventExpr.instance_expr): Make the field private.
7795
7796 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7797
7798         Fixed bug #50080 & cs0214-2.cs
7799         * expression.cs (Cast.DoResolve): Check unsafe context here.
7800         
7801         * statement.cs (Resolve.DoResolve): Likewise.
7802
7803 2004-05-26  Martin Baulig  <martin@ximian.com>
7804
7805         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7806
7807         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7808         (RootContext.LookupType): Pass down the `silent' flag.
7809
7810 2004-05-25  Martin Baulig  <martin@ximian.com>
7811
7812         * expression.cs
7813         (MethodGroupExpr.IdenticalTypeName): New public property.
7814         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7815         expression actually refers to a type.
7816
7817 2004-05-25  Martin Baulig  <martin@ximian.com>
7818
7819         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7820         for #56176 and made it actually work.
7821
7822 2004-05-25  Martin Baulig  <martin@ximian.com>
7823
7824         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7825         (FieldExpr, PropertyExpr): Override and implement
7826         CacheTemporaries.  Fixes #52279.
7827
7828 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7829
7830         * location.cs: In the new compiler listing a file twice is a
7831         warning, not an error.
7832
7833 2004-05-24  Martin Baulig  <martin@ximian.com>
7834
7835         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7836         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7837
7838 2004-05-24  Martin Baulig  <martin@ximian.com>
7839
7840         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7841         walking the `using' list.  Fixes #53921.
7842
7843 2004-05-24  Martin Baulig  <martin@ximian.com>
7844
7845         * const.cs (Const.LookupConstantValue): Added support for
7846         EmptyCast's; fixes #55251.
7847
7848 2004-05-24  Martin Baulig  <martin@ximian.com>
7849
7850         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7851         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7852         which does the CS0135 check.  The reason is that we first need to
7853         check whether the variable actually exists.
7854
7855 2004-05-24  Martin Baulig  <martin@ximian.com>
7856
7857         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7858         than RootContext.LookupType() to find the explicit interface
7859         type.  Fixes #58584.
7860
7861 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7862
7863         * Makefile: Simplify.  Use executable.make.
7864         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7865
7866 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7867
7868         * decl.cs:
7869         * enum.cs:
7870         Use the invariant culture when doing String.Compare for CLS case
7871         sensitivity.
7872         
7873 2004-05-23  Martin Baulig  <martin@ximian.com>
7874
7875         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7876         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7877
7878         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7879
7880 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7881
7882         * class.cs (MemberBase.Define): Reuse MemberType member for 
7883         resolved type. Other methods can use it too.
7884
7885 2004-05-23  Martin Baulig  <martin@ximian.com>
7886
7887         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7888         the variable also exists in the current block (otherwise, we need
7889         to report a CS0103).  Fixes #58670.
7890
7891 2004-05-23  Martin Baulig  <martin@ximian.com>
7892
7893         * flowanalysis.cs (Reachability.Reachable): Compute this
7894         on-the-fly rather than storing it as a field.
7895
7896 2004-05-23  Martin Baulig  <martin@ximian.com>
7897
7898         * flowanalysis.cs (Reachability.And): Manually compute the
7899         resulting `barrier' from the reachability.      
7900        
7901 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7902
7903         Fix bug #57835
7904         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7905         instance of ObsoleteAttribute when symbol is obsolete.
7906
7907         * class.cs
7908         (IMethodData): Extended interface for ObsoleteAttribute support.
7909
7910 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7911
7912         * attribute.cs: Fix bug #55970
7913
7914 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7915
7916         Fix bug #52705
7917         * attribute.cs
7918         (GetObsoleteAttribute): New method. Creates the instance of
7919         ObsoleteAttribute.
7920         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7921         ObsoleteAttribute when member is obsolete.
7922         (AttributeTester.Report_ObsoleteMessage): Common method for
7923         Obsolete error/warning reporting.
7924
7925         * class.cs
7926         (TypeContainer.base_classs_type): New member for storing parent type.
7927
7928         * decl.cs
7929         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7930         for this MemberCore.
7931
7932 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7933
7934         * attribute.cs, const.cs: Fix bug #58590
7935
7936 2004-05-21  Martin Baulig  <martin@ximian.com>
7937
7938         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7939         out parameters if the end of the method is unreachable.  Fixes
7940         #58098. 
7941
7942 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7943
7944         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7945         Hari was right, why extra method.
7946
7947 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7948
7949         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7950
7951 2004-05-20  Martin Baulig  <martin@ximian.com>
7952
7953         * delegate.cs: Convert this file to Unix mode - like the original
7954         version in mcs is.
7955
7956 2004-05-20  Martin Baulig  <martin@ximian.com>
7957
7958         * attribute.cs: Convert this file to Unix mode - like the original
7959         version in mcs is.
7960
7961 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7962
7963        Fix bug #58688 (MCS does not report error when the same attribute
7964        is assigned twice)
7965
7966        * attribute.cs (Attribute.Emit): Distinction between null and default.
7967
7968 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7969
7970        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7971        of a top-level attribute without an attribute target.
7972        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7973        Make non-static.
7974        (Attribute.Conditional_GetConditionName), 
7975        (Attribute.Obsolete_GetObsoleteMessage): Update.
7976        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7977        part of ScanForIndexerName.
7978        (Attribute.CanIgnoreInvalidAttribute): New function.
7979        (Attribute.ScanForIndexerName): Move to ...
7980        (Attributes.ScanForIndexerName): ... here.
7981        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7982        (Attributes.Search): New internal variant that can choose not to
7983        complain if types aren't resolved.  The original signature now
7984        complains.
7985        (Attributes.GetClsCompliantAttribute): Use internal variant, with
7986        complaints suppressed.
7987        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7988        only if it not useful.
7989        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7990        top-level for attributes that are shared between the assembly
7991        and a top-level class.
7992        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7993        * class.cs: Update to reflect changes.
7994        (DefineIndexers): Fuse loops.
7995        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7996        a couple more variants of attribute names.
7997
7998 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7999
8000         Fix bug #52585 (Implemented explicit attribute declaration)
8001
8002         * attribute.cs:
8003         (Attributable.ValidAttributeTargets): New abstract method. It gets
8004         list of valid attribute targets for explicit target declaration.
8005         (Attribute.Target): It holds target itself.
8006         (AttributeSection): Removed.
8007         (Attribute.CheckTargets): New method. It checks whether attribute
8008         target is valid for the current element.
8009
8010         * class.cs:
8011         (EventProperty): New class. For events that are declared like
8012         property (with add and remove accessors).
8013         (EventField): New class. For events that are declared like field.
8014         class.cs
8015
8016         * cs-parser.jay: Implemented explicit attribute target declaration.
8017
8018         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8019         Override ValidAttributeTargets.
8020
8021         * parameter.cs:
8022         (ReturnParameter): Class for applying custom attributes on 
8023         the return type.
8024         (ParameterAtribute): New class. Class for applying custom
8025         attributes on the parameter type.
8026
8027 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8028
8029         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8030         definitions. 
8031
8032         (Method): Allow UNSAFE here.
8033
8034         * modifiers.cs: Support unsafe reporting.
8035
8036 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8037
8038         * decl.cs: Fix bug #58478.
8039
8040 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8041
8042         * statement.cs: When checking for unreachable code on an EmptyStatement,
8043         set the location. Fixes bug #58488.
8044
8045 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8046
8047         * driver.cs: Add -pkg handling.
8048
8049         From Gonzalo: UseShelLExecute=false
8050
8051 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8052
8053         * attribute.cs:
8054         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8055         for attribute.
8056         (Attribute.IsClsCompliaceRequired): Moved to base for better
8057         accesibility.
8058         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8059         when attribute is AttributeUsageAttribute.
8060         (Attribute.GetValidTargets): Simplified.
8061         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8062         attribute for this type.
8063         (Attribute.ApplyAttributes): Method renamed to Emit and make
8064         non-static.
8065         (GlobalAttributeSection): New class for special handling of global
8066         attributes (assembly, module).
8067         (AttributeSection.Emit): New method.
8068
8069         * class.cs: Implemented Attributable abstract methods.
8070         (MethodCore.LabelParameters): Moved to Parameter class.
8071         (Accessor): Is back simple class.
8072         (PropertyMethod): Implemented Attributable abstract class.
8073         (DelegateMethod): Implemented Attributable abstract class.
8074         (Event): New constructor for disctintion between normal Event
8075         and Event with accessors.
8076
8077         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8078
8079         * codegen.cs, const.cs, decl.cs, delegate.cs:
8080         (CommonAssemblyModulClass): Implemented Attributable abstract class
8081         and simplified.
8082
8083         * enum.cs: Implement IAttributeSupport interface.
8084         (EnumMember): New class for emum members. Implemented Attributable
8085         abstract class
8086
8087         * parameter.cs:
8088         (ParameterBase): Is abstract.
8089         (ReturnParameter): New class for easier [return:] attribute handling.
8090
8091         * typemanager.cs: Removed builder_to_attr.
8092
8093 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8094
8095         Fix bug #57151.
8096         * attribute.cs (Attribute.GetPositionalValue): New function.
8097         * class.cs (TypeContainer.VerifyMembers): New function.
8098         (TypeContainer.Emit): Use it.
8099         (ClassOrStruct): New base class for Class and Struct.
8100         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8101         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8102         class.
8103         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8104         then each non-static field should have a FieldOffset attribute.
8105         Otherwise, none of the fields should have a FieldOffset attribute.
8106         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8107         and FieldOffset attributes.
8108         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8109         (TypeManager.field_offset_attribute_type): New core types.
8110         (TypeManager.InitCoreTypes): Initialize them.
8111
8112 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8113
8114         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8115         Return correct type.
8116         From bug #58270.
8117
8118 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8119
8120         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8121         be implicitly converted to ulong.
8122         
8123         * expression.cs: The logic for allowing operator &, | and ^ worked
8124         was wrong, it worked before because we did not report an error in
8125         an else branch.  Fixes 57895.
8126
8127         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8128         allow volatile fields to be reference types.
8129
8130 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8131
8132         * driver.cs: Add support for /debug-
8133
8134 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8135
8136         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8137         Add a 'complain' parameter to silence errors.
8138         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8139         silently overlooked type-resolutions.
8140         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8141         to reflect changes.
8142         (Attributes.Search): New function.
8143         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8144         (Attributes.GetAttributeFullName): Remove hack.
8145         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
8146         Update to reflect changes.
8147         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8148         Use Attributes.Search instead of nested loops.
8149
8150 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
8151
8152         * decl.cs:
8153         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8154         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8155         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8156
8157         * report.cs: (Report.Warning): Renamed to Warning_T because of
8158         parameter collision.
8159
8160 2004-05-05  Raja R Harinath  <rharinath@novell.com>
8161
8162         * expression.cs (MemberAccess.ResolveMemberAccess):
8163         Exit with non-zero status after Report.Error.
8164         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8165         Likewise.
8166         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8167
8168 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8169
8170         * support.cs: Don't hang when the file is empty.
8171
8172 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8173
8174         * support.cs: In SeekableStreamReader, compute the preamble size of the
8175           underlying stream. Position changes should take into account that initial
8176           count of bytes.
8177
8178 2004-05-03  Todd Berman  <tberman@sevenl.net>
8179
8180         * driver.cs: remove unused GetSysVersion function.
8181
8182 2004-05-03  Todd Berman  <tberman@sevenl.net>
8183
8184         * driver.cs: Remove the hack from saturday, as well as the hack
8185         from jackson (LoadAssemblyFromGac), also adds the CWD to the
8186         link_paths to get that bit proper.
8187
8188 2004-05-01  Todd Berman  <tberman@sevenl.net>
8189
8190         * driver.cs: Try a LoadFrom before a Load, this checks the current
8191         path. This is currently a bug in mono that is be fixed, however, this
8192         provides a workaround for now. This will be removed when the bug
8193         is fixed.
8194
8195 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
8196
8197         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8198         incomplete key pairs (#57941).
8199
8200 2004-05-01  Todd Berman  <tberman@sevenl.net>
8201
8202         * driver.cs: Remove '.' from path_chars, now System.* loads properly
8203         from the GAC
8204
8205 2004-04-30  Jackson Harper  <jackson@ximian.com>
8206
8207         * codegen.cs: Open keys readonly.
8208         
8209 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8210
8211         * typemanager.cs: don't report cyclic struct layout when a struct
8212         contains 2 or more fields of the same type. Failed for Pango.AttrShape
8213         which has 2 Pango.Rectangle fields.
8214
8215 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8216
8217         * expression.cs: Handle IntPtr comparisons with IL code
8218         rather than a method call.
8219
8220 2004-04-29  Martin Baulig  <martin@ximian.com>
8221
8222         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
8223         the list of PropertyInfo's in class hierarchy and find the
8224         accessor.  Fixes #56013.
8225
8226 2004-04-29  Martin Baulig  <martin@ximian.com>
8227
8228         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8229
8230 2004-04-29  Martin Baulig  <martin@ximian.com>
8231
8232         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8233
8234         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8235
8236 2004-04-29  Martin Baulig  <martin@ximian.com>
8237
8238         * class.cs (ConstructorInitializer.Resolve): Check whether the
8239         parent .ctor is accessible.  Fixes #52146.
8240
8241 2004-04-29  Martin Baulig  <martin@ximian.com>
8242
8243         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8244
8245         * statement.cs (Using.EmitLocalVariableDecls): Use
8246         TypeManager.idisposable_type, not typeof (IDisposable).
8247         (Foreach.EmitCollectionForeach): Added support for valuetypes.
8248
8249 2004-04-29  Martin Baulig  <martin@ximian.com>
8250
8251         * class.cs (Event.Define): Don't emit the field and don't set
8252         RTSpecialName and SpecialName for events on interfaces.  Fixes
8253         #57703. 
8254
8255 2004-04-29  Raja R Harinath  <rharinath@novell.com>
8256
8257         Refactor Attribute.ApplyAttributes.
8258         * attribute.cs (Attributable): New base class for objects that can
8259         have Attributes applied on them.
8260         (Attribute): Make AttributeUsage fields public.
8261         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8262         (Attribute.IsInternalCall): New property.
8263         (Attribute.UsageAttr): Convert to a public read-only property.
8264         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8265         (Attribute.ResolveType, Attribute.Resolve)
8266         (Attribute.ScanForIndexerName): Update to reflect changes.
8267         (Attribute.CheckAttributeTarget): Re-format.
8268         (Attribute.ApplyAttributes): Refactor, to various
8269         Attributable.ApplyAttributeBuilder methods.
8270         * decl.cs (MemberCore): Make Attributable.
8271         * class.cs (Accessor): Make Attributable.
8272         (MethodData.ApplyAttributes): Use proper attribute types, not
8273         attribute names.
8274         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8275         (TypeContainer.ApplyAttributeBuilder)
8276         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8277         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
8278         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8279         (Operator.ApplyAttributeBuilder): New factored-out methods.
8280         * const.cs (Const.ApplyAttributeBuilder): Likewise.
8281         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8282         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8283         * parameter.cs (ParameterBase): New Attributable base class
8284         that can also represent Return types.
8285         (Parameter): Update to the changes.
8286
8287 2004-04-29  Jackson Harper  <jackson@ximian.com>
8288
8289         * driver.cs: Prefer the corlib system version when looking for
8290         assemblies in the GAC. This is still a hack, but its a better hack
8291         now.
8292         
8293 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
8294
8295         * decl.cs, enum.cs: Improved error 3005 reporting.
8296   
8297         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8298         (related_symbols): New private member for list of symbols
8299         related to reported error/warning.
8300         
8301         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8302
8303 2004-04-29  Martin Baulig  <martin@ximian.com>
8304
8305         * ecore.cs (Expression.Constantify): If we're an enum and
8306         TypeManager.TypeToCoreType() doesn't give us another type, use
8307         t.UnderlyingSystemType.  Fixes #56178.  
8308
8309 2004-04-29  Martin Baulig  <martin@ximian.com>
8310
8311         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8312         interfaces and for each interface, only add members directly
8313         declared in that interface.  Fixes #53255.
8314
8315 2004-04-28  Martin Baulig  <martin@ximian.com>
8316
8317         * expression.cs (ConditionalLogicalOperator): Use a temporary
8318         variable for `left' to avoid that we evaluate it more than once;
8319         bug #52588.
8320
8321 2004-04-28  Martin Baulig  <martin@ximian.com>
8322
8323         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8324         `void[]' (CS1547).
8325
8326 2004-04-28  Martin Baulig  <martin@ximian.com>
8327
8328         * statement.cs (LocalInfo.Resolve): Check whether the type is not
8329         void (CS1547).
8330
8331         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8332         whether the type is not void (CS1547).
8333
8334 2004-04-28  Martin Baulig  <martin@ximian.com>
8335
8336         * expression.cs (Unary.DoResolveLValue): Override this and report
8337         CS0131 for anything but Operator.Indirection.
8338
8339 2004-04-28  Martin Baulig  <martin@ximian.com>
8340
8341         Committing a patch from Ben Maurer; see bug #50820.
8342
8343         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8344         check for classes.
8345
8346         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8347         classes.        
8348
8349 2004-04-28  Martin Baulig  <martin@ximian.com>
8350
8351         Committing a patch from Ben Maurer; see bug #50820.
8352
8353         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8354         check for classes.
8355
8356         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8357         classes.        
8358
8359 2004-04-28  Martin Baulig  <martin@ximian.com>
8360
8361         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8362         (Block.AddLabel): Call DoLookupLabel() to only search in the
8363         current block.
8364
8365 2004-04-28  Martin Baulig  <martin@ximian.com>
8366
8367         * cfold.cs (ConstantFold.BinaryFold): Added special support for
8368         comparing StringConstants and NullLiterals in Equality and Inequality.
8369
8370 2004-04-28  Jackson Harper  <jackson@ximian.com>
8371
8372         * driver.cs: Attempt to load referenced assemblies from the
8373         GAC. This is the quick and dirty version of this method that
8374         doesnt take into account versions and just takes the first
8375         canidate found. Will be good enough for now as we will not have more
8376         then one version installed into the GAC until I update this method.
8377
8378 2004-04-28  Martin Baulig  <martin@ximian.com>
8379
8380         * typemanager.cs (TypeManager.CheckStructCycles): New public
8381         static method to check for cycles in the struct layout.
8382
8383         * rootcontext.cs (RootContext.PopulateTypes): Call
8384         TypeManager.CheckStructCycles() for each TypeContainer.
8385         [Note: We only need to visit each type once.]
8386
8387 2004-04-28  Martin Baulig  <martin@ximian.com>
8388
8389         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8390
8391         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8392         success and added `out object value'.  Use a `bool resolved' field
8393         to check whether we've already been called rather than
8394         `ConstantValue != null' since this breaks for NullLiterals.
8395
8396 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8397
8398         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8399         setting of this flag, since the 'set' method may be non-public.
8400
8401 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8402
8403         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8404         check on current_vector.Block.
8405
8406 2004-04-27  Martin Baulig  <martin@ximian.com>
8407
8408         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8409         a field initializer.  Fixes #56459.
8410
8411 2004-04-27  Martin Baulig  <martin@ximian.com>
8412
8413         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8414         we're not attempting to use an indexer.  Fixes #52154.
8415
8416 2004-04-27  Martin Baulig  <martin@ximian.com>
8417
8418         * statement.cs (Return): Don't create a return label if we don't
8419         need it; reverts my change from January 20th.  Thanks to Ben
8420         Maurer for this.
8421
8422 2004-04-27  Martin Baulig  <martin@ximian.com>
8423
8424         According to the spec, `goto' can only leave a nested scope, but
8425         never enter it.
8426
8427         * statement.cs (Block.LookupLabel): Only lookup in the current
8428         block, don't recurse into parent or child blocks.
8429         (Block.AddLabel): Check in parent and child blocks, report
8430         CS0140/CS0158 if we find a duplicate.
8431         (Block): Removed this indexer for label lookups.
8432         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8433         this already does the error reporting for us.
8434
8435         * flowanalysis.cs
8436         (FlowBranching.UsageVector.Block): New public variable; may be null.
8437         (FlowBranching.CreateSibling): Added `Block' argument.
8438         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
8439         label for the target of a `goto' and check whether we're not
8440         leaving a `finally'.
8441
8442 2004-04-27  Martin Baulig  <martin@ximian.com>
8443
8444         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8445         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8446         just for returns).
8447
8448 2004-04-27  Martin Baulig  <martin@ximian.com>
8449
8450         * statement.cs (Block.AddLabel): Also check for implicit blocks
8451         and added a CS0158 check.
8452
8453 2004-04-27  Martin Baulig  <martin@ximian.com>
8454
8455         * flowanalysis.cs (FlowBranchingLoop): New class.
8456         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8457         UsageVector's instead of an ArrayList.
8458         (FlowBranching.Label): Likewise.
8459         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8460         (FlowBranching.AddBreakVector): New method.
8461
8462 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
8463
8464         * attribute.cs: Small regression fix: only convert the type if we
8465         the type is different, fixes System.Drawing build.
8466
8467 2004-04-27  Martin Baulig  <martin@ximian.com>
8468
8469         * attribute.cs (Attribute.Resolve): If we have a constant value
8470         for a named field or property, implicity convert it to the correct
8471         type.
8472
8473 2004-04-27  Raja R Harinath  <rharinath@novell.com>
8474
8475         * statement.cs (Block.Block): Implicit blocks share
8476         'child_variable_names' fields with parent blocks.
8477         (Block.AddChildVariableNames): Remove.
8478         (Block.AddVariable): Mark variable as "used by a child block" in
8479         every surrounding block.
8480         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8481         been used in a child block, complain about violation of "Invariant
8482         meaning in blocks" rule.
8483         * cs-parser.jay (declare_local_variables): Don't use
8484         AddChildVariableNames.
8485         (foreach_statement): Don't create an implicit block: 'foreach'
8486         introduces a scope.
8487
8488 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
8489
8490         * convert.cs (ImplicitNumericConversion): 0 is also positive when
8491         converting from 0L to ulong.  Fixes 57522.
8492
8493 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8494
8495         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8496         derived class hides via 'new' keyword field from base class (test-242.cs).
8497         TODO: Handle this in the more general way.
8498         
8499         * class.cs (CheckBase): Ditto.
8500
8501 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8502
8503         * decl.cs (caching_flags): New member for storing cached values
8504         as bit flags.
8505         (MemberCore.Flags): New enum where bit flags for caching_flags
8506         are defined.
8507         (MemberCore.cls_compliance): Moved to caching_flags.
8508         (DeclSpace.Created): Moved to caching_flags.
8509
8510         * class.cs: Use caching_flags instead of DeclSpace.Created
8511         
8512 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
8513
8514         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8515         if we are only a derived class, not a nested class.
8516
8517         * typemanager.cs: Same as above, but do this at the MemberLookup
8518         level (used by field and methods, properties are handled in
8519         PropertyExpr).   Allow for the qualified access if we are a nested
8520         method. 
8521
8522 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
8523
8524         * class.cs: Refactoring.
8525         (IMethodData): New inteface; Holds links to parent members
8526         to avoid member duplication (reduced memory allocation).
8527         (Method): Implemented IMethodData interface.
8528         (PropertyBase): New inner classes for get/set methods.
8529         (PropertyBase.PropertyMethod): Implemented IMethodData interface
8530         (Event): New inner classes for add/remove methods.
8531         (Event.DelegateMethod): Implemented IMethodData interface.
8532
8533         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8534         EmitContext (related to class.cs refactoring).
8535
8536 2004-04-21  Raja R Harinath  <rharinath@novell.com>
8537
8538         * delegate.cs (Delegate.VerifyApplicability): If the number of
8539         arguments are the same as the number of parameters, first try to
8540         verify applicability ignoring  any 'params' modifier on the last
8541         parameter.
8542         Fixes #56442.
8543
8544 2004-04-08  Martin Baulig  <martin@ximian.com>
8545
8546         Merged latest changes into gmcs.  Please keep this comment in
8547         here, it makes it easier for me to see what changed in MCS since
8548         the last time I merged.
8549
8550 2004-04-16  Raja R Harinath  <rharinath@novell.com>
8551
8552         * class.cs (TypeContainer.AddIndexer): Use
8553         'ExplicitInterfaceName' to determine if interface name was
8554         explicitly specified.  'InterfaceType' is not initialized at this time.
8555         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
8556         Indexers array is already in the required order.  Initialize
8557         'IndexerName' only if there are normal indexers.
8558         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8559         (TypeContainer.Emit): Emit DefaultMember attribute only if
8560         IndexerName is initialized.
8561         Fixes #56300.
8562
8563 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
8564
8565         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8566         Fixes #57007
8567
8568 2004-04-15  Raja R Harinath  <rharinath@novell.com>
8569
8570         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8571         attributes.
8572         Fix for #56456.
8573
8574         * attribute.cs (Attribute.Resolve): Check for duplicate named
8575         attributes.
8576         Fix for #56463.
8577
8578 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
8579
8580         * iterators.cs (MarkYield): track whether we are in an exception,
8581         and generate code accordingly.  Use a temporary value to store the
8582         result for our state.
8583
8584         I had ignored a bit the interaction of try/catch with iterators
8585         since their behavior was not entirely obvious, but now it is
8586         possible to verify that our behavior is the same as MS .NET 2.0
8587
8588         Fixes 54814
8589
8590 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
8591
8592         * iterators.cs: Avoid creating temporaries if there is no work to
8593         do. 
8594
8595         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8596         Enumerations, use TypeManager.EnumToUnderlying and call
8597         recursively. 
8598
8599         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8600         bug #57013
8601
8602         (This.Emit): Use EmitContext.EmitThis to emit our
8603         instance variable.
8604
8605         (This.EmitAssign): Ditto.
8606
8607         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8608         codepaths, we will move all the functionality into
8609         Mono.CSharp.This 
8610
8611         (FieldExpr.EmitAssign): Ditto.
8612
8613         This fixes several hidden bugs that I uncovered while doing a code
8614         review of this today.
8615
8616         * codegen.cs (EmitThis): reworked so the semantics are more clear
8617         and also support value types "this" instances.
8618
8619         * iterators.cs: Changed so that for iterators in value types, we
8620         do not pass the value type as a parameter.  
8621
8622         Initialization of the enumerator helpers is now done in the caller
8623         instead of passing the parameters to the constructors and having
8624         the constructor set the fields.
8625
8626         The fields have now `assembly' visibility instead of private.
8627
8628 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
8629
8630         * expression.cs (Argument.Resolve): Check if fields passed as ref
8631         or out are contained in a MarshalByRefObject.
8632
8633         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8634         another compiler type.
8635
8636 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8637
8638         * class.cs (Indexer.Define): use the new name checking method.
8639         Also, return false on an error.
8640         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8641         (is_identifier_[start/part]_character): make static.
8642
8643 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
8644
8645         * expression.cs (Binary.ResolveOperator): Do no append strings
8646         twice: since we can be invoked more than once (array evaluation)
8647         on the same concatenation, take care of this here.  Based on a fix
8648         from Ben (bug #56454)
8649
8650 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8651
8652         * codegen.cs: Fix another case where CS1548 must be reported (when 
8653         delay-sign isn't specified and no private is available #56564). Fix
8654         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8655         error when MCS is used on the MS runtime and we need to delay-sign 
8656         (which seems unsupported by AssemblyBuilder - see #56621).
8657
8658 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
8659
8660         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8661         (TypeManager.ComputeNamespaces): Faster implementation for
8662         Microsoft runtime.
8663
8664         * compiler.csproj: Updated AssemblyName to mcs.
8665
8666 2004-05-11  Jackson Harper  <jackson@ximian.com>
8667
8668         * Makefile: Preserve MONO_PATH
8669         
8670 2004-05-11  Jackson Harper  <jackson@ximian.com>
8671
8672         * Makefile: Use mono and mcs to build gmcs
8673         
8674 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
8675
8676         * codegen.cs: Add patch from Robert Shade
8677         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8678         sync with mcs.
8679
8680 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
8681
8682         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8683         incomplete key pairs (#57941).
8684
8685 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8686
8687         * codegen.cs: Fix another case where CS1548 must be reported (when 
8688         delay-sign isn't specified and no private is available #56564). Fix
8689         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8690         error when MCS is used on the MS runtime and we need to delay-sign 
8691         (which seems unsupported by AssemblyBuilder - see #56621).
8692
8693 2004-04-29  Jackson Harper  <jackson@ximian.com>
8694
8695         * Makefile: Set MONO_PATH to use the bootstrap corlib
8696         * driver.cs: Check the GAC for referenced assemblies.
8697                 
8698 2004-04-29  Martin Baulig  <martin@ximian.com>
8699
8700         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8701
8702 2004-04-07  Martin Baulig  <martin@ximian.com>
8703
8704         * expression.cs (Binary.ResolveOperator): Added special case for
8705         Equality/Inequality between a type parameter and a null literal.
8706
8707 2004-04-07  Martin Baulig  <martin@ximian.com>
8708
8709         * convert.cs: Check null literal -> type parameter conversions.
8710
8711 2004-04-07  Martin Baulig  <martin@ximian.com>
8712
8713         * generic.cs (ConstructedType.CheckConstraints): Enforce the
8714         `class' and `struct' constraints.
8715
8716 2004-04-07  Martin Baulig  <martin@ximian.com>
8717
8718         * generic.cs (SpecialConstraint): New public enum.
8719         (Constraints.Resolve): Added support for the `class' and `struct'
8720         constraints.
8721
8722         * cs-parser.jay (type_parameter_constraint): Added support for the
8723         `class' and `struct' constraints.
8724
8725 2004-04-07  Martin Baulig  <martin@ximian.com>
8726
8727         * support.cs (GenericConstraints): Replaced `Types' by
8728         `ClassConstraint' and `InterfaceConstraints'; added
8729         `HasClassConstraint'.   
8730
8731 2004-04-07  Martin Baulig  <martin@ximian.com>
8732
8733         * generic.cs
8734         (Constraints.InterfaceConstraints): New public property.
8735         (Constraints.Types): Make this property public
8736         (TypeParameter): Implement IMemberContainer.
8737         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8738         instead of a TypeBuilder/MethodBuilder; pass the interface
8739         constraints to TypeManager.AddTypeParameter().
8740         (TypeParameter.DefineType): Just take an EmitContext and no
8741         TypeBuilder/MethodBuilder.  Use the new public API.
8742
8743         * typemanager.cs (TypeManager.AddTypeParameter): Added
8744         `TypeExpr[]' argument; add the interfaces to the
8745         `builder_to_ifaces' hash.
8746         (TypeManager.LookupMemberContainer): For
8747         GenericTypeParameterBuilders, get the TypeParameter from the
8748         `builder_to_type_param'.
8749         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8750         the TypeParameter and call FindMembers on it.
8751
8752 2004-04-07  Martin Baulig  <martin@ximian.com>
8753
8754         * class.cs
8755         (MethodCore.GenericMethod): Moved this field here from Method.
8756         (MethodCore.IsDuplicateImplementation): Take the number of type
8757         parameters into account if we're a generic method.
8758
8759         * expression.cs (Invocation.InferTypeArguments): Don't return true
8760         if `arguments' is null; we still need to check whether we actually
8761         don't need to infer anything in this case.
8762         (MemberAccess): Merged the functionality from GenericMemberAccess
8763         into this class.
8764
8765         * generic.cs (GenericMemberAccess): Removed.
8766
8767 2004-04-05  Martin Baulig  <martin@ximian.com>
8768
8769         * decl.cs (MemberCore): For generic classes, interfaces and
8770         structs, `Name' now includes the number of type parameters
8771         ("Stack!1.Node!1").
8772         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8773         encode the number of type arguments in the type name.
8774
8775         * expression.cs (Expression.MemberLookup): Removed the
8776         `num_type_args' argument; we now encode the number of type
8777         arguments in the type name.
8778
8779         * ecore.cs (SimpleName): Encode the number of type arguments in
8780         the type name itself.
8781
8782         * generic.cs (ConstructedType): Likewise.
8783
8784         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8785         `MemberName'; we now include the number of type parameters in the
8786         type name.
8787
8788         * typemanager.cs (TypeManager.CheckGeneric): Removed.
8789         (TypeManager.MemberLookup): Removed the
8790         `num_type_args' argument; we now encode the number of type
8791         arguments in the type name.     
8792
8793 2004-04-03  Martin Baulig  <martin@ximian.com>
8794
8795         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8796         (MemberCore.MemberName): Moved here from MemberBase.
8797         (DeclSpace.SetParameterInfo): Just take the constraints as an
8798         ArrayList; we already have the type parameters in our
8799         `MemberName'; also do the CS0080 reporting here.
8800
8801         * cs-parser.jay (struct_declaration): Use `member_name' instead of
8802         `IDENTIFIER opt_type_parameter_list'; when constructing our
8803         `MemberName', it'll already include our type parameters.
8804         (class_declaration, interface_declaration): Likewise.
8805         (delegate_declaration): Likewise.
8806         (MakeName): Take a MemberName and return a MemberName.
8807         The following two changes are required to avoid shift/reduce conflicts:
8808         (member_name): Don't include a TypeName anymore; ie. this is now
8809         just 'IDENTIFIER opt_type_parameter_list'.
8810         (property_declaration, event_declaration): Use a
8811         `namespace_or_type_name' instead of a `member_name'.            
8812
8813 2004-04-03  Martin Baulig  <martin@ximian.com>
8814
8815         * decl.cs (MemberName): Renamed to `TypeName' and created a new
8816         `MemberName' class.
8817         (TypeName): Formerly known as MemberName.
8818
8819         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8820         instead of a `MemberName'.
8821
8822         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8823         (member_name): New rule; create a MemberName.
8824
8825 2004-04-02  Martin Baulig  <martin@ximian.com>
8826
8827         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8828         (CS0305 and CS0308).
8829
8830 2004-04-02  Martin Baulig  <martin@ximian.com>
8831
8832         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8833         support for nested types.
8834
8835 2004-04-02  Martin Baulig  <martin@ximian.com>
8836
8837         * ecore.cs (IAlias): New public interface.
8838         (TypeExpr, TypeExpression): Implement IAlias.
8839         (TypeAliasExpression): New public class.
8840
8841         * namespace.cs (Namespace): Implement IAlias.
8842         (Namespace.Lookup): Return an IAlias instead on an object.
8843         (Namespace.DefineName): Take an IAlias instead of an object.
8844         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8845         an object.
8846         (NamespaceEntry.UsingAlias): Take a Membername instead of an
8847         Expression.
8848         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8849         object.
8850         (NamespaceEntry.Lookup): Likewise.
8851
8852         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8853         instead of a Type.      
8854
8855         * decl.cs (DeclSpace): Implement IAlias.
8856         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8857
8858         * generic.cs (ConstructedType): Improved error checking.
8859
8860 2004-04-02  Martin Baulig  <martin@ximian.com>
8861
8862         * convert.cs: Added type parameter conversions.
8863
8864         * ecore.cs
8865         (UnboxCast.Emit): Emit an `unbox.any' for type params.
8866         (ClassCast.Emit): If the source type is a type parameter, box it.
8867         If the target type is a type parameter, emit an `unbox.any'
8868         instead of a `classcast'.1      
8869
8870 2004-04-01  Martin Baulig  <martin@ximian.com>
8871
8872         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8873
8874 2004-04-01  Martin Baulig  <martin@ximian.com>
8875
8876         * generic.cs (ConstructedType.CheckConstraints): Use
8877         Convert.ImplicitStandardConversionExists(); user-defined implicit
8878         conversions are not allowed according to the spec.
8879
8880 2004-03-30  Martin Baulig  <martin@ximian.com>
8881
8882         * expression.cs (New): Added support for type parameters.
8883
8884         * typemanager.cs
8885         (TypeManager.activator_type): New public static field.
8886         (TypeManager.activator_create_instance): Likewise.
8887
8888 2004-03-30  Martin Baulig  <martin@ximian.com>
8889
8890         * typemanager.cs (TypeManager.HasConstructorConstraint): New
8891         public method.
8892
8893 2004-03-30  Martin Baulig  <martin@ximian.com>
8894
8895         * generic.cs (ConstructedType.CheckConstraints): Actually follow
8896         the spec here: the argument type must be convertible to the
8897         constraints.
8898
8899 2004-03-30  Martin Baulig  <martin@ximian.com>
8900
8901         * generic.cs
8902         (TypeParameter.Define, TypeParameter.DefineMethod): Call
8903         TypeManager.AddTypeParameter().
8904         (ConstructedType.CheckConstraints): Re-enable this and actually
8905         check whether we have a constructor constraint.
8906
8907         * typemanager.cs
8908         (TypeManager.builder_to_type_param): New static field.
8909         (TypeManager.AddTypeParameter): New static method.
8910         (TypeManager.LookupTypeParameter): New public method.
8911
8912 2004-03-30  Martin Baulig  <martin@ximian.com>
8913
8914         * generic.cs (TypeParameter.DefineType): Return a boolean and use
8915         the new API to actually define the constructor constraint.
8916
8917         * typemanager.cs
8918         (TypeManager.new_constraint_attr_type): New static field.
8919         (TypeManager.InitCoreTypes): Initialize it.
8920
8921 2004-03-30  Martin Baulig  <martin@ximian.com>
8922
8923         * generic.cs (Constraints): Completed error checking, use correct
8924         error numbers.
8925
8926 2004-03-29  Martin Baulig  <martin@ximian.com>
8927
8928         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8929
8930         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8931         public version which takes a `ParameterData pd' instead of an
8932         `ArrayList args'.
8933
8934 2004-03-29  Martin Baulig  <martin@ximian.com>
8935
8936         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8937         not a MethodInfo.       
8938
8939 2004-03-29  Martin Baulig  <martin@ximian.com>
8940
8941         * expression.cs (Argument.ResolveMethodGroup): If we're a
8942         ConstructedType, call GetMemberAccess() on it.  
8943
8944 2004-03-29  Martin Baulig  <martin@ximian.com>
8945
8946         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8947         (MethodCore.CheckGenericOverride): When overriding a generic
8948         method, check whether the constraints match.
8949
8950         * support.cs (GenericConstraints): New public interface.
8951         (ParameterData.GenericConstraints): New public method.
8952
8953         * parameter.cs (Parameter.Resolve): Check whether we're a generic
8954         method parameter and compute our constraints if appropriate.
8955         (Parameter.GenericConstraints): New public property.
8956
8957         * generic.cs (Constraints): Implement GenericConstraints.
8958
8959 2004-03-29  Martin Baulig  <martin@ximian.com>
8960
8961         * decl.cs (MemberCache.FindMemberToOverride): Use
8962         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8963
8964 2004-03-29  Martin Baulig  <martin@ximian.com>
8965
8966         * generic.cs (GenericMethod.Define): Resolve our type parameters.
8967
8968 2004-03-29  Martin Baulig  <martin@ximian.com>
8969
8970         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8971         not allowed on non-generic declarations").
8972
8973 2004-03-29  Martin Baulig  <martin@ximian.com>
8974
8975         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8976         public version of this method.
8977
8978         * class.cs (MethodCore.IsDuplicateImplementation): Use
8979         Invocation.InferTypeArguments() to check this.
8980
8981 2004-03-29  Martin Baulig  <martin@ximian.com>
8982
8983         * convert.cs: Use TypeManager.IsDelegateType() instead of
8984         comparing types correctly.
8985
8986 2004-03-29  Martin Baulig  <martin@ximian.com>
8987
8988         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8989         types directly to make it work for generic instances.
8990
8991         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8992
8993 2004-03-29  Martin Baulig  <martin@ximian.com>
8994
8995         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8996         support for arrays.     
8997
8998 2004-03-24  Martin Baulig  <martin@ximian.com>
8999
9000         * decl.cs (DeclSpace.FindType): Also use
9001         TypeManager.CheckGeneric() for types from the using clauses.
9002
9003 2004-03-23  Martin Baulig  <martin@ximian.com>
9004
9005         * expression.cs (Invocation.OverloadResolve): Added `bool
9006         may_fail' argument and use it instead of the Location.IsNull() hack.
9007
9008 2004-03-23  Martin Baulig  <martin@ximian.com>
9009
9010         * expression.cs (Invocation.InferType): Use correct type inference
9011         rules here.     
9012
9013 2004-03-23  Martin Baulig  <martin@ximian.com>
9014
9015         * ecore.cs (MethodGroupExpr.Name): Use
9016         TypeManager.CSharpSignature() instead of just the name.
9017
9018         * expression.cs (Invocation.OverloadResolve): Provide better error
9019         reporting.
9020         (Invocation.DoResolve): OverloadResolve() never returns null
9021         without reporting an error, so removed the error -6 reporting here.
9022
9023 2004-03-23  Martin Baulig  <martin@ximian.com>
9024
9025         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9026         generic methods.
9027
9028         * cs-parser.jay (delegate_declaration): Support generic delegates.
9029
9030         * delegate.cs: Support generic delegates.
9031
9032 2004-03-22  Martin Baulig  <martin@ximian.com>
9033
9034         * expression.cs (Invocation.InferParamsTypeArguments): New static
9035         method; does type inference for params arguments.
9036
9037 2004-03-21  Martin Baulig  <martin@ximian.com>
9038
9039         * typemanager.cs (TypeManager.IsGenericMethod): New public static
9040         method; checks whether a method is a generic method.    
9041
9042         * expression.cs (Invocation.InferTypeArguments): New static method;
9043         infer type arguments for generic method invocation.
9044
9045         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9046         property; we set this to true if we're resolving a generic method
9047         invocation and the user specified type arguments, ie. we're not
9048         doing type inference.
9049
9050 2004-03-20  Martin Baulig  <martin@ximian.com>
9051
9052         * class.cs (MethodData.DeclaringType): New public property.
9053         (MethodData.Define): Set DeclaringType here.
9054         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9055         instead of OperatorMethodBuilder.DeclaringType.
9056
9057 2004-03-20  Martin Baulig  <martin@ximian.com>
9058
9059         * cs-tokenizer.cs (xtoken): Return a special
9060         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9061
9062         * cs-parser.jay (default_value_expression): Switch to the new
9063         syntax (14.5.13).
9064
9065 2004-03-19  Martin Baulig  <martin@ximian.com>
9066
9067         * decl.cs (MemberName): New class.  We use this to "construct"
9068         namespace_or_type_name's.
9069
9070         * generics.cs (TypeArguments.GetDeclarations): New public method;
9071         returns the type arguments as a string[] and reports a CS0081 if
9072         one of them is not an identifier.
9073
9074         * class.cs (MemberBase): The .ctor now takes the name as a
9075         MemberName instead of a string.
9076         (MemberBase.ExplicitInterfaceName): Changed type from string to
9077         Expression.
9078         (MemberBase.DoDefine): If we're an explicit implementation, the
9079         InterfaceType may be a generic instance.
9080
9081         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9082         (namespace_name): Call MemberName.GetName () to transform the
9083         MemberName into a string and ensure we don't have any type
9084         arguments.
9085         (type_name): Call MemberName.GetTypeExpression() to transfrom the
9086         MemberName into an expression.
9087         (method_header): Use namespace_or_type_name instead of member_name.     
9088
9089 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9090
9091         * rootcontext.cs: Add new types to the boot resolution.
9092
9093         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9094         MulticastDelegate is not allowed.
9095
9096         * typemanager.cs: Add new types to lookup: System.TypedReference
9097         and ArgIterator.
9098
9099         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9100         check for TypedReference or ArgIterator, they are not allowed. 
9101
9102         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9103         makes us properly catch 1510 in some conditions (see bug 56016 for
9104         details). 
9105
9106 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9107
9108         * CryptoConvert.cs: update from corlib version
9109         with endian fixes.
9110
9111 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9112
9113         * class.cs (Indexer.Define): Check indexername declaration
9114
9115 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9116
9117         * attribute.cs (IsClsCompliant): Fixed problem with handling
9118         all three states (compliant, not-compliant, undetected).
9119
9120 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9121
9122         * attribute.cs (Attribute): Location is now public.
9123         (Resolve): Store resolved arguments (pos_values) in attribute class.
9124         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9125         (GetClsCompliantAttributeValue): New method that gets
9126         CLSCompliantAttribute value.
9127         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9128         if exists else null.
9129         (AttributeTester): New class for CLS-Compliant verification routines.
9130
9131         * class.cs (Emit): Add CLS-Compliant verification.
9132         (Method.GetSignatureForError): Implemented.
9133         (Constructor.GetSignatureForError): Implemented
9134         (Constructor.HasCompliantArgs): Returns if constructor has
9135         CLS-Compliant arguments.
9136         (Constructor.Emit): Override.
9137         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9138         is needed to test only parameters.
9139         (FieldBase.GetSignatureForError): Implemented.
9140         (TypeContainer): New member for storing base interfaces.
9141         (TypeContainer.FindMembers): Search in base interfaces too.
9142
9143         * codegen.cs (GetClsComplianceAttribute): New method that gets
9144         assembly or module CLSCompliantAttribute value.
9145         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9146         for assembly.
9147         (ModuleClass.Emit): Add error 3012 test.
9148
9149         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9150
9151         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9152         state for all decl types.
9153         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9154         if CLS-Compliant tests are required.
9155         (IsClsCompliaceRequired): New method. Analyze whether code
9156         must be CLS-Compliant.
9157         (IsExposedFromAssembly): New method. Returns true when MemberCore
9158         is exposed from assembly.
9159         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9160         value or gets cached value.
9161         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9162         is explicitly marked with CLSCompliantAttribute.
9163         (IsIdentifierClsCompliant): New abstract method. This method is
9164         used to testing error 3005.
9165         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9166         for identifier and parameters CLS-Compliant testing.
9167         (VerifyClsCompliance): New method. The main virtual method for
9168         CLS-Compliant verifications.
9169         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9170         null. I don't know why is null (too many public members !).
9171         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9172         and get value of first CLSCompliantAttribute that found.
9173
9174         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9175         (VerifyClsCompliance): Override and add extra tests.
9176
9177         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9178         clscheck- disable CLS-Compliant verification event if assembly is has
9179         CLSCompliantAttribute(true).
9180
9181         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9182         ApllyAttribute is now called in emit section as in the other cases.
9183         Possible future Emit integration.
9184         (IsIdentifierClsCompliant): New override.
9185         (VerifyClsCompliance): New override.
9186         (GetEnumeratorName): Returns full enum name.
9187
9188         * parameter.cs (GetSignatureForError): Implemented.
9189
9190         * report.cs (WarningData): New struct for Warning message information.
9191         (LocationOfPreviousError): New method.
9192         (Warning): New method. Reports warning based on the warning table.
9193         (Error_T): New method. Reports error based on the error table.
9194
9195         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9196         verifications are done here.
9197
9198         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9199
9200         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9201         CLSCompliantAttribute.
9202         (all_imported_types): New member holds all imported types from other
9203         assemblies.
9204         (LoadAllImportedTypes): New method fills static table with exported types
9205         from all referenced assemblies.
9206         (Modules): New property returns all assembly modules.
9207
9208 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9209
9210         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9211         throwing a parser error.
9212
9213         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9214         which removes the hardcoded get_/set_ prefixes for properties, as
9215         IL allows for the properties to be named something else.  
9216
9217         Bug #56013
9218
9219         * expression.cs: Do not override operand before we know if it is
9220         non-null.  Fix 56207
9221
9222 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9223
9224         * typemanager.cs: support for pinned variables.
9225
9226 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9227
9228         * decl.cs, typemanager.cs: Avoid using an arraylist
9229         as a buffer if there is only one result set.
9230
9231 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9232
9233         * expression.cs: Make sure you cant call a static method
9234         with an instance expression, bug #56174.
9235
9236 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9237
9238         * class.cs (IsDuplicateImplementation): Improve error reporting to
9239         flag 663 (method only differs in parameter modifier).
9240
9241         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9242         in preprocessor directives.
9243
9244         * location.cs (LookupFile): Allow for the empty path.
9245
9246         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9247         better approach for some of that patch, but its failing with the
9248         CharSet enumeration.  For now try/catch will do.
9249
9250         * typemanager.cs: Do not crash if a struct does not have fields.
9251         Fixes 56150.
9252
9253 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9254
9255         * expression.cs: cs0213, cant fix a fixed expression.
9256         fixes 50231.
9257
9258 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9259
9260         * cs-parser.jay: detect invalid embeded statements gracefully.
9261         bug #51113.
9262
9263 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9264
9265         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9266         As a regex:
9267         s/
9268         the invocation type may not be a subclass of the tye of the item/
9269         The type of the item must be a subclass of the invocation item.
9270         /g
9271
9272         Fixes bug #50820.
9273
9274 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9275
9276         * attribute.cs: Added methods to get a string and a bool from an
9277         attribute. Required to information from AssemblyKeyFileAttribute,
9278         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9279         * codegen.cs: Modified AssemblyName creation to include support for
9280         strongnames. Catch additional exceptions to report them as CS1548.
9281         * compiler.csproj: Updated include CryptoConvert.cs.
9282         * compiler.csproj.user: Removed file - user specific configuration.
9283         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9284         Mono.Security assembly. The original class is maintained and tested in
9285         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9286         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9287         like CSC 8.0 (C# v2) supports.
9288         * Makefile: Added CryptoConvert.cs to mcs sources.
9289         * rootcontext.cs: Added new options for strongnames.
9290
9291 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9292
9293         * driver.cs: For --expect-error, report error code `2'
9294         if the program compiled with no errors, error code `1' if
9295         it compiled with an error other than the one expected.
9296
9297 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9298
9299         * compiler.csproj: Updated for Visual Studio .NET 2003.
9300         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9301         * compiler.sln: Updated for Visual Studio .NET 2003.
9302
9303 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9304
9305         * expression.cs: Fix bug #47234. We basically need to apply the
9306         rule that we prefer the conversion of null to a reference type
9307         when faced with a conversion to 'object' (csc behaviour).
9308
9309 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9310
9311         * statement.cs: Shorter form for foreach, eliminates
9312         a local variable. r=Martin.
9313
9314 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9315
9316         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9317         checks if we can use brtrue/brfalse to test for 0.
9318         * expression.cs: use the above in the test for using brtrue/brfalse.
9319         cleanup code a bit.
9320
9321 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9322
9323         * expression.cs: Rewrite string concat stuff. Benefits:
9324
9325         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9326         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9327         rather than a concat chain.
9328
9329         * typemanager.cs: Add lookups for more concat overloads.
9330
9331 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9332
9333         * expression.cs: Emit shorter il code for array init.
9334
9335         newarr
9336         dup
9337         // set 1
9338
9339         // set 2
9340
9341         newarr
9342         stloc.x
9343
9344         ldloc.x
9345         // set 1
9346
9347         ldloc.x
9348         // set 2
9349
9350 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9351
9352         * statement.cs: Before, two switch blocks would be merged if the
9353         total size of the blocks (end_item - begin_item + 1) was less than
9354         two times the combined sizes of the blocks.
9355
9356         Now, it will only merge if after the merge at least half of the
9357         slots are filled.
9358
9359         fixes 55885.
9360
9361 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9362
9363         * class.cs : csc build fix for GetMethods(). See bug #52503.
9364
9365 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9366
9367         * expression.cs: Make sure fp comparisons work with NaN.
9368         This fixes bug #54303. Mig approved this patch a long
9369         time ago, but we were not able to test b/c the runtime
9370         had a related bug.
9371
9372 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9373
9374         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9375
9376 2004-03-19  Martin Baulig  <martin@ximian.com>
9377
9378         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
9379         two overloads may unify for some type parameter substitutions and
9380         report a CS0408 if appropriate.
9381
9382 2004-03-19  Martin Baulig  <martin@ximian.com>
9383
9384         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9385         error here and not in our caller.
9386
9387 2004-03-19  Martin Baulig  <martin@ximian.com>
9388
9389         * interface.cs: Completely killed this file.
9390         (Interface): We're now a TypeContainer and live in class.cs.
9391
9392         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9393         argument; we're now also called for interfaces.
9394         (TypeContainer.DefineMembers): Allow this method being called
9395         multiple times.
9396         (TypeContainer.GetMethods): New public method; formerly known as
9397         Interface.GetMethod().  This is used by PendingImplementation.
9398         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9399         it's now private and non-static.
9400         (Interface): Moved this here; it's now implemented similar to
9401         Class and Struct.
9402         (Method, Property, Event, Indexer): Added `bool is_interface'
9403         argument to their .ctor's.
9404         (MemberBase.IsInterface): New public field.
9405
9406         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9407         instances instead of InterfaceMethod, InterfaceProperty, etc.
9408         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9409         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9410
9411 2004-03-19  Martin Baulig  <martin@ximian.com>
9412
9413         * class.cs (MethodCore.IsDuplicateImplementation): New private
9414         method which does the CS0111 checking.
9415         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9416         Use IsDuplicateImplementation().
9417
9418 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9419
9420         * decl.cs (FindMemberToOverride): New method to find the correct
9421         method or property to override in the base class.
9422         * class.cs
9423             - Make Method/Property use the above method to find the
9424               version in the base class.
9425             - Remove the InheritableMemberSignatureCompare as it is now
9426               dead code.
9427
9428         This patch makes large code bases much faster to compile, as it is
9429         O(n) rather than O(n^2) to do this validation.
9430
9431         Also, it fixes bug 52458 which is that nested classes are not
9432         taken into account when finding the base class member.
9433
9434         Reviewed/Approved by Martin.
9435
9436 2004-03-17  Martin Baulig  <martin@ximian.com>
9437
9438         * expression.cs (MemberAccess.DoResolve): Take the parent's number
9439         of type arguments into account; use the `real_num_type_args'
9440         approach like in DoResolveAsTypeStep().
9441
9442         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9443         nested types.
9444
9445 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9446
9447         * interface.cs: In all interface classes removed redundant
9448         member initialization.
9449
9450 2004-03-16  Martin Baulig  <martin@ximian.com>
9451
9452         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9453
9454 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9455
9456         * decl.cs (DefineTypeAndParents): New helper method to define a
9457         type's containers before the type itself is defined;  This is a
9458         bug exposed by the recent changes to Windows.Forms when an
9459         implemented interface was defined inside a class that had not been
9460         built yet.   
9461
9462         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9463
9464         (Check): Loop correctly to report errors modifiers
9465         (UNSAFE was not in the loop, since it was the same as TOP).
9466
9467         * interface.cs: Every interface member now takes a ModFlags,
9468         instead of a "is_new" bool, which we set on the base MemberCore. 
9469
9470         Every place where we called "UnsafeOk" in the interface, now we
9471         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9472         the unsafe settings from the member declaration instead of the
9473         container interface. 
9474
9475         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9476
9477         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9478         `set_indexer_name' to the pending bits (one per type).
9479
9480         We fixed a bug today that was picking the wrong method to
9481         override, since for properties the existing InterfaceMethod code
9482         basically ignored the method name.  Now we make sure that the
9483         method name is one of the valid indexer names.
9484
9485 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9486  
9487         * support.cs (SeekableStreamReader): Keep track of stream byte
9488         positions and don't mix them with character offsets to the buffer.
9489
9490         Patch from Gustavo Giráldez
9491
9492 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9493
9494         * interface.cs (InterfaceSetGetBase): Removed double member
9495         initialization, base class does it as well.
9496
9497 2004-03-13  Martin Baulig  <martin@ximian.com>
9498
9499         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9500         when compiling corlib.
9501
9502 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9503
9504         * convert.cs (ExplicitConversion): We were reporting an error on
9505         certain conversions (object_type source to a value type, when the
9506         expression was `null') before we had a chance to pass it through
9507         the user defined conversions.
9508
9509         * driver.cs: Replace / and \ in resource specifications to dots.
9510         Fixes 50752
9511
9512         * class.cs: Add check for duplicate operators.  Fixes 52477
9513
9514 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9515
9516         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9517         that are in the middle of the statements, not only at the end.
9518         Fixes #54987
9519
9520         * class.cs (TypeContainer.AddField): No longer set the
9521         `HaveStaticConstructor' flag, now we call it
9522         `UserDefineStaticConstructor' to diferentiate the slightly
9523         semantic difference.
9524
9525         The situation is that we were not adding BeforeFieldInit (from
9526         Modifiers.TypeAttr) to classes that could have it.
9527         BeforeFieldInit should be set to classes that have no static
9528         constructor. 
9529
9530         See:
9531
9532         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9533
9534         And most importantly Zoltan's comment:
9535
9536         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9537
9538         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9539          before its static fields are used', i.e. initialization does not need
9540          to be triggered by the first access to the type. Setting this flag
9541          helps the JIT to compile better code, since it can run the static
9542          constructor at JIT time, and does not need to generate code to call it
9543          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9544          this flag for lots of classes like String. 
9545          
9546          csc sets this flag if the type does not have an explicit static 
9547          constructor. The reasoning seems to be that if there are only static
9548          initalizers for a type, and no static constructor, then the programmer
9549          does not care when this initialization happens, so beforefieldinit
9550          can be used.
9551          
9552          This bug prevents the AOT compiler from being usable, since it 
9553          generates so many calls to mono_runtime_class_init that the AOT code
9554          is much slower than the JITted code. The JITted code is faster, 
9555          because it does not generate these calls if the vtable is type is
9556          already initialized, which is true in the majority of cases. But the
9557          AOT compiler can't do this."
9558
9559 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9560
9561         * class.cs (MethodData.Emit): Refactor the code so symbolic
9562         information is generated for destructors;  For some reasons we
9563         were taking a code path that did not generate symbolic information
9564         before. 
9565
9566 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9567
9568         * class.cs: Create a Constructor.CheckBase method that
9569         takes care of all validation type code. The method
9570         contains some code that was moved from Define.
9571
9572         It also includes new code that checks for duplicate ctors.
9573         This fixes bug #55148.
9574
9575 2004-03-09  Joshua Tauberer <tauberer@for.net>
9576
9577         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9578         a { ... }-style array creation invokes EmitStaticInitializers
9579         which is not good for reference-type arrays.  String, decimal
9580         and now null constants (NullCast) are not counted toward
9581         static initializers.
9582
9583 2004-03-05  Martin Baulig  <martin@ximian.com>
9584
9585         * location.cs (SourceFile.HasLineDirective): New public field;
9586         specifies whether the file contains or is referenced by a "#line"
9587         directive.
9588         (Location.DefineSymbolDocuments): Ignore source files which
9589         either contain or are referenced by a "#line" directive.        
9590
9591 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9592
9593         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9594         direct access to our parent, so check the method inline there.
9595
9596 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9597
9598         * expression.cs (Invocation.EmitCall): Miguel's last commit
9599         caused a regression. If you had:
9600
9601             T t = null;
9602             t.Foo ();
9603
9604         In Foo the implict this would be null.
9605
9606 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9607
9608         * expression.cs (Invocation.EmitCall): If the method is not
9609         virtual, do not emit a CallVirt to it, use Call.
9610
9611         * typemanager.cs (GetFullNameSignature): Improve the method to
9612         cope with ".ctor" and replace it with the type name.
9613
9614         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9615         as an argument the ConstructorBuilder where it is being defined,
9616         to catch the recursive constructor invocations.
9617
9618 2004-03-16  Martin Baulig  <martin@ximian.com>
9619
9620         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9621         ConstructedType, call ResolveType() on it to get the type rather
9622         than just using `expr.Type'.
9623
9624 2004-03-16  Martin Baulig  <martin@ximian.com>
9625
9626         * generics.cs (ConstructedType.GetMemberAccess): Take the
9627         EmitContext instead on the TypeExpr and use
9628         ec.TypeContainer.CurrentType/ec.ContainerType.
9629
9630 2004-03-16  Martin Baulig  <martin@ximian.com>
9631
9632         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9633         parameters before aliases.
9634
9635 2004-03-16  Martin Baulig  <martin@ximian.com>
9636
9637         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9638         New oublic function; checks whether two generic instances may become
9639         equal under some instantiations (26.3.1).
9640
9641         * class.cs (TypeContainer.Define): Call
9642         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9643         error.
9644
9645 2004-03-16  Martin Baulig  <martin@ximian.com>
9646
9647         * class.cs (TypeContainer.GetClassBases): Moved
9648         Error_TypeParameterAsBase() here and also check whether the base
9649         class is not an attribute.
9650
9651 2004-03-16  Martin Baulig  <martin@ximian.com>
9652
9653         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9654
9655 2004-03-16  Martin Baulig  <martin@ximian.com>
9656
9657         * class.cs (Error_TypeParameterAsBase): Use correct error number
9658         here (CS0689).  
9659
9660 2004-03-16  Martin Baulig  <martin@ximian.com>
9661
9662         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9663         for generics.
9664
9665         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9666         error reporting.
9667
9668 2004-03-15  Martin Baulig  <martin@ximian.com>
9669
9670         * typemanager.cs (TypeManager.GetFullName): New public method.
9671         (TypeManager.MemberLookup): Added `int_num_type_arguments'
9672         argument; only return members with the correct number of type
9673         arguments.
9674         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9675         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9676         whether the number of type arguments matches.
9677
9678         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9679         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9680
9681         * expression.cs (MemberAccess): Added public `NumTypeArguments'
9682         field; it's set by the protected .ctor when we're actually a
9683         GenericMemberAccess.
9684         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9685         arguments and pass it to MemberLookupFinal ().
9686
9687         * ecore.cs (Expression.MemberLookup): Added `int
9688         num_type_arguments' argument; only return members with the correct
9689         number of type arguments.
9690         (Expression.MemberLookupFailed): Check whether the MemberLookup
9691         failed because we did not have the correct number of type
9692         arguments; report CS0305 in this case.
9693
9694         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9695         `e.ResolveAsTypeTerminal()' already did so.
9696
9697 2004-03-15  Martin Baulig  <martin@ximian.com>
9698
9699         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9700         we're a ConstructedType; in this case, the caller must report an
9701         error (for instance CS0131).
9702
9703         * generic.cs (TypeArguments): Added Location argument to the .ctor.
9704         (TypeArguments.Resolve): Actually report errors here.
9705
9706 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9707
9708         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9709         `set_indexer_name' to the pending bits (one per type).
9710
9711         We fixed a bug today that was picking the wrong method to
9712         override, since for properties the existing InterfaceMethod code
9713         basically ignored the method name.  Now we make sure that the
9714         method name is one of the valid indexer names.
9715
9716 2004-03-15  Martin Baulig  <martin@ximian.com>
9717
9718         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9719         for generic instances.
9720
9721 2004-03-13  Martin Baulig  <martin@ximian.com>
9722
9723         * class.cs (TypeContainer.DefineType): Call
9724         TypeManager.AddUserType() immediately after creating the
9725         TypeBuilder; pass all type parameters when creating the
9726         CurrentType.
9727
9728         * decl.cs (DeclSpace.FindNestedType): New public method.
9729         (DeclSpace.FindType): Added `int num_type_args' argument; only
9730         return types with the correct number of type parameters.
9731         (DeclSpace.CountTypeParams): New public property.
9732
9733         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9734         the number of type parameters; defaults to zero.
9735
9736         * generic.cs (TypeArguments.Count): New public property.
9737         (ConstructedType.DoResolveAsTypeStep): First call
9738         ds.FindNestedType() to find out whether we're nested in the
9739         current generic type; in this case, we inherit all type parameters
9740         from the current class.
9741
9742         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9743         num_type_args' argument.
9744         (RootContext.LookupType): Added overloaded version which takes the
9745         number of type arguments; only return types with the correct
9746         number of type arguments.
9747
9748         * typemanager.cs (TypeManager.CheckGeneric): New public function;
9749         checks whether `Type t' has `int num_type_args'.
9750
9751 2004-03-13  Martin Baulig  <martin@ximian.com>
9752
9753         * generic.cs (GenericMethod.DefineType): New method; calls
9754         DefineType() on all the type parameters.
9755
9756         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9757         (MethodData.Define): If we're a generic method, call
9758         GenericMethod.DefineType() to define the type parameters.       
9759
9760 2004-03-10  Martin Baulig  <martin@ximian.com>
9761
9762         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9763         instead of IsAssignableFrom.    
9764
9765 2004-03-10  Martin Baulig  <martin@ximian.com>
9766
9767         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9768
9769         * support.cs (ParameterData.HasArrayParameter): New property.
9770         (ReflectionParameters.ctor): Take a MethodBase instead of a
9771         ParameterInfo[].  If we have any type parameters, get the generic
9772         method definition and ask it whether we have variable arguments.
9773
9774 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9775
9776         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9777         routines to check if a type is an enumerable/enumerator allow
9778         classes that implement the IEnumerable or IEnumerator interfaces.
9779
9780         * class.cs (Property, Operator): Implement IIteratorContainer, and
9781         implement SetYields.
9782
9783         (Property.Define): Do the block swapping for get_methods in the
9784         context of iterators.   We need to check if Properties also
9785         include indexers or not.
9786
9787         (Operator): Assign the Block before invoking the
9788         OperatorMethod.Define, so we can trigger the Iterator code
9789         replacement. 
9790
9791         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9792         Property and Operator classes are not created when we parse the
9793         declarator but until we have the block completed, so we use a
9794         singleton SimpleIteratorContainer.Simple to flag whether the
9795         SetYields has been invoked.
9796
9797         We propagate this setting then to the Property or the Operator to
9798         allow the `yield' to function.
9799
9800 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9801
9802         * codegen.cs: Implemented attribute support for modules.
9803         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9804         Assembly/Module functionality.
9805
9806         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9807         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9808         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9809
9810 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9811
9812         * interface.cs (FindMembers): The operation is performed on all base
9813         interfaces and not only on the first. It is required for future CLS Compliance patch.
9814
9815 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9816
9817         * statement.cs, codegen.cs:
9818         This patch deals with patterns such as:
9819
9820         public class List : IEnumerable {
9821
9822                 public MyEnumerator GetEnumerator () {
9823                         return new MyEnumerator(this);
9824                 }
9825
9826                 IEnumerator IEnumerable.GetEnumerator () {
9827                         ...
9828                 }
9829                 
9830                 public struct MyEnumerator : IEnumerator {
9831                         ...
9832                 }
9833         }
9834
9835         Before, there were a few things we did wrong:
9836         1) we would emit callvirt on a struct, which is illegal
9837         2) we emited ldarg when we needed to emit ldarga
9838         3) we would mistakenly call the interface methods on an enumerator
9839         type that derived from IEnumerator and was in another assembly. For example:
9840
9841         public class MyEnumerator : IEnumerator
9842
9843         Would have the interface methods called, even if there were public impls of the
9844         method. In a struct, this lead to invalid IL code.
9845
9846 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9847
9848         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9849           renamed to Emit.
9850
9851         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9852
9853 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9854
9855         * cs-parser.jay: Fix small regression: we were not testing V2
9856         compiler features correctly.
9857
9858         * interface.cs: If the emit context is null, then create one
9859
9860 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9861
9862         * decl.cs (GetSignatureForError): New virtual method to get full name
9863           for error messages.
9864
9865         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9866           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9867
9868         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9869           Duplicated members and code in these classes has been removed.
9870           Better encapsulation in these classes.
9871
9872 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9873
9874         * assign.cs (Assign.DoResolve): When dealing with compound
9875         assignments, there is a new rule in ECMA C# 2.4 (might have been
9876         there before, but it is documented here) that states that in:
9877
9878         a op= b;
9879
9880         If b is of type int, and the `op' is a shift-operator, then the
9881         above is evaluated as:
9882
9883         a = (int) a op b 
9884
9885         * expression.cs (Binary.ResolveOperator): Instead of testing for
9886         int/uint/long/ulong, try to implicitly convert to any of those
9887         types and use that in pointer arithmetic.
9888
9889         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9890         method to print information for from the type, not from the
9891         null-method we were given.
9892
9893 2004-02-01  Duncan Mak  <duncan@ximian.com>
9894
9895         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9896         parsing for cmd, fixes bug #53694.
9897
9898 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9899
9900         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9901         in the member name duplication tests. Property and operator name duplication
9902         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9903
9904 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9905
9906         * interface.cs (PopulateMethod): Fixed crash when interface method
9907         returns not existing type (error test cs0246-3.cs).
9908
9909 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9910
9911         * cs-parser.jay (interface_accessors): Re-write actions to also
9912         store attributes attached to get and set methods. Fix spelling
9913         while at it.
9914
9915         (inteface_property_declaration): Modify accordingly.
9916
9917         (InterfaceAccessorInfo): New helper class to store information to pass
9918         around between rules that use interface_accessors.
9919
9920         * interface.cs (Emit): Apply attributes on the get and set
9921         accessors of properties and indexers too.
9922
9923         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9924         right MethodBuilder when applying attributes to the get and set accessors.
9925
9926 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9927
9928         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9929
9930 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9931
9932         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9933
9934 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9935
9936         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9937         changes that treat `yield' specially when present before `break'
9938         or `return' tokens.
9939
9940         * cs-tokenizer.cs: yield is no longer a keyword.
9941
9942 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9943
9944         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9945         setting for default constructors.
9946         For default constructors are almost every time set wrong Modifier. The
9947         generated IL code has been alright. But inside mcs this values was
9948         wrong and this was reason why several of my CLS Compliance tests
9949         failed.
9950
9951 2004-02-27  Martin Baulig  <martin@ximian.com>
9952
9953         * generics.cs (ConstructedType.ResolveType): Make the nested type
9954         stuff actually work.
9955
9956 2004-02-25  Martin Baulig  <martin@ximian.com>
9957
9958         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9959         property; returns the type parameters just from the current type,
9960         ie. with the ones from outer classes.
9961         (DeclSpace.LookupGeneric): First search in the current class, then
9962         in outer classes.
9963         (DeclSpace.initialize_type_params): When hiding a type parameter
9964         from an outer class, put it into the `type_param_list' anyways.
9965
9966         * expression.cs (MemberAccess.expr): Made this field protected.
9967
9968         * class.cs (TypeContainer.Define): The `CurrentType' just contains
9969         the type parameters from the current class.
9970
9971         * generic.cs (ConstructedType.ResolveType): Support nested generic
9972         types by taking the type parameters which we inherit from outer
9973         classes into account.
9974         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9975         support for nested generic types.
9976
9977 2004-02-23  Martin Baulig  <martin@ximian.com>
9978
9979         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9980         field and check whether we're nested inside a generic type.
9981         (DeclSpace.ResolveType): If we're resolving to a generic type
9982         definition, create a ConstructedType and return its resolved type.
9983         (DeclSpace.initialize_type_params): New private method;
9984         initializes the `type_param_list' field from the type parameters
9985         from this and all enclosing classes.
9986         (DeclSpace.TypeParameters): Call initialize_type_params() unless
9987         we're already initialized.
9988
9989 2004-02-23  Martin Baulig  <martin@ximian.com>
9990
9991         * class.cs (Method.Define): Create the generic method before
9992         calling DoDefine().
9993         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9994         the TypeContainer one); we use this for generic methods.
9995
9996         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9997         parent's TypeBuilder.
9998
9999 2004-02-18  Martin Baulig  <martin@ximian.com>
10000
10001         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10002         to check for equality.
10003
10004 2004-02-05  Martin Baulig  <martin@ximian.com>
10005
10006         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10007         `ec.TypeContainer.CurrentType', use it instead of
10008         `ec.ContainerType' to check whether we're in the type's ctor.
10009
10010 2004-01-29  Martin Baulig  <martin@ximian.com>
10011
10012         * expression.cs (Invocation.DoResolve): If we're a
10013         `ConstructedType', then we're actually a generic method, so
10014         rewrite the expr as a GenericMemberAccess.
10015
10016         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10017         here; manually parse it into a string.
10018
10019 2004-01-28  Martin Baulig  <martin@ximian.com>
10020
10021         * typemanager.cs (TypeManager.IsEqual): New static method.
10022         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10023         check for equality instead of using `=='.
10024
10025 2004-01-26  Martin Baulig  <martin@ximian.com>
10026
10027         * decl.cs (DeclSpace.CurrentType): New public field.
10028
10029         * expression.cs (This.ResolveBase): If we have an
10030         `ec.TypeContainer.CurrentType', use it instead of
10031         `ec.ContainerType'.
10032
10033         * class.cs (TypeContainer.DefineType): If we're a generic type,
10034         create the `CurrentType' (unresolved).
10035         (TypeContainer.GenericType): New private field.
10036         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10037         it and store it in `GenericType' before creating the MemberCache.
10038         (TypeContainer.GetMembers): If we have a `GenericType', call
10039         TypeManager.FindMembers() on it.
10040
10041         * interface.cs (Interface.GenericType): New private field.
10042         (Interface.DefineType): If we're a generic type, create the
10043         `CurrentType' (unresolved).
10044         (Interface.DefineMembers): If we have a `CurrentType', resolve it
10045         and store it in `GenericType' before creating the MemberCache.
10046         (Interface.GetMembers): If we have a `GenericType', call
10047         TypeManager.FindMembers() on it.
10048
10049 2004-01-22  Martin Baulig  <martin@ximian.com>
10050
10051         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10052         not a QualifiedIdentifier.  This is what `type_name_expression'
10053         was previously doing.
10054         (type_name_expression): Removed; the code is now in
10055         `namespace_or_type_name'.
10056         (qualified_identifier): Removed, use `namespace_or_type_name'
10057         instead.
10058         (QualifiedIdentifier): Removed this class.      
10059
10060 2004-01-22  Martin Baulig  <martin@ximian.com>
10061
10062         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10063         not a string as alias name.
10064
10065 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10066
10067         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10068         #52730 bug, and instead compute correctly the need to use a
10069         temporary variable when requesting an address based on the
10070         static/instace modified of the field and the constructor.
10071  
10072 2004-01-21  Martin Baulig  <martin@ximian.com>
10073
10074         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10075         class and namespace before looking up aliases.  Fixes #52517.
10076
10077 2004-01-21  Martin Baulig  <martin@ximian.com>
10078
10079         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10080         assinged in a 'try'; fixes exception4.cs.
10081
10082 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10083         * class.cs : Implemented parameter-less constructor for TypeContainer
10084
10085         * decl.cs: Attributes are now stored here. New property OptAttributes
10086
10087         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10088
10089         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10090
10091 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10092
10093         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10094           (CSharpSignature): New method for indexer and property signature.
10095
10096 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10097
10098         * pending.cs (IsVirtualFilter): Faster implementation.
10099
10100 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10101
10102         * typemanager.cs: Avoid inclusion of same assembly more than once.
10103
10104 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10105
10106         * cs-parser.jay: Fixed problem where the last assembly attribute
10107           has been applied also to following declaration (class, struct, etc.)
10108           
10109 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10110
10111         * class.cs: Added error CS0538, CS0539 reporting.
10112         Fixed crash on Microsoft runtime when field type is void.
10113
10114         * cs-parser.jay: Added error CS0537 reporting.
10115
10116         * pending.cs: Added error CS0535 reporting.
10117         Improved error report for errors CS0536, CS0534.
10118
10119 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10120
10121         Merge a few bits from the Anonymous Method MCS tree.
10122
10123         * statement.cs (ToplevelBlock): New class for toplevel methods,
10124         will hold anonymous methods, lifted variables.
10125
10126         * cs-parser.jay: Create toplevel blocks for delegates and for
10127         regular blocks of code. 
10128
10129 2004-01-20  Martin Baulig  <martin@ximian.com>
10130
10131         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10132         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10133         and `NeedExplicitReturn'; added `IsLastStatement'.
10134         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10135         have a `ReturnLabel' or we're not unreachable.
10136
10137         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10138         child's reachability; don't just override ours with it.  Fixes
10139         #58058 (lluis's example).
10140         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10141         InFinally(), InLoop(), InSwitch() and
10142         BreakCrossesTryCatchBoundary() methods.
10143
10144         * statement.cs (Return): Do all error checking in Resolve().
10145         Unless we are the last statement in a top-level block, always
10146         create a return label and jump to it.
10147         (Break, Continue): Do all error checking in Resolve(); also make
10148         sure we aren't leaving a `finally'.
10149         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10150         statement in a top-level block.
10151         (Block.Flags): Added `IsDestructor'.
10152         (Block.IsDestructor): New public property.
10153
10154 2004-01-20  Martin Baulig  <martin@ximian.com>
10155
10156         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10157
10158 2004-01-20  Martin Baulig  <martin@ximian.com>
10159
10160         * statement.cs (Statement.ResolveUnreachable): New public method.
10161         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10162         (Block.Resolve): Resolve unreachable statements.
10163
10164 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10165
10166         * expression.cs: We need to fix the case where we do
10167         not have a temp variable here.
10168
10169         * assign.cs: Only expression compound assignments need
10170         temporary variables.
10171
10172 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10173
10174         * flowanalysis.cs: Reduce memory allocation in a few ways:
10175           - A block with no variables should not allocate a bit
10176             vector for itself.
10177           - A method with no out parameters does not need any tracking
10178             for assignment of the parameters, so we need not allocate
10179             any data for it.
10180           - The arrays:
10181                 public readonly Type[] VariableTypes;
10182                 public readonly string[] VariableNames;
10183             Are redundant. The data is already stored in the variable
10184             map, so we need not allocate another array for it.
10185           - We need to add alot of checks for if (params | locals) == null
10186             due to the first two changes.
10187
10188 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10189
10190         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10191         implement IMemoryLocation, we store a copy on a local variable and
10192         take the address of it.  Patch from Benjamin Jemlich
10193
10194         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10195         to use a special "type_name_expression" rule which reduces the
10196         number of "QualifiedIdentifier" classes created, and instead
10197         directly creates MemberAccess expressions.
10198
10199 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10200
10201         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10202         that fixes #52853.  Null literal assignment to ValueType
10203
10204         * class.cs (MethodData.Emit): Instead of checking the name of the
10205         method to determine if its a destructor, create a new derived
10206         class from Method called Destructor, and test for that.  
10207
10208         * cs-parser.jay: Create a Destructor object instead of a Method.  
10209
10210         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10211
10212         Fixes: 52933
10213
10214 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * expression.cs (Binary.ResolveOperator): Perform an implicit
10217         conversion from MethodGroups to their delegate types on the
10218         Addition operation.
10219
10220         * delegate.cs: Introduce a new class DelegateCreation that is the
10221         base class for `NewDelegate' and `ImplicitDelegateCreation',
10222         factor some code in here.
10223
10224         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10225         conversion from MethodGroups to compatible delegate types. 
10226
10227         * ecore.cs (Expression.Resolve): Do not flag error 654
10228         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10229         we allow conversions from MethodGroups to delegate types now.
10230
10231         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10232         assignments in v2 either.
10233
10234 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10235
10236         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10237         static read-only fields in ctors.
10238
10239         Applied patch from Benjamin Jemlich 
10240
10241         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10242
10243 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10244
10245         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10246         here to return true, as they can be used like this:
10247
10248                 (XXX) int.MEMBER ()
10249
10250         Fixed 49836 and all the other dups
10251
10252 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10253
10254         * driver.cs: Implement /win32res and /win32icon.
10255
10256 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10257
10258         * cs-parser.jay: Add a rule to improve error handling for the
10259         common mistake of placing modifiers after the type.
10260
10261 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10262
10263         * cs-parser.jay (interface_event_declaration): Catch
10264         initialization of events on interfaces, and report cs0068
10265
10266         * cs-parser.jay (interface_event_declaration): Catch
10267         initialization of events. 
10268
10269         * ecore.cs: Better report missing constructors.
10270
10271         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10272         the error reporting done in the wrong place.  Fix.
10273
10274         * expression.cs (Binary.ResolveOperator): Catch the 
10275         operator + (E x, E y) error earlier, and later allow for implicit
10276         conversions in operator +/- (E e, U x) from U to the underlying
10277         type of E.
10278
10279         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10280         52596, if the container class is abstract, the default constructor
10281         is protected otherwise its public (before, we were always public).
10282
10283         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10284         fixed statement.
10285
10286         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10287         Jemlich that fixes bug #52597, MCS was generating invalid code for
10288         idisposable structs.   Thanks to Ben for following up with this
10289         bug as well.
10290
10291 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10292
10293         * driver.cs: Allow assemblies without code to be generated, fixes
10294         52230.
10295
10296 2004-01-07  Nick Drochak <ndrochak@gol.com>
10297
10298         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10299
10300 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10301
10302         * cs-parser.jay: Add rules to improve error reporting if fields or
10303         methods are declared at the namespace level (error 116)
10304
10305         * Add rules to catch event add/remove
10306
10307 2004-01-04  David Sheldon <dave-mono@earth.li>
10308
10309   * expression.cs: Added matching ")" to error message for 
10310   CS0077
10311
10312 2004-01-03 Todd Berman <tberman@gentoo.org>
10313
10314         * ecore.cs, attribute.cs:
10315         Applying fix from #52429.
10316
10317 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10318
10319         * ecore.cs, expression.cs, statement.cs:
10320         Total rewrite of how we handle branching. We
10321         now handle complex boolean expressions with fewer
10322         jumps. As well if (x == 0) no longer emits a ceq.
10323
10324         if (x is Foo) is much faster now, because we generate
10325         better code.
10326
10327         Overall, we get a pretty big improvement on our benchmark
10328         tests. The code we generate is smaller and more readable.
10329
10330         I did a full two-stage bootstrap. The patch was reviewed
10331         by Martin and Miguel.
10332
10333 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10334
10335         * cs-parser.jay: Make primary_expression not take a QI.
10336         we dont need this because the member_access rule covers
10337         us here. So we replace the rule with just IDENTIFIER.
10338
10339         This has two good effects. First, we remove a s/r conflict.
10340         Second, we allocate many fewer QualifiedIdentifier objects.
10341
10342 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10343
10344         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10345         set the correct information via SRE. This prevents
10346         hanging on the MS runtime. Fixes #29374.
10347
10348 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10349
10350         * convert.cs: correctly handle conversions to value types
10351         from Enum and ValueType as unboxing conversions.
10352
10353         Fixes bug #52569. Patch by Benjamin Jemlich.
10354
10355 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10356
10357         * expression.cs (BetterConversion): Prefer int -> uint
10358         over int -> ulong (csc's behaviour). This fixed bug #52046.
10359
10360 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10361
10362         * decl.cs (MemberCache.FindMembers): now returns a
10363         MemberInfo [].
10364
10365         * typemanager.cs: In general, go with with ^^.
10366         (CopyNewMethods): take an IList.
10367         (RealMemberLookup): Only allocate an arraylist
10368         if we copy from two sets of methods.
10369
10370         This change basically does two things:
10371         1) Fewer array lists allocated due to CopyNewMethods.
10372         2) the explicit cast in MemberList costed ALOT.
10373
10374 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10375
10376         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10377         a hashtable to avoid needless string allocations when an identifier is
10378         used more than once (the common case).
10379
10380 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10381
10382         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10383         is broken, it will not return anything. So, we
10384         have to use the information we have in mcs to
10385         do the task.
10386
10387         * typemanager.cs: Add a cache for GetInterfaces,
10388         since this will now be used more often (due to ^^)
10389
10390         (GetExplicitInterfaces) New method that gets the
10391         declared, not effective, interfaces on a type
10392         builder (eg, if you have interface IFoo, interface
10393         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10394         { IBar }.
10395
10396         This patch makes MCS able to bootstrap itself on
10397         Windows again.
10398
10399 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10400
10401         * expression.cs: Remove the Nop's that Miguel put
10402         in by mistake.
10403
10404 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10405
10406         * report.cs, codegen.cs: Give the real stack trace to
10407         the error when an exception is thrown.
10408
10409 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10410
10411         * decl.cs: only allocate hashtables for ifaces if 
10412         it is an iface!
10413
10414 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10415
10416         * expression.cs: fix the error from cs0121-2.cs
10417         (a parent interface has two child interfaces that
10418         have a function with the same name and 0 params
10419         and the function is called through the parent).
10420
10421 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10422
10423         * class.cs, rootcontext.cs, typmanager.cs: do not
10424         leak pointers.
10425
10426 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10427
10428         * codegen.cs: remove stack for the ec flow branching.
10429         It is already a linked list, so no need.
10430
10431 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10432
10433         * Makefile: Allow custom profiler here.
10434
10435 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10436
10437         * typemanager.cs (LookupType):
10438           - Use a static char [], because split takes
10439             a param array for args, so it was allocating
10440             every time.
10441           - Do not store true in a hashtable, it boxes.
10442
10443 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10444
10445         * flowanalysis.cs: bytify common enums.
10446
10447 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10448
10449         * modifiers.cs: Add a new set of flags for the
10450         flags allowed on explicit interface impls.
10451         * cs-parser.jay: catch the use of modifiers in
10452         interfaces correctly.
10453         * class.cs: catch private void IFoo.Blah ().
10454
10455         All related to bug #50572.
10456
10457 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10458
10459         * decl.cs: Rewrite the consistant accessability checking.
10460         Accessability is not linear, it must be implemented in
10461         a tableish way. Fixes #49704.
10462
10463 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10464
10465         * expression.cs: Handle negation in a checked context.
10466         We must use subtraction from zero. Fixes #38674.
10467
10468 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10469
10470         * class.cs: Ignore static void main in DLLs.
10471         * rootcontext.cs: Handle the target type here,
10472         since we are have to access it from class.cs
10473         * driver.cs: account for the above.
10474
10475 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10476
10477         * report.cs: Give line numbers and files if available.
10478
10479 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10480
10481         * driver.cs: Implement /addmodule.
10482
10483         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10484         ModuleBuilders.
10485
10486 2003-12-20  Martin Baulig  <martin@ximian.com>
10487
10488         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10489         (FieldBase.IsAssigned): Removed this field.
10490         (FieldBase.SetAssigned): New public method.
10491         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10492
10493 2003-12-20  Martin Baulig  <martin@ximian.com>
10494
10495         * expression.cs (LocalVariableReference.DoResolve): Don't set
10496         `vi.Used' if we're called from DoResolveLValue().
10497
10498         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10499         returns the usage vector it just merged into the current one -
10500         pass this one to UsageWarning().
10501         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10502         of the `EmitContext', don't call this recursively on our children.
10503
10504 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10505
10506         * driver.cs: Implement /target:module.
10507
10508 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10509
10510         * support.cs (CharArrayHashtable): New helper class.
10511
10512         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10513         char arrays, not strings, so we can avoid creating a string in
10514         consume_identifier if the identifier is a keyword.
10515
10516 2003-12-16  Martin Baulig  <martin@ximian.com>
10517
10518         * statement.cs (LocalInfo.Assigned): Removed this property.
10519         (LocalInfo.Flags): Removed `Assigned'.
10520         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10521         and uses flow analysis.
10522         (Block.UsageWarning): Made this method private.
10523         (Block.Resolve): Call UsageWarning() if appropriate.
10524
10525         * expression.cs (LocalVariableReference.DoResolve): Always set
10526         LocalInfo.Used here.
10527
10528 2003-12-13  Martin Baulig  <martin@ximian.com>
10529
10530         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10531         any value here; we're now using flow analysis to figure out
10532         whether a statement/block returns a value.
10533
10534 2003-12-13  Martin Baulig  <martin@ximian.com>
10535
10536         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10537         working again.
10538         (FlowBranching.MergeFinally): Don't call
10539         `branching.CheckOutParameters()' here, this is called in
10540         MergeTopBlock().
10541         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10542         when adding the `finally' vector.       
10543
10544 2003-12-13  Martin Baulig  <martin@ximian.com>
10545
10546         * flowanalysis.cs
10547         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10548         actually work and also fix #48962.
10549
10550 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10551
10552         * decl.cs: Do not check System.Object for nested types,
10553         since we know it does not have any. Big bang for buck:
10554
10555         BEFORE:
10556            Run 1:   8.35 seconds
10557            Run 2:   8.32 seconds
10558            corlib:  17.99 seconds
10559         AFTER:
10560            Run 1:   8.17 seconds
10561            Run 2:   8.17 seconds
10562            corlib:  17.39 seconds
10563
10564 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10565
10566         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10567         time we are returning 0 members, so we save alot here.
10568
10569 2003-12-11  Martin Baulig  <martin@ximian.com>
10570
10571         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10572         `MergeChild()', also just take the `FlowBranching' as argument;
10573         call Merge() on it and return the result.
10574         (FlowBranching.Merge): We don't need to do anything if we just
10575         have one sibling.
10576
10577 2003-12-11  Martin Baulig  <martin@ximian.com>
10578
10579         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10580         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10581         Maurer for this idea.
10582
10583 2003-12-11  Martin Baulig  <martin@ximian.com>
10584
10585         * flowanalysis.cs (MergeResult): This class is now gone; we now
10586         use the `UsageVector' for this.  The reason for this is that if a
10587         branching just has one sibling, we don't need to "merge" them at
10588         all - that's the next step to do.
10589         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10590         `MergeResult'.
10591
10592 2003-12-11  Martin Baulig  <martin@ximian.com>
10593
10594         Reworked flow analyis and made it more precise and bug-free.  The
10595         most important change is that we're now using a special `Reachability'
10596         class instead of having "magic" meanings of `FlowReturns'.  I'll
10597         do some more cleanups and optimizations and also add some more
10598         documentation this week.
10599
10600         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10601         largely reworked this class.
10602         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10603         the new `Reachability' class instead of having "magic" values here.
10604         (FlowBranching): We're now using an instance of `Reachability'
10605         instead of having separate `Returns', `Breaks' etc. fields.
10606
10607         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10608         based on flow analysis; ignore the return value of block.Emit ().
10609
10610 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10611
10612         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10613         if they are private.
10614
10615 2003-12-09  Martin Baulig  <martin@ximian.com>
10616
10617         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10618         call them directly on the UsageVector.
10619
10620 2003-12-09  Martin Baulig  <martin@ximian.com>
10621
10622         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10623         Changed return type from `FlowReturns' to `Reachability'.
10624
10625 2003-12-09  Martin Baulig  <martin@ximian.com>
10626
10627         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10628         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10629         `Reachable' fields with a single `Reachability' one.
10630
10631 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10632
10633         * class.cs (FindMembers): Remove foreach's.
10634
10635         Bootstrap times:
10636
10637         BEFORE
10638                 Run 1:   8.74 seconds
10639                 Run 2:   8.71 seconds
10640
10641         AFTER
10642                 Run 1:   8.64 seconds
10643                 Run 2:   8.58 seconds
10644
10645
10646 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10647
10648         * cs-parser.jay:
10649         * gen-treedump.cs:
10650         * statement.cs:
10651         This patch does a few things:
10652                 1. EmptyStatement is now a singleton, so it is never reallocated.
10653                 2. All blah is EmptyStatement constructs have been changed to
10654                    blah == EmptyStatement.Value, which is much faster and valid
10655                    now that EmptyStatement is a singleton.
10656                 3. When resolving a block, rather than allocating a new array for
10657                    the non-empty statements, empty statements are replaced with
10658                    EmptyStatement.Value
10659                 4. Some recursive functions have been made non-recursive.
10660         Mainly the performance impact is from (3), however (1) and (2) are needed for
10661         this to work. (4) does not make a big difference in normal situations, however
10662         it makes the profile look saner.
10663
10664         Bootstrap times:
10665
10666         BEFORE
10667         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10668         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10669         Total memory allocated: 56397 KB
10670
10671         AFTER
10672         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10673         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10674         Total memory allocated: 55666 KB
10675
10676 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10677
10678         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10679         than the hashtable in a hashtable version
10680
10681         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10682         we always end up concating a string. This results in a huge perf
10683         loss, because many strings have to be tracked by the GC. In this
10684         patch, we first use a hashtable that works with two keys, so that
10685         the strings do not need to be concat'ed.
10686
10687         Bootstrap times:
10688         BEFORE
10689                 Run 1:   8.74 seconds
10690                 Run 2:   8.71 seconds
10691
10692         AFTER
10693                 Run 1:   8.65 seconds
10694                 Run 2:   8.56 seconds
10695
10696 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10697
10698         * Makefile: Add a new target `do-time' that does a quick and simple
10699         profile, leaving easy to parse output.
10700
10701 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10702
10703         * codegen.cs (Init): Create the dynamic assembly with 
10704         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10705
10706 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10707
10708         * support.cs: Make the PtrHashtable use only one
10709         instance of its comparer.
10710
10711 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10712
10713         * typemanager.cs: Fix lookup of GetNamespaces.
10714
10715 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10716
10717         * expression.cs: Removed redundant line.
10718
10719         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10720         ArrayLists, use for loops with bounds.  
10721
10722         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10723         arraylist.
10724
10725         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10726         arraylists, use for loop with bounds.
10727
10728         The above three changes give us a 0.071 second performance
10729         improvement out of 3.294 seconds down to 3.223.  On my machine
10730         the above changes reduced the memory usage by 1,387 KB during
10731         compiler bootstrap.
10732
10733         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10734         QualifiedIdentifiers.  Before we created a new string through
10735         concatenation, and mostly later on, the result would be
10736         manipulated by DecomposeQI through string manipulation.
10737
10738         This reduced the compiler memory usage for bootstrapping from
10739         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10740         compile times in 0.05 seconds.
10741
10742 2003-11-28  Dick Porter  <dick@ximian.com>
10743
10744         * support.cs: Do string compares with the Invariant culture.
10745
10746         * rootcontext.cs: 
10747         * gen-treedump.cs: 
10748         * expression.cs: 
10749         * driver.cs: 
10750         * decl.cs: 
10751         * codegen.cs: 
10752         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10753         the comparison is done with the Invariant culture.
10754
10755 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10756
10757         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10758         GetEnumerator method.
10759
10760         (ProbeCollectionType): Iterate starting at the most specific type
10761         upwards looking for a GetEnumerator
10762
10763         * expression.cs: Shift count can be up to 31 for int/uint and 63
10764         for long/ulong.
10765
10766 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10767
10768         * statement.cs (Block.LookupLabel): Also look for the label on the
10769         children blocks.  Use a hash table to keep track of visited
10770         nodes. 
10771
10772         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10773         we actually did transform the other operand, otherwise fall back
10774         to the common codepath that casts to long.
10775
10776         * cs-tokenizer.cs: Use the same code pattern as the int case.
10777         Maybe I should do the parsing myself, and avoid depending on the
10778         Parse routines to get this done.
10779
10780 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10781
10782         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10783         which fixes bug 51347.  This time test it.
10784
10785         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10786         attributes for example can not tell the difference between these.
10787         The difference was only a syntax feature of the language. 
10788
10789         * attribute.cs: Apply attributes to delegates.
10790
10791         * delegate.cs: Call the apply attributes method.
10792
10793 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10794
10795         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10796         comparing 0 vs Byte.MinValue, not the value
10797
10798         (ImplicitConversionRequired): When reporting a conversion error,
10799         use error 31 to print out the constant error instead of the
10800         simpler 29.
10801
10802         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10803         which fixes bug 51347.
10804
10805 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10806
10807         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10808         which fixes the -warnaserror command line option.
10809
10810 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10811
10812         * cfold.cs (DoNumericPromotions): During constant folding of
10813         additions on UIntConstant, special case intconstants with
10814         IntConstants like we do on the expression binary operator. 
10815
10816 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * convert.cs (ImplicitReferenceConversion): We were missing a case
10819         (System.Enum are not value types or class types, so we need to
10820         classify them separatedly).
10821
10822         * driver.cs: We do not support error 2007.
10823
10824 2003-11-12 Jackson Harper <jackson@ximian.com>
10825
10826         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10827         system directory. Also use the full file name so users can
10828         libraries names mscorlib-o-tron.dll in a non system dir.
10829         
10830 2004-01-04  David Sheldon <dave-mono@earth.li>
10831
10832         * expression.cs: Added matching ")" to error message for CS0077.
10833
10834 2003-12-19  Martin Baulig  <martin@ximian.com>
10835
10836         * typemanager.cs (TypeManager.IsEqualGenericType): New public
10837         static method; see documentation in the method.
10838         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10839
10840         * convert.cs (Convert.ImplicitReferenceConversion,
10841         Convert.ImplicitReferenceConversionExists): Add support for
10842         generic type declarations; see gen-36.cs.
10843
10844 2003-12-19  Martin Baulig  <martin@ximian.com>
10845
10846         * pending.cs (Pending.InterfaceMethod): Use
10847         `Type.IsAssignableFrom()' instead of `=='.
10848
10849 2003-12-18  Martin Baulig  <martin@ximian.com>
10850
10851         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10852         byref types first.
10853
10854         * convert.cs (Convert.ImplicitStandardConversionExists): Use
10855         `expr_type.Equals (target_type)' instead of `=='.
10856
10857 2003-12-08  Martin Baulig  <martin@ximian.com>
10858
10859         * generics.cs (Constraints.Types): Removed.
10860         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10861         to Type's.
10862         (Constraints.ResolveTypes): New public method; resolves the
10863         TypeExpr's to Type's.
10864         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10865         longer takes the constraints.
10866         (TypeParameter.DefineMethod): Likewise.
10867         (TypeParameter.DefineType): New public method.  Calls
10868         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10869         the constraints.
10870
10871 2003-12-08  Martin Baulig  <martin@ximian.com>
10872
10873         * convert.cs (Convert.ImplicitConversionStandard): Use
10874         `expr_type.Equals (target_type)' instead of `=='.
10875
10876 2003-12-08  Martin Baulig  <martin@ximian.com>
10877
10878         * typemanager.cs (TypeManager.GetReferenceType): Call
10879         `Type.MakeByRefType ()'.
10880
10881 2003-12-08  Martin Baulig  <martin@ximian.com>
10882
10883         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10884         just has some special meaning in some situations.  For instance,
10885         it is allowed to use `where' as the name of a variable etc.
10886
10887 2003-12-04  Martin Baulig  <martin@ximian.com>
10888
10889         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10890         `Type.MakeArrayType()' for array types.
10891
10892 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
10893
10894         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10895         debugging message.
10896
10897         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
10898         corlib to compile.
10899
10900 2003-11-16  Martin Baulig  <martin@ximian.com>
10901
10902         * codegen.cs (EmitContext.IsGeneric): Removed.
10903
10904         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10905         ResolveGeneric() on the DeclSpace.
10906
10907 2003-11-16  Martin Baulig  <martin@ximian.com>
10908
10909         * generic.cs (TypeArguments.Resolve):
10910         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10911         `ResolveType()' on it to get the Type.
10912
10913 2003-11-15  Martin Baulig  <martin@ximian.com>
10914
10915         * generic.cs (ConstructedType.GetInterfaces): Override this.
10916
10917 2003-11-14  Martin Baulig  <martin@ximian.com>
10918
10919         * interface.cs (Interface.DefineType): Define all type parameters
10920         before adding the interfaces we inherit.
10921
10922 2003-11-11  Martin Baulig  <martin@ximian.com>
10923
10924         * generic.cs (ConstructedType.ResolveType): Always call
10925         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10926
10927 2003-11-10  Martin Baulig  <martin@ximian.com>
10928
10929         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10930         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10931         calling `ResolveType()' on them, directly assign their `Type'.
10932
10933 2003-11-08  Martin Baulig  <martin@ximian.com>
10934
10935         * generic.cs (ConstructedType): Override `IsClass' etc.
10936
10937 2003-11-08  Martin Baulig  <martin@ximian.com>
10938
10939         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10940         return value and the `out parent' parameter.
10941         (TypeContainer.DefineType): Moved the CS0644 check into
10942         GetClassBases().  Don't pass the interface types to the
10943         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10944         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10945
10946         * ecore.cs (TypeExpr.IsAttribute): New property.
10947         (TypeExpr.GetInterfaces): New method.
10948
10949         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10950         TypeExpr instead of a Type.
10951         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10952         (Interface.DefineType): Don't pass the interface types to the
10953         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10954         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10955
10956         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10957         instead of a `Type[]'.
10958         (TypeManager.RegisterBuilder): Likewise.
10959         (TypeManager.AddUserInterface): Likewise.
10960         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10961         `Type[]' and also return a `TypeExpr[]'.
10962         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10963
10964 2003-11-08  Martin Baulig  <martin@ximian.com>
10965
10966         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10967         Expression.     
10968
10969 2003-11-08  Martin Baulig  <martin@ximian.com>
10970
10971         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10972         TypeManager.ResolveExpressionTypes().
10973
10974         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10975         instead of an Expression.
10976         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10977         (TypeExpression): New public class; formerly known as `TypeExpr'.
10978
10979         * expression.cs (ComposedCast): Derive from TypeExpr.
10980
10981         * typemanager.cs (TypeManager.system_*_expr): These are now
10982         TypExpr's instead of Expression's.
10983         (TypeManager.ResolveExpressionTypes): New public static function;
10984         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10985         of them.        
10986
10987 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10988
10989         * expression.cs (New.DoResolve): Do not dereference value that
10990         might be a null return.
10991
10992         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10993         sure that the constant value has the right type.  Fixes an
10994         unreported bug, similar to 50425.
10995
10996         * const.cs (Const.LookupConstantValue): Call
10997         ImplicitStandardConversionExists before doing a conversion to
10998         avoid havng the TypeManager.ChangeType do conversions.
10999
11000         Reduced the number of casts used
11001
11002         (Const.ChangeType): New routine to enable reuse of the constant
11003         type changing code from statement.
11004
11005         * typemanager.cs (ChangeType): Move common initialization to
11006         static global variables.
11007
11008         Fixes #50425.
11009
11010         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11011         every value type to go through, even if it was void.  Fix that. 
11012
11013         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11014         character of the define, and the is_identifier_part_character for
11015         the rest of the string.
11016
11017 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11018
11019         * expression.cs (UnaryMutator.EmitCode): When I updated
11020         LocalVariableReference.DoResolve, I overdid it, and dropped an
11021         optimization done on local variable references.
11022
11023 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11024
11025         * ecore.cs: Convert the return from Ldlen into an int.
11026
11027 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11028
11029         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11030         the accessibility, this is a special case for toplevel non-public
11031         classes (internal for instance).
11032
11033 2003-10-20  Nick Drochak <ndrochak@gol.com>
11034
11035         * ecore.cs: Fix typo and build.  Needed another right paren.
11036
11037 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11038
11039         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11040         `internal' case regular and protected, but not allowing protected
11041         to be evaluated later.  Bug 49840
11042
11043 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11044
11045         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11046         to kb.Nlast, and not the kb.nFirst to isolate the switch
11047         statement.
11048
11049         Extract the underlying type, so enumerations of long/ulong are
11050         treated like long/ulong.
11051
11052 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * expression.cs (New): Overload the meaning of RequestedType to
11055         track the possible creation of the NewDelegate type, since
11056         DoResolve is invoked more than once for new constructors on field
11057         initialization.
11058
11059         See bugs: #48800 and #37014
11060
11061         * cs-parser.jay (declare_local_constants): Take an arraylist
11062         instead of a single constant.
11063
11064         (local_constant_declaration): It should take a
11065         constant_declarators, not a constant_declarator.  Fixes 49487
11066
11067         * convert.cs: Fix error report.
11068
11069 2003-10-13 Jackson Harper <jackson@ximian.com>
11070
11071         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11072         bug #49611
11073         
11074 2003-11-03  Martin Baulig  <martin@ximian.com>
11075
11076         * expression.cs (ArrayAccess.GetStoreOpcode): Added
11077         `out bool has_type_arg'; if set, we need to pass the type to
11078         ig.Emit().
11079         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11080         Stelem_Any/Ldelem_Any for generic parameters.   
11081
11082 2003-11-02  Martin Baulig  <martin@ximian.com>
11083
11084         * expression.cs (Invocation.EmitCall): Use
11085         `TypeManager.IsValueType()' to check whether it's a value type.
11086         Don't set `struct_call' when calling a method on a type parameter.
11087
11088 2003-11-02  Martin Baulig  <martin@ximian.com>
11089
11090         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11091         and removed the TypeBuilder argument.
11092
11093         * typemanager.cs (TypeManager.IsValueType): Return
11094         `t.IsGenericParameter || t.IsValueType'.
11095
11096 2003-10-25  Martin Baulig  <martin@ximian.com>
11097
11098         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11099         call ConstructedType.Resolve() on it.
11100
11101         * generic.cs (ConstructedType.Resolve): Set `type' on success.
11102
11103 2003-10-25  Martin Baulig  <martin@ximian.com>
11104
11105         * class.cs (TypeContainer.GetClassBases): Changed
11106         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
11107         CS8214 reporting here.
11108         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11109         instead of a `Type' for our parent.  In case of a recursive
11110         declaration (see tests/gen-23.cs for an example), our parent is a
11111         ConstructedType and it doesn't have its type set.  So, first
11112         create our own TypeBuilder, then call constructed.Resolve() to get
11113         the parent's type and finally TypeBuilder.SetParent() it.
11114
11115         * ecore.cs (TypeExpr.Name): New public virtual property.
11116
11117         * generic.cs
11118         (ConstructedType): We're now a TypeExpr and not just an Expression.
11119         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11120         arguments here; this is done later.
11121         (ConstructedType.Resolve): New public method to resolve the type
11122         arguments and bind them.
11123
11124 2003-10-21  Martin Baulig  <martin@ximian.com>
11125
11126         * convert.cs: Use `TypeManager.IsValueType' instead of
11127         'type.IsValueType' everywhere.
11128
11129         * typemanager.cs (TypeManager.IsValueType): Return true for type
11130         parameters.  The reason for this is that we need to box a type
11131         parameter when converting it to a reference type.
11132
11133         * cs-parser.jay: Added support for default value expressions.
11134
11135         * generics.cs (DefaultValueExpression): New public class.       
11136
11137 2003-10-17  Martin Baulig  <martin@ximian.com>
11138
11139         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11140         TypeContainer so we can also use this for Interfaces.
11141         (TypeParameter.Resolve): Likewise.
11142
11143         * interface.cs (Interface.DefineType): Added support for generic
11144         interfaces.
11145
11146         * cs-parser.jay: Added support for generic structs and interfaces.
11147
11148 2003-10-17  Martin Baulig  <martin@ximian.com>
11149
11150         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
11151         call generic methods :-)
11152
11153 2003-10-16  Martin Baulig  <martin@ximian.com>
11154
11155         * cs-parser.jay (namespace_or_type_name): Only create a
11156         GenericMemberAccess if we actually have type arguments.
11157
11158 2003-10-13  Martin Baulig  <martin@ximian.com>
11159
11160         * class.cs (Method.Define): If we're a generic method, call
11161         TypeBuilder.DefineGenericMethod () before resolving
11162         the parameters.
11163         (MethodData): Added .ctor which takes an additional MethodBuilder
11164         argument; this is used for generic methods.
11165         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
11166         we already have a MethodBuilder.
11167
11168 2003-10-10  Martin Baulig  <martin@ximian.com>
11169
11170         * class.cs (Method): Added .ctor which takes a `GenericMethod'
11171         instead of a `DeclSpace'.  This is used for generic methods.
11172
11173         * cs-parser.jay (method_header): Added support for generic
11174         methods; create a `GenericMethod' instance and pass it to the
11175         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
11176         parameters and locals.
11177
11178         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
11179         since we already have the location.  Check whether we're a generic
11180         type declaration or a generic method and create the correct type
11181         parameter.
11182
11183         * generic.cs (TypeParameter.DefineMethod): New public method.
11184         (GenericMethod): New public class; derives from DeclSpace and is
11185         used for generic methods.       
11186
11187 2003-10-09  Martin Baulig  <martin@ximian.com>
11188
11189         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11190         to the .ctor.
11191         (MethodCore.DoDefineParameters): Removed the TypeContainer
11192         argument; use the DeclSpace which was passed to the .ctor instead.
11193         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11194         TypeContainer; we only need a DeclSpace here.
11195
11196 2003-10-09  Martin Baulig  <martin@ximian.com>
11197
11198         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11199         to the .ctor.
11200         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11201         EmitContext's .ctor.    
11202
11203 2003-10-09  Martin Baulig  <martin@ximian.com>
11204
11205         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11206         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11207         AsAccessible(), moved them as well.
11208
11209         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11210
11211 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11212
11213         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11214         generation for >=, as spotted by Paolo, bug 48679.  
11215         Patch from David Waite.
11216
11217         * cs-tokenizer.cs: Add handling for #pragma.
11218
11219         * cs-parser.jay: Allow for both yield and yield return in the
11220         syntax.  The anti-cobolization of C# fight will go on!
11221
11222         * class.cs (TypeBuilder.DefineType): Catch error condition here
11223         (Parent.DefineType erroring out and returning null).
11224
11225         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11226         coping with enumerations variables, we were mistakenly processing
11227         them as a regular value type instead of built-in types.  Fixes the
11228         bug #48063
11229
11230         * typemanager.cs (IsBuiltinOrEnum): New method.
11231
11232 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11233
11234         * cs-parser.jay: Upgrade: yield now needs the return clause.
11235
11236 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11237
11238         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11239
11240 2003-09-29  Martin Baulig  <martin@ximian.com>
11241
11242         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
11243         inflated generic methods.
11244
11245         * generics.cs (ConstructedType): Distinguish between open and
11246         closed constructed types; correctly resolve the arguments.
11247
11248 2003-09-22  Martin Baulig  <martin@ximian.com>
11249
11250         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
11251         all type arguments meet their constraints.
11252
11253 2003-09-19  Martin Baulig  <martin@ximian.com>
11254
11255         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11256         `MemberCache parent' argument.  Normally, an interface doesn't
11257         have a parent type except System.Object, but we use this in gmcs
11258         for generic type parameters.
11259
11260 2003-09-18  Martin Baulig  <martin@ximian.com>
11261
11262         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11263         on `type.IsInterface'; don't check whether the type has a parent
11264         to determine whether it's an interface.
11265
11266 2003-09-17  Martin Baulig  <martin@ximian.com>
11267
11268         * generic.cs (ConstructedType.ToString): Always use `name' as the
11269         type name.
11270
11271 2003-09-15  Martin Baulig  <martin@ximian.com>
11272
11273         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
11274
11275         * generic.cs (Constraints.Resolve): New public method; this is
11276         called to resolve the constraint types and to check whether all
11277         the constraints are correct.
11278         (Constraints.Types): New public property.
11279         (TypeParameter.Resolve): New public method; resolves all the
11280         type's constraints.
11281
11282         * class.cs (TypeContainer.DefineType): Call
11283         TypeParameter.Resolve() before actually defining the type.
11284
11285 2003-09-15  Martin Baulig  <martin@ximian.com>
11286
11287         * class.cs (TypeContainer.DefineType): Added an error flag to
11288         avoid reporting duplicate CS0146's ("class definition is
11289         circular.").
11290
11291         * driver.cs (Driver.MainDriver): Abort if
11292         RootContext.ResolveTree() reported any errors.
11293
11294 2003-09-07  Martin Baulig  <martin@ximian.com>
11295
11296         * report.cs (Error, Warning): Added overloaded versions which take
11297         a `params object[] args' and call String.Format().
11298
11299 2003-09-07  Martin Baulig  <martin@ximian.com>
11300
11301         * decl.cs (DeclSpace..ctor): Don't call
11302         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11303         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11304         (DeclSpace.RecordDecl): New method.
11305
11306         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11307
11308 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11309
11310         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11311         value attributes to be applied to ParameterBuilders.
11312
11313         * class.cs (MethodCore.LabelParameters): Make static and more
11314         generic so that it can be used from other places - like interface
11315         methods, for instance.
11316
11317         * interface.cs (Interface.Emit): Call LabelParameters before
11318         emitting attributes on the InterfaceMethod.
11319
11320 2003-09-07  Martin Baulig  <martin@ximian.com>
11321
11322         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
11323         if the number of type parameters doesn't match.
11324
11325 2003-09-04  Martin Baulig  <martin@ximian.com>
11326
11327         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
11328         for arrays of generic type params (ie. `!0[]').
11329
11330 2003-09-04  Martin Baulig  <martin@ximian.com>
11331
11332         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
11333         for the moment.
11334
11335 2003-09-04  Martin Baulig  <martin@ximian.com>
11336
11337         * decl.cs (DeclSpace.LookupGeneric): New method.
11338         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
11339         moment.
11340
11341         * generic.cs (TypeParameterExpr): Take a TypeParameter as
11342         argument, not just a string.
11343         (TypeParameter.Define): New public method; this is called to
11344         actually define the generic parameter; after this, you can use the
11345         new `Type' property to get the type.
11346
11347 2003-09-04  Martin Baulig  <martin@ximian.com>
11348
11349         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
11350         is now an ArrayList; initialize the result of the `TypeParameters'
11351         property here.
11352         (DeclSpace.GetGenericData): Removed.
11353         (DeclSpace.LookupGeneric): Temporarily removed; we need to
11354         implement this in a different way.
11355         (DeclSpace.GetTypeParameters): Removed; there's now a
11356         `TypeParameters' property.
11357         (DeclSpace.TypeParameters): New public property.
11358
11359         * generic.cs (Constraints): Make this class public.
11360         (TypeParameter): New public class.
11361
11362 2003-09-04  Martin Baulig  <martin@ximian.com>
11363
11364         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
11365         generic parameters.
11366
11367         * class.cs (TypeContainer.DefineType): Call
11368         TypeBuilder.DefineGenericParameter () on all generic parameters if
11369         this is a generic type.
11370
11371 2003-08-28  Martin Baulig  <martin@ximian.com>
11372
11373         * sample-stack.il: Compile this with ilasm: "ilasm /dll
11374         sample-stack.il".
11375
11376         * sample-hello.cs: Compile this with gmcs: "gmcs
11377         /r:sample-stack.dll sample-hello.cs".
11378
11379 2003-08-28  Martin Baulig  <martin@ximian.com>
11380
11381         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
11382         the parameters to the generic type.
11383
11384 2003-08-28  Martin Baulig  <martin@ximian.com>
11385
11386         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
11387
11388 2003-08-28  Martin Baulig  <martin@ximian.com>
11389
11390         * cs-parser.jay (opt_type_argument_list): Use
11391         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
11392         (primary_expression): Replace `qualified_identifier' with `type_name'.
11393         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
11394
11395         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
11396         parser to check whether it is syntactically a type parameter list;
11397         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
11398         this case.
11399
11400 2003-08-26  Martin Baulig  <martin@ximian.com>
11401
11402         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11403         resolving aliases; fixes #47927.
11404
11405 2003-08-26  Martin Baulig  <martin@ximian.com>
11406
11407         * statement.cs (Using.DoResolve): This is internally emitting a
11408         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11409         do not always return.  Fixes #47681.
11410
11411 2003-08-26  Martin Baulig  <martin@ximian.com>
11412
11413         * decl.cs (MemberCore): Moved WarningNotHiding(),
11414         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11415         into MemberBase.
11416         (AdditionResult): Make this nested in DeclSpace.
11417         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11418         argument; call NamespaceEntry.Define() unless we're nested in a
11419         class or struct.
11420
11421         * namespace.cs (Namespace.DefineName): New public function.  This
11422         is called from DeclSpace's .ctor to add 
11423         (Namespace.Lookup): Include DeclSpaces in the lookup.
11424
11425         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11426
11427         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11428
11429 2003-08-25  Martin Baulig  <martin@ximian.com>
11430
11431         * convert.cs (Convert.ExplicitReferenceConversion): When
11432         converting from an interface type to a class, unbox if the target
11433         type is a struct type.  Fixes #47822.
11434
11435 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11436
11437         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11438         #47854.
11439
11440 2003-08-22  Martin Baulig  <martin@ximian.com>
11441
11442         * class.cs (TypeManager.DefineType): When defining a nested type,
11443         call DefineType() on our parent; fixes #47801.
11444
11445 2003-08-22  Martin Baulig  <martin@ximian.com>
11446
11447         * class.cs (MethodData.Define): While checking if a method is an
11448         interface implementation, improve the test a bit more to fix #47654.
11449
11450 2003-08-22  Martin Baulig  <martin@ximian.com>
11451
11452         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11453         correctly; fixes #47722.
11454
11455 2003-08-22  Martin Baulig  <martin@ximian.com>
11456
11457         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11458         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11459
11460         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11461
11462 2003-08-22  Martin Baulig  <martin@ximian.com>
11463
11464         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11465         can only be assigned in static constructors.  Fixes #47161.
11466
11467 2003-08-22  Martin Baulig  <martin@ximian.com>
11468
11469         Rewrote and improved the flow analysis code.
11470
11471         * flowbranching.cs (FlowBranching): Make this class abstract.
11472         (FlowBranching.CreateBranching): New static function to create a
11473         new flow branching.
11474         (FlowBranchingBlock, FlowBranchingException): New classes.
11475         (FlowBranching.UsageVector.Type): New public readonly field.
11476         (FlowBranching.UsageVector.Breaks): Removed the setter.
11477         (FlowBranching.UsageVector.Returns): Removed the setter.
11478         (FlowBranching.UsageVector): Added Break(), Return(),
11479         NeverReachable() and Throw() methods to modify the reachability.
11480         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11481         done by FlowBranching.Merge().
11482         (FlowBranching.UsageVector.MergeChild): New method; merges the
11483         merge result into the current vector.
11484         (FlowBranching.Merge): New abstract method to merge a branching.
11485
11486 2003-08-12  Martin Baulig  <martin@ximian.com>
11487
11488         * expression.cs (Indirection.CacheTemporaries): Create the
11489         LocalTemporary with the pointer type, not its element type.
11490
11491 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11492
11493         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11494         token was a keyword or not.
11495
11496         Add `error' options where an IDENTIFIER was expected;  Provide
11497         CheckToken and CheckIdentifierToken convenience error reporting
11498         functions. 
11499
11500         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11501
11502         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11503         NameSpaceEntry NameSpaceEntry.
11504
11505         (LookupInterfaceOrClass): Avoid creating a full qualified name
11506         from namespace and name: avoid doing lookups when we know the
11507         namespace is non-existant.   Use new Tree.LookupByNamespace which
11508         looks up DeclSpaces based on their namespace, name pair.
11509
11510         * driver.cs: Provide a new `parser verbose' to display the
11511         exception thrown during parsing.  This is turned off by default
11512         now, so the output of a failure from mcs is more graceful.
11513
11514         * namespace.cs: Track all the namespaces defined in a hashtable
11515         for quick lookup.
11516
11517         (IsNamespace): New method
11518
11519 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11520
11521         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11522         we know that we need to concatenate (full typename can never be
11523         null). 
11524
11525         * class.cs: ditto.
11526
11527         * statement.cs: Use a bitfield;  Do not initialize to null things
11528         which are done by the constructor by default.
11529
11530         * cs-parser.jay: bug fix, parameter was 4, not 3.
11531
11532         * expression.cs: Just use the property;
11533
11534         * statement.cs: No need for GetVariableInfo method.
11535
11536 2003-08-08  Martin Baulig  <martin@ximian.com>
11537
11538         * flowanalysis.cs (FlowReturns): This is now nested in the
11539         `FlowBranching' class.
11540         (MyBitVector): Moved this here from statement.cs.
11541         (FlowBranching.SiblingType): New enum type.
11542         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11543
11544 2003-08-07  Martin Baulig  <martin@ximian.com>
11545
11546         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11547         `FlowBranching' class and called `BranchingType'.
11548
11549 2003-08-07  Martin Baulig  <martin@ximian.com>
11550
11551         * flowanalysis.cs: Moved all the control flow analysis code into
11552         its own file.
11553
11554 2003-08-07  Martin Baulig  <martin@ximian.com>
11555
11556         * assign.cs (Assign.DoResolve): `target' must either be an
11557         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11558         #37319.
11559
11560 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11561
11562         * expression.cs (BinaryMethod): This kind of expression is created by the
11563         Binary class if it determines that the operator has to be handled
11564         by a method.
11565
11566         (BinaryDelegate): This kind of expression is created if we are
11567         dealing with a + or - operator on delegates.
11568
11569         (Binary): remove method, argumetns, and DelegateOperator: when
11570         dealing with methods, 
11571
11572         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11573
11574         * statement.cs (Block): use bitfields for the three extra booleans
11575         we had in use.   Remove unused topblock parameter.
11576
11577         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11578
11579         * assign.cs: Drop extra unneeded tests.
11580
11581 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11582
11583         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11584
11585         * statement.cs (Foreach): Use VariableStorage instead of
11586         LocalBuilders.   
11587
11588         * codegen.cs (VariableStorage): New class used by clients that
11589         require a variable stored: locals or fields for variables that
11590         need to live across yield.
11591
11592         Maybe provide a convenience api for EmitThis+EmitLoad?
11593
11594         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11595         these bad boys.
11596
11597 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11598
11599         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11600         RemapParameterLValue): New methods that are used to turn a
11601         precomputed FieldInfo into an expression like this:
11602
11603                 instance.FieldInfo
11604
11605         The idea is to use this instead of making LocalVariableReference
11606         have more than one meaning.
11607
11608         * cs-parser.jay: Add error production to BASE.
11609
11610         * ecore.cs: Deal with TypeManager.GetField returning null, which
11611         is now a valid return value.
11612
11613         (FieldExprNoAddress): New expression for Fields whose address can
11614         not be taken.
11615
11616         * expression.cs (LocalVariableReference): During the resolve
11617         phases, create new expressions if we are in a remapping context.
11618         Remove code that dealt with remapping here.
11619
11620         (ParameterReference): same.
11621
11622         (ProxyInstance): New expression, like the `This' expression, but
11623         it is born fully resolved.  We know what we are doing, so remove
11624         the errors that are targeted to user-provided uses of `this'.
11625
11626         * statement.cs (Foreach): our variable is now stored as an
11627         Expression;  During resolution, follow the protocol, dont just
11628         assume it will return this.
11629
11630 2003-08-06  Martin Baulig  <martin@ximian.com>
11631
11632         * support.cs (SeekableStreamReader.cs): New public class.
11633
11634         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11635         SeekableStreamReader instead of the normal StreamReader.
11636
11637 2003-08-04  Martin Baulig  <martin@ximian.com>
11638
11639         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11640         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11641         deambiguate casts and delegate invocations.
11642         (parenthesized_expression): Use the new tokens to ensure this is
11643         not a cast of method invocation.
11644
11645         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11646         when reading a `)' and Deambiguate_CloseParens () was previously
11647         called.
11648
11649         * expression.cs (ParenthesizedExpression): New class.  This is
11650         just used for the CS0075 test.
11651         (Binary.DoResolve): Check for CS0075.   
11652
11653 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11654
11655         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11656         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11657         reference comparison.
11658
11659         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11660         examine the ReturnType for equality - this is necessary in the
11661         cases of implicit and explicit operators whose signature also
11662         includes the return type.
11663
11664 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11665
11666         * namespace.cs: Cache the result of the namespace computation,
11667         instead of computing it every time.
11668
11669 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11670
11671         * decl.cs: Use a global arraylist that we reuse over invocations
11672         to avoid excesive memory consumption.  Reduces memory usage on an
11673         mcs compile by one meg (45 average).
11674
11675         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11676         private, work around that.
11677
11678 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11679
11680         * literal.cs (IntLiteral): Define Zero and One static literals. 
11681
11682         * cs-parser.jay (integer_literal): use static literals to reduce
11683         memory usage for the most used literals (0, 1 and -1).  211kb
11684         reduced in memory usage.
11685
11686         Replace all calls to `new ArrayList' with `new
11687         ArrayList(4)' which is a good average number for most allocations,
11688         and also requires only 16 bytes of memory for its buffer by
11689         default. 
11690
11691         This reduced MCS memory usage in seven megabytes for the RSS after
11692         bootstrapping.
11693
11694 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11695
11696         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11697         handle params methods the correct way by forming only one
11698         applicable set with params and normal methods in them. Earlier we
11699         were looking at params methods only if we found no normal methods
11700         which was not the correct thing to do.
11701
11702         (Invocation.BetterFunction): Take separate arguments indicating
11703         when candidate and the best method are params methods in their
11704         expanded form.
11705
11706         This fixes bugs #43367 and #46199.
11707
11708         * attribute.cs: Documentation updates.
11709
11710         (CheckAttribute): Rename to CheckAttributeTarget.
11711         (GetValidPlaces): Rename to GetValidTargets.
11712
11713         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11714         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11715
11716         Fixes bug #44468.
11717
11718 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
11719
11720         * codegen.cs: Compute IsGeneric correctly.
11721
11722         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11723         resolution. 
11724
11725         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11726         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
11727         regressions, and I was chasing more bugs than I required.
11728
11729         * interface.cs: Use expressions for base type names (like classes
11730         and structs have been doing for a while now), and resolve that.
11731         This patch should probably go into head as well.
11732
11733         This makes it one less user of FindType.
11734
11735 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11736
11737         This compiler can not self host currently.  Need to fix that.
11738         
11739         * Makefile: compile to `gmcs.exe'
11740
11741         * driver.cs: Turn on v2 by default on gmcs.
11742
11743         * generic.cs (ConstructedType): Does no longer take a container
11744         type argument;  That will be taken care of later.
11745
11746         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11747         Use SimpleName to resolve for now, so we can continue the work on
11748         the parser, until we get Type.GetType that understands generics.
11749
11750         (ConstructedType.ToString): Implement
11751
11752         (TypeArguments.Resolve): Resolve the child expressions as types. 
11753         
11754         * cs-parser.jay: Rename interface_constraints to
11755         type_parameter_constraints
11756
11757         (namespace_or_type_name): Only use constructed types for the basic
11758         construction, we will deal with identifier<...> later.
11759
11760         (type/type_name): No longer call DecomposeQI, as
11761         namespace_or_type_name is always decoded now.
11762         
11763 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11764
11765         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11766         closely: we eliminate methods in base types when we have an
11767         applicable method in a top-level type.
11768
11769         Please see section 14.5.5.1 for an exact description of what goes
11770         on. 
11771
11772         This fixes bug #45127 and a host of other related to corlib compilation.
11773
11774         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11775         array is the method corresponding to the top-level type (this is
11776         because of the changes made to icall.c) so we change this
11777         accordingly.
11778
11779         (MethodGroupExpr.Name): This too.
11780
11781         * typemanager.cs (GetElementType): New method which does the right
11782         thing when compiling corlib. 
11783
11784         * everywhere: Make use of the above in the relevant places.
11785
11786 2003-07-22  Martin Baulig  <martin@ximian.com>
11787
11788         * cs-parser.jay (invocation_expression): Moved
11789         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11790         `cast_expression', but create a InvocationOrCast which later
11791         resolves to either an Invocation or a Cast.
11792
11793         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11794         method; call this before EmitStatement() to make sure that this
11795         expression can be used as a statement.
11796
11797         * expression.cs (InvocationOrCast): New class; resolves to either
11798         an Invocation or a Cast.
11799
11800         * statement.cs (StatementExpression): Call ResolveStatement() on
11801         the ExpressionStatement before emitting it.
11802
11803 2003-07-21  Martin Baulig  <martin@ximian.com>
11804
11805         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11806         `ref' and `out' attributes match; fixes #46220.
11807         (MemberAccess.ResolveMemberAccess): You can't reference a type
11808         through an expression; fixes #33180.
11809         (Indexers.GetIndexersForType): Don't return the indexers from
11810         interfaces the class implements; fixes #46502.
11811
11812 2003-07-21  Martin Baulig  <martin@ximian.com>
11813
11814         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11815         CS0661 checks; fixes bug #30442.
11816
11817 2003-07-21  Martin Baulig  <martin@ximian.com>
11818
11819         * decl.cs (AdditionResult): Added `Error'.
11820
11821         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11822
11823         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11824         cs0031.cs actually work.
11825
11826  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11827  
11828         * cs-parser.jay (namespace_name): do not use
11829         namespace_or_type_name, use qualified_identifier, because
11830         namespace_or_type_name will soon return a composed expression
11831         instead of a string.
11832  
11833         (namespace_or_type_name): Instead of returning a string, now this
11834         production returns an expression.
11835  
11836         * codegen.cs (EmitContext): Setup IsGeneric property based on
11837         whether our DeclSpace is generic, our the method is generic.
11838  
11839         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11840         the method is generic.
11841  
11842         * cs-parser.jay (type_arguments, opt_type_argument_list,
11843         type_parameters, type_parameter_list, opt_type_parameter_list,
11844         type_parameter,, opt_type_parameter_constraints_clauses,
11845         type_parameter_constraints_clauses,
11846         type_parameter_constraint_clause, type_parameter_constraint,
11847         interface_constraints): Add new production
11848  
11849         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11850         DeclSpace is generic or not.
11851  
11852         (DeclSpace.SetParameterInfo): New routine, used to set the
11853         parameter info for a type.
11854  
11855         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11856         returns a GenericTypeExpr
11857  
11858         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11859         generic, lookup the generic argument.
11860  
11861         * attribute.cs: Do not allow TypeParameterExpressions in
11862         Attributes.
11863  
11864         * class.cs: Do not allow the Main method to be defined in a
11865         Generic container.
11866  
11867         * expression.cs (SizeOf): Do not allow generic types to be used as
11868         arguments to sizeof.
11869  
11870         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11871         it: whether a type is generic or not.  Only works for types we are
11872         currently building for now.
11873         
11874 2003-07-20  Martin Baulig  <martin@ximian.com>
11875
11876         * namespace.cs: Fixed that bug which caused a crash when compiling
11877         the debugger's GUI.
11878
11879 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11880
11881         * typemanager.cs (LookupTypeReflection): Never expose types which
11882         are NotPublic, NestedPrivate, NestedAssembly, or
11883         NestedFamANDAssem.  We used to return these, and later do a check
11884         that would report a meaningful error, but the problem is that we
11885         would not get the real match, if there was a name override.
11886
11887 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11888
11889         * namespace.cs (Namespace, Name): Do not compute the namespace
11890         name dynamically, compute it in the constructor.  This reduced
11891         memory usage by 1697 KB.
11892
11893         * driver.cs: Use --pause to pause at the end.
11894
11895 2003-07-17  Peter Williams  <peter@newton.cx>
11896
11897         * Makefile: Change the name of the test target so that it doesn't
11898         conflict with the recursive test target.
11899
11900 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11901
11902         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11903         AddressOf): Do not use EmitThis, that was wrong, use the actual
11904         this pointer.
11905
11906 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11907
11908         * class.cs (MethodData.Define): While checking if a method is an
11909         interface implementation, improve the test: If we are not public
11910         (use new test here: use the computed MethodAttributes directly,
11911         instead of the parsed modifier flags) check if the `implementing'
11912         method comes from an interface or not.
11913
11914         * pending.cs (VerifyPendingMethods): Slightly better error
11915         message.
11916
11917         * makefile: add test target that does the mcs bootstrap.
11918
11919 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11920
11921         * interface.cs (Define): Do nothing here since there are no
11922         members to populate etc. Move the attribute emission out of here
11923         since this was just totally the wrong place to put it. Attribute
11924         application happens during the 'Emit' phase, not in the 'Define'
11925         phase.
11926
11927         (Emit): Add this method and move the attribute emission here
11928
11929         * rootcontext.cs (EmitCode): Call the Emit method on interface
11930         types too.
11931
11932 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11933
11934         * expression.cs (OverloadResolve): Report error only if Location
11935         is not 'Null' which means that there was a probe going on.
11936
11937 2003-07-14  Martin Baulig  <martin@ximian.com>
11938
11939         * expression.cs (ConditionalLogicalOperator): New public class to
11940         implement user defined conditional logical operators.
11941         This is section 14.11.2 in the spec and bug #40505.
11942
11943 2003-07-14  Martin Baulig  <martin@ximian.com>
11944
11945         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11946
11947 2003-07-14  Martin Baulig  <martin@ximian.com>
11948
11949         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11950
11951         * ecore.cs (IVariable.VerifyFixed): New interface method.
11952
11953         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11954         operator, check whether the variable is actually fixed.  Fixes bug
11955         #36055.  Set a variable definitely assigned when taking its
11956         address as required by the spec.
11957
11958         * statement.cs (LocalInfo.IsFixed): New field.
11959         (LocalInfo.MakePinned): Set `IsFixed' to true.
11960
11961 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11962
11963         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11964         for .ctors, ensure that we only ask for members declared in the
11965         attribute type (BindingFlags.DeclaredOnly).
11966
11967         Fixes bug #43632.
11968
11969         * expression.cs (Error_WrongNumArguments): Report error 1501
11970         correctly the way CSC does.
11971
11972 2003-07-13  Martin Baulig  <martin@ximian.com>
11973
11974         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11975         lookup on the fully qualified name, to make things like "X.X" work
11976         where "X.X" is a fully qualified type name, but we also have a
11977         namespace "X" in the using list.  Fixes #41975.
11978
11979 2003-07-13  Martin Baulig  <martin@ximian.com>
11980
11981         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11982         function. If we're a CompoundAssign, we need to create an embedded
11983         CompoundAssign, not an embedded Assign.
11984         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11985         Fixes #45854.
11986
11987 2003-07-13  Martin Baulig  <martin@ximian.com>
11988
11989         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11990         work to fix bug #46088.
11991
11992 2003-07-13  Ravi Pratap <ravi@ximian.com>
11993
11994         * class.cs (Operator.Emit): Do not emit attributes here - it is
11995         taken care of by the Method class that we delegate too. This takes
11996         care of bug #45876.
11997
11998 2003-07-10  Martin Baulig  <martin@ximian.com>
11999
12000         * expression.cs (TypeOfVoid): New class.
12001         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12002
12003 2003-07-10  Martin Baulig  <martin@ximian.com>
12004
12005         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12006         bug #35957.
12007
12008 2003-07-10  Martin Baulig  <martin@ximian.com>
12009
12010         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12011         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12012
12013         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12014
12015         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12016
12017 2003-07-10  Martin Baulig  <martin@ximian.com>
12018
12019         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12020         of decimal.  Fixes #42850.
12021
12022         NOTE: I also fixed the created byte blob, but this doesn't work on
12023         the MS runtime and csc never produces any byte blobs for decimal
12024         arrays.
12025
12026 2003-07-10  Martin Baulig  <martin@ximian.com>
12027
12028         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12029         structs; fixes #32068.
12030         (Block.AddChildVariableNames): Fixed #44302.
12031
12032 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12033
12034         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12035
12036 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12037
12038         * attribute.cs: And this test is onger needed.
12039
12040 2003-07-08  Martin Baulig  <martin@ximian.com>
12041
12042         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12043         inaccessible types.  Fixes #36313.
12044
12045         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12046
12047         * namespace.cs (NamespaceEntry): Create implicit entries for all
12048         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12049         implicit entries for N1.N2 and N1.
12050
12051 2003-07-08  Martin Baulig  <martin@ximian.com>
12052
12053         Rewrote the handling of namespaces to fix a lot of the issues
12054         wrt. `using' aliases etc.
12055
12056         * namespace.cs (Namespace): Splitted this class into a
12057         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12058
12059         * typemanager.cs (TypeManager.IsNamespace): Removed.
12060         (TypeManager.ComputeNamespaces): Only compute namespaces from
12061         loaded assemblies here, not the namespaces from the assembly we're
12062         currently compiling.
12063
12064 2003-07-08  Martin Baulig  <martin@ximian.com>
12065
12066         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12067
12068 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12069
12070         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12071         already fixed it.  
12072
12073         I thought about the memory savings here, but LookupTypeReflection
12074         is used under already very constrained scenarios.  Compiling
12075         corlib or mcs only exposes one hit, so it would not really reduce
12076         any memory consumption.
12077
12078 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12079
12080         * typemanager.cs: fixes bug #45889 by only adding public types from
12081         other assemblies to the list of known types.
12082
12083 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12084
12085         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12086         on the type we resolved.
12087
12088 2003-07-05  Martin Baulig  <martin@ximian.com>
12089
12090         * pending.cs (PendingImplementation.ParentImplements): Don't
12091         create the proxy if the parent is abstract.
12092
12093         * class.cs (TypeContainer.DefineIndexers): Process explicit
12094         interface implementations first.  Fixes #37714.
12095
12096 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12097
12098         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12099         defined recursively;  but since we modify the input parameters
12100         (left is set to `this' temporarily), we reset this value if the
12101         left_is_explicit is false, which gives the original semantics to
12102         the code.  
12103
12104         * literal.cs (NullPointer): new class used to represent a null
12105         literal in a pointer context.
12106
12107         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12108         type is a pointer, use a NullPointer object instead of a
12109         NullLiteral.   Closes 43687
12110
12111         (ExplicitConversion): Convert pointer values using
12112         the conv opcode to the proper type.
12113
12114         * ecore.cs (New): change ValueTypeVariable property into a method,
12115         that returns whether the valuetype is suitable for being used.
12116
12117         * expression.cs (Binary.DoNumericPromotions): Only return if we
12118         the int constant was a valid uint, and we can return both left and
12119         right as uints.  If not, we continue processing, to trigger the
12120         type conversion.  This fixes 39018.
12121
12122         * statement.cs (Block.EmitMeta): During constant resolution, set
12123         the CurrentBlock property on the emitcontext, so that we resolve
12124         constants propertly.
12125
12126 2003-07-02  Martin Baulig  <martin@ximian.com>
12127
12128         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12129         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12130
12131         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12132         than emitting it here.
12133
12134         * statement.cs: Fixed some more flow analysis bugs.
12135
12136 2003-07-02  Martin Baulig  <martin@ximian.com>
12137
12138         * class.cs (MethodData.Define): When implementing interface
12139         methods, set Final unless we're Virtual.
12140
12141         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12142         check work for interface methods.
12143
12144 2003-07-01  Martin Baulig  <martin@ximian.com>
12145
12146         * ecore.cs (EmitContext.This): Replaced this property with a
12147         GetThis() method which takes a Location argument.  This ensures
12148         that we get the correct error location for a CS0188.
12149
12150 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12151
12152         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12153         ImplicitStandardConversion.
12154
12155         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12156
12157 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12158
12159         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12160         optimization.
12161
12162 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12165         constructors.
12166
12167         (MethodData.Define): Turn off initlocals for unsafe methods.
12168
12169 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12170
12171         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12172         complete;  Fixes #37521.
12173
12174         * delegate.cs: Use Modifiers.TypeAttr to compute the
12175         TypeAttributes, instead of rolling our own.  This makes the flags
12176         correct for the delegates.
12177
12178 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12179
12180         * class.cs (Constructor.Define): Set the private flag for static
12181         constructors as well.
12182
12183         * cs-parser.jay (statement_expression): Set the return value to
12184         null, to avoid a crash when we catch an error.
12185
12186 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12187
12188         * cs-parser.jay: Applied patch from Jackson that adds support for
12189         extern and unsafe modifiers to destructor declarations.
12190
12191         * expression.cs: Report error 21 if the user is trying to index a
12192         System.Array.
12193
12194         * driver.cs: Add an error message, suggested by the bug report.
12195
12196         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12197         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12198
12199 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12200
12201         * namespace.cs: Add some information to reduce FAQs.
12202
12203 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12206         underlying enumeration types.  Fixes #43915.
12207
12208         * expression.cs: Treat ushort/short as legal values to be used in
12209         bitwise operations.
12210
12211 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12212
12213         * delegate.cs: transfer custom attributes for paramenters from
12214         the delegate declaration to Invoke and BeginInvoke.
12215
12216 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12217
12218         * attribute.cs: handle custom marshalers and emit marshal info
12219         for fields, too.
12220
12221 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12222
12223         * makefile.gnu: Added anonymous.cs to the compiler sources.
12224
12225 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12226
12227         * iterators.cs: Change the name of the proxy class to include two
12228         underscores.
12229
12230         * cs-parser.jay: Update grammar to include anonymous methods.
12231
12232         * anonymous.cs: new file.
12233
12234 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * class.cs (Field.Define): Add missing test for pointers and
12237         safety. 
12238
12239 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12240
12241         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12242         we use the stobj opcode.
12243
12244         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12245         since it wasn't the correct fix. 
12246
12247         It still is puzzling that we are required to use stobj for IntPtr
12248         which seems to be a ValueType.
12249
12250 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12251
12252         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12253         during regular simple name resolution.   Now, the trick is that
12254         instead of returning for processing the simplename, we do a
12255         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12256         contextual lookup type).   If a match is found, return that, if
12257         not, return for further composition.
12258
12259         This fixes long-standing 30485.
12260
12261         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12262         using the address to initialize an object, do an Stobj instead of
12263         using the regular Stelem.
12264
12265         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12266         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12267         Because if we are a BaseIndexerAccess that value will be true.
12268         Fixes 43643.
12269
12270         * statement.cs (GotoCase.Resolve): Return after reporting an
12271         error, do not attempt to continue. 
12272
12273         * expression.cs (PointerArithmetic.Emit): If our operand is a
12274         long, convert our constants to match the operand before
12275         multiplying.  Convert to I type before adding.   Fixes 43670.
12276
12277 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12278
12279         * enum.cs (ImplicitConversionExists) : Rename to
12280         ImplicitEnumConversionExists to remove ambiguity. 
12281
12282         * ecore.cs (NullCast): New type of cast expression class which
12283         basically is very similar to EmptyCast with the difference being
12284         it still is a constant since it is used only to cast a null to
12285         something else
12286         (eg. (string) null)
12287
12288         * convert.cs (ImplicitReferenceConversion): When casting a null
12289         literal, we return a NullCast.
12290
12291         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12292         should be around anymore.
12293
12294         The renaming (reported was slightly wrong). Corrections:
12295
12296         ConvertImplicitStandard -> ImplicitConversionStandard
12297         ConvertExplicitStandard -> ExplicitConversionStandard
12298
12299         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12300         before passing them in !
12301
12302         * convert.cs (ImplicitConversionStandard): When comparing for
12303         equal expr and target types, ensure that expr is not a
12304         NullLiteral.
12305
12306         In general, we must not be checking (expr_type ==
12307         target_type) in the top level conversion methods
12308         (ImplicitConversion, ExplicitConversion etc). This checking is
12309         done in the methods that they delegate to.
12310
12311 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12312
12313         * convert.cs: Move Error_CannotConvertType,
12314         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12315         ImplicitNumericConversion, ImplicitConversionExists,
12316         ImplicitUserConversionExists, StandardConversionExists,
12317         FindMostEncompassedType, FindMostSpecificSource,
12318         FindMostSpecificTarget, ImplicitUserConversion,
12319         ExplicitUserConversion, GetConversionOperators,
12320         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12321         TryImplicitIntConversion, Error_CannotConvertImplicit,
12322         ConvertImplicitRequired, ConvertNumericExplicit,
12323         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12324         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12325         its own file.
12326
12327         Perform the following renames:
12328
12329         StandardConversionExists -> ImplicitStandardConversionExists
12330         ConvertImplicit -> ImplicitConversion
12331         ConvertImplicitStandard -> ImplicitStandardConversion
12332         TryImplicitIntConversion -> ImplicitIntConversion
12333         ConvertImplicitRequired -> ImplicitConversionRequired
12334         ConvertNumericExplicit -> ExplicitNumericConversion
12335         ConvertReferenceExplicit -> ExplicitReferenceConversion
12336         ConvertExplicit -> ExplicitConversion
12337         ConvertExplicitStandard -> ExplicitStandardConversion
12338
12339 2003-05-19  Martin Baulig  <martin@ximian.com>
12340
12341         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12342         (TypeInfo): Added support for structs having structs as fields.
12343
12344         * ecore.cs (FieldExpr): Implement IVariable.
12345         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12346         VariableInfo for the field.
12347
12348 2003-05-18  Martin Baulig  <martin@ximian.com>
12349
12350         * expression.cs (This.DoResolve): Report a CS0027 if we're
12351         emitting a field initializer.
12352
12353 2003-05-18  Martin Baulig  <martin@ximian.com>
12354
12355         * expression.cs (This.ResolveBase): New public function.
12356         (This.DoResolve): Check for CS0188.
12357
12358         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12359         This.Resolve().
12360
12361         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12362         `instance_expression' to null if we don't have any non-static
12363         methods.
12364
12365 2003-05-18  Martin Baulig  <martin@ximian.com>
12366
12367         Reworked the way how local variables and parameters are handled by
12368         the flow analysis code.
12369
12370         * statement.cs (TypeInfo, VariableMap): New public classes.
12371         (VariableInfo): New public class.  This is now responsible for
12372         checking whether a variable has been assigned.  It is used for
12373         parameters and local variables.
12374         (Block.EmitMeta): Take the InternalParameters as argument; compute
12375         the layout of the flow vectors here.
12376         (Block.LocalMap, Block.ParameterMap): New public properties.
12377         (FlowBranching): The .ctor doesn't get the InternalParameters
12378         anymore since Block.EmitMeta() now computes the layout of the flow
12379         vector.
12380         (MyStructInfo): This class is now known as `StructInfo' and nested
12381         in `TypeInfo'; we don't access this directly anymore.
12382
12383         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12384         property and removed IsAssigned(), IsFieldAssigned(),
12385         SetAssigned() and SetFieldAssigned(); we now call them on the
12386         VariableInfo so we don't need to duplicate this code everywhere.
12387
12388         * expression.cs (ParameterReference): Added `Block block' argument
12389         to the .ctor.
12390         (LocalVariableReference, ParameterReference, This): The new
12391         VariableInfo class is now responsible for all the definite
12392         assignment stuff.
12393
12394         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12395         IsParameterAssigned, SetParameterAssigned): Removed.
12396
12397 2003-05-18  Martin Baulig  <martin@ximian.com>
12398
12399         * typemanager.cs (InitCoreTypes): Try calling
12400         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12401         the 3-args-version.  Corlib now also needs our `void_type'.
12402         (GetMethod): Added overloaded version which takes an optional
12403         `bool report_errors' to allow lookups of optional methods.
12404
12405 2003-05-12  Martin Baulig  <martin@ximian.com>
12406
12407         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12408         only used for locals and not for parameters.
12409
12410 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12411
12412         * support.cs (InternalParameters.ParameterType): Return the
12413         ExternalType of the parameter.
12414
12415         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12416         they were unused.
12417
12418 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12419
12420         * class.cs (MethodData.Define): Do not set the `newslot' on
12421         interface members, if they are also flagged as "override".
12422
12423         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12424         better code for ++i and i++.  This only works for static fields
12425         and local variables.
12426
12427         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12428         want to pull the DeclSpace out of the builder_to_declspace instead
12429         of the TypeBuilder (like in TypeContainer.FindMembers).
12430
12431         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12432         instead of LookupTypeContainer.  Fixes the crash on .NET for
12433         looking up interface members.
12434
12435         * const.cs: Create our own emit context during the Definition
12436         stage, so that constants are evaluated in the proper context, when
12437         a recursive definition happens.
12438
12439 2003-05-11  Martin Baulig  <martin@ximian.com>
12440
12441         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12442         new block for a switch section.
12443         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12444         the adding/lookup in the switch block.  Fixes #39828.
12445
12446 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12447
12448         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12449         functionality: I needed to convert the data after I had performed
12450         the add/sub operation into the operands type size.
12451
12452         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12453         pass the type for the box operation, otherwise the resulting
12454         object would have been of type object.
12455
12456         (BoxedCast): Add constructor to specify the type to box as.
12457
12458 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12459
12460         * iterators.cs: I was reusing the `count' variable inadvertently,
12461         take steps to not allow this to happen.
12462
12463 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12464
12465         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12466         by creating an array at the point where the params starts and
12467         putting all those arguments there, then adjusting the size of the
12468         array.
12469
12470 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12471
12472         * expression.cs (New.AddressOf): Implement interface
12473         IMemoryLocation.  This is used when the `new' operator is used in
12474         the context of an invocation to a method on a value type.
12475
12476         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12477         example. 
12478
12479         * namespace.cs: Also check the using aliases here.
12480
12481         * driver.cs: Move the test for using validity after the types have
12482         been entered, so we do a single pass that also includes the using
12483         aliases. 
12484
12485         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12486         in the regular case.   CreateSiblingForFinally is doing extra
12487         error checking.
12488
12489         * attribute.cs (GetAttributeArgumentExpression): Store the result
12490         on an out value, and use the return value to indicate failure
12491         instead of using null (which is a valid return for Constant.GetValue).
12492
12493         * statement.cs: Perform the analysis flow for the increment
12494         portion after the statement, because this will be the real flow of
12495         execution.  Fixes #42385
12496
12497         * codegen.cs (EmitContext.EmitArgument,
12498         EmitContext.EmitStoreArgument): New helper functions when the
12499         RemapToProxy flag is set.
12500
12501         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12502         function.
12503
12504         Add support for remapping parameters. 
12505
12506         * iterators.cs: Propagate parameter values;  Store parameter
12507         values in the proxy classes.
12508
12509 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12510
12511         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12512         need a proxy reference;  I do not know what I was thinking
12513
12514         * cs-parser.jay (constructor_initializer): catch another error,
12515         and display nice message.
12516
12517         (field_declaration): catch void field declaration
12518         to flag a better error. 
12519
12520         * class.cs (MemberBase.CheckBase): Report an error instead of a
12521         warning if a new protected member is declared in a struct. 
12522         (Field.Define): catch the error of readonly/volatile.
12523
12524         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12525
12526         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12527         volatile variable is taken
12528
12529 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12530
12531         * statement.cs (Fixed.Resolve): Report an error if we are not in
12532         an unsafe context.
12533
12534 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12535
12536         * typemanager.cs: reuse the code that handles type clashes for
12537         delegates and enumerations.
12538
12539         * class.cs (Report28): Always report.
12540
12541         * expression.cs (EncodeAsAttribute): Allow nulls here.
12542
12543 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12544
12545         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12546         the functionality for testing whether an expression is valid for
12547         an attribute here.  Also handle the case of arrays of elements
12548         being stored. 
12549
12550         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12551         encoding a linear array into an array of objects that are suitable
12552         to be passed to an CustomAttributeBuilder.
12553
12554         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12555
12556         * ecore.cs: (FieldExpr): Handle field remapping here.
12557
12558         * iteratators.cs: Pass the instance variable (if the method is an
12559         instance method) to the constructors, so we can access the field
12560         variables on the class.
12561
12562         TODO: Test this with structs.  I think the THIS variable on
12563         structs might have to be a pointer, and not a refenrece
12564
12565 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12568         local variables to fields in a proxy class.
12569
12570         * iterators.cs (PopulateProxy): Rename our internal fields to
12571         <XXX>.  
12572         Create a <THIS> field if we are an instance method, so we can
12573         reference our parent container variables.
12574         (MapVariable): Called back from the EmitContext code to enter a
12575         new variable to field mapping into the proxy class (we just create
12576         a FieldBuilder).
12577
12578         * expression.cs
12579         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12580         for using the remapped locals to fields.
12581
12582         I placed the code here, because that gives the same semantics to
12583         local variables, and only changes the Emit code.
12584
12585         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12586         statements inside iterators.
12587         (VariableInfo): Add a FieldBuilder for the cases when we are
12588         remapping local variables to fields in a proxy class
12589
12590         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12591         current_block != null.
12592
12593         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12594         not cope with strings, as it has been moved to the
12595         TableSwitchEmit.  Fixed bug in switch generation.
12596
12597         * expression.cs (New.DoResolve): Provide more context for the user
12598         when reporting an error.
12599
12600         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12601         pointers. 
12602
12603         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12604         check the permissions for it.  Note than in a type-resolution
12605         context the check was already present in DeclSpace.ResolveType,
12606         but was missing from the MemberAccess.
12607
12608         (ArrayCreation.CheckIndices): warn if the user has
12609         more nested levels of expressions, but there are no more
12610         dimensions specified.  Avoids crash on bug 41906.
12611
12612 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12613
12614         * statement.cs (Block): replace Implicit bool, for a generic
12615         flags.   
12616         New flag: `Unchecked'.  This is used during the EmitMeta phase
12617         (which is out-of-line with the regular Resolve/Emit process for a
12618         statement, as this is done ahead of time, but still gets a chance
12619         to call constant resolve).
12620
12621         (Block.Flags): new enum for adding a new flag.
12622
12623         (Block.EmitMeta): track the state of unchecked.
12624
12625         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12626         to enable constant resolution to work there as well.
12627
12628 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12629
12630         * typemanager.cs (ienumerable_type): Also look up
12631         System.Collections.IEnumerable. 
12632
12633 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12634
12635         TODO: Test more than one conditional per method.
12636
12637         * class.cs (Indexer.Define): Report the location where the user is
12638         referencing the unsupported feature.
12639
12640         (MethodData): Overload the use of `conditionals' to
12641         minimize the creation of needless ArrayLists.   This saves roughly
12642         212kb on my machine.
12643
12644         (Method): Implement the new IIteratorContainer interface.
12645         (Method.SetYields): Implement the method by setting the ModFlags
12646         to contain METHOD_YIELDS.
12647
12648         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12649         which just got set to null.
12650
12651         * iterators.cs: New file.
12652
12653         (Yield, YieldBreak): New statements.
12654
12655         * statement.cs (Return.Resolve): Flag an error if we are used in
12656         an iterator method.
12657
12658         * codegen.cs (InIterator): New flag set if the code is being
12659         compiled in an iterator method.
12660
12661         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12662         internal modifier, and we just use it to avoid adding extra
12663         fields, as this is seldom used.  
12664
12665         * cs-parser.jay: Add yield_statement (yield and yield break).
12666
12667         * driver.cs: New flag -v2 to turn on version 2 features. 
12668
12669         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12670         hashtable when v2 is enabled.
12671
12672 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12673
12674         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12675         there is already a namespace defined with this name.
12676
12677         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12678         people upgraded their corlibs.
12679
12680         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12681         always use fully qualified types, no need to use the compiler
12682         front end.
12683
12684         (TypeManager.IsNamespace): Use binarysearch.
12685
12686         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12687         AddDelegate): I did not quite use the new IsValid API properly: I
12688         have to pass the short-name and the fullname.  I was passing only
12689         the basename instead of the fullname sometimes. 
12690
12691         (TypeContainer.DefineType): call NamespaceClash.
12692
12693         * interface.cs (Interface.DefineType): use NamespaceClash before
12694         defining the type.
12695
12696         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12697         defining the type.
12698
12699         * enum.cs: (Enum.DefineType): use NamespaceClash before
12700         defining the type.
12701
12702         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12703         speed increase.  First, use the negative_hits cache when we get a
12704         negative.  Second, add the type with its full original name
12705         instead of the new . and + encoded name (reflection uses + to
12706         separate type from a nested type).  Use LookupTypeReflection
12707         directly which bypasses the type->name hashtable (that we already
12708         know does not contain the type.
12709
12710         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12711         location/container type. 
12712
12713         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12714
12715 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12716
12717         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12718
12719         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12720         method is being referenced in the method group from a static
12721         context, and report error 120 if so.
12722
12723         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12724         Error118. 
12725
12726         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12727         is created, we create the A namespace).
12728
12729         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12730         Fixes #41591
12731
12732 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12733
12734         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12735         invocation to ModuleBuilder.GetType with the same values will
12736         return a new type instance, so we need to cache its return
12737         values. 
12738
12739         * expression.cs (Binary.ResolveOperator): Only allow the compare
12740         operators on enums if they are of the same type.
12741
12742         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12743         types of ValueType on their own case.  Before we were giving them
12744         the same treatment as objects.
12745
12746         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12747         fullname.  Short name is used to compare against container name.
12748         Fullname is used to check against defined namespace names.
12749
12750         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12751         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12752
12753         (Method.CheckBase): Call parent.
12754         (MemberBase.CheckBase): Check for protected members on sealed
12755         classes.
12756         (PropertyBase.CheckBase): Call parent.
12757         (Field.Define): Call parent.
12758
12759         * report.cs: Negative error codes are now mapped to 8000 - code,
12760         so that the display is render more nicely.
12761
12762         * typemanager.cs: Do not use try/catch, instead report a regular
12763         error. 
12764
12765         (GetPointerType, GetReferenceType): These methods provide
12766         mechanisms to obtain the T* and T& from a T.  We had the code
12767         previously scattered around the code base, and it also used
12768         TypeManager.LookupType that would go through plenty of caches.
12769         This one goes directly to the type source.
12770
12771         In some places we did the Type.GetType followed by
12772         ModuleBuilder.GetType, but not in others, so this unifies the
12773         processing as well.
12774
12775         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12776         statements now that we have namespace information.
12777
12778         * typemanager.cs (IsNamespace): New method, returns whether the
12779         string presented is a namespace or not.
12780
12781         (ComputeNamespaces): New public entry point, computes the list of
12782         available namespaces, using the GetNamespaces API call in Mono, or
12783         the slower version in MS.NET.   
12784
12785         Now before we start the semantic analysis phase, we have a
12786         complete list of namespaces including everything that the user has
12787         provided.
12788
12789         Deleted old code to cache namespaces in .nsc files.
12790
12791 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12792
12793         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12794         class/struct location definition Location for the implicit
12795         constructor location.
12796
12797         (Operator.Define): Use the location of the operator for the
12798         implicit Method definition.
12799
12800         (Constructor.Emit): use the constructor location for the implicit
12801         base initializer constructor.
12802
12803         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12804         and the Expression class now contains two new methods:
12805
12806         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12807         isolate type lookup from the rest of the resolution process.
12808
12809         Since we use Expressions to hold type definitions due to the way
12810         we parse the input we have historically overloaded Resolve to
12811         perform the Type lookups if a special flag is passed.  Now this is
12812         eliminated and two methods take their place. 
12813
12814         The differences in the two methods between xStep and xTerminal is
12815         that xStep is involved in our current lookup system that uses
12816         SimpleNames to compose a name, while xTerminal is used just to
12817         catch the case where the simplename lookup failed.
12818
12819 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12820
12821         * expression.cs (ResolveMemberAccess): Remove redundant code.
12822         TypeExpr expressions are always born fully resolved.
12823
12824         * interface.cs (PopulateMethod): Do not lookup the types twice.
12825         We were doing it once during SemanticAnalysis and once during
12826         PopulateMethod.
12827
12828         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12829         in local variable type definitions, were being returned as a
12830         SimpleName (we decomposed everything into a string), that is
12831         because primary_expression was being used instead of a type in the
12832         grammar (reduce/reduce conflicts).
12833
12834         The part that was wrong is that we converted the expression into a
12835         string (an oversimplification in one hand, compounded with primary
12836         expressions doing string concatenation).
12837
12838         So things like:
12839
12840         A.B.C [] x;
12841
12842         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12843         using clauses from working on this particular context.  And a type
12844         was being matched directly against "A.B.C[]".
12845
12846         We now use the correct approach, and allow for ComposedCast to be
12847         part of the unary expression.  So the "A.B.C []" become a composed
12848         cast of "A.B.C" (as a nested group of MemberAccess with a
12849         SimpleName at the end) plus the rank composition "[]". 
12850
12851         Also fixes 35567
12852
12853 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12854
12855         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12856         for the access level checking.
12857
12858         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12859         `TypeContainer container', because I kept getting confused when I
12860         was debugging this code.
12861
12862         * expression.cs (Indexers): Instead of tracking getters/setters,
12863         we now track them in parallel.  We create one arraylist less, but
12864         most importantly it is possible now for the LValue code to find a
12865         matching get for a set.
12866
12867         (IndexerAccess.DoResolveLValue): Update the code.
12868         GetIndexersForType has been modified already to extract all the
12869         indexers from a type.  The code assumed it did not.
12870
12871         Also make the code set the correct return type for the indexer.
12872         This was fixed a long time ago for properties, but was missing for
12873         indexers.  It used to be void_type.
12874
12875         (Binary.Emit): Test first for doubles instead of
12876         floats, as they are more common.
12877
12878         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12879         when dealing with floats and the <=, >= operators.  This fixes bug
12880         #39314 
12881
12882         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12883         to load the array value by emitting a load on the foreach variable
12884         type.  This was incorrect.  
12885
12886         We now emit the code to load an element using the the array
12887         variable type, and then we emit the conversion operator.
12888
12889         Fixed #40176
12890
12891 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12892
12893         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12894
12895 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12896
12897         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12898         test for protection before we test for signatures. 
12899
12900         (MethodSignature.ToString): implement.
12901
12902         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12903         to the case where we reduced into a LongConstant.
12904
12905         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12906         depend on whether the information is acurrate, because the
12907         Microsoft runtime will always claim that the array type is public,
12908         regardless of the real state.
12909
12910         If the type is a pointer, another problem happens: the type is
12911         reported as non-public in Microsoft.  
12912
12913         In both cases we have to call CheckAccessLevel recursively with
12914         the underlying type as the argument to be tested.
12915
12916 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12917
12918         * assign.cs (Assign.Emit): If we are dealing with a compound
12919         assignment expression, we should use the code path that stores the
12920         intermediate result in a temporary value.  This fixes #40903.
12921
12922         *expression.cs (Indirection.ToString): Provide ToString method for
12923         debugging. 
12924
12925 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12926
12927         * class.cs: Null out fields holding references to Block objects so
12928         they can be garbage collected.
12929
12930         * expression.cs (OverloadResolve): Remove unused local.
12931
12932 2003-04-07  Martin Baulig  <martin@ximian.com>
12933
12934         * codegen.cs (EmitContext.CurrentFile): New public field.
12935         (EmitContext.Mark): Use the CurrentFile to check whether the
12936         location is in the correct file.
12937         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12938
12939 2003-04-07  Martin Baulig  <martin@ximian.com>
12940
12941         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12942
12943         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12944         location.  [FIXME: The location argument which gets passed to this
12945         method is sometimes wrong!]
12946
12947 2003-04-07  Nick Drochak <ndrochak@gol.com>
12948
12949         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12950
12951 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12952
12953         * expression.cs (Indirection.EmitAssign): We were using the
12954         temporary, but returning immediately instead of continuing the
12955         EmitAssing flow.
12956
12957 2003-04-06  Martin Baulig  <martin@ximian.com>
12958
12959         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12960         if it's a nested child, but also deriving from the outer class.
12961         See test 190.cs.
12962
12963         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12964         nested child, but also deriving from the outer class.  See
12965         test-190.cs.
12966         (FilterWithClosure): We may access private members of the outer
12967         class if we're a nested child and deriving from the outer class.
12968         (RealMemberLookup): Only set `closure_private_ok' if the
12969         `original_bf' contained BindingFlags.NonPublic.
12970
12971 2003-04-05  Martin Baulig  <martin@ximian.com>
12972
12973         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12974         probe if its a type parameter, and if so, flag an error.
12975
12976         * decl.cs: Move here the SetParameterInfo code from class.cs.
12977         Handle IsGeneric here.
12978
12979         Handle a variety of errors in the parameter info definition.
12980
12981         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12982         type parameters here.
12983
12984         * cs-parser.jay (class_declaration): report errors for parameters
12985         here as well.
12986
12987 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * generic.cs: New file, contains support code for generics.
12990
12991         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12992         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12993
12994         Update parser for the above removals.
12995
12996         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
12997         now taken care of in the parser.
12998
12999 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13000
13001         * class.cs (Event.Define): Do not allow abstract events to have
13002         initializers. 
13003
13004 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13005
13006         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13007         block in event declarations.
13008
13009         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13010         value type, get its address.
13011
13012         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13013         leaving a class on the stack instead of a boolean value (int
13014         0/1).  Change the code so we compare against null, and then the
13015         result against zero.
13016
13017         * class.cs (TypeContainer.GetClassBases): We were checking for the
13018         parent class being sealed too late.
13019
13020         * expression.cs (Binary.Emit): For <= and >= when dealing with
13021         floating point values, use cgt.un and clt.un instead of cgt and
13022         clt alone.
13023
13024 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13025
13026         * statement.cs: Apply the same optimization as MS: skip the 
13027         GetEnumerator returning an IEnumerator, and use the one returning a 
13028         CharEnumerator instead. This allows us to avoid the try-finally block 
13029         and the boxing.
13030
13031 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13032
13033         * cs-parser.jay: Attributes cannot be applied to
13034                          namespaces. Fixes #40473
13035
13036 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13037
13038         * class.cs:
13039         (Add*): check if the name is valid using the full name for constants,
13040         fields, properties and events.
13041
13042 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13043
13044         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13045         char constants to be part of the enumeration.
13046
13047         * expression.cs (Conditional.DoResolve): Add support for operator
13048         true. Implements the missing functionality from 14.12
13049
13050         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13051         operator true/false as required by the spec.
13052
13053         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13054         implicit conversion to boolean.
13055
13056         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13057         also one where the type implements `operator true'. 
13058
13059         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13060         get an expression that will invoke operator true based on an
13061         expression.  
13062
13063         (GetConversionOperators): Removed the hack that called op_True
13064         here.  
13065
13066         (Expression.ResolveBoolean): Move this from Statement.
13067
13068 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13069
13070         * ecore.cs (FieldExpr): do not allow initialization of initonly
13071         fields on derived classes
13072
13073 2003-03-13  Martin Baulig  <martin@ximian.com>
13074
13075         * statement.cs (Block.Emit): Call ig.BeginScope() and
13076         ig.EndScope() when compiling with debugging info; call
13077         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13078
13079 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13080
13081         * expression.cs (Indexers): Do not construct immediately, allow
13082         for new members to be appended as we go.  Fixes 38143
13083
13084 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13085
13086         * expression.cs: save/restore context when resolving an unchecked
13087         expression.
13088
13089 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13090
13091         * cfold.cs: Catch division by zero in modulus operator during
13092         constant folding.
13093
13094 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13095
13096         * interface.cs (Interface.DefineMembers): Avoid defining members
13097         twice. 
13098
13099 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * driver.cs: handle the +/- options for -noconfig
13102
13103         * statement.cs (Unckeched.Resolve): Also track the state of
13104         unchecked in the Resolve phase.
13105
13106 2003-02-27  Martin Baulig  <martin@ximian.com>
13107
13108         * ecore.cs (Expression.MemberLookup): Don't create a
13109         MethodGroupExpr for something which is not a method.  Fixes #38291.
13110
13111 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13112
13113         * class.cs (MemberBase.CheckParameters): Also check that the type
13114         is unmanaged if it is a pointer.
13115
13116         * expression.cs (SizeOf.Resolve): Add location information.
13117
13118         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13119         a managed type is declared.
13120
13121         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13122         parameter modifiers as well.  Fixes bug 38606
13123
13124         * class.cs: Very sad.  Am backing out the speed up changes
13125         introduced by the ArrayList -> Array in the TypeContainer, as they
13126         were not actually that much faster, and introduced a bug (no error
13127         reports on duplicated methods).
13128
13129         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13130         source first, this will guarantee that we have a valid expression
13131         before calling in lower levels functions that will require a
13132         resolved object.  Then use this original_source in the
13133         target.ResolveLValue instead of the original source that was
13134         passed to us.
13135
13136         Another change.  Use target.Resolve instead of LValueResolve.
13137         Although we are resolving for LValues, we will let the Assign code
13138         take care of that (it will be called again from Resolve).  This
13139         basically allows code like this:
13140
13141         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13142         class Y { void A (X x) { x [0] += o; }
13143
13144         The problem was that the indexer was trying to resolve for
13145         set_Item (idx, object o) and never finding one.  The real set_Item
13146         was set_Item (idx, X).  By delaying the process we get the right
13147         semantics. 
13148
13149         Fixes bug 36505
13150
13151 2003-02-23  Martin Baulig  <martin@ximian.com>
13152
13153         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13154         while calling DoEmit ().
13155
13156         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13157         source files; if you use the #line directive inside a method, the
13158         compiler stops emitting line numbers for the debugger until it
13159         reaches the end of the method or another #line directive which
13160         restores the original file.
13161
13162 2003-02-23  Martin Baulig  <martin@ximian.com>
13163
13164         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13165
13166 2003-02-23  Martin Baulig  <martin@ximian.com>
13167
13168         * statement.cs (Block.AddChildVariableNames): We need to call this
13169         recursively, not just for our immediate children.
13170
13171 2003-02-23  Martin Baulig  <martin@ximian.com>
13172
13173         * class.cs (Event.Define): Always make the field private, like csc does.
13174
13175         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13176         actually work, fixes bug #37521.
13177
13178 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13179
13180         * delegate.cs: When creating the various temporary "Parameters"
13181         classes, make sure that we call the ComputeAndDefineParameterTypes
13182         on those new parameters (just like we do with the formal ones), to
13183         allow them to be resolved in the context of the DeclSpace.
13184
13185         This fixes the bug that Dick observed in Bugzilla #38530.
13186
13187 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13188
13189         * expression.cs (ResolveMemberAccess): When resolving a constant,
13190         do not attempt to pull a constant if the value was not able to
13191         generate a valid constant.
13192
13193         * const.cs (LookupConstantValue): Do not report more errors than required.
13194
13195 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13196
13197         * expression.cs: fixes bug #38328.
13198
13199 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13200
13201         * class.cs: Changed all the various members that can be part of a
13202         class from being an ArrayList to be an Array of the right type.
13203         During the DefineType type_list, interface_list, delegate_list and
13204         enum_list are turned into types, interfaces, delegates and enums
13205         arrays.  
13206
13207         And during the member population, indexer_list, event_list,
13208         constant_list, field_list, instance_constructor_list, method_list,
13209         operator_list and property_list are turned into their real arrays.
13210
13211         Although we could probably perform this operation earlier, for
13212         good error reporting we need to keep the lists and remove the
13213         lists for longer than required.
13214
13215         This optimization was triggered by Paolo profiling the compiler
13216         speed on the output of `gen-sample-program.pl' perl script. 
13217
13218         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13219         not crash in methods like MemberLookupFailed that use this field.  
13220
13221         This problem arises when the compiler fails to resolve a type
13222         during interface type definition for example.
13223
13224 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13225
13226         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13227         inherit from System.Object, so we have to stop at null, not only
13228         when reaching System.Object.
13229
13230 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13231
13232         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13233         DeclaredOnly because the parent indexer might have had a different
13234         name, but did not loop until the top of the hierarchy was reached.
13235
13236         The problem this one fixes is 35492: when a class implemented an
13237         indexer from an interface, we were getting the interface method
13238         (which was abstract) and we were flagging an error (can not invoke
13239         abstract method).
13240
13241         This also keeps bug 33089 functioning, and test-148 functioning.
13242
13243         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13244         out if a method is special is to see if it is declared in a
13245         property or event, or whether it is one of the predefined operator
13246         names.   This should fix correctly #36804.
13247
13248 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13249
13250         The goal here is to remove the dependency on EmptyCast.Peel ().
13251         Killing it completely.
13252
13253         The problem is that currently in a number of places where
13254         constants are expected, we have to "probe" for an EmptyCast, and
13255         Peel, which is not the correct thing to do, as this will be
13256         repetitive and will likely lead to errors. 
13257
13258         The idea is to remove any EmptyCasts that are used in casts that
13259         can be reduced to constants, so we only have to cope with
13260         constants. 
13261
13262         This bug hunt was triggered by Bug 37363 and the desire to remove
13263         the duplicate pattern where we were "peeling" emptycasts to check
13264         whether they were constants.  Now constants will always be
13265         constants.
13266
13267         * ecore.cs: Use an enumconstant here instead of wrapping with
13268         EmptyCast.  
13269
13270         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13271         throwing me off.  By handling this we can get rid of a few hacks.
13272
13273         * statement.cs (Switch): Removed Peel() code.
13274
13275 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13276
13277         * class.cs: Location information for error 508
13278
13279         * expression.cs (New.DoResolve): Add a guard against double
13280         resolution of an expression.  
13281
13282         The New DoResolve might be called twice when initializing field
13283         expressions (see EmitFieldInitializers, the call to
13284         GetInitializerExpression will perform a resolve on the expression,
13285         and later the assign will trigger another resolution
13286
13287         This leads to bugs (#37014)
13288
13289         * delegate.cs: The signature for EndInvoke should contain any ref
13290         or out parameters as well.  We were not doing this in the past. 
13291
13292         * class.cs (Field.Define): Do not overwrite the type definition
13293         inside the `volatile' group.  Turns out that volatile enumerations
13294         were changing the type here to perform a validity test, which
13295         broke conversions. 
13296
13297 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13298
13299         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13300         and structs, we do not want to load the instance variable
13301
13302         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13303         enum_type has to be handled like an object reference (implicit
13304         conversions exists from this to object), but the regular IsClass
13305         and IsValueType tests will never return true for this one.
13306
13307         Also we use TypeManager.IsValueType instead of type.IsValueType,
13308         just for consistency with the rest of the code (this is only
13309         needed if we ever use the construct exposed by test-180.cs inside
13310         corlib, which we dont today).
13311
13312 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13313
13314         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13315         just InternalCall.
13316
13317 2003-02-09  Martin Baulig  <martin@ximian.com>
13318
13319         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13320         (Namespace.DefineNamespaces): New static public method; this is
13321         called when we're compiling with debugging to add all namespaces
13322         to the symbol file.
13323
13324         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13325         pass it to the Namespace's .ctor.
13326
13327         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13328         and MethodBase arguments; pass the namespace ID to the symwriter;
13329         pass the MethodBase instead of the token to the symwriter.
13330         (SymbolWriter.DefineNamespace): New method to add a namespace to
13331         the symbol file.
13332
13333 2003-02-09  Martin Baulig  <martin@ximian.com>
13334
13335         * symbolwriter.cs: New file.  This is a wrapper around
13336         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13337         methods here in near future.
13338
13339 2003-02-09  Martin Baulig  <martin@ximian.com>
13340
13341         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13342         ILGenerator.MarkSequencePoint() which are actually used by the
13343         symbol writer.
13344
13345 2003-02-09  Martin Baulig  <martin@ximian.com>
13346
13347         * location.cs (SourceFile): New public sealed class.  This
13348         contains the name and an index which is used in the location's token.
13349         (Location): Reserve an appropriate number of bits in the token for
13350         the source file instead of walking over that list, this gives us a
13351         really huge performance improvement when compiling with debugging.
13352
13353         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13354         `SourceFile' argument instead of a string.
13355         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13356         but don't parse/tokenize here, we need to generate the list of all
13357         source files before we do that.
13358         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13359         the files.
13360
13361         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13362         instead of a string.
13363
13364         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13365         of a string.
13366
13367 2003-02-09  Martin Baulig  <martin@ximian.com>
13368
13369         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13370         filename on `#line default'.
13371
13372 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13373
13374         * statement.cs: don't clear the pinned var when the fixed statement
13375         returns from the method (fixes bug#37752).
13376
13377 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13378
13379         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13380         to IsValueType.
13381
13382 2003-02-07  Martin Baulig  <martin@ximian.com>
13383
13384         * driver.cs: Removed the `--debug-args' command line argument.
13385
13386         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13387         automatically by the AsssemblyBuilder.
13388         (CodeGen.InitializeSymbolWriter): We don't need to call any
13389         initialization function on the symbol writer anymore.  This method
13390         doesn't take any arguments.
13391
13392 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13393
13394         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13395         from referenced assemblies as well.
13396
13397 2003-02-02  Martin Baulig  <martin@ximian.com>
13398
13399         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13400
13401 2003-02-02  Martin Baulig  <martin@ximian.com>
13402
13403         * class.cs (Constructor.Emit): Open the symbol writer before
13404         emitting the constructor initializer.
13405         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13406         single-stepping through constructor initializers.
13407
13408 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13409
13410         * class.cs: Handle error 549: do not allow virtual methods in
13411         sealed classes. 
13412
13413 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13414
13415         * decl.cs: Check access levels when resolving types
13416
13417 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13418
13419         * statement.cs: Add parameters and locals set in catch blocks that might 
13420         return to set vector
13421
13422 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13423
13424         * class.cs (Operator): Set the SpecialName flags for operators.
13425
13426         * expression.cs (Invocation.DoResolve): Only block calls to
13427         accessors and operators on SpecialName methods.
13428
13429         (Cast.TryReduce): Handle conversions from char constants.
13430
13431
13432 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13433
13434         * statement.cs: small memory and time optimization in FlowBranching.
13435
13436 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13437
13438         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13439         problem that the last fix but in the other sid (Set).
13440
13441         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13442         access when there is no indexer in the hierarchy.
13443
13444 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13445
13446         * class.cs: Combine some if statements.
13447
13448 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13449
13450         * driver.cs: fixed bug #37187.
13451
13452 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13453
13454         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13455         any indexer, it's needed to build a list with all the indexers in the
13456         hierarchy (AllGetters), else we have problems. Fixes #35653.
13457
13458 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13459
13460         * class.cs (MethodData.Define): It is wrong for an interface
13461         implementation to be static in both cases: explicit and implicit.
13462         We were only handling this in one case.
13463
13464         Improve the if situation there to not have negations.
13465
13466         * class.cs (Field.Define): Turns out that we do not need to check
13467         the unsafe bit on field definition, only on usage.  Remove the test.
13468
13469 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13470
13471         * driver.cs: use assembly.Location instead of Codebase (the latest
13472         patch made mcs fail when using MS assemblies).
13473
13474 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13475
13476         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13477         get the path to *corlib.dll.
13478
13479 2003-01-21  Nick Drochak <ndrochak@gol.com>
13480
13481         * cs-tokenizer.cs:
13482         * pending.cs:
13483         * typemanager.cs: Remove compiler warnings
13484
13485 2003-01-20  Duncan Mak  <duncan@ximian.com>
13486
13487         * AssemblyInfo.cs: Bump the version number to 0.19.
13488
13489 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13490
13491         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13492
13493 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13494
13495         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13496
13497 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13498
13499         * cs-parser.jay: Small fix: we were not comparing the constructor
13500         name correctly.   Thanks to Zoltan for the initial pointer.
13501
13502 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13503
13504         * cs-tokenizer.cs: Set file name when specified with #line
13505
13506 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13507
13508         * cs-parser.jay: Only perform the constructor checks here if we
13509         are named like the class;  This will help provider a better
13510         error.  The constructor path is taken when a type definition is
13511         not found, but most likely the user forgot to add the type, so
13512         report that rather than the constructor error.
13513
13514 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13515
13516         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13517         allocations.
13518
13519 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13520
13521         * cs-parser.jay: Add cleanup call.
13522
13523 2003-01-13  Duncan Mak  <duncan@ximian.com>
13524
13525         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13526         consistent with other methods.
13527
13528 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13529
13530         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13531
13532 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13533
13534         * attribute.cs: only set GuidAttr to true when we have a
13535         GuidAttribute.
13536
13537 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13538
13539         * ecore.cs:
13540         * expression.cs:
13541         * typemanager.cs: fixes to allow mcs compile corlib with the new
13542         Type.IsSubclassOf fix.
13543
13544 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13545
13546         * expression.cs (LocalVariableReference.DoResolve): Classify a
13547         constant as a value, not as a variable.   Also, set the type for
13548         the variable.
13549
13550         * cs-parser.jay (fixed_statement): take a type instead of a
13551         pointer_type, so we can produce a better error message later.
13552
13553         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13554         as an error.  
13555
13556         (For.DoEmit): Make inifinite loops have a
13557         non-conditional branch back.
13558
13559         (Fixed.DoEmit): First populate the pinned variables, then emit the
13560         statement, then clear the variables.  Before I was emitting the
13561         code once for each fixed piece.
13562
13563
13564 2003-01-08  Martin Baulig  <martin@ximian.com>
13565
13566         * statement.cs (FlowBranching.MergeChild): A break in a
13567         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13568
13569 2003-01-08  Martin Baulig  <martin@ximian.com>
13570
13571         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13572         lives in the same number space than `param_map'.  Fixes #36154.
13573
13574 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13575
13576         * cs-parser.jay (constructor_declaration): Set the
13577         Constructor.ModFlags before probing for it.  This makes the
13578         compiler report 514, 515 and 132 (the code was there, but got
13579         broken). 
13580
13581         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13582         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13583         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13584
13585 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13586
13587         * enum.cs: create the enum static fields using the enum type.
13588
13589 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13590
13591         * class.cs: don't try to create the ParamBuilder for the return
13592         type if it's not needed (and handle it breaking for the ms runtime
13593         anyway).
13594
13595 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13596
13597         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13598
13599 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13600
13601         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13602         the command.   This showed up while compiling the JANET source
13603         code, which used \r as its only newline separator.
13604
13605 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13606
13607         * class.cs (Method.Define): If we are an operator (because it
13608         reuses our code), then set the SpecialName and HideBySig.  #36128
13609
13610 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13613         exception, report error 120 `object reference required'.
13614
13615         * driver.cs: Add --pause option, used during to measure the size
13616         of the process as it goes with --timestamp.
13617
13618         * expression.cs (Invocation.DoResolve): Do not allow methods with
13619         SpecialName to be invoked.
13620
13621 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13622
13623         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13624         number before adding it.
13625
13626 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13627
13628         * ecore.cs (StandardImplicitConversion): When in an unsafe
13629         context, we allow conversion between void * to any other pointer
13630         type. This fixes bug #35973.
13631
13632 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13633
13634         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13635         is not thrown when extensionless outputs are used 
13636
13637 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13638
13639         * rootcontext.cs: fixed compilation of corlib.
13640
13641 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13642
13643         * attribute.cs (Attributes.Contains): Add new method.
13644
13645         * class.cs (MethodCore.LabelParameters): if the parameter is an
13646         `out' parameter, check that no attribute `[In]' has been passed.
13647
13648         * enum.cs: Handle the `value__' name in an enumeration.
13649
13650 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13651
13652         * decl.cs: Added special case to allow overrides on "protected
13653         internal" methods
13654
13655 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13656
13657         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13658         since it makes much more sense.
13659
13660         (Attributes.ctor): Don't require a Location parameter.
13661
13662         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13663
13664         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13665         since we already have that information per attribute.
13666
13667         * everywhere : make appropriate changes.
13668
13669         * class.cs (LabelParameters): Write the code which actually
13670         applies attributes to the return type. We can't do this on the MS
13671         .NET runtime so we flag a warning in the case an exception is
13672         thrown.
13673
13674 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13675
13676         * const.cs: Handle implicit null conversions here too.
13677
13678 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13679
13680         * class.cs (MethodCore.LabelParameters): Remove the extra
13681         Type [] parameter since it is completely unnecessary. Instead
13682         pass in the method's attributes so that we can extract
13683         the "return" attribute.
13684
13685 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13686
13687         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13688         of ignoring it and letting the compile continue.
13689
13690         * typemanager.cs (ChangeType): use an extra argument to return an
13691         error condition instead of throwing an exception.
13692
13693 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13694
13695         * expression.cs (Unary.TryReduce): mimic the code for the regular
13696         code path.  Perform an implicit cast in the cases where we can
13697         implicitly convert to one of the integral types, and then reduce
13698         based on that constant.   This fixes bug #35483.
13699
13700 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13701
13702         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13703
13704 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13705
13706         * namespace.cs: fixed bug #35489.
13707
13708 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13709
13710         * class.cs: Remove some dead code.
13711
13712         * cs-parser.jay: Estimate the number of methods needed
13713         (RootContext.MethodCount);
13714
13715         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13716         numbers instead of StringBuilders.
13717
13718         * support.cs (PtrHashtable): Add constructor with initial size;
13719         We can now reduce reallocations of the method table.
13720
13721 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13722
13723         * attribute.cs (ApplyAttributes): Keep track of the emitted
13724         attributes on a per-target basis. This fixes bug #35413.
13725
13726 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13729         default to the Windows 1252 encoding.
13730
13731         (UnixParseOption): Support version, thanks to Alp for the missing
13732         pointer. 
13733
13734         * AssemblyInfo.cs: Add nice assembly information.
13735
13736         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13737         (bug 35169).
13738
13739         * cs-parser.jay: Allow a trailing comma before the close bracked
13740         in the attribute_section production.
13741
13742         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13743         address of the instance was being taken, I will take this out,
13744         because we take the address of the object immediately here.
13745
13746 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13747
13748         * typemanager.cs (AreMultipleAllowed): Take care of the most
13749         obvious case where attribute type is not in the current assembly -
13750         stupid me ;-)
13751
13752 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13753
13754         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13755         definitions, instead of doing that afterwards.  
13756
13757         Also we use a nice little hack, depending on the constructor, we
13758         know if we are a "composed" name or a simple name.  Hence, we
13759         avoid the IndexOf test, and we avoid 
13760
13761         * codegen.cs: Add code to assist in a bug reporter to track down
13762         the source of a compiler crash. 
13763
13764 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13765
13766         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13767         types have been emitted for a given element and flag an error
13768         if something which does not have AllowMultiple set is used more
13769         than once.
13770
13771         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13772         attribute types and their corresponding AllowMultiple properties
13773
13774         (AreMultipleAllowed): Check the property for a given type.
13775
13776         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13777         property in the case we have a TypeContainer.
13778
13779         (Attributes.AddAttribute): Detect duplicates and just skip on
13780         adding them. This trivial fix catches a pretty gross error in our
13781         attribute emission - global attributes were being emitted twice!
13782
13783         Bugzilla bug #33187 is now fixed.
13784
13785 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13786
13787         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13788         instead of pp_and).
13789
13790         * expression.cs (Binary.ResolveOperator): I can only use the
13791         Concat (string, string, string) and Concat (string, string,
13792         string, string) if the child is actually a concatenation of
13793         strings. 
13794
13795 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13796
13797         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13798         context where we need a 2-character lookahead.
13799
13800         * pending.cs (PendingImplementation): Rework so we can keep track
13801         of interface types all the time, and flag those which were
13802         implemented by parents as optional.
13803
13804 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13805
13806         * expression.cs (Binary.ResolveOperator): Use
13807         String.Concat(string,string,string) or
13808         String.Concat(string,string,string,string) when possible. 
13809
13810         * typemanager: More helper methods.
13811
13812
13813 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13814
13815         * pending.cs: remove the bogus return from GetMissingInterfaces()
13816         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13817
13818 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13819
13820         * namespace.cs: avoid duplicated 'using xxx' being added to
13821         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13822         when we get more than one 'using' statement for the same namespace.
13823         Report a CS0105 warning for it.
13824
13825 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13826
13827         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13828         of calling getChar/putback, uses internal knowledge of it.    
13829
13830         (xtoken): Reorder tokenizer so most common patterns are checked
13831         first.  This reduces the compilation time in another 5% (from 8.11s
13832         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13833
13834         The parsing time is 22% of the compilation in mcs, and from that
13835         64% is spent on the tokenization process.  
13836
13837         I tried using a binary search for keywords, but this is slower
13838         than the hashtable.  Another option would be to do a couple of
13839         things:
13840
13841                 * Not use a StringBuilder, instead use an array of chars,
13842                   with a set value.  Notice that this way we could catch
13843                   the 645 error without having to do it *afterwards*.
13844
13845                 * We could write a hand-parser to avoid the hashtable
13846                   compares altogether.
13847
13848         The identifier consumption process takes 37% of the tokenization
13849         time.  Another 15% is spent on is_number.  56% of the time spent
13850         on is_number is spent on Int64.Parse:
13851
13852                 * We could probably choose based on the string length to
13853                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13854                   computations. 
13855
13856         Another 3% is spend on wrapping `xtoken' in the `token' function.
13857
13858         Handle 0xa0 as whitespace (#34752)
13859
13860 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * typemanager.cs (IsCLRType): New routine to tell whether a type
13863         is one of the builtin types.  
13864
13865         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13866         typecode in more places instead of doing pointer comparissions.
13867         We could leverage some knowledge about the way the typecodes are
13868         laid out.
13869
13870         New code to cache namespaces in assemblies, it is currently not
13871         invoked, to be used soon.
13872
13873         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13874
13875         * expression.cs (Binary.ResolveOperator): specially handle
13876         strings, and do not perform user-defined operator overloading for
13877         built-in types.
13878
13879 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13882         internalcall as it is a pretty simple operation;  Avoid whenever
13883         possible to call Char.IsLetter.
13884
13885         (consume_identifier): Cut by half the number of
13886         hashtable calls by merging the is_keyword and GetKeyword behavior.
13887
13888         Do not short-circuit, because if we do, we
13889         report errors (ie, #if false && true would produce an invalid
13890         directive error);
13891
13892
13893 2002-11-24  Martin Baulig  <martin@ximian.com>
13894
13895         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13896         check constant ranges and report a CS0221.  Fixes #33186.
13897
13898 2002-11-24  Martin Baulig  <martin@ximian.com>
13899
13900         * cs-parser.jay: Make this work for uninitialized variable
13901         declarations in the `for' initializer.  Fixes #32416.
13902
13903 2002-11-24  Martin Baulig  <martin@ximian.com>
13904
13905         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13906         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13907
13908 2002-11-24  Martin Baulig  <martin@ximian.com>
13909
13910         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13911         argument; if true, we also check for user-defined conversions.
13912         This is only needed if both arguments are of a user-defined type.
13913         Fixes #30443, added test-175.cs.
13914         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13915
13916         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13917
13918 2002-11-24  Martin Baulig  <martin@ximian.com>
13919
13920         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13921         function to get the store opcode.
13922         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13923         only emit the Ldelema if the store opcode is Stobj.  You must run
13924         both test-34 and test-167 to test this.  Fixes #34529.
13925
13926 2002-11-23  Martin Baulig  <martin@ximian.com>
13927
13928         * ecore.cs (Expression.MemberLookup): Added additional
13929         `qualifier_type' argument which is used when we're being called
13930         from MemberAccess.DoResolve() and null if we're called from a
13931         SimpleName lookup.
13932         (Expression.MemberLookupFailed): New method to report errors; this
13933         does the CS1540 check and reports the correct error message.
13934
13935         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13936         argument for the CS1540 check and redone the way how we're dealing
13937         with private members.  See the comment in the source code for details.
13938         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13939         `closure_start_type' to `closure_qualifier_type' and check whether
13940         it's not null.  It was not this filter being broken, it was just
13941         being called with the wrong arguments.
13942
13943         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13944         and pass it the correct `qualifier_type'; this also does the error
13945         handling for us.
13946
13947 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13948
13949         * expression.cs (Invocation.EmitParams): If the we are dealing
13950         with a non-built-in value type, load its address as well.
13951
13952         (ArrayCreation): Use a a pretty constant instead
13953         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13954         static initializers.  
13955
13956         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13957         because they are not really value types, just glorified integers. 
13958
13959         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13960
13961         * ecore.cs: Remove redundant code for enumerations, make them use
13962         the same code path as everything else, fixes the casting issue
13963         with enumerations in Windows.Forms.
13964
13965         * attribute.cs: Do only cast to string if it is a string, the
13966         validation happens later.
13967
13968         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13969         people upgrade their corlibs.
13970
13971         * ecore.cs: Oops, enumerations were not following the entire code path
13972
13973 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13974
13975         * typemanager.cs (FilterWithClosure): Commented out the test for
13976         1540 in typemanager.cs, as it has problems when accessing
13977         protected methods from a parent class (see test-174.cs). 
13978
13979         * attribute.cs (Attribute.ValidateGuid): new method.
13980         (Attribute.Resolve): Use above.
13981
13982 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13983
13984         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13985
13986         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13987         handling for enumerations, as we only needed the TypeContainer
13988         functionality to begin with (this is required for the fix below to
13989         work for enums that reference constants in a container class for
13990         example). 
13991
13992         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13993
13994         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13995         a valid TypeBuilder to perform lookups on.o
13996
13997         * class.cs (InheritableMemberSignatureCompare): Use true in the
13998         call to GetGetMethod and GetSetMethod, because we are comparing
13999         the signature, and we need to get the methods *even* if they are
14000         private. 
14001
14002         (PropertyBase.CheckBase): ditto.
14003
14004         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14005         GotoCase.Resolve): Use Peel on EmpytCasts.
14006
14007         * ecore.cs (EmptyCast): drop child, add Peel method.
14008
14009 2002-11-17  Martin Baulig  <martin@ximian.com>
14010
14011         * ecore.cs (EmptyCast.Child): New public property.
14012
14013         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14014         label resolved to an EmptyCast.  Fixes #34162.
14015         (GotoCase.Resolve): Likewise.
14016         (Block.EmitMeta): Likewise.
14017
14018 2002-11-17  Martin Baulig  <martin@ximian.com>
14019
14020         * expression.cs (Invocation.BetterConversion): Prefer int over
14021         uint; short over ushort; long over ulong for integer literals.
14022         Use ImplicitConversionExists instead of StandardConversionExists
14023         since we also need to check for user-defined implicit conversions.
14024         Fixes #34165.  Added test-173.cs.
14025
14026 2002-11-16  Martin Baulig  <martin@ximian.com>
14027
14028         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14029         with the `true' and `false' literals.  Fixes #33151.
14030
14031 2002-11-16  Martin Baulig  <martin@ximian.com>
14032
14033         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14034         October 22nd; don't do the cs1540 check for static members.
14035
14036         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14037         now using our own filter here and doing the cs1540 check again.
14038
14039 2002-11-16  Martin Baulig  <martin@ximian.com>
14040
14041         * support.cs (InternalParameters): Don't crash if we don't have
14042         any fixed parameters.  Fixes #33532.
14043
14044 2002-11-16  Martin Baulig  <martin@ximian.com>
14045
14046         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14047         when looking up static methods to make this work on Windows.
14048         Fixes #33773.
14049
14050 2002-11-16  Martin Baulig  <martin@ximian.com>
14051
14052         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14053         a setter rather than using PropertyInfo.CanWrite.
14054
14055 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14056
14057         * class.cs: Allow acces to block member by subclasses. Fixes build
14058         breaker.
14059
14060 2002-11-14  Martin Baulig  <martin@ximian.com>
14061
14062         * class.cs (Constructor.Emit): Added the extern/block check.
14063         Fixes bug #33678.
14064
14065 2002-11-14  Martin Baulig  <martin@ximian.com>
14066
14067         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14068         iteration while looking for indexers, this is needed because the
14069         indexer may have a different name in our base classes.  Fixed the
14070         error reporting (no indexers at all, not get accessor, no
14071         overloaded match).  Fixes bug #33089.
14072         (IndexerAccess.DoResolveLValue): Likewise.
14073
14074 2002-11-14  Martin Baulig  <martin@ximian.com>
14075
14076         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14077         indexers.  Fixes the first part of bug #33089.
14078         (MethodSignature.InheritableMemberSignatureCompare): Added support
14079         for properties.
14080
14081 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14082
14083         * attribute.cs (Attribute.Resolve): Catch the
14084         NullReferenceException and report it since it isn't supposed to
14085         happen. 
14086
14087 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14088
14089         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14090         LogicalOr and LogicalAnd that can benefit from recursively
14091         handling EmitBranchable.  The code now should be nice for Paolo.
14092
14093 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14094
14095         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14096         the Type lookups, as we perform quite a number of lookups on
14097         non-Types.  This can be removed once we can deterministically tell
14098         whether we have a type or a namespace in advance.
14099
14100         But this might require special hacks from our corlib.
14101
14102         * TODO: updated.
14103
14104         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14105         and double which avoids a conversion from an integer to a double.
14106
14107         * expression.cs: tiny optimization, avoid calling IsConstant,
14108         because it effectively performs the lookup twice.
14109
14110 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14111
14112         But a bogus return here to keep the semantics of the old code
14113         until the Mono runtime is fixed.
14114
14115         * pending.cs (GetMissingInterfaces): New method used to remove all
14116         the interfaces that are already implemented by our parent
14117         classes from the list of pending methods. 
14118
14119         * interface.cs: Add checks for calls after ResolveTypeExpr.
14120
14121 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * class.cs (Class.Emit): Report warning 67: event not used if the
14124         warning level is beyond 3.
14125
14126         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14127         being a NullLiteral.
14128
14129         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14130         specifiers. 
14131
14132         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14133         path that might fail if a type can not be resolved.
14134
14135         * expression.cs (Binary.Emit): Emit unsigned versions of the
14136         operators. 
14137
14138         * driver.cs: use error 5.
14139
14140 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14141
14142         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14143
14144 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * cs-parser.jay (switch_section): A beautiful patch from Martin
14147         Baulig that fixed 33094.
14148
14149 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14150
14151         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14152         Check whether the base is abstract and report an error if so.
14153
14154         * expression.cs (IndexerAccess.DoResolveLValue,
14155         IndexerAccess.DoResolve): ditto. 
14156
14157         (Invocation.DoResolve): ditto.
14158
14159         (Invocation.FullMethodDesc): Improve the report string.
14160
14161         * statement.cs (Block): Eliminate IsVariableDefined as it is
14162         basically just a wrapper for GetVariableInfo.
14163
14164         * ecore.cs (SimpleName): Use new 
14165
14166         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14167         type, as we return the actual parameter ref/unref state on a
14168         different call.
14169
14170 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14171
14172         * support.cs: Return proper flags REF/OUT fixing the previous
14173         commit.  
14174
14175         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14176         not used to mean `ref' but `ref or out' in ParameterReference
14177
14178         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14179         full type signature instead of calling TypeManger.CSharpName
14180         ourselves. 
14181
14182         * support.cs (InternalParameters.ParameterDesc): Do not compare
14183         directly to the modflags, because REF/OUT will actually be bitsets
14184         if set. 
14185
14186         * delegate.cs (VerifyMethod): Check also the modifiers.
14187
14188         * cs-tokenizer.cs: Fix bug where floating point values with an
14189         exponent where a sign was missing was ignored.
14190
14191         * driver.cs: Allow multiple assemblies to be specified in a single
14192         /r: argument
14193
14194 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14195
14196         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14197         because identifiers after a parenthesis would end up in this kind
14198         of production, and we needed to desamiguate it for having casts
14199         like:
14200
14201                 (UserDefinedType *) xxx
14202
14203 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14204
14205         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14206         we should set on the Bindingflags.NonPublic, but not turn on
14207         private_ok.  private_ok controls whether a Private member is
14208         returned (this is chekced on the filter routine), while the
14209         BindingFlags.NonPublic just controls whether private/protected
14210         will be allowed.   This fixes the problem part of the problem of
14211         private properties being allowed to be used in derived classes.
14212
14213         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14214         so we can call the children DoResolveLValue method (this will
14215         properly signal errors on lvalue assignments to base properties)
14216
14217         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14218         getter are null, and we have a property info, we know that this
14219         happened because the lookup failed, so we report an error 122 for
14220         protection level violation.
14221
14222         We also silently return if setter and getter are null in the
14223         resolve functions, this condition only happens if we have flagged
14224         the error before.  This is the other half of the problem. 
14225
14226         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14227         not have accessibility information, that is why we were returning
14228         true in the filter function in typemanager.cs.
14229
14230         To properly report 122 (property is inaccessible because of its
14231         protection level) correctly, we report this error in ResolveAccess
14232         by failing if both the setter and the getter are lacking (ie, the
14233         lookup failed). 
14234
14235         DoResolve and DoLResolve have been modified to check for both
14236         setter/getter being null and returning silently, the reason being
14237         that I did not want to put the knowledge about this error in upper
14238         layers, like:
14239
14240         int old = Report.Errors;
14241         x = new PropertyExpr (...);
14242         if (old != Report.Errors)
14243                 return null;
14244         else
14245                 return x;
14246
14247         So the property expr is returned, but it is invalid, so the error
14248         will be flagged during the resolve process. 
14249
14250         * class.cs: Remove InheritablePropertySignatureCompare from the
14251         class, as we no longer depend on the property signature to compute
14252         whether it is possible to implement a method or not.
14253
14254         The reason is that calling PropertyInfo.GetGetMethod will return
14255         null (in .NET, in Mono it works, and we should change this), in
14256         cases where the Get Method does not exist in that particular
14257         class.
14258
14259         So this code:
14260
14261         class X { public virtual int A { get { return 1; } } }
14262         class Y : X { }
14263         class Z : Y { public override int A { get { return 2; } } }
14264
14265         Would fail in Z because the parent (Y) would not have the property
14266         defined.  So we avoid this completely now (because the alternative
14267         fix was ugly and slow), and we now depend exclusively on the
14268         method names.
14269
14270         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14271         reference method, instead of using the property.
14272
14273         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14274         routines are gone now.
14275
14276         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14277         names, they were incorrectly named.
14278
14279         * cs-tokenizer.cs: Return are more gentle token on failure. 
14280
14281         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14282         had an out-of-sync index variable, which caused it to remove from
14283         the list of pending methods the wrong method sometimes.
14284
14285 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14286
14287         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14288         CanWrite, because those refer to this particular instance of the
14289         property, and do not take into account the fact that we can
14290         override single members of a property.
14291
14292         Constructor requires an EmitContext.  The resolution process does
14293         not happen here, but we need to compute the accessors before,
14294         because the resolution does not always happen for properties.
14295
14296         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14297         subclass, before we did not update this flag, but we did update
14298         bindingflags. 
14299
14300         (GetAccessors): Drop this routine, as it did not work in the
14301         presence of partially overwritten set/get methods. 
14302
14303         Notice that this broke the cs1540 detection, but that will require
14304         more thinking. 
14305
14306 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14307
14308         * class.cs:
14309         * codegen.cs:
14310         * driver.cs: issue a warning instead of an error if we don't support
14311         debugging for the platform. Also ignore a couple of errors that may
14312         arise when trying to write the symbols. Undo my previous patch.
14313
14314 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14315
14316         * driver.cs: ignore /debug switch except for Unix platforms.
14317
14318 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14319
14320         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14321
14322 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14323
14324         * driver.cs: Do not make mcs-debug conditional, so we do not break
14325         builds that use it.
14326
14327         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14328         review this patch.  But basically after all the children variables
14329         have been merged, the value of "Breaks" was not being set to
14330         new_breaks for Switch blocks.  I think that it should be set after
14331         it has executed.  Currently I set this to the value of new_breaks,
14332         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14333         conservative, but I do not understand this code very well.
14334
14335         I did not break anything in the build, so that is good ;-)
14336
14337         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14338
14339 2002-10-20  Mark Crichton  <crichton@gimp.org>
14340
14341         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14342
14343 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14344
14345         * cfold.cs: Fixed compile blocker.
14346
14347 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * driver.cs: I was chekcing the key, not the file.
14350
14351 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14352
14353         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14354         message that we were generating - we just need to silently return
14355         a null.
14356
14357 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14358
14359         * class.cs (Event.Define): Change my previous commit, as this
14360         breaks the debugger.  This is a temporary hack, as it seems like
14361         the compiler is generating events incorrectly to begin with.
14362
14363         * expression.cs (Binary.ResolveOperator): Added support for 
14364         "U operator - (E x, E y)"
14365
14366         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14367         y)".
14368
14369         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14370         init-only variables, but this path did not take into account that
14371         there might be also instance readonly variables.  Correct this
14372         problem. 
14373
14374         This fixes bug 32253
14375
14376         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14377         delegates as well.
14378
14379         * driver.cs: Change the extension for modules to `netmodule'
14380
14381         * cs-parser.jay: Improved slightly the location tracking for
14382         the debugger symbols.
14383
14384         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14385         modifiers that were specified instead of the hardcoded value
14386         (FamAndAssem).  This was basically ignoring the static modifier,
14387         and others.  Fixes 32429.
14388
14389         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14390         fixed a bug in the process (32476)
14391
14392         * expression.cs (ArrayAccess.EmitAssign): Patch from
14393         hwang_rob@yahoo.ca that fixes bug 31834.3
14394
14395 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * driver.cs: Make the module extension .netmodule.
14398
14399 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14400
14401         * driver.cs: Report an error if the resource file is not found
14402         instead of crashing.
14403
14404         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14405         false, like Emit does.
14406
14407 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14408
14409         * typemanager.cs: Remove unused private member.  Also reported mcs
14410         bug to report this as a warning like csc.
14411
14412 2002-10-15  Martin Baulig  <martin@gnome.org>
14413
14414         * statement.cs (Statement.Emit): Made this a virtual method; emits
14415         the line number info and calls DoEmit().
14416         (Statement.DoEmit): New protected abstract method, formerly knows
14417         as Statement.Emit().
14418
14419         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14420
14421 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14422
14423         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14424         have fixed a remaining problem: not every AddXXXX was adding a
14425         fully qualified name.  
14426
14427         Now everyone registers a fully qualified name in the DeclSpace as
14428         being defined instead of the partial name.  
14429
14430         Downsides: we are slower than we need to be due to the excess
14431         copies and the names being registered this way.  
14432
14433         The reason for this is that we currently depend (on the corlib
14434         bootstrap for instance) that types are fully qualified, because
14435         we dump all the types in the namespace, and we should really have
14436         types inserted into the proper namespace, so we can only store the
14437         basenames in the defined_names array.
14438
14439 2002-10-10  Martin Baulig  <martin@gnome.org>
14440
14441         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14442         from bug #31834, see the bug report for a testcase which is
14443         miscompiled.
14444
14445 2002-10-10  Martin Baulig  <martin@gnome.org>
14446
14447         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14448         flow analysis code for this.
14449
14450         * statement.cs (Do, While, For): Tell the flow analysis code about
14451         infinite loops.
14452         (FlowBranching.UsageVector): Added support for infinite loops.
14453         (Block.Resolve): Moved the dead code elimination here and use flow
14454         analysis to do it.
14455
14456 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14457
14458         * class.cs (Field.Define): Catch cycles on struct type
14459         definitions. 
14460
14461         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14462         fields if the fields are static.  We only need to check instance
14463         fields. 
14464
14465         * expression.cs (As.DoResolve): Test for reference type.
14466
14467         * statement.cs (Using.ResolveExpression): Use
14468         ConvertImplicitRequired, not ConvertImplicit which reports an
14469         error on failture
14470         (Using.ResolveLocalVariableDecls): ditto.
14471
14472         * expression.cs (Binary.ResolveOperator): Report errors in a few
14473         places where we had to.
14474
14475         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14476
14477 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14478
14479         * expression.cs: Use StoreFromPtr instead of extracting the type
14480         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14481
14482         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14483         an enumeration value to a System.Enum, but System.Enum is not a
14484         value type, but an class type, so we need to box.
14485
14486         (Expression.ConvertExplicit): One codepath could return
14487         errors but not flag them.  Fix this.  Fixes #31853
14488
14489         * parameter.cs (Resolve): Do not allow void as a parameter type.
14490
14491 2002-10-06  Martin Baulig  <martin@gnome.org>
14492
14493         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14494         if it's a class type and not a struct.  Fixes #31815.
14495
14496 2002-10-06  Martin Baulig  <martin@gnome.org>
14497
14498         * statement.cs: Reworked the flow analysis code a bit to make it
14499         usable for dead code elimination.
14500
14501 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14502
14503         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14504
14505 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14506
14507         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14508         to fix the test 165, will investigate deeper.
14509
14510 2002-10-04  Martin Baulig  <martin@gnome.org>
14511
14512         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14513         finally blocks actually work.
14514         (Try.Resolve): We don't need to create a sibling for `finally' if
14515         there is no finally block.
14516
14517 2002-10-04  Martin Baulig  <martin@gnome.org>
14518
14519         * class.cs (Constructor.Define): The default accessibility for a
14520         non-default constructor is private, not public.
14521
14522 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14523
14524         * class.cs (Constructor): Make AllowedModifiers public, add
14525         EXTERN.
14526
14527         * cs-parser.jay: Perform the modifiers test here, as the
14528         constructor for the Constructor class usually receives a zero
14529         because of the way we create it (first we create, later we
14530         customize, and we were never checking the modifiers).
14531
14532         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14533         is a version of LookupTypeReflection that includes the type-name
14534         cache.  This can be used as a fast path for functions that know
14535         the fully qualified name and are only calling into *.GetType() to
14536         obtain a composed type.
14537
14538         This is also used by TypeManager.LookupType during its type
14539         composition.
14540
14541         (LookupType): We now also track the real type name, as sometimes
14542         we can get a quey for the real type name from things like
14543         ComposedCast.  This fixes bug 31422.
14544
14545         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14546         complete type fullname, it does not have to go through the type
14547         resolution system to obtain the composed version of the type (for
14548         obtaining arrays or pointers).
14549
14550         (Conditional.Emit): Use the EmitBoolExpression to
14551         generate nicer code, as requested by Paolo.
14552
14553         (ArrayCreation.CheckIndices): Use the patch from
14554         hwang_rob@yahoo.ca to validate the array initializers. 
14555
14556 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14557
14558         * class.cs (ConstructorInitializer.Emit): simplify code by using
14559         Invocation.EmitCall, and at the same time, fix the bugs in calling
14560         parent constructors that took variable arguments. 
14561
14562         * ecore.cs (Expression.ConvertNumericExplicit,
14563         Expression.ImplicitNumericConversion): Remove the code that
14564         manually wrapped decimal (InternalTypeConstructor call is now gone
14565         as well).
14566
14567         * expression.cs (Cast.TryReduce): Also handle decimal types when
14568         trying to perform a constant fold on the type.
14569
14570         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14571
14572         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14573         that only turned off an error report, and did nothing else. 
14574
14575 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14576
14577         * driver.cs: Handle and ignore /fullpaths
14578
14579 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14580
14581         * expression.cs (Binary.ResolveOperator): Catch the case where
14582         DoNumericPromotions returns true, 
14583
14584         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14585
14586 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14587
14588         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14589         report error 70.
14590
14591 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14592
14593         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14594         conversion exists, but it is also required that the conversion be
14595         performed.  This manifested in "(Type64Enum) 2".  
14596
14597         * class.cs (TypeManager.AddMethod): The fix is not to change
14598         AddEnum, because that one was using a fully qualified name (every
14599         DeclSpace derivative does), but to change the AddMethod routine
14600         that was using an un-namespaced name.  This now correctly reports
14601         the duplicated name.
14602
14603         Revert patch until I can properly fix it.  The issue
14604         is that we have a shared Type space across all namespaces
14605         currently, which is wrong.
14606
14607         Options include making the Namespace a DeclSpace, and merge
14608         current_namespace/current_container in the parser.
14609
14610 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14611
14612         * cs-parser.jay: Improve error reporting when we get a different
14613         kind of expression in local_variable_type and
14614         local_variable_pointer_type. 
14615
14616         Propagate this to avoid missleading errors being reported.
14617
14618         * ecore.cs (ImplicitReferenceConversion): treat
14619         TypeManager.value_type as a target just like object_type.   As
14620         code like this:
14621
14622         ValueType v = 1;
14623
14624         Is valid, and needs to result in the int 1 being boxed before it
14625         is assigned to the value type v.
14626
14627         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14628         to validate the enumeration name.
14629
14630         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14631         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14632         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14633
14634         * ecore.cs (TryImplicitIntConversion): When doing an
14635         implicit-enumeration-conversion, check if the type is 64-bits and
14636         perform a conversion before passing to EnumConstant.
14637
14638 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14639
14640         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14641         report ambiguous type references.  Unlike the MS version, we
14642         report what the ambiguity is.   Innovation at work ;-)
14643
14644         (DeclSpace.FindType): Require a location argument to
14645         display when we display an ambiguous error.
14646
14647         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14648
14649         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14650
14651         * expression.cs (EmitDynamicInitializers): Apply patch from
14652         hwang_rob@yahoo.ca that fixes the order in which we emit our
14653         initializers. 
14654
14655 2002-09-21  Martin Baulig  <martin@gnome.org>
14656
14657         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14658         delegate takes no arguments.
14659
14660 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14661
14662         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14663         from integers.
14664
14665         * expression.cs: Extract the underlying type.
14666
14667         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14668
14669         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14670
14671 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14672
14673         * class.cs (TypeContainer.DefineType): We can not use the nice
14674         PackingSize with the size set to 1 DefineType method, because it
14675         will not allow us to define the interfaces that the struct
14676         implements.
14677
14678         This completes the fixing of bug 27287
14679
14680         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14681         means also structs.  This fixes part of the problem. 
14682         (Expresion.ImplicitReferenceConversionExists): ditto.
14683
14684         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14685         error if there were no errors reported during the type lookup
14686         process, to avoid duplicates or redundant errors.  Without this
14687         you would get an ambiguous errors plus a type not found.  We have
14688         beaten the user enough with the first error.  
14689
14690         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14691         reference. 
14692
14693         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14694         during the resolution process, stop the lookup, this avoids
14695         repeated error reports (same error twice).
14696
14697         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14698
14699         * typemanager.cs (LookupType): Redo the type lookup code to match
14700         the needs of System.Reflection.  
14701
14702         The issue is that System.Reflection requires references to nested
14703         types to begin with a "+" sign instead of a dot.  So toplevel
14704         types look like: "NameSpace.TopLevelClass", and nested ones look
14705         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14706         levels. 
14707
14708 2002-09-19  Martin Baulig  <martin@gnome.org>
14709
14710         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14711         says that a method always returns or always throws an exception,
14712         don't report the CS0161.
14713
14714         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14715         set `Returns = new_returns'.
14716
14717 2002-09-19  Martin Baulig  <martin@gnome.org>
14718
14719         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14720         to an enum constant, check for a CS0176.
14721
14722 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14725         for operators that must be in pairs and report errors.
14726
14727         * ecore.cs (SimpleName.DoResolveType): During the initial type
14728         resolution process, when we define types recursively, we must
14729         check first for types in our current scope before we perform
14730         lookups in the enclosing scopes.
14731
14732         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14733
14734         (Invocation.VerifyArgumentsCompat): Call
14735         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14736         I thought we were supposed to always call this, but there are a
14737         few places in the code where we dont do it.
14738
14739 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14740
14741         * driver.cs: Add support in -linkres and -resource to specify the
14742         name of the identifier.
14743
14744 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14745
14746         * ecore.cs (StandardConversionExists): Sync with the conversion
14747         code: allow anything-* to void* conversions.
14748
14749         (FindMostSpecificSource): Use an Expression argument
14750         instead of a Type, because we might be handed over a Literal which
14751         gets a few more implicit conversions that plain types do not.  So
14752         this information was being lost.
14753
14754         Also, we drop the temporary type-holder expression when not
14755         required.
14756
14757 2002-09-17  Martin Baulig  <martin@gnome.org>
14758
14759         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14760         this is an explicit interface implementation.
14761
14762 2002-09-17  Martin Baulig  <martin@gnome.org>
14763
14764         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14765         different `IndexerName' attributes.
14766
14767         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14768         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14769         virtual CommonResolve().
14770
14771 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14772
14773         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14774         and convert that to the UnderlyingType.
14775
14776         * statement.cs (Foreach.Resolve): Indexers are just like variables
14777         or PropertyAccesses.
14778
14779         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14780         inside quoted strings, we were not doing this before.
14781
14782 2002-09-16  Martin Baulig  <martin@gnome.org>
14783
14784         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14785         resolve it.  This is needed for the definite assignment check of the
14786         instance expression, fixes bug #29846.
14787         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14788
14789 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14790
14791         * parameter.cs: Fix compile error.  Cannot reference static member
14792         from an instance object.  Is this an mcs bug?
14793
14794 2002-09-14  Martin Baulig  <martin@gnome.org>
14795
14796         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14797         multiple times.  Fixes bug #30295, added test-166.cs.
14798
14799 2002-09-14  Martin Baulig  <martin@gnome.org>
14800
14801         * statement.cs (Block.Emit): Don't emit unreachable code.
14802         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14803         `break' statements.
14804         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14805
14806 2002-09-14  Martin Baulig  <martin@gnome.org>
14807
14808         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14809         is set.
14810
14811 2002-09-14  Martin Baulig  <martin@gnome.org>
14812
14813         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14814         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14815         be false on the ms runtime.
14816
14817 2002-09-13  Martin Baulig  <martin@gnome.org>
14818
14819         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14820         the CS0038 error message.
14821
14822 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14823
14824         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14825         constant inside, return it.
14826
14827 2002-09-12  Martin Baulig  <martin@gnome.org>
14828
14829         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14830         implicit conversion can be done between enum types.
14831
14832         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14833         check whether an implicit conversion to the current enum's UnderlyingType
14834         exists and report an error if not.
14835
14836         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14837         without debugging support.
14838
14839         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14840         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14841
14842 2002-09-12  Martin Baulig  <martin@gnome.org>
14843
14844         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14845
14846         * ecore.cs (IMemberExpr.DeclaringType): New property.
14847         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14848         nonstatic member of an outer type (CS0038).
14849
14850 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14851
14852         * driver.cs: Activate the using-error detector at warning level
14853         4 (at least for MS-compatible APIs).
14854
14855         * namespace.cs (VerifyUsing): Small buglett fix.
14856
14857         * pending.cs (PendingImplementation): pass the container pointer. 
14858
14859         * interface.cs (GetMethods): Allow for recursive definition.  Long
14860         term, I would like to move every type to support recursive
14861         definitions, not the current ordering mechanism that we have right
14862         now.
14863
14864         The situation is this: Attributes are handled before interfaces,
14865         so we can apply attributes to interfaces.  But some attributes
14866         implement interfaces, we will now handle the simple cases
14867         (recursive definitions will just get an error).  
14868
14869         * parameter.cs: Only invalidate types at the end if we fail to
14870         lookup all types.  
14871
14872 2002-09-09  Martin Baulig  <martin@gnome.org>
14873
14874         * ecore.cs (PropertyExpr.Emit): Also check for
14875         TypeManager.system_int_array_get_length so this'll also work when
14876         compiling corlib.  Fixes #30003.
14877
14878 2002-09-09  Martin Baulig  <martin@gnome.org>
14879
14880         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14881         and throw an exception if we can't get the type's size.  Fixed #30040,
14882         added test-165.cs.
14883
14884 2002-09-09  Martin Baulig  <martin@gnome.org>
14885
14886         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14887
14888         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14889         context.  Fixes bug #30027.
14890
14891         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14892         virtual functions.  Fixes bug #30043, added test-164.cs.
14893
14894 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14895
14896         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14897
14898 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14899
14900         * driver.cs: Use an object to get the windows codepage since it's not a
14901         static property.
14902
14903 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * statement.cs (For.Emit): for infinite loops (test == null)
14906         return whether there is a break inside, not always "true".
14907
14908         * namespace.cs (UsingEntry): New struct to hold the name of the
14909         using definition, the location where it is defined, and whether it
14910         has been used in a successful type lookup.
14911
14912         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14913         strings.
14914
14915         * decl.cs: ditto.
14916
14917 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14918
14919         * attribute.cs : Fix incorrect code which relied on catching
14920         a NullReferenceException to detect a null being passed in
14921         where an object was expected.
14922
14923 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * statement.cs (Try): flag the catch variable as assigned
14926
14927         * expression.cs (Cast): Simplified by using ResolveType instead of
14928         manually resolving.
14929
14930         * statement.cs (Catch): Fix bug by using ResolveType.
14931
14932 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14933
14934         * expression.cs (BetterConversion): Special case for when we have
14935         a NullLiteral as the argument and we have to choose between string
14936         and object types - we choose string the way csc does.
14937
14938         * attribute.cs (Attribute.Resolve): Catch the
14939         NullReferenceException and report error #182 since the Mono
14940         runtime no more has the bug and having this exception raised means
14941         we tried to select a constructor which takes an object and is
14942         passed a null.
14943
14944 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14945
14946         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14947         message (1502, 1503) when we can't locate a method after overload
14948         resolution. This is much more informative and closes the bug
14949         Miguel reported.
14950
14951         * interface.cs (PopulateMethod): Return if there are no argument
14952         types. Fixes a NullReferenceException bug.
14953
14954         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14955         expressions too. Previously we were checking only in one place for
14956         positional arguments leaving out named arguments.
14957
14958         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14959         type to the enum type is not allowed. Remove code corresponding to
14960         that.
14961
14962         (ConvertNumericExplicit): Allow explicit conversions from
14963         the underlying type to enum type. This precisely follows the spec
14964         and closes a bug filed by Gonzalo.
14965
14966 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14967
14968         * compiler.csproj:
14969         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14970
14971 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14972
14973         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14974         it was important that we stored the right value after the
14975         reduction in `converted'.
14976
14977 2002-09-04  Martin Baulig  <martin@gnome.org>
14978
14979         * location.cs (Location.SymbolDocument): Use full pathnames for the
14980         source files.
14981
14982 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14983
14984         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14985         of the expression resolve mechanism, because that will catch the
14986         SimpleName error failures.
14987
14988         (Conditional): If we can not resolve the
14989         expression, return, do not crash.
14990
14991 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14992
14993         * cs-tokenizer.cs:
14994         (location): display token name instead of its number.
14995
14996 2002-08-28  Martin Baulig  <martin@gnome.org>
14997
14998         * expression.cs (Binary.ResolveOperator): Don't silently return
14999         but return an error if an operator cannot be applied between two
15000         enum types.
15001
15002 2002-08-28  Martin Baulig  <martin@gnome.org>
15003
15004         * class.cs (Constructor.Define): Set the permission attributes
15005         correctly instead of making all constructors public.
15006
15007 2002-08-28  Martin Baulig  <martin@gnome.org>
15008
15009         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15010         for private members before reporting a CS0103; if we find anything,
15011         it's a CS0122.
15012
15013 2002-08-28  Martin Baulig  <martin@gnome.org>
15014
15015         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15016         to check whether `closure_start_type == closure_invocation_type',
15017         we also need to check whether `m.DeclaringType == closure_invocation_type'
15018         before bypassing the permission checks.  We might be accessing
15019         protected/private members from the base class.
15020         (TypeManager.RealMemberLookup): Only set private_ok if private
15021         members were requested via BindingFlags.NonPublic.
15022
15023         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15024
15025         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15026         MethodGroupExpr.IsExplicitImpl if appropriate.
15027         (Invocation.DoResolve): Don't report the CS0120 for explicit
15028         interface implementations.
15029
15030 2002-08-27  Martin Baulig  <martin@gnome.org>
15031
15032         * expression.cs (Invocation.DoResolve): If this is a static
15033         method and we don't have an InstanceExpression, we must report
15034         a CS0120.
15035
15036 2002-08-25  Martin Baulig  <martin@gnome.org>
15037
15038         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15039         `==' between a valuetype and an object.
15040
15041 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * ecore.cs (TypeExpr): Provide a ToString method.
15044
15045 2002-08-24  Martin Baulig  <martin@gnome.org>
15046
15047         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15048         now called proggie.dbg and it's a binary file.
15049
15050 2002-08-23  Martin Baulig  <martin@gnome.org>
15051
15052         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15053
15054 2002-08-23  Martin Baulig  <martin@gnome.org>
15055
15056         * struct.cs (MyStructInfo.ctor): Make this work with empty
15057         structs; it's not allowed to use foreach() on null.
15058
15059 2002-08-23  Martin Baulig  <martin@gnome.org>
15060
15061         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15062         writer the full pathname of the generated assembly.
15063
15064 2002-08-23  Martin Baulig  <martin@gnome.org>
15065
15066         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15067         A `finally' block never returns or breaks; improved handling of
15068         unreachable code.
15069
15070 2002-08-23  Martin Baulig  <martin@gnome.org>
15071
15072         * statement.cs (Throw.Resolve): Allow `throw null'.
15073
15074 2002-08-23  Martin Baulig  <martin@gnome.org>
15075
15076         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15077         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15078         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15079         MemberLookup would return a wrong event if this is an explicit
15080         interface implementation and the class has an event with the same
15081         name.
15082
15083 2002-08-23  Martin Baulig  <martin@gnome.org>
15084
15085         * statement.cs (Block.AddChildVariableNames): New public method.
15086         (Block.AddChildVariableName): Likewise.
15087         (Block.IsVariableNameUsedInChildBlock): Likewise.
15088         (Block.AddVariable): Check whether a variable name has already
15089         been used in a child block.
15090
15091         * cs-parser.jay (declare_local_variables): Mark all variable names
15092         from the current block as being used in a child block in the
15093         implicit block.
15094
15095 2002-08-23  Martin Baulig  <martin@gnome.org>
15096
15097         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15098         find the symbol writer.
15099
15100         * driver.cs: csc also allows the arguments to /define being
15101         separated by commas, not only by semicolons.
15102
15103 2002-08-23  Martin Baulig  <martin@gnome.org>
15104
15105         * interface.cs (Interface.GetMembers): Added static check for events.
15106
15107 2002-08-15  Martin Baulig  <martin@gnome.org>
15108
15109         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15110         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15111
15112         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15113         why the MethodData.EmitDestructor() change was necessary.
15114
15115 2002-08-20  Martin Baulig  <martin@gnome.org>
15116
15117         * class.cs (TypeContainer.FindMembers): Added static check for events.
15118
15119         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15120
15121         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15122         use Type.GetEvents(), not Type.FindMembers().
15123
15124 2002-08-20  Martin Baulig  <martin@gnome.org>
15125
15126         * decl.cs (MemberCache): Added a special method cache which will
15127         be used for method-only searched.  This ensures that a method
15128         search will return a MethodInfo with the correct ReflectedType for
15129         inherited methods.      
15130
15131 2002-08-20  Martin Baulig  <martin@gnome.org>
15132
15133         * decl.cs (DeclSpace.FindMembers): Made this public.
15134
15135 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15136
15137         * delegate.cs: fixed build on windows.
15138         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15139
15140 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15141
15142         * ecore.cs (StandardConversionExists): Return a false
15143         if we are trying to convert the void type to anything else
15144         since that is not allowed.
15145
15146         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15147         we flag error 70 in the event an event is trying to be accessed
15148         directly from outside the declaring type.
15149
15150 2002-08-20  Martin Baulig  <martin@gnome.org>
15151
15152         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15153         MemberCache from typemanager.cs to decl.cs.
15154
15155 2002-08-19  Martin Baulig  <martin@gnome.org>
15156
15157         * class.cs (TypeContainer): Implement IMemberContainer.
15158         (TypeContainer.DefineMembers): Create the MemberCache.
15159         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15160         return public members if BindingFlags.Public was given, check
15161         whether members are static.
15162
15163 2002-08-16  Martin Baulig  <martin@gnome.org>
15164
15165         * decl.cs (DeclSpace.Define): Splitted this in Define and
15166         DefineMembers.  DefineMembers is called first and initializes the
15167         MemberCache.
15168
15169         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15170         DefineMembers() on all our DeclSpaces.
15171
15172         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15173         but call DefineMembers() on all nested interfaces.  We call their
15174         Define() in our new Define() function.
15175
15176         * interface.cs (Interface): Implement IMemberContainer.
15177         (Interface.Define): Moved all code except the attribute stuf to
15178         DefineMembers().
15179         (Interface.DefineMembers): Initialize the member cache.
15180
15181         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15182         need this anymore since we can use MemberCache.FindMembers directly.
15183
15184 2002-08-19  Martin Baulig  <martin@gnome.org>
15185
15186         * typemanager.cs (MemberCache): When creating the cache for an
15187         interface type, add all inherited members.
15188         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15189         to `out bool used_cache' and documented it.
15190         (TypeManager.MemberLookup): If we already used the cache in the first
15191         iteration, we don't need to do the interfaces check.
15192
15193 2002-08-19  Martin Baulig  <martin@gnome.org>
15194
15195         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15196         here from IMemberFinder and don't implement this interface anymore.
15197         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15198
15199         * typemanager.cs (IMemberFinder): This interface is now only used by
15200         classes which actually support the member cache.
15201         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15202         since we only put DeclSpaces into this Hashtable.
15203         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15204         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15205
15206 2002-08-16  Martin Baulig  <martin@gnome.org>
15207
15208         * typemanager.cs (ICachingMemberFinder): Removed.
15209         (IMemberFinder.MemberCache): New property.
15210         (TypeManager.FindMembers): Merged this with RealFindMembers().
15211         This function will never be called from TypeManager.MemberLookup()
15212         so we can't use the cache here, just the IMemberFinder.
15213         (TypeManager.MemberLookup_FindMembers): Check whether the
15214         IMemberFinder has a MemberCache and call the cache's FindMembers
15215         function.
15216         (MemberCache): Rewrote larger parts of this yet another time and
15217         cleaned it up a bit.
15218
15219 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * driver.cs (LoadArgs): Support quoting.
15222
15223         (Usage): Show the CSC-like command line arguments.
15224
15225         Improved a few error messages.
15226
15227 2002-08-15  Martin Baulig  <martin@gnome.org>
15228
15229         * typemanager.cs (IMemberContainer.Type): New property.
15230         (IMemberContainer.IsInterface): New property.
15231
15232         The following changes are conditional to BROKEN_RUNTIME, which is
15233         defined at the top of the file.
15234
15235         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15236         class'es members, but add all members from TypeHandle.ObjectType
15237         if we're an interface.
15238         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15239         is the current type.
15240         (MemberCache.CacheEntry.Container): Removed this field.
15241         (TypeHandle.GetMembers): Include inherited members.
15242
15243 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15244
15245         * typemanager.cs: fixed compilation and added a comment on a field that
15246         is never used.
15247
15248 2002-08-15  Martin Baulig  <martin@gnome.org>
15249
15250         * class.cs (ConstructorInitializer.Resolve): In the
15251         Expression.MemberLookup call, use the queried_type as
15252         invocation_type.
15253
15254         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15255         declared' attribute, it's always true.
15256         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15257         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15258         temporary wrapper for FindMembers which tells MemberLookup whether
15259         members from the base classes are included in the return value.
15260         This will go away soon.
15261         (TypeManager.MemberLookup): Use this temporary hack here; once the
15262         new MemberCache is completed, we don't need to do the DeclaredOnly
15263         looping here anymore since the MemberCache will take care of this.
15264         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15265         (MemberCache): When creating the MemberCache for a class, get
15266         members from the current class and all its base classes.
15267         (MemberCache.CacheEntry.Container): New field.  This is a
15268         temporary hack until the Mono runtime is fixed to distinguish
15269         between ReflectedType and DeclaringType.  It allows us to use MCS
15270         with both the MS runtime and the unfixed Mono runtime without
15271         problems and without accecting performance.
15272         (MemberCache.SearchMembers): The DeclaredOnly looping from
15273         TypeManager.MemberLookup is now done here.      
15274
15275 2002-08-14  Martin Baulig  <martin@gnome.org>
15276
15277         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15278         Type.GetFields on dynamic types but get the fields from the
15279         corresponding TypeContainer.
15280         (MyStructInfo.GetStructInfo): Added check for enum types.
15281
15282         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15283         (MemberList.SyncRoot): Implemented.
15284         (TypeManager.FilterWithClosure): No need to check permissions if
15285         closure_start_type == closure_invocation_type, don't crash if
15286         closure_invocation_type is null.
15287
15288 2002-08-13  Martin Baulig  <martin@gnome.org>
15289
15290         Rewrote TypeContainer.FindMembers to use a member cache.  This
15291         gives us a speed increase of about 35% for the self-hosting MCS
15292         build and of about 15-20% for the class libs (both on GNU/Linux).
15293
15294         * report.cs (Timer): New class to get enhanced profiling.  This
15295         whole class is "TIMER" conditional since it remarkably slows down
15296         compilation speed.
15297
15298         * class.cs (MemberList): New class.  This is an IList wrapper
15299         which we're now using instead of passing MemberInfo[]'s around to
15300         avoid copying this array unnecessarily.
15301         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15302         (ICachingMemberFinder, IMemberContainer): New interface.
15303         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15304         has already been checked, otherwise use it for the name comparision.
15305         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15306         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15307         if possible.  Returns a MemberList, not a MemberInfo [].
15308         (TypeHandle): New class, implements IMemberContainer.  We create
15309         one instance of this class per type, it contains a MemberCache
15310         which is used to do the member lookups.
15311         (MemberCache): New class.  Each instance of this class contains
15312         all members of a type and a name-based hash table.
15313         (MemberCache.FindMembers): This is our new member lookup
15314         function.  First, it looks up all members of the requested name in
15315         the hash table.  Then, it walks this list and sorts out all
15316         applicable members and returns them.
15317
15318 2002-08-13  Martin Baulig  <martin@gnome.org>
15319
15320         In addition to a nice code cleanup, this gives us a performance
15321         increase of about 1.4% on GNU/Linux - not much, but it's already
15322         half a second for the self-hosting MCS compilation.
15323
15324         * typemanager.cs (IMemberFinder): New interface.  It is used by
15325         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15326         Enum, Delegate or Interface.
15327         (TypeManager.finder_to_member_finder): New PtrHashtable.
15328         (TypeManager.finder_to_container): Removed.
15329         (TypeManager.finder_to_delegate): Removed.
15330         (TypeManager.finder_to_interface): Removed.
15331         (TypeManager.finder_to_enum): Removed.
15332
15333         * interface.cs (Interface): Implement IMemberFinder.
15334
15335         * delegate.cs (Delegate): Implement IMemberFinder.
15336
15337         * enum.cs (Enum): Implement IMemberFinder.
15338
15339         * class.cs (TypeContainer): Implement IMemberFinder.
15340
15341 2002-08-12  Martin Baulig  <martin@gnome.org>
15342
15343         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15344
15345 2002-08-12  Martin Baulig  <martin@gnome.org>
15346
15347         * ecore.cs (ITypeExpression): New interface for expressions which
15348         resolve to a type.
15349         (TypeExpression): Renamed to TypeLookupExpression.
15350         (Expression.DoResolve): If we're doing a types-only lookup, the
15351         expression must implement the ITypeExpression interface and we
15352         call DoResolveType() on it.
15353         (SimpleName): Implement the new ITypeExpression interface.
15354         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15355         hack, the situation that we're only looking up types can't happen
15356         anymore when this method is called.  Moved the type lookup code to
15357         DoResolveType() and call it.
15358         (SimpleName.DoResolveType): This ITypeExpression interface method
15359         is now doing the types-only lookup.
15360         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15361         (ResolveFlags): Added MaskExprClass.
15362
15363         * expression.cs (MemberAccess): Implement the ITypeExpression
15364         interface.
15365         (MemberAccess.DoResolve): Added support for a types-only lookup
15366         when we're called via ITypeExpression.DoResolveType().
15367         (ComposedCast): Implement the ITypeExpression interface.
15368
15369         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15370         Expression.Resolve() with ResolveFlags.Type instead.
15371
15372 2002-08-12  Martin Baulig  <martin@gnome.org>
15373
15374         * interface.cs (Interface.Define): Apply attributes.
15375
15376         * attribute.cs (Attribute.ApplyAttributes): Added support for
15377         interface attributes.
15378
15379 2002-08-11  Martin Baulig  <martin@gnome.org>
15380
15381         * statement.cs (Block.Emit): Only check the "this" variable if we
15382         do not always throw an exception.
15383
15384         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15385         whether the property has a set accessor.
15386
15387 2002-08-11  Martin Baulig  <martin@gnome.org>
15388
15389         Added control flow analysis support for structs.
15390
15391         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15392         with control flow analysis turned off.
15393         (IVariable): New interface.
15394         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15395         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15396         (FieldExpr.DoResolve): Resolve the instance expression with flow
15397         analysis turned off and do the definite assignment check after the
15398         resolving when we know what the expression will resolve to.
15399
15400         * expression.cs (LocalVariableReference, ParameterReference):
15401         Implement the new IVariable interface, only call the flow analysis
15402         code if ec.DoFlowAnalysis is true.
15403         (This): Added constructor which takes a Block argument.  Implement
15404         the new IVariable interface.
15405         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15406         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15407         This does the definite assignment checks for struct members.
15408
15409         * class.cs (Constructor.Emit): If this is a non-static `struct'
15410         constructor which doesn't have any initializer, call
15411         Block.AddThisVariable() to tell the flow analysis code that all
15412         struct elements must be initialized before control returns from
15413         the constructor.
15414
15415         * statement.cs (MyStructInfo): New public class.
15416         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15417         argument to this indexer.  If non-zero, check an individual struct
15418         member, not the whole struct.
15419         (FlowBranching.CheckOutParameters): Check struct members.
15420         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15421         overloaded versions of these methods which take an additional
15422         `int field_idx' argument to check struct members.
15423         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15424         overloaded versions of these methods which take an additional
15425         `string field_name' argument to check struct member.s
15426         (VariableInfo): Implement the IVariable interface.
15427         (VariableInfo.StructInfo): New public property.  Returns the
15428         MyStructInfo instance of the variable if it's a struct or null.
15429         (Block.AddThisVariable): New public method.  This is called from
15430         Constructor.Emit() for non-static `struct' constructor which do
15431         not have any initializer.  It creates a special variable for the
15432         "this" instance variable which will be checked by the flow
15433         analysis code to ensure that all of the struct's fields are
15434         initialized before control returns from the constructor.
15435         (UsageVector): Added support for struct members.  If a
15436         variable/parameter is a struct with N members, we reserve a slot
15437         in the usage vector for each member.  A struct is considered fully
15438         initialized if either the struct itself (slot 0) or all its
15439         members are initialized.
15440
15441 2002-08-08  Martin Baulig  <martin@gnome.org>
15442
15443         * driver.cs (Driver.MainDriver): Only report an error CS5001
15444         if there were no compilation errors.
15445
15446         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15447         `UnsafeContext' property to determine whether the parent is in
15448         unsafe context rather than checking the parent's ModFlags:
15449         classes nested in an unsafe class are unsafe as well.
15450
15451 2002-08-08  Martin Baulig  <martin@gnome.org>
15452
15453         * statement.cs (UsageVector.MergeChildren): Distinguish between
15454         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15455         we return.  Added test17() and test18() to test-154.cs.
15456
15457 2002-08-08  Martin Baulig  <martin@gnome.org>
15458
15459         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15460         Family access, make sure the invoking type isn't a subclass of the
15461         queried type (that'd be a CS1540).
15462
15463         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15464         this method which takes an additional `Type invocation_type'.
15465
15466         * expression.cs (BaseAccess.DoResolve): Use the base type as
15467         invocation and query type.
15468         (MemberAccess.DoResolve): If the lookup failed and we're about to
15469         report a CS0122, try a lookup with the ec.ContainerType - if this
15470         succeeds, we must report a CS1540.
15471
15472 2002-08-08  Martin Baulig  <martin@gnome.org>
15473
15474         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15475         (MethodGroupExpr): Implement the IMemberExpr interface.
15476
15477         * expression (MemberAccess.ResolveMemberAccess): No need to have
15478         any special code for MethodGroupExprs anymore, they're now
15479         IMemberExprs.   
15480
15481 2002-08-08  Martin Baulig  <martin@gnome.org>
15482
15483         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15484         Family, FamANDAssem and FamORAssem permissions.
15485         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15486
15487 2002-08-08  Martin Baulig  <martin@gnome.org>
15488
15489         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15490         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15491         or loop block.
15492
15493 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15494
15495         * driver.cs: implemented /resource option to embed managed resources.
15496
15497 2002-08-07  Martin Baulig  <martin@gnome.org>
15498
15499         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15500         (FieldBase.HasFieldInitializer): New public property.
15501         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15502         returns the field initializer and makes sure it is only resolved once.
15503         (TypeContainer.EmitFieldInitializers): Call
15504         FieldBase.GetInitializerExpression to get the initializer, this ensures
15505         that it isn't resolved multiple times.
15506
15507         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15508         the resolving process (SimpleName/MemberLookup) that we're currently
15509         emitting a field initializer (which must not access any instance members,
15510         this is an error CS0236).
15511
15512         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15513         argument, if the `IsFieldInitializer' flag is set, we must report and
15514         error CS0236 and not an error CS0120.   
15515
15516 2002-08-07  Martin Baulig  <martin@gnome.org>
15517
15518         * ecore.cs (IMemberExpr): New public interface.
15519         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15520         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15521         if the expression is an IMemberExpr.
15522
15523         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15524         to be null, implicitly default to `this' if we're non-static in
15525         this case.  Simplified the code a lot by using the new IMemberExpr
15526         interface.  Also fixed bug #28176 here.
15527
15528 2002-08-06  Martin Baulig  <martin@gnome.org>
15529
15530         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15531         ParameterReferences during semantic analysis so that we can do a
15532         type-only search when resolving Cast, TypeOf and SizeOf.
15533         (block): Pass the `current_local_parameters' to the Block's
15534         constructor.
15535
15536         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15537         argument to the constructor.
15538         (ConstructorInitializer.Resolve): Create a temporary implicit
15539         block with the parameters.
15540
15541         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15542         references here if we aren't doing a type-only search.
15543
15544         * statement.cs (Block): Added constructor which takes a
15545         `Parameters parameters' argument.
15546         (Block.Parameters): New public property.
15547
15548         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15549         to `Parameters' and made it public readonly.
15550
15551 2002-08-06  Martin Baulig  <martin@gnome.org>
15552
15553         * ecore.cs (Expression.Warning): Made this public as well.
15554
15555         * report.cs (Report.Debug): Print the contents of collections.
15556
15557 2002-08-06  Martin Baulig  <martin@gnome.org>
15558
15559         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15560         used to tell Resolve() which kinds of expressions it may return.
15561         (Expression.Resolve): Added overloaded version of this method which
15562         takes a `ResolveFlags flags' argument.  This can be used to tell
15563         Resolve() which kinds of expressions it may return.  Reports a
15564         CS0118 on error.
15565         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15566         ResolveFlags.SimpleName.
15567         (Expression.Error118): Added overloaded version of this method which
15568         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15569         which kinds of expressions are allowed.
15570
15571         * expression.cs (Argument.ResolveMethodGroup): New public method.
15572         Resolves an argument, but allows a MethodGroup to be returned.
15573         This is used when invoking a delegate.
15574
15575         * TODO: Updated a bit.
15576
15577 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15578
15579         Fixed compilation with csc.
15580
15581         * ecore.cs: Expression.Error made public. Is this correct? Should
15582         Warning be made public too?
15583
15584         * expression.cs: use ea.Location instead of ea.loc.
15585         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15586
15587 2002-08-06  Martin Baulig  <martin@gnome.org>
15588
15589         * ecore.cs (Expression.loc): Moved the location here instead of
15590         duplicating it in all derived classes.
15591         (Expression.Location): New public property.
15592         (Expression.Error, Expression.Warning): Made them non-static and
15593         removed the location argument.
15594         (Expression.Warning): Added overloaded version which takes an
15595         `int level' argument.
15596         (Expression.Error118): Make this non-static and removed the
15597         expression and location arguments.
15598         (TypeExpr): Added location argument to the constructor.
15599
15600         * expression.cs (StaticCallExpr): Added location argument to
15601         the constructor.
15602         (Indirection, PointerArithmetic): Likewise.
15603         (CheckedExpr, UnCheckedExpr): Likewise.
15604         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15605         (StringPtr): Likewise.
15606
15607
15608 2002-08-05  Martin Baulig  <martin@gnome.org>
15609
15610         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15611
15612         * assign.cs (Assign.DoResolve): Check whether the source
15613         expression is a value or variable.
15614
15615         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15616         while resolving the corresponding blocks.
15617
15618         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15619         an error, don't silently return null.
15620
15621         * statement.cs (Block.AddVariable): Do the error reporting here
15622         and distinguish between CS0128 and CS0136.
15623         (Block.DoResolve): Report all unused labels (warning CS0164).
15624         (LabeledStatement): Pass the location to the constructor.
15625         (LabeledStatement.HasBeenReferenced): New property.
15626         (LabeledStatement.Resolve): Set it to true here.
15627
15628         * statement.cs (Return.Emit): Return success even after reporting
15629         a type mismatch error (CS0126 or CS0127), this is what csc does and
15630         it avoids confusing the users with any consecutive errors.
15631
15632 2002-08-05  Martin Baulig  <martin@gnome.org>
15633
15634         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15635
15636         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15637
15638         * expression.cs (MemberAccess.DoResolve): Silently return if an
15639         error has already been reported.
15640
15641         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15642         error has already been reported.
15643
15644 2002-08-05  Martin Baulig  <martin@gnome.org>
15645
15646         * statement.cs (UsageVector): Only initialize the `parameters'
15647         vector if we actually have any "out" parameters.
15648
15649 2002-08-05  Martin Baulig  <martin@gnome.org>
15650
15651         * expression.cs (Binary.ResolveOperator): When combining delegates,
15652         they must have the same type.
15653
15654 2002-08-05  Martin Baulig  <martin@gnome.org>
15655
15656         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15657         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15658         work with the ms runtime and we also don't need it: if we're a
15659         PropertyBuilder and not in the `indexer_arguments' hash, then we
15660         are a property and not an indexer.
15661
15662         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15663         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15664         since the latter one doesn't work with the ms runtime.
15665
15666 2002-08-03  Martin Baulig  <martin@gnome.org>
15667
15668         Fixed bugs #27998 and #22735.
15669
15670         * class.cs (Method.IsOperator): New public field.
15671         (Method.CheckBase): Report CS0111 if there's already a method
15672         with the same parameters in the current class.  Report CS0508 when
15673         attempting to change the return type of an inherited method.
15674         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15675         and it's not marked abstract or extern.
15676         (PropertyBase): New abstract base class for Property and Indexer.
15677         (PropertyBase.CheckBase): Moved here from Property and made it work
15678         for indexers.
15679         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15680         the same so we can reuse it there.
15681         (Property, Indexer): Derive from PropertyBase.
15682         (MethodSignature.inheritable_property_signature_filter): New delegate
15683         to find properties and indexers.
15684
15685         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15686         argument and improved error reporting.
15687
15688         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15689         EmptyReadOnlyParameters and made it a property.
15690
15691         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15692         version of this method which takes a `PropertyInfo indexer'.
15693         (TypeManager.RegisterIndexer): New method.
15694
15695         * class.cs: Added myself as author of this file :-)
15696
15697 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15698
15699         * class.cs: fixed compilation on windoze.
15700
15701 2002-08-03  Martin Baulig  <martin@gnome.org>
15702
15703         * interface.cs (Interface.GetInterfaceBases): Check whether all
15704         base interfaces are at least as accessible than the current one.
15705
15706         * class.cs (TypeContainer.GetClassBases): Check whether base types
15707         are at least as accessible than the current type.
15708         (TypeContainer.AsAccessible): Implemented and made non-static.
15709         (MemberBase.CheckParameters): Report errors if the accessibility
15710         checks fail.
15711
15712         * delegate.cs (Delegate.Delegate): The default visibility is
15713         internal for top-level types and private for nested types.
15714         (Delegate.Define): Report errors if the accessibility checks fail.
15715
15716         * enum.cs (Enum.Enum): The default visibility is internal for
15717         top-level types and private for nested types.
15718         (Enum.DefineType): Compute the correct visibility.
15719
15720         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15721         function which takes a `bool is_toplevel' instead of a TypeContainer.
15722
15723         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15724         builtin type.
15725
15726 2002-08-02  Martin Baulig  <martin@gnome.org>
15727
15728         * expression.cs (LocalVariableReferenc): Added constructor which
15729         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15730         (LocalVariableReference.IsReadOnly): New property.
15731         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15732         variable is readonly, use our own readonly flag to do this; you can
15733         use the new constructor to get a writable reference to a read-only
15734         variable.
15735
15736         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15737         reference to the local variable.
15738
15739 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15740
15741         * rootcontext.cs (ResolveCore): Also include System.Exception
15742
15743         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15744         we reach an EmptyStatement.
15745
15746         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15747         is also fine.
15748
15749         * expression.cs (Binary.ResolveOperator): Check error result in
15750         two places.
15751
15752         use brtrue/brfalse directly and avoid compares to null.
15753
15754 2002-08-02  Martin Baulig  <martin@gnome.org>
15755
15756         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15757         Fixes bug #28407, added test-155.cs.
15758
15759 2002-08-01  Martin Baulig  <martin@gnome.org>
15760
15761         * class.cs (Event.EmitDefaultMethod): Make this work with static
15762         events.  Fixes #28311, added verify-3.cs.
15763
15764 2002-08-01  Martin Baulig  <martin@gnome.org>
15765
15766         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15767         `is_disposable' fields.
15768         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15769         `hm.is_disposable' if we're using the collection pattern.
15770         (Foreach.EmitCollectionForeach): Use the correct type for the
15771         enumerator's local variable, only emit the try/finally block if
15772         necessary (fixes #27713).
15773
15774 2002-08-01  Martin Baulig  <martin@gnome.org>
15775
15776         * ecore.cs (Expression.report118): Renamed to Error118 and made
15777         it public static.
15778
15779         * statement.cs (Throw.Resolve): Check whether the expression is of
15780         the correct type (CS0118) and whether the type derives from
15781         System.Exception (CS0155).
15782         (Catch.Resolve): New method.  Do the type lookup here and check
15783         whether it derives from System.Exception (CS0155).
15784         (Catch.CatchType, Catch.IsGeneral): New public properties.
15785
15786         * typemanager.cs (TypeManager.exception_type): Added.
15787
15788 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15789
15790         * driver.cs: Updated About function.
15791
15792 2002-07-31  Martin Baulig  <martin@gnome.org>
15793
15794         Implemented Control Flow Analysis.
15795
15796         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15797         (EmitContext.CurrentBranching): Added.
15798         (EmitContext.StartFlowBranching): Added.
15799         (EmitContext.EndFlowBranching): Added.
15800         (EmitContext.KillFlowBranching): Added.
15801         (EmitContext.IsVariableAssigned): Added.
15802         (EmitContext.SetVariableAssigned): Added.
15803         (EmitContext.IsParameterAssigned): Added.
15804         (EmitContext.SetParameterAssigned): Added.
15805         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15806         Added control flow analysis stuff here.
15807
15808         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15809         resolve the expression as lvalue.
15810         (LocalVariableReference.DoResolve): Check whether the variable has
15811         already been assigned.
15812         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15813         the parameter as assigned here.
15814         (ParameterReference.DoResolve): Check whether the parameter has already
15815         been assigned.
15816         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15817         expression as lvalue.
15818
15819         * statement.cs (FlowBranching): New class for the flow analysis code.
15820         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15821         (LabeledStatement.IsDefined): New public property.
15822         (LabeledStatement.AddUsageVector): New public method to tell flow
15823         analyis that the label may be reached via a forward jump.
15824         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15825         flow analysis.
15826         (VariableInfo.Number): New public field.  This is used by flow analysis
15827         to number all locals of a block.
15828         (Block.CountVariables): New public property.  This is the number of
15829         local variables in this block (including the locals from all parent
15830         blocks).
15831         (Block.EmitMeta): Number all the variables.
15832
15833         * statement.cs: Added flow analysis support to all classes.
15834
15835 2002-07-31  Martin Baulig  <martin@gnome.org>
15836
15837         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15838         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15839         then use this argument.
15840
15841         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15842
15843         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15844         use this to specify /define options.
15845
15846 2002-07-29  Martin Baulig  <martin@gnome.org>
15847
15848         * statement.cs (Fixed): Moved all code that does variable lookups
15849         and resolvings from Emit to Resolve.
15850
15851         * statement.cs (For): Moved all code that does variable lookups
15852         and resolvings from Emit to Resolve.
15853
15854         * statement.cs (Using): Moved all code that does variable lookups
15855         and resolvings from Emit to Resolve.
15856
15857 2002-07-29  Martin Baulig  <martin@gnome.org>
15858
15859         * attribute.cs (Attribute.Resolve): Explicitly catch a
15860         System.NullReferenceException when creating the
15861         CustromAttributeBuilder and report a different warning message.
15862
15863 2002-07-29  Martin Baulig  <martin@gnome.org>
15864
15865         * support.cs (ParameterData.ParameterName): Added method to
15866         get the name of a parameter.
15867
15868         * typemanager.cs (TypeManager.IsValueType): New public method.
15869
15870 2002-07-29  Martin Baulig  <martin@gnome.org>
15871
15872         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15873         is a flag which specifies that it's either ref or out.
15874         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15875         the out parameter to `out Parameter.Modifier mod', also set the
15876         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15877
15878         * support.cs (InternalParameters.ParameterModifier): Distinguish
15879         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15880         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15881
15882         * expression.cs (Argument.GetParameterModifier): Distinguish
15883         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15884         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15885
15886 2002-07-29  Martin Baulig  <martin@gnome.org>
15887
15888         * expression.cs (ParameterReference.ParameterReference): Added
15889         `Location loc' argument to the constructor.
15890
15891         * cs-parser.jay: Pass location to ParameterReference.
15892
15893 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * statement.cs (Try): Initialize the location.
15896
15897         * cs-parser.jay: pass location to Try.
15898
15899         * expression.cs (Unary.Reduce): Change the prototype to return
15900         whether a constant fold could be performed or not.  The result is
15901         returned in an out parameters.  In the case of Indirection and
15902         AddressOf, we want to perform the full tests.
15903
15904 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15905
15906         * statement.cs (Statement.Emit): Flag dead code.
15907
15908 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15909
15910         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15911
15912 2002-07-27  Martin Baulig  <martin@gnome.org>
15913
15914         * class.cs (MethodData.Define): Put back call to
15915         TypeManager.AddMethod(), accidentally commented this out.
15916
15917         * report.cs (Debug): New public method to print debugging information,
15918         this is `[Conditional ("DEBUG")]'.
15919
15920 2002-07-26  Martin Baulig  <martin@gnome.org>
15921
15922         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15923         (switch_statement): Push the current_block to the switch_stack and
15924         pop it again when we're done with the switch.
15925         (switch_section): The new block is a child of the current_block.
15926         Fixes bug #24007, added test-152.cs.
15927
15928 2002-07-27  Martin Baulig  <martin@gnome.org>
15929
15930         * expression.cs (Invocation.EmitArguments): When calling a varargs
15931         function with only its fixed arguments, we need to pass an empty
15932         array.
15933
15934 2002-07-27  Martin Baulig  <martin@gnome.org>
15935
15936         Mono 0.13 has been released.
15937
15938 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15939
15940         * driver.cs: Rename --resource to --linkres, because that is what
15941         we do currently, we dont support --resource yet.
15942
15943         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15944
15945 2002-07-25  Martin Baulig  <martin@gnome.org>
15946
15947         * class.cs (MethodData): New public class.  This is a `method builder'
15948         class for a method or one accessor of a Property/Indexer/Event.
15949         (MethodData.GetMethodFlags): Moved here from MemberBase.
15950         (MethodData.ApplyAttributes): Likewise.
15951         (MethodData.ApplyObsoleteAttribute): Likewise.
15952         (MethodData.ApplyConditionalAttribute): Likewise.
15953         (MethodData.ApplyDllImportAttribute): Likewise.
15954         (MethodData.CheckAbstractAndExternal): Likewise.
15955         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15956         (MethodData.Emit): Formerly known as Method.Emit().
15957         (MemberBase): Moved everything which was specific to a single
15958         accessor/method to MethodData.
15959         (Method): Create a new MethodData and call Define() and Emit() on it.
15960         (Property, Indexer, Event): Create a new MethodData objects for each
15961         accessor and call Define() and Emit() on them.
15962
15963 2002-07-25  Martin Baulig  <martin@gnome.org>
15964
15965         Made MethodCore derive from MemberBase to reuse the code from there.
15966         MemberBase now also checks for attributes.
15967
15968         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15969         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15970         as virtual.
15971         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15972         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15973         (MemberBase.ApplyAttributes): New virtual method; applies the
15974         attributes to a method or accessor.
15975         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15976         (MemberBase.ApplyConditionalAttribute): Likewise.
15977         (MemberBase.ApplyDllImportAttribute): Likewise.
15978         (MemberBase.CheckAbstractAndExternal): Likewise.
15979         (MethodCore.ParameterTypes): This is now a property instead of a
15980         method, it's initialized from DoDefineParameters().
15981         (MethodCore.ParameterInfo): Removed the set accessor.
15982         (MethodCore.DoDefineParameters): New protected virtual method to
15983         initialize ParameterTypes and ParameterInfo.
15984         (Method.GetReturnType): We can now simply return the MemberType.
15985         (Method.GetMethodFlags): Override the MemberBase version and add
15986         the conditional flags.
15987         (Method.CheckBase): Moved some code from Define() here, call
15988         DoDefineParameters() here.
15989         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15990         here to avoid some larger code duplication.
15991         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15992         ensure that abstract and external accessors don't declare a body.
15993
15994         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15995         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15996         lookup in the attribute's parent classes, so we need to abort as soon
15997         as we found the first match.
15998         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15999         the attribute has no arguments.
16000
16001         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16002         of a Method.
16003
16004 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16005
16006         * cs-parser.jay: reverted previous patch.
16007
16008 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16009
16010         * cs-parser.jay: fixed bug #22119.
16011
16012 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16013
16014         * attribute.cs: fixed compilation. The error was:
16015         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16016         be assigned to before control leaves the current method."
16017         [FIXME:  Filed as bug #28186: MCS must report this error.]
16018
16019 2002-07-25  Martin Baulig  <martin@gnome.org>
16020
16021         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16022         method to pull the condition name ouf of a Conditional attribute.
16023         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16024         the obsolete message and error flag out of an Obsolete attribute.
16025
16026         * class.cs (Method.GetMethodFlags): New public method to get the
16027         TypeManager.MethodFlags for this method.
16028         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16029         private methods.
16030         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16031         if we're overriding a virtual function, set the new private variable
16032         `parent_method'; call the new TypeManager.AddMethod().
16033
16034         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16035         the MethodBuilder and the Method in a PtrHashtable.
16036         (TypeManager.builder_to_method): Added for this purpose.
16037         (TypeManager.MethodFlags): Added IsObsoleteError.
16038         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16039         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16040         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16041         the message from the attribute.
16042
16043 2002-07-24  Martin Baulig  <martin@gnome.org>
16044
16045         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16046         preprocessor directives, ensure that the argument to #define/#undef is
16047         exactly one identifier and that it's actually an identifier.
16048
16049         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16050         did not work ....
16051
16052 2002-07-24  Martin Baulig  <martin@gnome.org>
16053
16054         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16055         initialize it to TypeManager.object_type in the constructor.
16056         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16057         of the `hm.get_current' method if we're using the collection pattern.
16058         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16059         for the explicit conversion to make it work when we're using the collection
16060         pattern and the `Current' property has a different return type than `object'.
16061         Fixes #27713.
16062
16063 2002-07-24  Martin Baulig  <martin@gnome.org>
16064
16065         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16066         does not match, but don't report any errors.  This method is called in
16067         order for all methods in a MethodGroupExpr until a matching method is
16068         found, so we don't want to bail out if the first method doesn't match.
16069         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16070         matches, report the 123.  Fixes #28070.
16071
16072 2002-07-24  Martin Baulig  <martin@gnome.org>
16073
16074         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16075         TypeManager.TypeToCoreType() to the top of the method so the
16076         following equality checks will work.  Fixes #28107.
16077
16078 2002-07-24  Martin Baulig  <martin@gnome.org>
16079
16080         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16081         operand is of type uint, and the other operand is of type sbyte,
16082         short or int, the operands are converted to type long." -
16083         Actually do what this comment already told us.  Fixes bug #28106,
16084         added test-150.cs.
16085
16086 2002-07-24  Martin Baulig  <martin@gnome.org>
16087
16088         * class.cs (MethodBase): New abstract class.  This is now a base
16089         class for Property, Indexer and Event to avoid some code duplication
16090         in their Define() and DefineMethods() methods.
16091         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16092         generic methods for Define() and DefineMethods().
16093         (FieldBase): Derive from MemberBase, not MemberCore.
16094         (Property): Derive from MemberBase, not MemberCore.
16095         (Property.DefineMethod): Moved all the code from this method to the
16096         new MethodBase.DefineAccessor(), just call it with appropriate
16097         argumetnts.
16098         (Property.Define): Call the new Property.DoDefine(), this does some
16099         sanity checks and we don't need to duplicate the code everywhere.
16100         (Event): Derive from MemberBase, not MemberCore.
16101         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16102         accessors, this will also make them work with interface events.
16103         (Indexer): Derive from MemberBase, not MemberCore.
16104         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16105         (Indexer.Define): Use the new MethodBase functions.
16106
16107         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16108         argument to the constructor.
16109         (Interface.FindMembers): Added support for interface events.
16110         (Interface.PopluateEvent): Implemented.
16111
16112         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16113
16114 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16117         but this is required to check for a method name being the same as
16118         the containing class.  
16119
16120         Handle this now.
16121
16122 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16123
16124         * interface.cs: initialize variable.
16125
16126 2002-07-23  Martin Baulig  <martin@gnome.org>
16127
16128         Implemented the IndexerName attribute in interfaces.
16129
16130         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16131         name if this is an explicit interface implementation.
16132         (Indexer.InterfaceIndexerName): New public variable.  If we're
16133         implementing an interface indexer, this is the IndexerName in that
16134         interface.  Otherwise, it's the IndexerName.
16135         (Indexer.DefineMethod): If we're implementing interface indexer,
16136         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16137         and Pending.ImplementIndexer methods.
16138         (Indexer.Define): Also define the PropertyBuilder if we're
16139         implementing an interface indexer and this is neither an explicit
16140         interface implementation nor do the IndexerName match the one in
16141         the interface.
16142
16143         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16144         If a method is defined here, then we always need to create a proxy
16145         for it.  This is used when implementing interface indexers.
16146         (Pending.IsInterfaceIndexer): New public method.
16147         (Pending.ImplementIndexer): New public method.
16148         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16149         This is used when implementing interface indexers to define a proxy
16150         if necessary.
16151         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16152         define a proxy if necessary.
16153
16154         * interface.cs (Interface.IndexerName): New public variable.
16155         (Interface.PopulateIndexer): Set the IndexerName.
16156         (Interface.DefineIndexers): New private method.  Populate all the
16157         indexers and make sure their IndexerNames match.
16158
16159         * typemanager.cs (IndexerPropertyName): Added support for interface
16160         indexers.
16161
16162 2002-07-22  Martin Baulig  <martin@gnome.org>
16163
16164         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16165         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16166         ret if HasReturnLabel.
16167         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16168         variables.
16169
16170         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16171         and set the ec.LoopBeginTryCatchLevel.
16172         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16173         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16174         the current ec.TryCatchLevel, the branch goes out of an exception
16175         block.  In this case, we need to use Leave and not Br.
16176
16177 2002-07-22  Martin Baulig  <martin@gnome.org>
16178
16179         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16180         block unless the block does not always return or it is contained in
16181         another try { ... } catch { ... } block.  Fixes bug #26506.
16182         Added verify-1.cs to the test suite.
16183
16184 2002-07-22  Martin Baulig  <martin@gnome.org>
16185
16186         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16187         then we do not always return.  Fixes bug #24985.
16188
16189 2002-07-22  Martin Baulig  <martin@gnome.org>
16190
16191         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16192         lookup on a per-class level; ie. walk up the class hierarchy until we
16193         found at least one applicable method, then choose the best among them.
16194         Fixes bug #24463 and test-29.cs.
16195
16196 2002-07-22  Martin Baulig  <martin@gnome.org>
16197
16198         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16199         return types of the methods.  The return type is not part of the
16200         signature and we must not check it to make the `new' modifier work.
16201         Fixes bug #27999, also added test-147.cs.
16202         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16203
16204         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16205         on the method's return type.
16206
16207 2002-07-21  Martin Baulig  <martin@gnome.org>
16208
16209         * assign.cs: Make this work if the rightmost source is a constant and
16210         we need to do an implicit type conversion.  Also adding a few more tests
16211         to test-38.cs which should have caught this.
16212
16213         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16214         target in the makefile for this.  The makefile.gnu is primarily intended
16215         for end-users who don't want to debug the compiler.
16216
16217 2002-07-21  Martin Baulig  <martin@gnome.org>
16218
16219         * assign.cs: Improved the Assign class so it can now handle embedded
16220         assignments (X = Y = Z = something).  As a side-effect this'll now also
16221         consume less local variables.  test-38.cs now passes with MCS, added
16222         a few new test cases to that test.
16223
16224 2002-07-20  Martin Baulig  <martin@gnome.org>
16225
16226         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16227         instructions.  Fixes bug #27977, also added test-146.cs.
16228
16229 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16230
16231         * cs-tokenizer.cs: fixed getHex ().
16232
16233 2002-07-19  Martin Baulig  <martin@gnome.org>
16234
16235         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16236         not Type.GetType() to lookup the array type.  This is needed when
16237         we're constructing an array of a user-defined type.
16238         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16239         single-dimensional arrays, but also for single-dimensial arrays of
16240         type decimal.
16241
16242 2002-07-19  Martin Baulig  <martin@gnome.org>
16243
16244         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16245         this function is called, it's not allowed to share LocalBuilders
16246         among ILGenerators.
16247
16248 2002-07-19  Martin Baulig  <martin@gnome.org>
16249
16250         * expression.cs (Argument.Resolve): Report an error 118 when trying
16251         to pass a type as argument.
16252
16253 2002-07-18  Martin Baulig  <martin@gnome.org>
16254
16255         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16256         Conv_R_Un for the signed `long' type.
16257
16258 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16259
16260         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16261         `expr' for the temporary result, as that will fail if we do
16262         multiple resolves on the same expression.
16263
16264 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16265
16266         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16267         ec.TypeContainer for looking up aliases. 
16268
16269         * class.cs (TypeContainer): Remove LookupAlias from here.
16270
16271         * decl.cs (DeclSpace); Move here.
16272
16273 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16274
16275         * class.cs (FindMembers): Only call filter if the constructor
16276         bulider is not null.
16277
16278         Also handle delegates in `NestedTypes' now.  Now we will perform
16279         type lookups using the standard resolution process.  This also
16280         fixes a bug.
16281
16282         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16283         This uses Expressions (the limited kind that can be parsed by the
16284         tree) instead of strings.
16285
16286         * expression.cs (ComposedCast.ToString): Implement, used to flag
16287         errors since now we have to render expressions.
16288
16289         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16290         FormArrayType. 
16291
16292         * ecore.cs (SimpleName.ToString): ditto.
16293
16294         * cs-parser.jay: Instead of using strings to assemble types, use
16295         Expressions to assemble the type (using SimpleName, ComposedCast,
16296         MemberAccess).  This should fix the type lookups in declarations,
16297         because we were using a different code path for this.
16298
16299         * statement.cs (Block.Resolve): Continue processing statements
16300         even when there is an error.
16301
16302 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16303
16304         * class.cs (Event.Define): Also remove the `remove' method from
16305         the list of pending items.
16306
16307         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16308         generate more compact code. 
16309
16310 2002-07-17  Martin Baulig  <martin@gnome.org>
16311
16312         * const.cs (Const.LookupConstantValue): Add support for constant
16313         `unchecked' and `checked' expressions.
16314         Also adding test case test-140.cs for this.
16315
16316 2002-07-17  Martin Baulig  <martin@gnome.org>
16317
16318         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16319         check whether mi.ReturnType implements the IEnumerator interface; the
16320         `==' and the IsAssignableFrom() will fail in this situation.
16321
16322 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16323
16324         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16325         here too.
16326
16327 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16328
16329         * expression.cs: fixed bug #27811.
16330
16331 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16332
16333         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16334         Molaro: when we are a ref, the value already contains a pointer
16335         value, do not take the address of it.
16336
16337 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16338         * removed mb-parser.jay and mb-tokenizer.cs
16339
16340 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16341
16342         * expression.cs: check against the building corlib void type.
16343
16344 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16345
16346         * ecore.cs: fix for valuetype static readonly fields: when 
16347         initializing them, we need their address, not the address of a copy.
16348
16349 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16350
16351         * typemanager.cs: register also enum_type in corlib.
16352
16353 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16354
16355         * class.cs: allow calling this (but not base) initializers in structs.
16356
16357 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16358
16359         * ecore.cs: make sure we compare against the building base types
16360         in GetTypeSize ().
16361
16362 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16363
16364         * typemanager.cs: fix TypeToCoreType() to handle void and object
16365         (corlib gets no more typerefs after this change).
16366
16367 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * expression.cs (ArrayCreation.EmitArrayArguments): use
16370         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16371
16372         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16373         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16374         array indexes, the runtime actually forbids them.
16375
16376         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16377         for array arguments here.
16378
16379         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16380         instead of the default for ValueTypes.
16381
16382         (New.DoEmit): Use IsValueType instead of
16383         IsSubclassOf (value_type)
16384         (New.DoResolve): ditto.
16385         (Invocation.EmitCall): ditto.
16386
16387         * assign.cs (Assign): ditto.
16388
16389         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16390         Statements *are* currently doing part of their resolution during
16391         Emit.  
16392
16393         Expressions do always resolve during resolve, but statements are
16394         only required to propagate resolution to their children.
16395
16396 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16397
16398         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16399
16400         (LoadAssembly): Do not add the dll if it is already specified
16401
16402         (MainDriver): Add the System directory to the link path at the end,
16403         after all the other -L arguments. 
16404
16405         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16406         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16407         ldelem.u1) and using the opposite for sbytes.
16408
16409         This fixes Digger, and we can finally run it.
16410
16411         * driver.cs (UnixParseOption): Move the option parsing here.  
16412         (CSCParseOption): Implement CSC-like parsing of options.
16413
16414         We now support both modes of operation, the old Unix way, and the
16415         new CSC-like way.  This should help those who wanted to make cross
16416         platform makefiles.
16417
16418         The only thing broken is that /r:, /reference: and /lib: are not
16419         implemented, because I want to make those have the same semantics
16420         as the CSC compiler has, and kill once and for all the confussion
16421         around this.   Will be doing this tomorrow.
16422
16423         * statement.cs (Unsafe.Resolve): The state is checked during
16424         resolve, not emit, so we have to set the flags for IsUnsfe here.
16425
16426 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16429         not catch the Error_ObjectRefRequired in SimpleName (as it is
16430         possible to have a class/instance variable name that later gets
16431         deambiguated), we have to check this here.      
16432
16433 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16434
16435         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16436         make static and put into Expression.
16437
16438         (Event.Define): Register the private field of the event with the 
16439         TypeManager so that GetFieldFromEvent can get at it.
16440
16441         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16442         keep track of the private field associated with an event which
16443         has no accessors.
16444
16445         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16446         private field.
16447
16448         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16449
16450 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16451
16452         * expression.cs (Binary.EmitBranchable): this routine emits the
16453         Binary expression in a branchable context.  This basically means:
16454         we need to branch somewhere, not just get the value on the stack.
16455
16456         This works together with Statement.EmitBoolExpression.
16457
16458         * statement.cs (Statement.EmitBoolExpression): Use
16459         EmitBranchable. 
16460
16461 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16462
16463         * statement.cs (For): Reduce the number of jumps in loops.
16464
16465         (For): Implement loop inversion for the For statement.
16466
16467         (Break): We can be breaking out of a Try/Catch controlled section
16468         (foreach might have an implicit try/catch clause), so we need to
16469         use Leave instead of Br.
16470
16471         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16472         now).  If the instace expression supports IMemoryLocation, we use
16473         the AddressOf method from the IMemoryLocation to extract the
16474         address instead of emitting the instance.
16475
16476         This showed up with `This', as we were emitting the instance
16477         always (Emit) instead of the Address of This.  Particularly
16478         interesting when This is a value type, as we dont want the Emit
16479         effect (which was to load the object).
16480
16481 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16482
16483         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16484
16485         * statement.cs (Checked): Set the CheckedState during the resolve
16486         process too, as the ConvCast operations track the checked state on
16487         the resolve process, and not emit.
16488
16489         * cs-parser.jay (namespace_member_declaration): Flag that we have
16490         found a declaration when we do.  This is used to flag error 1529
16491
16492         * driver.cs: Report ok when we display the help only.
16493
16494 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16495
16496         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16497
16498 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16499
16500         * cs-tokenizer.cs (define): We also have to track locally the
16501         defines.  AllDefines is just used for the Conditional Attribute,
16502         but we also need the local defines for the current source code. 
16503
16504 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16505
16506         * statement.cs (While, For, Do): These loops can exit through a
16507         Break statement, use this information to tell whether the
16508         statement is the last piece of code.
16509
16510         (Break): Flag that we break.
16511
16512         * codegen.cs (EmitContexts): New `Breaks' state variable.
16513
16514 2002-07-03  Martin Baulig  <martin@gnome.org>
16515
16516         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16517         modifiers in method declarations in structs.  Otherwise, you won't
16518         be able to override things like Object.Equals().
16519
16520 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16521
16522         * class.cs (Method, Property, Indexer): Do not allow the public
16523         modifier to be used in explicit interface implementations.
16524
16525         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16526         override modifiers in method declarations in structs
16527
16528 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16529
16530         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16531         integer or real overflow, report an error
16532
16533 2002-07-02  Martin Baulig  <martin@gnome.org>
16534
16535         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16536         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16537         to tell the runtime about our newly created System.Object and
16538         System.ValueType types.
16539
16540 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16543         struct instead of Ldarg/Starg.
16544
16545 2002-07-02  Martin Baulig  <martin@gnome.org>
16546
16547         * expression.cs (Indirection.Indirection): Call
16548         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16549
16550 2002-07-02  Martin Baulig  <martin@gnome.org>
16551
16552         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16553         ValueType, call TypeManager.TypeToCoreType() on it.
16554         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16555         the OpCodes.Newarr argument.
16556
16557 2002-07-02  Martin Baulig  <martin@gnome.org>
16558
16559         * expression.cs (Invocation.EmitCall): When compiling corlib,
16560         replace all calls to the system's System.Array type to calls to
16561         the newly created one.
16562
16563         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16564         System.Array methods.
16565         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16566         from the system's System.Array type which must be replaced.
16567
16568 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16569
16570         * typemanager.cs: load unverifiable_code_ctor so we can build
16571         corlib using the correct type. Avoid using GetTypeCode() with
16572         TypeBuilders.
16573         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16574         TypeManager.object_type to allow building corlib.
16575
16576 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16577
16578         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16579
16580 2002-07-01  Martin Baulig  <martin@gnome.org>
16581
16582         * class.cs: Make the last change actually work, we need to check
16583         whether `ifaces != null' to avoid a crash.
16584
16585 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16586
16587         * class.cs: when we build structs without fields that implement
16588         interfaces, we need to add the interfaces separately, since there is
16589         no API to both set the size and add the interfaces at type creation
16590         time.
16591
16592 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16593
16594         * expression.cs: the dimension arguments to the array constructors
16595         need to be converted if they are a long.
16596
16597 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16598
16599         * class.cs: don't emit ldarg.0 if there is no parent constructor
16600         (fixes showstopper for corlib).
16601
16602 2002-06-29  Martin Baulig  <martin@gnome.org>
16603
16604         MCS now compiles corlib on GNU/Linux :-)
16605
16606         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16607         ie. check for MethodImplOptions.InternalCall.
16608
16609         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16610         and TypeManager.attribute_type are null, so we must explicitly check
16611         whether parent is not null to find out whether it's an attribute type.
16612         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16613         and SetBuilder, not only if the property is neither abstract nor external.
16614         This is necessary to set the MethodImplOptions on the accessor methods.
16615         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16616         SetBuilder, see Property.Emit().
16617
16618         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16619         populate "System.Object", "System.ValueType" and "System.Attribute" since
16620         they've already been populated from BootCorlib_PopulateCoreTypes().
16621
16622 2002-06-29  Martin Baulig  <martin@gnome.org>
16623
16624         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16625         is the NullLiteral, we also need to make sure that target_type is not
16626         an enum type.   
16627
16628 2002-06-29  Martin Baulig  <martin@gnome.org>
16629
16630         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16631         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16632         before calling BootstrapCorlib_ResolveDelegate ().
16633
16634 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16635
16636         * statement.cs: fixed build-breaker. All tests passed ok.
16637
16638 2002-06-27  Martin Baulig  <martin@gnome.org>
16639
16640         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16641         for System.Decimal when compiling corlib.
16642
16643 2002-06-27  Martin Baulig  <martin@gnome.org>
16644
16645         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16646         switch blocks which contain nothing but a default clause.
16647
16648 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16649
16650        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16651
16652 2002-06-27  Martin Baulig  <martin@gnome.org>
16653
16654         * ecore.cs (PropertyExpr.PropertyExpr): Call
16655         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16656
16657         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16658         is already a TypeBuilder.
16659
16660 2002-06-27  Martin Baulig  <martin@gnome.org>
16661
16662         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16663         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16664         the "from an array-type to System.Array" case.  This makes it work
16665         when compiling corlib.
16666
16667 2002-06-27  Martin Baulig  <martin@gnome.org>
16668
16669         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16670         non-static PropertyExpr, set its InstanceExpression.  This makes
16671         the `ICollection.Count' property work in System/Array.cs.
16672
16673 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16674
16675         * driver.cs: Made error handling more consistent.  Errors now
16676         tracked by Report class, so many methods which used to return int
16677         now return void.  Main() now prints success/failure and 
16678         errors/warnings message.
16679
16680         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16681         the magic number return values (123 and 124).  Now, if the
16682         expected error occurs, the compiler exits with success (exit value
16683         0).  If the compilation completes without seeing that particular
16684         error, the compiler exits with failure (exit value 1).  The
16685         makefile in mcs/errors has been changed to handle the new behaviour.
16686
16687         * report.cs: Made 'expected error' number a property and renamed
16688         it from 'Probe' to 'ExpectedError'.
16689
16690         * genericparser.cs: Removed error handling support, since it is
16691         now all done by Report class.
16692
16693         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16694         class, so parse() no longer returns an int.
16695
16696         * namespace.cs: Use Report.Error instead of GenericParser.error
16697
16698 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16701         TypeContainer.AddOperator): At the front of the list put the
16702         explicit implementations, so they get resolved/defined first. 
16703
16704 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16705
16706         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16707         interface type is implemented by this TypeContainer.  Used during
16708         explicit interface implementation.
16709
16710         (Property.Define, Indexer.Define, Method.Define): Validate that
16711         the given interface in the explicit implementation is one of the
16712         base classes for the containing type.
16713
16714         Also if we are explicitly implementing an interface, but there is
16715         no match in the pending implementation table, report an error.
16716
16717         (Property.Define): Only define the property if we are
16718         not explicitly implementing a property from an interface.  Use the
16719         correct name also for those properties (the same CSC uses,
16720         although that is really not needed).
16721
16722         (Property.Emit): Do not emit attributes for explicitly implemented
16723         properties, as there is no TypeBuilder.
16724
16725         (Indexer.Emit): ditto.
16726
16727         Hiding then means that we do not really *implement* a pending
16728         implementation, which makes code fail.
16729
16730 2002-06-22  Martin Baulig  <martin@gnome.org>
16731
16732         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16733         the return value of Object.GetType().  [FIXME: we need to do this whenever
16734         we get a type back from the reflection library].
16735
16736 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16737
16738         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16739
16740 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16741
16742         * attribute.cs: Return null if we can not look up the type.
16743
16744         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16745         the interface types found.
16746
16747         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16748         interface types found.
16749
16750         * typemanager.cs (GetInterfaces): Make this routine returns alll
16751         the interfaces and work around the lame differences between
16752         System.Type and System.Reflection.Emit.TypeBuilder in the results
16753         result for GetInterfaces.
16754
16755         (ExpandInterfaces): Given an array of interface types, expand and
16756         eliminate repeated ocurrences of an interface.  This expands in
16757         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16758         be IA, IB, IC.
16759
16760 2002-06-21  Martin Baulig  <martin@gnome.org>
16761
16762         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16763         on System.Enum.
16764
16765 2002-06-21  Martin Baulig  <martin@gnome.org>
16766
16767         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16768         and called with one of the core types, return the corresponding typebuilder for
16769         that type.
16770
16771         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16772         element type.
16773
16774 2002-06-21  Martin Baulig  <martin@gnome.org>
16775
16776         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16777         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16778         (Expression.ConvertReferenceExplicit): Likewise.
16779
16780         * expression.cs (ElementAccess.DoResolve): Likewise.
16781         (ElementAccess.DoResolveLValue): Likewise.
16782
16783 2002-06-10  Martin Baulig  <martin@gnome.org>
16784
16785         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16786         add the "value" parameter to the parameter list.
16787
16788         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16789         to our caller.
16790
16791 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16792
16793         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16794         the argument to an int, uint, long or ulong, per the spec.  Also
16795         catch negative constants in array creation.
16796
16797 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16798
16799         * class.cs: do not allow the same interface to appear twice in
16800         the definition list.
16801
16802 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16803
16804         * ecore.cs: don't use ldlen with System.Array.
16805
16806 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16807
16808         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16809
16810 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16811
16812         * modifiers.cs: produce correct field attributes for protected
16813         internal. Easy fix so miguel can work on ther harder stuff:-)
16814
16815 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16816
16817         * pending.cs: New file.  Move the code from class.cs here.
16818         Support clearning the pending flag for all methods (when not doing
16819         explicit interface implementation).
16820
16821 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16822
16823         * rootcontext.cs: added a couple more types needed to bootstrap.
16824
16825 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16826
16827         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16828         constructor in the type, instead of any constructor in the type
16829         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16830         a bug in the Mono runtime when applying the params attribute). 
16831
16832 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16833         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16834
16835 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16836
16837         * expression.cs (Unary.ResolveOperator): Use TypeManager
16838         to resolve the type.
16839
16840 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16841
16842         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16843         attached.
16844
16845         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16846         with each member too.
16847
16848         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16849         field builders too - this takes care of the enum member case.
16850
16851 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16852
16853         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16854         address-of operator on both value types and pointers.
16855
16856 2002-06-10  Martin Baulig  <martin@gnome.org>
16857
16858         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16859         PropertyBuilder to the `property_builders' list.
16860
16861         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16862         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16863         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16864         find any indexers which are inherited from an interface.
16865
16866 2002-06-09  Martin Baulig  <martin@gnome.org>
16867
16868         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16869         the same type as the constant if necessary.  There's also a test-130.cs
16870         for this.
16871
16872         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16873
16874         * typemanager.cs (TypeManager.ChangeType): Previously known as
16875         Enum.ChangeEnumType().
16876
16877 2002-06-09  Martin Baulig  <martin@gnome.org>
16878
16879         * expression.cs (Cast.TryReduce): Added support for consts.
16880
16881 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16882
16883         * class.cs (Accessor): Hold attributes information so we can pass
16884         it along.
16885
16886         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16887         Modify to pass in attributes attached to the methods.
16888
16889         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16890
16891         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16892         to handle the Accessor kind :-)
16893
16894         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16895
16896 2002-06-08  Martin Baulig  <martin@gnome.org>
16897
16898         * expression.cs (Unary.TryReduceNegative): Added support for
16899         ULongConstants.
16900
16901 2002-06-08  Martin Baulig  <martin@gnome.org>
16902
16903         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16904         name can't be found in the `defined_names' - the caller will do a
16905         MemberLookup in this case and thus find methods in System.Enum
16906         such as Enum.IsDefined().
16907
16908 2002-06-08  Martin Baulig  <martin@gnome.org>
16909
16910         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16911         Convert.ChangeType() which works with TypeBuilder created types.
16912         (Enum.LookupEnumValue, Enum.Define): Use it here.
16913
16914         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16915         `TypeBuilder.BaseType != null' check.
16916         (TypeContainer.FindMembers): Only lookup parent members if we
16917         actually have a parent.
16918         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16919         (ConstructorInitializer.Resolve): Likewise.
16920
16921         * interface.cs (Interface.FindMembers): Added
16922         `TypeBuilder.BaseType != null' check.
16923
16924         * rootcontext.cs (RootContext.ResolveCore): Added
16925         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16926         classes_second_stage.
16927
16928         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16929         debug_type and trace_type when compiling with --nostdlib.       
16930
16931 2002-06-07  Martin Baulig  <martin@gnome.org>
16932
16933         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16934         (AddField): Set it to true when adding a non-static field.
16935         (DefineType): Use `have_nonstatic_fields' to find out whether we
16936         have non-static fields, not `Fields != null'.
16937
16938 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16939
16940         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16941         dereferencing a null on the static-field code path)
16942
16943 2002-05-30  Martin Baulig  <martin@gnome.org>
16944
16945         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16946         to take command line arguments.  Use reflection to call the new
16947         custom `Initialize' function on the symbol writer and pass it the
16948         command line arguments.
16949
16950         * driver.cs (--debug-args): New command line argument to pass command
16951         line arguments to the symbol writer.
16952
16953 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16954
16955         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16956         the target type for indexers and properties.  Thanks to Joe for
16957         catching this.
16958
16959 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16960
16961         * typemanager.cs (MethodFlags): returns the method flags
16962         (Obsolete/ShouldIgnore) that control warning emission and whether
16963         the invocation should be made, or ignored. 
16964
16965         * expression.cs (Invocation.Emit): Remove previous hack, we should
16966         not do this on matching a base type, we should do this based on an attribute
16967
16968         Only emit calls to System.Diagnostics.Debug and
16969         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16970         on the command line.
16971
16972         * rootcontext.cs: Global settings for tracing and debugging.
16973
16974         * cs-tokenizer.cs (define): New utility function to track
16975         defines.   Set the global settings for TRACE and DEBUG if found.
16976
16977 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16978
16979         * interface.cs (Populate*): Pass in the TypeContainer as well as
16980         the DeclSpace as parameters so that we can create EmitContexts and
16981         then use that to apply attributes etc.
16982
16983         (PopulateMethod, PopulateEvent, PopulateProperty)
16984         (PopulateIndexer): Apply attributes everywhere.
16985
16986         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16987         etc.
16988
16989         (ApplyAttributes): Update accordingly.
16990
16991         We now apply interface attributes for all members too.
16992
16993 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16994
16995         * class.cs (Indexer.Define); Correctly check if we are explicit
16996         implementation (instead of checking the Name for a ".", we
16997         directly look up if the InterfaceType was specified).
16998
16999         Delay the creation of the PropertyBuilder.
17000
17001         Only create the PropertyBuilder if we are not an explicit
17002         interface implementation.   This means that explicit interface
17003         implementation members do not participate in regular function
17004         lookups, and hence fixes another major ambiguity problem in
17005         overload resolution (that was the visible effect).
17006
17007         (DefineMethod): Return whether we are doing an interface
17008         implementation. 
17009
17010         * typemanager.cs: Temporary hack until we get attributes in
17011         interfaces (Ravi is working on that) and we get IndexerName
17012         support in interfaces.
17013
17014         * interface.cs: Register the indexers as properties.
17015
17016         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17017         warning, I have verified that this is a bug in the .NET runtime
17018         (JavaScript suffers of the same problem).
17019
17020         * typemanager.cs (MemberLookup): When looking up members for
17021         interfaces, the parent of an interface is the implicit
17022         System.Object (so we succeed in searches of Object methods in an
17023         interface method invocation.  Example:  IEnumerable x;  x.ToString
17024         ()) 
17025
17026 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17027
17028         * class.cs (Event): Events should also register if they do
17029         implement the methods that an interface requires.
17030
17031         * typemanager.cs (MemberLookup); use the new GetInterfaces
17032         method. 
17033
17034         (GetInterfaces): The code used to lookup interfaces for a type is
17035         used in more than one place, factor it here. 
17036
17037         * driver.cs: Track the errors at the bottom of the file, we kept
17038         on going.
17039
17040         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17041         instance if the method we are calling is static!
17042
17043 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17044
17045         * attribute.cs (ApplyAttributes): Make this function filter out
17046         the IndexerName attribute (as that attribute in reality is never
17047         applied) and return the string constant for the IndexerName
17048         attribute. 
17049
17050         * class.cs (TypeContainer.Emit): Validate that all the indexers
17051         have the same IndexerName attribute, and if so, set the
17052         DefaultName attribute on the class. 
17053
17054         * typemanager.cs: The return value might contain other stuff (not
17055         only methods).  For instance, consider a method with an "Item"
17056         property and an Item method.
17057
17058         * class.cs: If there is a problem with the parameter types,
17059         return. 
17060
17061 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17062
17063         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17064         looks at user defined conversion after making a call to 
17065         StandardConversionExists - we need this for overload resolution.
17066
17067         * expression.cs : Update accordingly the various method calls.
17068
17069         This fixes 2 bugs filed against implicit user defined conversions 
17070
17071 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17072
17073         * statement.cs: Track the result of the assignment.
17074
17075 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17076
17077         * expression.cs (MemberAccess): Improved error reporting for
17078         inaccessible members.
17079
17080 2002-05-22  Martin Baulig  <martin@gnome.org>
17081
17082         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17083         itself with debugging support.
17084
17085 2002-05-22  Martin Baulig  <martin@gnome.org>
17086
17087         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17088         Removed, this isn't needed anymore.
17089
17090 2002-05-20  Martin Baulig  <martin@gnome.org>
17091
17092         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17093         be underlying type for an enum.
17094
17095 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17096
17097         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17098         that splits out the loading of just the core types.
17099
17100         * rootcontext.cs (ResolveCore): Split the struct resolution in
17101         two, so we can load the enumeration underlying types before any
17102         enums are used.
17103
17104         * expression.cs (Is): Bandaid until we fix properly Switch (see
17105         bug #24985 for details).
17106
17107         * typemanager.cs (ImplementsInterface): The hashtable will contain
17108         a null if there are no interfaces implemented.
17109
17110 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17111
17112         * cs-parser.jay (indexer_declarator): It is fine to have array
17113         parameters
17114
17115 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17116
17117         * typemanager.cs: (RegisterBuilder): New function used to register
17118         TypeBuilders that implement interfaces.  Since
17119         TypeBuilder.GetInterfaces (as usual) does not work with lame
17120         Reflection.Emit. 
17121         (AddUserType): register interfaces.
17122
17123         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17124         dealing with TypeBuilder.  Also, arrays are showing up as
17125         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17126         methods can not be invoked on them!
17127
17128         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17129         (ImplicitReferenceConversionExists): Split out from
17130         StandardConversionExists. 
17131
17132         * expression.cs (As): We were only implementing one of the three
17133         cases for the as operator.  We now implement them all.
17134         (Is): Implement the various other cases for Is as well.
17135
17136         * typemanager.cs (CACHE): New define used to control if we want or
17137         not the FindMembers cache.  Seems to have a negative impact on
17138         performance currently
17139
17140         (MemberLookup): Nested types have full acess to
17141         enclosing type members
17142
17143         Remove code that coped with instance/static returns for events, we
17144         now catch this in RealFindMembers.
17145
17146         (RealFindMembers): only perform static lookup if the instance
17147         lookup did not return a type or an event.  
17148
17149 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17150
17151         * assign.cs (CompoundAssign): We pass more semantic information
17152         now to Compound Assignments than we did before: now we have all
17153         the information at hand, and now we resolve the target *before* we
17154         do the expression expansion, which allows the "CacheValue" method
17155         to have the effect we intended (before, a [x] += 1 would generate
17156         two differen ArrayAccess expressions from the ElementAccess,
17157         during the resolution process).
17158
17159         (CompoundAssign.DoResolve): Resolve target and original_source here.
17160
17161 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17162
17163         * expression.cs (ArrayAccess): dropped debugging information. 
17164
17165         * typemanager.cs: Small bug fix: I was always returning i_members,
17166         instead of one of i_members or s_members (depending on which had
17167         the content).
17168
17169         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17170         method is invoked before any code generation takes place, and it
17171         is a mechanism to inform that the expression will be invoked more
17172         than once, and that the method should use temporary values to
17173         avoid having side effects
17174
17175         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17176
17177         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17178         implementation.
17179
17180         * expression.cs (Indirection, ArrayAccess): Add support for
17181         CacheTemporaries in these two bad boys. 
17182
17183         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17184         ldobj or ldind_ref.  
17185         (StoreFromPtr): Handle stobj as well.
17186
17187         * expression.cs (UnaryMutator): Share more code.
17188
17189         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17190         down: I was not tracking the Filter function as well, which
17191         was affecting the results of the cache.
17192
17193 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17194
17195         * attribute.cs: Remove the hack to handle the CharSet property on
17196         StructLayouts. 
17197
17198 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17199
17200         * attribute.cs (DoResolve): More uglyness, we now only try to
17201         resolve the attribute partially, to extract the CharSet
17202         information (only if we are a StructLayout attribute).  Otherwise 
17203
17204         (GetExtraTypeInfo): Add some code to conditionally kill in the
17205         future this.   I am more and more convinced that the .NET
17206         framework has special code to handle the attribute setting on
17207         certain elements.
17208
17209         * expression.cs (IsParamsMethodApplicable): Revert my previous
17210         foreach change here, it was wrong.
17211
17212 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17213
17214         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17215         (pp_expr): do not abort on unknown input, just return.
17216         (eval): abort if there are pending chars.
17217
17218         * attribute.cs (Attribute.Resolve): Positional parameters are
17219         optional.  Deal with that case.
17220
17221         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17222         the Ansi/Unicode/Auto information for the type.
17223
17224         (TypeContainer.DefineType): instantiate the EmitContext here, as
17225         we will be using it during the type definition (to resolve
17226         attributes) and during the emit phase.
17227
17228         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17229         to pull type information out of the attributes
17230
17231         (Attribute.Resolve): track the constructor builder, and allow for
17232         multiple invocations (structs and classes will use this).
17233
17234         * ecore.cs (MemberLookupFinal): new version with all the
17235         parameters customizable.
17236
17237         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17238         constructors.  Return if the result value is null (as the error
17239         would have been flagged already by MemberLookupFinal)
17240
17241         Do not allow instances of abstract classes or interfaces to be
17242         created.
17243
17244         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17245         We have to compare the assembly property here when dealing with
17246         FamANDAssem and Assembly access modifiers, because we might be
17247         creating an assembly from *modules* (that means that we are not
17248         getting TypeBuilders for types defined in other modules that are
17249         part of this assembly).
17250
17251         (Method.Emit): If the method is marked abstract and has a body,
17252         emit an error. 
17253
17254         (TypeContainer.DefineMembers): If both the defined member and the
17255         parent name match are methods, then do not emit any warnings: let
17256         the Method.Define routine take care of flagging warnings.  But if
17257         there is a mismatch (method overrides something else, or method is
17258         overriwritten by something, then emit warning).
17259
17260         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17261         set to null, this means `do not check for the return type on the
17262         signature'. 
17263
17264         (Method.Define): set the return type for the method signature to
17265         null, so that we get methods with the same name and parameters and
17266         different return types.  This is used to flag warning 114 (you are
17267         hiding a method, and you probably want to use the new/override
17268         keywords instead).
17269
17270         * typemanager.cs (MemberLookup): Implemented proper access
17271         control, closing a long standing set of bug reports.  The problem
17272         was that the Framework only has two bits: Public and NonPublic,
17273         and NonPublic includes private and protected methods, but we need
17274         to enforce the FamANDAssem, FamOrAssem and Family. 
17275
17276 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17277
17278         * statement.cs (GotoCase): Return true: Ammounts to giving up
17279         knowledge on whether we return or not, and letting the other case
17280         be responsible for it.
17281
17282 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * driver.cs: Do not load directories for each file processed, only
17285         do it if there is a pattern.
17286
17287         * ecore.cs: Report readonly assigns here as well, as we might have
17288         been resolved only by MemberAccess.
17289
17290         (SimpleName.SimpleNameResolve): Also be useful for LValue
17291         resolution.   We need this to propagate assign to local readonly variables
17292
17293         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17294         do not want to reuse potential criteria memory.
17295
17296         * class.cs (MyEventBuilder): Set reflected_type;
17297
17298         * ecore.cs (Constantify): Added support for constifying bools.
17299
17300         (RootContext.LookupType): Added a cache for values looked up in
17301         the declaration space.
17302
17303         * typemanager.cs (FindMembers): Now is a front-end to
17304         RealFindMembers, and provides a two-level hashtable-based cache to
17305         the request.  
17306
17307         15% performance improvement: from 22.5 to 19.2 seconds.
17308
17309         * expression.cs (IsParamsMethodApplicable): use foreach.
17310         (Invocation.DoResolve): ditto.
17311         (New.DoResolve): ditto.
17312         (ArrayCreation.DoResolve): ditto.
17313
17314         * ecore.cs (FindMostEncompassingType): use foreach.
17315
17316         * delegate.cs (NewDelegate.DoResolve): Use foreach
17317
17318         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17319         (RemoveMethods): use foreach.
17320
17321         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17322         nested foreach statements instead of for, and also break out of
17323         the inner loop once a match is found.
17324
17325         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17326
17327 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17328
17329         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17330         we actually unwrap the expression to allow for extra information
17331         to be extracted. 
17332
17333         * expression.cs: Use Shr_Un on unsigned operations. 
17334
17335 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17336
17337         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17338         applicable operators was not being considered correctly. This closes
17339         the bug Miguel reported.
17340
17341 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17342
17343         * attribute.cs: check that the type derives from System.Attribute
17344         and report the correct error in that case (moved the duplicate code to
17345         its own method, too).
17346
17347 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17348
17349         * attribute.cs: lookup attribute type name as the spec says: first the
17350         bare attribute name and then name + "Attribute" (nant compiles with
17351         mcs after this fix).
17352
17353 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17354
17355         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17356         Because of the way we parse things, we should try to see if a
17357         UIntConstant can fit in an integer.
17358
17359 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17360
17361         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17362         when we are in an explicit context.
17363
17364         (ConvertReferenceExplicit): When converting from Iface type S to Class
17365         T make sure the rules are implemented as an OR.
17366
17367         * parameter.cs (ParameterType): Make it a property for now although the
17368         purpose really isn't anything immediate.
17369
17370         * expression.cs (Is*Applicable): Do better checking on the parameter type
17371         of a ref/out parameter. The ones from the system assemblies are already 
17372         marked with the correct type so we don't need to do any correction.
17373
17374         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17375         the object type is standard too so include that.
17376
17377 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17378
17379         * ecore.cs (StandardConversionExists): Augment with missing code:
17380         deal with IntConstant, LongConstants and Enumerations.
17381
17382         * assign.cs: Report the error, instead of failing silently
17383
17384         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17385         typecontainer that they are declared, because the
17386         typecontainer/namespace will have the list of using clauses that
17387         need to be applied.
17388
17389         Assembly Attributes were escaping the normal registration
17390         mechanism. 
17391
17392         (EmitCode): Apply attributes within an EmitContext that represents
17393         the container they were declared on.
17394
17395         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17396
17397 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17398
17399         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17400         Revamp completely - make much cleaner as we now operate only
17401         on a set of Types.
17402
17403         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17404         to implement the logic detailed in the spec more correctly.
17405
17406         (UserDefinedConversion): Update accordingly.
17407
17408 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17409
17410         * statement.cs: Return flow analysis information up.
17411
17412         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17413         and the default.
17414
17415         (token): Do not consume an extra character before calling
17416         decimal_digits.
17417
17418 2002-05-06  Piers Haken <piersh@friskit.com>
17419
17420         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17421
17422 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17423
17424         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17425         EmitContext during the instance constructor initializer
17426         resolution, to stop access to instance variables.
17427
17428         This is mandated by the spec, last paragraph of the `constructor
17429         initializers' section. 
17430
17431 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17432
17433         * cs-parser.jay, class.cs (Accessor): new class used to represent
17434         an accessor (get or set).  In the past we used `null' to represent
17435         a missing accessor.  But this is ambiguous because there was no
17436         way to tell in abstract indexers/properties if one of them was
17437         specified.
17438
17439         Now there is a way of addressing that.
17440
17441         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17442         instead of FindMembers.
17443
17444         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17445         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17446
17447         * attribute.cs: Treat indexers and properties as the same in terms
17448         of applying attributes
17449
17450         * ecore.cs (FindMostEncompassedType): Use statically initialized
17451         EmptyExpressions()s like we do elsewhere to avoid creating useless
17452         objects (and we take this out of the tight loop).
17453
17454         (GetConversionOperators): Move the code to extract the actual
17455         operators to a separate routine to clean things up.
17456
17457 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17458
17459         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17460         events are always registered FieldBuilders.
17461
17462         * class.cs (FieldBase): New class shared by Fields 
17463
17464         * delegate.cs: If we are a toplevel delegate, use our full name.
17465         If we are a nested delegate, then only use our tail name.
17466
17467 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17468
17469         * expression.cs (IsApplicable): Ensure that we add the "&" to
17470         ref/out types before comparing it with the type of the argument.
17471
17472         (IsParamsMethodApplicable): Ditto.
17473
17474         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17475         silly me ;-)
17476
17477         * delegate.cs : Handle the case when we have more than one applicable
17478         method. Flag an error only when we finish checking all.
17479
17480 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17481
17482         * expression.cs: Add support for boolean static initializers.
17483
17484 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17485
17486         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17487
17488         * parameter.cs (ComputeParameterTypes,
17489         ComputeAndDefineParameterTypes): Better error handling: now we
17490         clear the `types' cache if we fail during any of the type lookups.
17491         We also return the status code correctly to our caller
17492
17493         * delegate.cs: If we fail to define a delegate, abort the extra
17494         steps. 
17495
17496         * expression.cs (Binary.ResolveOperator): for
17497         operator==(object,object) and operator !=(object, object) we also
17498         have to verify that there is an implicit conversion from one to
17499         the other.
17500
17501         (ArrayAccess.DoResolve): Array Access can operate on
17502         non-variables. 
17503
17504 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17505
17506         * assign.cs (CompoundAssign): A new class used as a "flag" that
17507         the assignment actually is happening as part of a compound
17508         assignment operator.
17509
17510         During compound assignment, a few new rules exist to enable things
17511         like:
17512
17513         byte b |= 1 + 2
17514
17515         From the spec:
17516
17517         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17518         to the type of x) if y is implicitly convertible to the type of x,
17519         and the operator is a builtin operator and the return type of the
17520         operator is explicitly convertible to the type of x. 
17521
17522         * rootcontext.cs: Reset warning level to 2.  4 catches various
17523         "interesting" features in mcs, we must clean this up at some
17524         point, but currently am trying to kill other bugs ;-)
17525
17526         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17527         in container classes as well.  
17528
17529         * expression.cs (Binary.ResolveOperator): Handle string case
17530         before anything else (as operator overloading does emit an error
17531         before doing anything else).
17532
17533         This code could go away when we move to a table driven model, but
17534         i could not come up with a good plan last night.
17535
17536 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17537
17538         * typemanager.cs (CSharpName): reimplementation using regex.
17539         * class.cs: added null check for fields in Emit
17540         * rootcontext.cs: set warninglevel to 4
17541
17542 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17543
17544         * typemanager.cs (CSharpName): reimplemented with Lupus
17545         suggestion.
17546
17547 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17548
17549         * statement.cs (If): correclty implement Resolve, because we were
17550         not catching sem errors in there.  The same process is needed
17551         everywhere else. 
17552         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17553
17554
17555         (Statement.Warning_DeadCodeFound): Factorize code.
17556         (While): Report dead code here too.
17557
17558         (Statement): Added Resolve virtual method to allow
17559         for resolution split from the emit code.
17560
17561 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17562
17563         * statement.cs (EmitBoolExpression): No longer try to resolve the
17564         expression here.    
17565         (MakeBoolean): New utility function that resolve, implicitly
17566         converts to boolean and tags the expression. 
17567
17568
17569         (If, Do): Implement dead code elimination.
17570         (While): Implement loop inversion
17571
17572         (Do, While, For, If): Resolve the expression prior to calling our
17573         code generation.
17574
17575 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17576
17577         * class.cs:
17578           - added method Report28 (warning: program has more than one entry point)
17579           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17580           - modified method Method.Define, the part at the end of the method
17581
17582         * rootcontext.cs: added static public Location EntryPointLocation;
17583           
17584         * ../errors/cs0028.cs : Add test case for the above warning.              
17585
17586         * typemanager.cs:
17587           - modified method CSharpName to allow arrays of primitive type to
17588             be printed nicely (e.g. instead of System.Int32[][] it now prints
17589             int[][])
17590           - added method CSharpSignature: returns the signature of a method
17591             in string format to be used in reporting errors, warnings, etc.
17592
17593         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17594         with String.Empty.
17595
17596 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17597
17598         * delegate.cs (Define): Fix extremely silly bug where I was
17599         setting the type of the 'object' parameter of the BeginInvoke
17600         method to System.IAsyncResult instead of System.Object ;-)
17601
17602 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17603
17604         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17605         here. 
17606
17607         (Constructor.Emit): return if we fail to initialize the
17608         constructor.  Another door closed!  
17609
17610         * expression.cs (New.DoResolve): Improve error message (from -6 to
17611         1501).  Use DeclaredOnly lookup to find the exact constructor.
17612
17613         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17614         loop.  This is useful.
17615
17616         * cs-parser.jay: Adjust the default parameters so that destructors
17617         have the proper signature.
17618
17619 2002-04-26  Martin Baulig  <martin@gnome.org>
17620
17621         * driver.cs (LoadAssembly): If `assembly' contains any characters
17622         which are only valid in path names and not in assembly names
17623         (currently slash, backslash and point), use Assembly.LoadFrom ()
17624         instead of Assembly.Load () on the `assembly' (before iteration
17625         over the link_paths).
17626
17627 2002-04-26  Martin Baulig  <martin@gnome.org>
17628
17629         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17630
17631 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17632
17633         * class.cs (Property): use the new typemanager.MemberLookup
17634
17635         (TypeContainer.MemberLookup): Implement using the
17636         TypeManager.MemberLookup now. 
17637
17638         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17639         and return MemberInfos, so that these can be used without an
17640         EmitContext (what we had before).
17641
17642 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17643
17644         * expression.cs: Fix the case where the argument to params if the
17645         type of the params.  I omitted handling this before.   Fixed
17646
17647 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17648
17649         * driver.cs: Call BootCorlib_PopulateCoreType
17650
17651         * class.cs (Property.CheckBase): Check for properties only, not
17652         for all members. 
17653
17654         * interface.cs: Temporary hack: try/catch around the
17655         CustomAttributeBuilder, because I am getting an exception that I
17656         do not understand.
17657
17658         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17659         types whose definitions are required to be there (attributes are
17660         defined before standard types).
17661
17662         Compute definitions as we boot the various types, as they are used
17663         immediately (value_type class will need object_type, but if we do
17664         not initialize object_type, we will pass a null, which will let
17665         the runtime pick the System.Object from the existing corlib, which
17666         is not what we want).
17667
17668 2002-04-22  Patrik Torstensson <totte@labs2.com>
17669
17670         * cs-tokenizer.cs: fixed a number of trim() issues.
17671
17672 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17673
17674         * expression.cs (Argument.Type): Ensure that we return the correct
17675         type when we have out or ref parameters [in which case we 
17676         append a "&"].
17677
17678 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17679
17680         * class.cs (Property, Indexer): Allow extern modifier in there. 
17681
17682         * typemanager.cs (InitBaseTypes): Initializes object_type and
17683         value_type, since those will be used early on during the bootstrap
17684         process to compile corlib.
17685
17686         (InitCoreTypes): Move code from here to InitBaseTypes.
17687
17688 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17689
17690         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17691         single-dimension arrays as using the ldlen opcode.  
17692
17693         Daniel Lewis discovered this optimization.  
17694
17695         * typemanager.cs: Add signature for System.Array::get_Length
17696
17697 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17698
17699         * statement.cs: report the error when the foreach does not apply to an
17700         array nor a collection.
17701
17702 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17703
17704         * expression.cs: Add implicit conversions to the operator ~.
17705
17706         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17707
17708         * typemanager.cs: Locate the decimal constructor.
17709
17710 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17711
17712         * attribute.cs: use the new property of TypeOf.
17713         * expression.cs: added 'get' property around typearg.
17714
17715         These changes fix a build breaker reported by NickD. Is this the
17716         correct way to fix?  If not, please, revert my changes and make it
17717         work :-).
17718
17719 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17720
17721         * attribute.cs: Add support for typeof in attribute invocations.
17722         I am not sure that this is right though.
17723
17724 2002-04-14  Duncan Mak  <duncan@ximian.com>
17725
17726         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17727         Binary.Operator.Division case.
17728
17729 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17730
17731         * class.cs (DefineType): Ensure that we do a proper check on
17732         attribute types and also register it with the TypeManager.
17733
17734         (TypeContainer.Targets): The default for attribute types is
17735         AttributeTargets.All.
17736
17737         * attribute.cs (ApplyAttributes): Registering the attribute type
17738         is done elsewhere, not when we discover we have a Usage attribute.
17739
17740 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17741
17742         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17743         and get rid of is_delegate parameter.
17744
17745         * everywhere : update.
17746
17747 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17748
17749         * cs-parser.jay (compilation_unit): Revamp completely to use
17750         some new ideas that I got from Rhys' grammar to solve the problems
17751         with assembly level attributes.
17752
17753         (outer_declaration): New grammar production.
17754
17755         (attribute_sections): Add.
17756
17757         (opt_attributes): Base on attribute_sections
17758
17759         (namespace_declaration): Allow opt_attributes to tackle the case
17760         when we have assembly level attributes - we are clever in this
17761         regard now ;-)
17762
17763         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17764         attributes in the non-global context.
17765
17766         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17767         instead of SetGlobalAttributes.
17768
17769         * class.cs, rootcontext.cs : Ensure we define and generate 
17770         attribute types before anything else.
17771
17772         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17773         and flag the new error -20 for the case when the attribute type
17774         does not have valid targets specified. csc does not catch this.
17775
17776         * ../errors/errors.txt : update for error # -20
17777
17778 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17779
17780         * support.cs (InternalParameters.ParameterModifier): Do some null
17781         checking and return sane values.
17782
17783         * class.cs (Method.Define): If we are a PInvoke method, ensure
17784         that we are static and extern. Report error # 601
17785
17786         * ../errors/cs0601.cs : Add test case for the above error.
17787
17788 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17789
17790         * rootcontext.cs (attribute_types): We need to keep type of
17791         all attribute types separately and emit code for them first.
17792
17793         (RegisterAttribute) : Implement.
17794
17795         * class.cs (DefineType): Check if the current Type is a custom
17796         attribute type and register it accordingly.
17797
17798         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17799         adding the first attribute twice and rename to
17800
17801         (SetGlobalAttributes): this.
17802
17803         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17804         lookups.
17805
17806         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17807         if we are processing global arguments. Hmm, I am unsure of this.
17808
17809 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17810
17811         * expression.cs: added static array of strings to avoid calling
17812         Enum.ToString () for Operator in Binary. Significant recover of
17813         performance.
17814
17815 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17816
17817         * class.cs (FindMembers): Allow the Builders of the various
17818         members to be null.  If they are skip them.  This only happens
17819         during the PInvoke declaration.
17820
17821 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17822
17823         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17824         failure, so we do not keep going afterwards.
17825
17826         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17827         wanted to pass `false' as the `is_delegate' argument.  If this is
17828         the case, why not use delegate_type == null to mean `is_delegate =
17829         false' and anything else as is_delegate = true.
17830
17831 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17832
17833         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17834         code for the section, not the beginning of the tests.
17835
17836 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17837
17838         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17839
17840         * expression.cs (Binary): same.  Warn about errors where we have
17841         Enum/Enum in operator + as well.
17842
17843 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17844
17845         * statement.cs:
17846                 - added support for switch(bool)
17847                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17848                 - add TableSwitchEmit() to handle table-based switch statements
17849
17850 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17851
17852         * expression.cs (Invocation.OverloadResolve): Factor out code which
17853         does parameter compatibility checking with arguments so that we can 
17854         re-use the code even from Delegate.VerifyApplicability
17855
17856         (VerifyArgumentsCompat): Move above code here.
17857
17858         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17859         and instead make a call to the above method.
17860
17861 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17862
17863         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17864         We use it to keep track of classes which are attribute types.
17865
17866 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17867
17868         * delegate.cs (Delegate.Define): Correctly define the types in the
17869         presence of fixed and array parameters.
17870
17871         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17872         doing FindMembers.
17873
17874         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17875         include NonPublic after the first iteration.
17876
17877         * class.cs (Indexer.CheckBase): Only check if both parents are
17878         non-null. 
17879
17880         * cs-parser.jay (accessor_body): If empty, set to null.
17881
17882         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17883         same code path here to resolve constants names that we did have in
17884         MemberAccess.DoResolve.  There is too much code duplicated here.
17885
17886 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17887
17888         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17889
17890         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17891         to MakeUnionSet.
17892
17893         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17894         tokens, numbers and strings.
17895
17896         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17897         parenthesis.
17898
17899         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17900         asyncronous parameters and the regular parameters.  
17901
17902         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17903         specify the target directory.
17904
17905         * expression.cs: (This.DoResolve): Simplify
17906         (As.Emit): Optimize, do not generate IsInst if the expression is
17907         always of the given type.
17908
17909         (Is.DoResolve): Bug fix, we were reporting both always/never for
17910         the is expression.
17911
17912         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17913         creating too many unnecessary arrays.
17914
17915 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17916
17917         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17918         fields instead of rolling our own initializer.   Takes care of all
17919         implicit conversions, and drops unnecessary static checks/argument.
17920
17921 2002-03-31  Dick Porter  <dick@ximian.com>
17922
17923         * driver.cs: use the GetDirectories() return values properly, and
17924         use "/" as path separator.
17925
17926 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17927
17928         * expression.cs (Unary): Optimize - - expr into expr.
17929         (Binary): Optimize a + (-b) into a -b.
17930
17931         * codegen.cs (CodeGen): Made all methods static.
17932
17933 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * rootcontext.cs: 
17936
17937         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17938         TypeBuilder property.
17939
17940         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17941         instead. 
17942
17943         * tree.cs: Removed the various RecordXXXX, and replaced with a
17944         single RecordDecl.  Removed all the accessor methods, and just
17945         left a single access point Type 
17946
17947         * enum.cs: Rename DefineEnum to DefineType.
17948
17949         * decl.cs: New abstract method `DefineType' used to unify the
17950         Defines for Enumerations, Interfaces, TypeContainers and
17951         Delegates.
17952
17953         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17954         LookupBaseClasses method that used to live in class.cs and
17955         interface.cs here, and renamed to FindType.
17956
17957         * delegate.cs: Implement DefineType.  Take advantage of the
17958         refactored pattern for locating the parent builder without taking
17959         the parent_builder argument (which we know does not work if we are
17960         nested, and triggering a toplevel definition).
17961
17962 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17963
17964         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17965         accessibility of a member has changed during override and report
17966         an error if so.
17967
17968         * class.cs (Method.Define, Property.Define): Only complain on
17969         overrides if the method is private, any other accessibility is
17970         fine (and since we just checked the permission is the same, we are
17971         good to go).
17972
17973         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17974         and elif are processed always.  The other pre-processing
17975         directives are only processed if we are "taking" the path
17976
17977 2002-03-29  Martin Baulig  <martin@gnome.org>
17978
17979         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17980         current location is not Null.
17981
17982         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17983         a separate method so we can profile it.
17984
17985         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17986         `span.Seconds' are just seconds, but no minutes or hours.
17987         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17988
17989 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17992         Remove the gratuitous set of Final:
17993
17994                                 // If an interface implementation, then we can set Final.
17995                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17996                                     implementing.DeclaringType.IsInterface)
17997                                         flags |= MethodAttributes.Final;
17998
17999         I do not know what I was smoking when I used that.
18000
18001
18002         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18003         step into fixing the name resolution issues for delegates and
18004         unifying the toplevel name resolution.
18005
18006 2002-03-28  Martin Baulig  <martin@gnome.org>
18007
18008         * class.cs (Method.Emit): If we have a symbol writer, call its
18009         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18010         tell it about the current method.
18011
18012         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18013         writer that we're going to emit the first byte of IL code for a new
18014         statement (a new source line).
18015         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18016         EmitContext.Mark() before emitting any code.
18017
18018         * location.cs (SymbolDocument): Return null when we're Null.
18019
18020         * statement.cs (Statement): Moved the `Location loc' variable here.
18021         (Statement.EmitBoolExpression): If we have a symbol writer, call
18022         ec.Mark() before emitting any code to tell it that we're at the
18023         beginning of a new statement.
18024         (StatementExpression): Added `Location' argument to the constructor.
18025         (Block): Added public readonly variable `StartLocation' and public
18026         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18027         (Block): Added constructor which takes a start and end location.
18028         (Block.SetEndLocation): New method. This sets the end location.
18029         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18030         local variables we create.
18031         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18032         each statement and do also mark the begin and end of the block.
18033
18034         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18035         tell it the current lexer.Location, use Location.Null for the end of the
18036         block.
18037         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18038         current block, set its end location using SetEndLocation().
18039         (statement_expression): StatementExpression constructor now takes the
18040         lexer.Location as additional argument.
18041         (for_statement, declare_local_variables): Likewise.
18042         (declare_local_variables): When creating a new implicit block, use the
18043         new Block constructor and pass it the lexer.Location.
18044
18045 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18046
18047         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18048         members also on the parent interfaces recursively.
18049
18050 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18051
18052         * report.cs: Use new formats, since Gonzalo finished the missing
18053         bits. 
18054
18055         * expression.cs (Binary.ResolveOperator): added missing operator|
18056         operator& and operator^ for bool/bool.
18057
18058         * cs-parser.jay: CheckDef now takes a Location argument that is
18059         used to report errors more precisly (instead of reporting the end
18060         of a definition, we try to track something which is a lot closer
18061         to the source of the problem).
18062
18063         * cs-tokenizer.cs: Track global token use, so we can properly flag
18064         the use of #define/#undef after the first token has been seen.
18065
18066         Also, rename the reportXXXX to Error_DescriptiveName
18067
18068         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18069         TypeContainer, so that Enum and Interface can use this too.
18070
18071         * class.cs (TypeContainer.LookupInterfaceOrClass,
18072         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18073         `builder' argument.  Typically this was used to pass the parent
18074         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18075         the definition).  
18076
18077         The problem is that a nested class could trigger the definition of
18078         a toplevel class, and the builder would be obviously wrong in that
18079         case. 
18080
18081         So we drop this argument, and we compute dynamically the
18082         TypeBuilder/ModuleBuilder (the correct information was available
18083         to us anyways from DeclSpace.Parent)
18084
18085         * interface.cs (Interface.DefineInterface): Drop builder
18086         parameter cleanup like class.cs
18087
18088         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18089         like class.cs
18090
18091         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18092         values. 
18093
18094         (Try.Emit): Propagate the returns value from the statement.
18095
18096         (Return.Emit): Even if we are leavning 
18097
18098         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18099
18100         * modifiers.cs: Fix the computation of MethodAttributes flags.
18101
18102 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18103
18104         * driver.cs: allow compilation of files that start with '/'.
18105         Add a default case when checking the argument of --target.
18106
18107 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18108
18109         * interface.cs: Implement the same search algorithm for types in
18110         the interface code.
18111
18112         * delegate.cs: Do not allow multiple definition.
18113
18114         * Recovered ChangeLog that got accidentally amputated
18115
18116         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18117
18118         * rootcontext.cs: Load manually enum to allow core classes to
18119         contain enumerations.
18120
18121         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18122         Update to new static methods in TypeManager.
18123
18124         * typemanager.cs (GetMethod, GetConstructor): Use our
18125         implementation of FindMembers to find the members, since during
18126         corlib compilation, the types are TypeBuilders and GetMethod and
18127         GetConstructor do not work.
18128
18129         Make all methods in TypeManager static.
18130
18131         (InitCodeHelpers): Split the functionality from
18132         the InitCodeTypes function.
18133
18134         * driver.cs: Call InitCodeHelpers after we have populated the
18135         types. 
18136
18137         * cs-parser.jay (delegate_declaration): we did not used to compute
18138         the delegate name correctly for void delegates.
18139
18140 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18141
18142         * rootcontext.cs (RootContext): Init the interface_resolve_order
18143         and type_container_resolve_order always.
18144
18145         (ResolveCore, BootstrapCorlib_ResolveClass,
18146         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18147         compiler when compiling with --nostdlib
18148
18149         * class.cs (TypeContainer.DefineType): Check that our parent is
18150         not null.  This test is most important when we are bootstraping
18151         the core types.
18152
18153         * codegen.cs: Split out the symbol writing code.
18154
18155 2002-03-25  Martin Baulig  <martin@gnome.org>
18156
18157         * driver.cs (-g): Made -g an alias for --debug.
18158
18159 2002-03-24  Martin Baulig  <martin@gnome.org>
18160
18161         * codegen.cs (SymbolWriter): New public variable. Returns the
18162         current symbol writer.
18163         (CodeGen): Added `bool want_debugging_support' argument to the
18164          constructor. If true, tell the ModuleBuild that we want debugging
18165         support and ask it for the ISymbolWriter.
18166         (Save): If we have a symbol writer, call it's Close() method after
18167         saving the assembly.
18168
18169         * driver.c (--debug): New command line argument to create a
18170         debugger information file.
18171
18172         * location.cs (SymbolDocument): New public property. Returns an
18173         ISymbolDocumentWriter object for the current source file or null
18174         if we don't have a symbol writer.
18175
18176 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18177
18178         * driver.cs (LoadAssembly): Correctly return when all the paths
18179         have been tried and not before.
18180
18181         * statement.cs (Switch.Emit): return the actual coverage for this
18182         statement (returns/not-returns)
18183
18184         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18185         switch of the statement if we are the last switch section.  That
18186         kills two problems: try/catch problems (we used to emit an empty
18187         nop at the end) and switch statements where all branches would
18188         return. 
18189
18190 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18191
18192         * driver.cs: Add default assemblies (the equivalent to the
18193         Microsoft CSC.RSP file)
18194
18195         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18196         also update tokens_seen and set it to false.
18197
18198         * driver.cs: Implement --recurse for Mike.
18199
18200         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18201         correctly splitting out the paths.
18202
18203 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * interface.cs (Interface.PopulateProperty): Instead of using
18206         `parent' as the declaration space for the set parameters, use
18207         `this' 
18208
18209         * support.cs (InternalParameters): InternalParameters constructor
18210         takes a DeclSpace instead of a TypeContainer.
18211
18212         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18213         types are being initialized, load the address of it before calling
18214         the function.  
18215
18216         (New): Provide a mechanism to disable the generation of local
18217         value type temporaries when the caller will be providing us with
18218         an address to store it.
18219
18220         (ArrayCreation.EmitDynamicInitializers): Use it.
18221
18222 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18223
18224         * expression.cs (Invocation.EmitArguments): Only probe for array
18225         property if there is more than one argument.  Sorry about that.
18226
18227         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18228         empty param arrays.
18229
18230         * class.cs (Method.LabelParameters): Fix incorrect code path that
18231         prevented the `ParamArrayAttribute' from being applied to the
18232         params attribute.
18233
18234 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18235
18236         * support.cs (ReflectionParameters): Correctly compute whether the
18237         last argument is a params array.  Fixes the problem with
18238         string.Split ('a')
18239
18240         * typemanager.cs: Make the assemblies array always be non-null
18241         (empty, but non-null)
18242
18243         * tree.cs (RecordDecl): New function that abstracts the recording
18244         of names.  This reports error 101, and provides a pointer to the
18245         previous declaration.  Fixes a crash in the compiler.
18246
18247         * cs-parser.jay (constructor_declaration): Update to new grammar,
18248         and provide a constructor_body that can be empty.
18249
18250 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18251
18252         * driver.cs: Add support for --resources.
18253
18254         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18255         Make all types for the various array helper methods be integer.
18256
18257         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18258         CheckState to ConvCast.
18259
18260         (ConvCast): Now it takes a `checked' state argument, to avoid
18261         depending on the emit context for the conversion, and just using
18262         the resolve time setting.
18263
18264         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18265         instead of Invocation.EmitArguments.  We do not emit the original
18266         arguments, instead we emit those which have been converted to
18267         unsigned int expressions.
18268
18269         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18270
18271         * codegen.cs: ditto.
18272
18273         * expression.cs (LocalVariableReference): Drop the use of the
18274         Store function that depended on the variable index.
18275
18276         * statement.cs (VariableInfo): Drop the `Idx' property from this
18277         class, as this is not taking into account the indexes for
18278         temporaries tat we generate during the execution, getting the
18279         indexes wrong.
18280
18281         * class.cs: First emit class initializers, then call the parent
18282         constructor. 
18283
18284         * expression.cs (Binary): Fix opcode emision.
18285         (UnaryMutator.EmitCode): Support checked code generation
18286
18287         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18288         matches for events for both the Static and Instance scans,
18289         pointing to the same element.   Fix that.
18290
18291 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18292
18293         * rootcontext.cs (ResolveTree): Always set the
18294         interface_resolve_order, because nested interfaces will be calling
18295         into us.
18296
18297         * class.cs (GetInterfaceOrClass): Track the same resolution
18298         process used by TypeManager.LookupType.  This fixes the nested
18299         type lookups in class declarations (separate path from
18300         LookupType). 
18301
18302         (TypeContainer.DefineType): Also define nested interfaces.
18303         (TypeContainer.RegisterOrder): New public function used to
18304         register the order in which child interfaces need to be closed.
18305
18306         Nested interfaces need to be closed after their parents have been
18307         created. 
18308
18309         * interface.cs (InterfaceAttr): Put all the logic for computing
18310         the interface attribute here. 
18311
18312         (DefineInterface): Register our interface order with the
18313         RootContext or with the TypeContainer depending on the case.
18314
18315 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18316
18317         * cs-parser.jay: rework foreach statement to work with the new
18318         changes to the policy on SimpleNames.
18319
18320         * report.cs: support Stacktrace on warnings as well.
18321
18322         * makefile: drop --unsafe and /unsafe from the compile.
18323
18324 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18325
18326         * ecore.cs (StandardConversionExists): Modify to take an Expression
18327         as the first parameter. Ensure we do null -> reference type conversion
18328         checking.
18329
18330         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18331         temporary Expression objects.
18332
18333 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18334
18335         * interface.cs: workaround bug in method overloading resolution
18336         (there is already a bugzilla bug for it).
18337
18338 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18339
18340         We could also solve this problem by having a separate path for
18341         performing type lookups, instead of DoResolve, we could have a
18342         ResolveType entry point, and only participating pieces of the
18343         production (simplename, deref, array) would implement this. 
18344
18345         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18346         signal SimpleName to only resolve type names and not attempt to
18347         resolve anything else.
18348
18349         * expression.cs (Cast): Set the flag.
18350
18351         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18352
18353         * class.cs: Only report 108 if there is no `new' modifier.
18354
18355         * cs-parser.jay: rework foreach statement to work with the new
18356         changes to the policy on SimpleNames.
18357         
18358         * report.cs: support Stacktrace on warnings as well.
18359
18360         * makefile: drop --unsafe and /unsafe from the compile.
18361
18362 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18363
18364         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18365         lookups here, instead of doing that at parse time.  This means
18366         that our grammar will not introduce `LocalVariableReferences' as
18367         expressions at this point.  That solves the problem of code like
18368         this:
18369
18370         class X {
18371            static void Main ()
18372            { int X = 1;
18373             { X x = null }}}
18374
18375         This is only half the fix.  The full fix requires parameters to
18376         also be handled in this way.
18377
18378         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18379         makes the use more obvious of the DeclSpace.  The
18380         ec.TypeContainer.TypeBuilder is now only used to pull the
18381         TypeBuilder for it.
18382
18383         My theory is that I can get rid of the TypeBuilder completely from
18384         the EmitContext, and have typecasts where it is used (from
18385         DeclSpace to where it matters).  
18386
18387         The only pending problem is that the code that implements Aliases
18388         is on TypeContainer, and probably should go in DeclSpace.
18389
18390         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18391         lookups here, instead of doing that at parse time.  This means
18392         that our grammar will not introduce `LocalVariableReferences' as
18393         expressions at this point.  That solves the problem of code like
18394         this:
18395
18396         class X {
18397            static void Main ()
18398            { int X = 1;
18399             { X x = null }}}
18400
18401         This is only half the fix.  The full fix requires parameters to
18402         also be handled in this way.
18403
18404         * class.cs (Property.DefineMethod): When implementing an interface
18405         method, set newslot, when implementing an abstract method, do not
18406         set the flag (before we tried never setting it, or always setting
18407         it, which is the difference).
18408         (Indexer.DefineMethod): same.
18409         (Method.DefineMethod): same.
18410
18411         * ecore.cs: Only set the status used flag if we get back a Field.
18412
18413         * attribute.cs: Temporary hack, so Paolo can keep working.
18414
18415 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18416
18417         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18418         the unmanaged type in the case we have a MarshalAs attribute.
18419
18420         (Resolve): Handle the case when we are parsing the special MarshalAs
18421         attribute [we need to store the unmanaged type to use later]
18422
18423         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18424         MarshalAs Attribute.
18425
18426         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18427         on parameters and accordingly set the marshalling info.
18428
18429 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18430
18431         * class.cs: Optimizing slightly by removing redundant code after
18432         we switched to the `NoTypes' return value.
18433         (Property.DefineMethod): use NoTypes here too.
18434
18435         This fixes the bug I introduced in my last batch of changes.
18436
18437 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18438
18439         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18440
18441         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18442         Enums since those are types too. 
18443
18444         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18445
18446         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18447         thanks to a call during the lookup process.
18448
18449 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18450
18451         * statement.cs (Foreach): Lots of work to accomodate a particular
18452         kind of foreach statement that I had not kept in mind.  It is
18453         possible to have foreachs on classes that provide a GetEnumerator
18454         method that return objects that implement the "pattern" for using
18455         a foreach, there is no need to support GetEnumerator
18456         specifically. 
18457
18458         This is needed to compile nant.
18459
18460         * decl.cs: Only report 114 if the member is not `Finalize' and if
18461         the warning level is at least 2.
18462
18463         * class.cs: Moved the compare function from Method to
18464         MethodSignature. 
18465
18466         (MethodSignature.InheritableMemberSignatureCompare): Add new
18467         filter function that is used to extract inheritable methods from a
18468         class. 
18469
18470         (Method.Define): Use the new `inheritable_method_signature_filter'
18471         delegate
18472
18473         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18474         command. 
18475
18476 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18477
18478         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18479
18480         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18481
18482         * expression.cs: Pass location information to
18483         ConvertImplicitStandard. 
18484
18485         * class.cs: Added debugging code to track return values from
18486         interfaces. 
18487
18488 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18489
18490         * expression.cs (Is.DoResolve): If either side of the `is' is an
18491         interface, do not flag the warning.
18492
18493         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18494         for interfaces
18495
18496         * report.cs: Allow for --fatal to be used with --probe.
18497
18498         * typemanager.cs (NoTypes): Move the definition for the empty Type
18499         array here. 
18500
18501         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18502         properties. 
18503         (TypeContainer.DefineProxy): New function used to proxy to parent
18504         implementations when implementing interfaces.
18505         (TypeContainer.ParentImplements): used to lookup if our parent
18506         implements a public function that is required by an interface.
18507         (TypeContainer.VerifyPendingMethods): Hook this up.
18508
18509         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18510         `modules' and `assemblies' arraylists into arrays.  We only grow
18511         these are the very early start up of the program, so this improves
18512         the speedof LookupType (nicely measured).
18513
18514         * expression.cs (MakeByteBlob): Replaced unsafe code with
18515         BitConverter, as suggested by Paolo.
18516
18517         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18518         folding of string concatenation, but if either side is a string,
18519         and the other is not, then return null, and let the runtime use
18520         the concatenation on the string plus the object (using
18521         `Object.ToString'). 
18522
18523 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18524
18525         Constant Folding has been implemented now.
18526
18527         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18528         the error instead on types that are not supported in one's
18529         complement. 
18530
18531         * constant.cs (Constant and all children): New set of functions to
18532         perform implict and explicit conversions.
18533
18534         * ecore.cs (EnumConstant): Implement the new functions to perform
18535         conversion by proxying to the child expression.
18536
18537         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18538         own separate setting that can not be turned off from the command
18539         line using --unchecked or --checked and is only controlled using
18540         the checked/unchecked statements and expressions.  This setting is
18541         used by the constant folder to flag errors.
18542
18543         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18544         ConstantCheckState as well.   
18545
18546         During Resolve, they also have to flag the state, because the
18547         constant folder runs completely in the Resolve phase.
18548
18549         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18550         well.
18551
18552 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18553
18554         * cfold.cs: New file, this file contains the constant folder.
18555
18556         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18557         argument to track whether we are using the resulting address to
18558         load or store a value and provide better error messages. 
18559
18560         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18561         new AddressOf arguments.
18562
18563         * statement.cs (Foreach.EmitCollectionForeach): Update
18564
18565         * expression.cs (Argument.Emit): Call AddressOf with proper
18566         arguments to track usage.
18567
18568         (New.DoEmit): Call AddressOf with new arguments.
18569
18570         (Unary.Emit): Adjust AddressOf call.
18571
18572 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18573
18574         * cs-parser.jay (member_access): Change the case for pre-defined types
18575         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18576         this suggestion.
18577
18578         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18579         a method body.
18580
18581         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18582         essentially like methods and apply attributes like MethodImplOptions to them too.
18583
18584         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18585         not being null.
18586
18587         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18588         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18589         is the DeclSpace.
18590
18591         * Update code everywhere accordingly.
18592
18593         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18594
18595         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18596
18597 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18598
18599         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18600         try performing lookups against those instead of jumping straight into using
18601         the 'using' clauses.
18602
18603         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18604
18605         (LookupType): Perform lookups in implicit parents too.
18606
18607         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18608         sequence as RootContext.LookupType. 
18609
18610         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18611         the various cases of namespace lookups into this method.
18612
18613 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18614
18615         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18616         in positional arguments)
18617
18618         * class.cs (Operator): Update the AllowedModifiers to contain
18619         extern. 
18620
18621         * cs-parser.jay: Update operator declaration to allow for the
18622         operator body to be empty.
18623
18624         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18625         values. 
18626
18627 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18628
18629         * class.cs (Method.Emit): Label parameters.
18630
18631         * driver.cs: Return 1 or 0 as the program exit code.
18632
18633 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18634
18635         * expression.cs: Special case the `null' object when trying to
18636         auto-compute the type, as anything can be explicitly converted to
18637         that. 
18638
18639         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18640         spotting this Paolo.
18641
18642         (Expression.ImplicitNumericConversion): Perform comparissions of
18643         the type using the underlying type in the case of an enumeration
18644         rather than using the enumeration type for the compare.
18645
18646         Cope with the underlying == type case, which is not possible to
18647         catch before. 
18648
18649         (Expression.ConvertNumericExplicit): Perform comparissions of
18650         the type using the underlying type in the case of an enumeration
18651         rather than using the enumeration type for the compare.
18652
18653         * driver.cs: If the user does not supply an extension, assume .exe
18654
18655         * cs-parser.jay (if_statement): Rewrote so that we can track the
18656         location for the if statement.
18657
18658         * expression.cs (Binary.ConstantFold): Only concat strings when
18659         the operation is "+", not everything ;-)
18660
18661         * statement.cs (Statement.EmitBoolExpression): Take a location
18662         argument. 
18663         (If, While, Do): Track location.
18664
18665         * expression.cs (Binary.ResolveOperator): In the object + string
18666         case, I was missing a call to ConvertImplicit
18667
18668 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18669
18670         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18671         Location arguments. Ensure we use RootContext.LookupType to do our work
18672         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18673
18674         * interface.cs (PopulateMethod): Handle the type of the parameter being
18675         null gracefully.
18676
18677         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18678         have a params method with no fixed arguments and a call is made with no
18679         arguments.
18680
18681 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18682
18683         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18684         the verbatim-string-literal
18685
18686         * support.cs (InternalParameters.ParameterModifier): handle null
18687         fixed parameters.
18688         (InternalParameters.ParameterType): ditto.
18689
18690         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18691         duplicating the name of the variable parameter.
18692         (GetParameterByName): Fix bug where we were not looking up array
18693         paramters if they were the only present (thanks Paolo!).
18694         (GetParameterInfo): We only have an empty set of types if both
18695         fixed and array are set to null.
18696         (GetParameterInfo-idx): Handle FixedParameter == null
18697
18698         * cs-parser.jay: Handle the case where there is no catch
18699         statements (missing null test).
18700
18701 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18702
18703         * driver.cs (MainDriver): Be conservative on our command line
18704         handling.
18705
18706         Catch DirectoryNotFoundException when calling GetFiles.
18707
18708         (SplitPathAndPattern): Used to split the input specification into
18709         a path and a pattern that we can feed to Directory.GetFiles.
18710
18711 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18712
18713         * statement.cs (Fixed): Implement the last case of the Fixed
18714         statement (string handling).
18715
18716         * expression.cs (StringPtr): New class used to return a char * to
18717         a string;  Used by the Fixed statement.
18718
18719         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18720
18721         * expression.cs (Binary.ResolveOperator): Remove redundant
18722         MemberLookup pn parent type.
18723         Optimize union call, we do not need a union if the types are the same.
18724         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18725         type.
18726
18727         Specialize the use of MemberLookup everywhere, instead of using
18728         the default settings. 
18729
18730         (StackAlloc): Implement stackalloc keyword.
18731
18732         * cs-parser.jay: Add rule to parse stackalloc.
18733
18734         * driver.cs: Handle /h, /help, /?
18735
18736         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18737         before we supported unsafe code.
18738
18739         * makefile: add --unsafe to the self compilation of mcs.
18740
18741 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18742
18743         * expression.cs (PointerArithmetic): New class that is used to
18744         perform pointer arithmetic.
18745         (Binary.Resolve): Handle pointer arithmetic
18746         Handle pointer comparission.
18747         (ArrayPtr): Utility expression class that is used to take the
18748         address of an array.
18749
18750         (ElementAccess): Implement array access for pointers
18751
18752         * statement.cs (Fixed): Implement fixed statement for arrays, we
18753         are missing one more case before we are done.
18754
18755         * expression.cs (Indirection): Implement EmitAssign and set the
18756         ExprClass to Variable.  This allows pointer dereferences to be
18757         treated as variables, and to have values assigned to them.
18758
18759         * ecore.cs (Expression.StoreFromPtr): New utility function to
18760         store values dereferencing.
18761
18762 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18763
18764         * expression.cs (Binary.ResolveOperator): Ensure that we are
18765         not trying to operate on a void type - this fixes the reported
18766         bug.
18767
18768         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18769         the parent implementation is sealed.
18770
18771         * ../errors/cs0239.cs : Add.
18772
18773         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18774
18775         * typemanager.cs (unverifiable_code_type): Corresponds to 
18776         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18777         which have unsafe code in them.
18778
18779         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18780         unsafe context.
18781
18782 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18783
18784         * cs-tokenizer.cs: Add support for @"litreal strings"
18785
18786         Make tokenizer accept pre-processor directives
18787         on any column (remove the old C-like limitation). 
18788
18789         * rootcontext.cs (EmitCode): Emit any global attributes.
18790         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18791
18792         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18793
18794         * cs-parser.jay: Add support for global attributes.  
18795
18796 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18797
18798         * expression.cs (Indirection): New helper class.  Unary will
18799         create Indirection classes to be able to implement the
18800         IMemoryLocation interface on it.
18801
18802 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18803
18804         * cs-parser.jay (fixed_statement): reference the right statement.
18805
18806         * statement.cs (Fixed.Emit): Finish implementing the fixed
18807         statement for the &x case.
18808
18809 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * class.cs (Property.Define, Method.Define): Remove newslot when
18812         `implementing'.  
18813
18814         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18815         wrong.  NewSlot should only be used if the `new' keyword is present.
18816
18817         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18818         locating our system dir.  Sorry about this.
18819
18820 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18821
18822         * driver.cs (GetSystemDir): Compute correctly the location of our
18823         system assemblies.  I was using the compiler directory instead of
18824         the library directory.
18825
18826 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18827
18828         * expression.cs (BetterFunction): Put back in what Miguel commented out
18829         since it is the correct fix. The problem is elsewhere ;-)
18830
18831         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18832         parameters of the parms method are themselves compatible or not !
18833
18834         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18835         to check that a class implements an interface before saying that an implicit
18836         conversion was allowed. Use ImplementsInterface to do the checking.
18837
18838 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18839
18840         * class.cs (Method.Define): Track whether we are an explicit
18841         implementation or not.  And only call DefineMethodOverride if we
18842         are an explicit implementation.
18843
18844         (Property.DefineMethod): Ditto.
18845
18846 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18847
18848         * expression.cs (BetterFunction): Catch hideous bug which was
18849          preventing us from detecting ambiguous calls due to implicit casts i.e
18850         cs0121.
18851
18852 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18853
18854         * support.cs (Pair): Remove un-needed method.  I figured why I was
18855         getting the error in cs-parser.jay, the variable in a foreach loop
18856         is readonly, and the compiler does not really treat this as a variable.
18857
18858         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18859         instead of EQUALS in grammar.  
18860
18861         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18862
18863         * expression.cs (Unary.DoResolve): Check whether the argument is
18864         managed or not.
18865
18866 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18867
18868         * support.cs: Api for Pair to set a value.  Despite the fact that
18869         the variables are public the MS C# compiler refuses to compile
18870         code that accesses the field if the variable is part of a foreach
18871         statement. 
18872
18873         * statement.cs (Fixed): Begin implementation of the fixed
18874         statement.
18875
18876         (Block.AddVariable): Return the VariableInfo on success and null
18877         on failure instead of true/false. 
18878
18879         * cs-parser.jay (foreach): Catch errors on variables already
18880         defined (we were ignoring this value before) and properly unwind
18881         the block hierarchy
18882
18883         (fixed_statement): grammar for the fixed statement.
18884
18885 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18886
18887         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18888         pointer types to be incretemented.
18889
18890         (SizeOf): Implement.
18891
18892         * cs-parser.jay (pointer_member_access): Implement
18893         expr->IDENTIFIER production.
18894
18895         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18896         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18897         on safe contexts.
18898
18899         (Unary): Implement indirection.
18900
18901         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18902         use in non-unsafe context).
18903
18904         (SimpleName.DoResolve): Check for pointers in field access on safe
18905         contexts. 
18906
18907         (Expression.LoadFromPtr): Factor the load-indirect code in this
18908         function.  This was duplicated in UnboxCast and ParameterReference
18909
18910 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18911
18912         * expression.cs (ComposedCast): report an error if a pointer cast
18913         is used in a safe region.
18914
18915         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18916         pointer type casts in unsafe context.
18917
18918         * codegen.cs (EmitContext): Set up IsUnsafe.
18919
18920         * cs-parser.jay (non_expression_type): Add productions for pointer
18921         casts. 
18922
18923         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18924         code.  We should not use force into static mode if the method is
18925         not virtual.  Fixes bug in MIS
18926
18927         * statement.cs (Do.Emit, While.Emit, For.Emit,
18928         Statement.EmitBoolExpression): Add support to Do and While to
18929         propagate infinite loop as `I do return' semantics.
18930
18931         Improve the For case to also test for boolean constants.
18932
18933         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18934         to the list of attributes we can add.
18935
18936         Remove `EmitContext' argument.
18937
18938         * class.cs (Method.Define): Apply parameter attributes.
18939         (Constructor.Define): Apply parameter attributes.
18940         (MethodCore.LabelParameters): Move here the core of labeling
18941         parameters. 
18942
18943         * support.cs (ReflectionParameters.ParameterModifier,
18944         InternalParameters.ParameterModifier): Use IsByRef on the type and
18945         only return the OUT bit for these parameters instead of in/out/ref
18946         flags.
18947
18948         This is because I miss-understood things.  The ParameterInfo.IsIn
18949         and IsOut represent whether the parameter has the [In] and [Out]
18950         attributes set.  
18951
18952 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18953
18954         * ecore.cs (FieldExpr.Emit): Release temporaries.
18955
18956         * assign.cs (LocalTemporary.Release): new function.
18957
18958         * codegen.cs (EmitContext.GetTemporaryStorage,
18959         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18960         temporary storage.  Now we can "put back" localbuilders when we
18961         are done with them
18962
18963 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18964
18965         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18966         need to make a copy of the variable to generate verifiable code.
18967
18968 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18969
18970         * driver.cs: Compute dynamically the system directory.
18971
18972         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18973         Slower, but more generally useful.  Used by the abstract
18974         registering implementation. 
18975
18976         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18977         the rules for the special rule on Type/instances.  First check if
18978         we have the same name, and if so, try that special static path
18979         rather than the instance path.
18980
18981 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18982
18983         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18984         for, while and if.
18985
18986         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18987         Enum, ValueType, Delegate or Array for non-corlib compiles.
18988
18989         * cs-tokenizer.cs: Catch long identifiers (645)
18990
18991         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18992         piece of code.
18993
18994         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18995         fix, we were returning too early, so we were not registering
18996         pending methods from abstract classes.
18997
18998         Do not register pending methods if the class is abstract.
18999
19000         * expression.cs (Conditional.DoResolve): Report circular implicit
19001         conversions when we neecd to compute it for conditional
19002         expressions. 
19003
19004         (Is.DoResolve): If the expression is always of the provided type,
19005         flag warning 183.  If the expression can not ever be of the
19006         provided type flag warning 184.
19007
19008         * class.cs: Catch 169 as well.
19009
19010         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19011         read. 
19012
19013 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19014
19015         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19016
19017 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19018
19019         * interface.cs: (PopulateMethod): Check for pointers being defined
19020         only if the unsafe context is active.
19021         (PopulateProperty): ditto.
19022         (PopulateIndexer): ditto.
19023
19024         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19025         specified.  If pointers are present, make sure that they are
19026         present in an unsafe context.
19027         (Constructor, Constructor.Define): ditto.
19028         (Field, Field.Define): ditto.
19029         (Property, Property.Define): ditto.
19030         (Event, Event.Define): ditto.
19031
19032         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19033         hashtable if there are classes or structs defined.
19034
19035         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19036         code, as the constant resolution moved.
19037
19038         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19039         the metadata, so we can flag error 133. 
19040
19041         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19042         pointer is being declared in an unsafe context.
19043
19044 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19045
19046         * modifiers.cs (Modifiers.Check): Require a Location argument.
19047         Report error 227 for Unsafe use.
19048
19049         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19050
19051         * statement.cs (For.Emit): If the test is null, then report that
19052         we do `return', as we wont reach anything afterwards.
19053
19054         (Switch.SwitchGoverningType): Track the expression that matched
19055         the conversion.
19056
19057         * driver.cs: Allow negative numbers as an error code to flag.
19058
19059         * cs-parser.jay: Handle 1551.
19060
19061         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19062
19063 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19064
19065         * cs-parser.jay: Report 1518 (type declaration can only contain
19066         class, struct, interface, enum or delegate)
19067
19068         (switch_label): Report 1523 (keywords `case' or `default' must
19069         preced code)
19070
19071         (opt_switch_sections): Report 1522 (empty switch)
19072
19073         * driver.cs: Report 1515 (response file specified multiple times)
19074         Report 1516 (Source file specified multiple times).
19075
19076         * expression.cs (Argument.Resolve): Signal 1510
19077
19078         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19079         access not allowed in static code)
19080
19081 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19082
19083         * typemanager.cs (IsPointerType): Utility method which we are going
19084         to need a lot.
19085
19086         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19087         the object type, so we take care of that.
19088
19089         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19090
19091         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19092         added to non-params parameters :-)
19093
19094         * typemanager.cs (CSharpName): Include 'void' type too. 
19095
19096         (void_ptr_type): Include in the set of core types.
19097
19098         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19099         duplicating code.
19100
19101         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19102         an unsafe context.
19103
19104         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19105         completely forgotten about it.
19106
19107 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19108
19109         * cs-parser.jay (pointer_type): Add. This begins our implementation
19110         of parsing rules for unsafe code.
19111
19112         (unsafe_statement): Implement.
19113
19114         (embedded_statement): Modify to include the above.
19115
19116         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19117
19118         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19119         if the current context is an unsafe one.
19120
19121         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19122         are handled differently, we need separate rules for them.
19123
19124         (local_variable_declaration): Update to use local_variable_pointer_type
19125         to allow variable declarations of unmanaged pointer types.
19126
19127         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19128         in unsafe contexts.
19129
19130         * ../errors/cs0214.cs : Add.
19131
19132 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19133
19134         * makefile: remove 'response' file when cleaning.
19135
19136 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * cs-parser.jay: Report 1524.
19139
19140 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19141
19142         * typemanager.cs (RegisterMethod): drop checking if we have
19143         registered this from here
19144
19145 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19146
19147         * class.cs (Method.EmitDestructor): Implement calling our base
19148         destructor. 
19149
19150         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19151         value of InFinally.
19152
19153         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19154         this routine and will wrap the call in a try/catch block.  Deal
19155         with the case.
19156
19157 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19158
19159         * ecore.cs (Expression.MemberLookup): instead of taking a
19160         parameter `same_type' that was used to tell whether we could
19161         access private members we compute our containing type from the
19162         EmitContext.
19163
19164         (FieldExpr): Added partial support for volatile fields.  This does
19165         not work for volatile fields exposed from assemblies, as I can not
19166         figure out how to extract the modreq from it.
19167
19168         Updated all the source files to use this.
19169
19170         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19171         because it is referenced by MemberLookup very often. 
19172
19173 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19174
19175         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19176         TypeBuilder.GetCustomAttributes to retrieve what we need.
19177
19178         Get rid of redundant default_member_attr_type as this is the same as
19179         default_member_type which already exists.
19180
19181         * interface.cs, attribute.cs : Update accordingly.
19182
19183 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19184
19185         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19186         work for TYpeBuilders though.  Ravi, can you please fix this?
19187
19188         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19189
19190         * expression.cs (Argument.Emit): Handle the case of ref objects
19191         being passed to ref functions;  
19192
19193         (ParameterReference.EmitLoad): Loads the content of the pointer
19194         without dereferencing.
19195
19196 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19197
19198         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19199
19200 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19201
19202         * class.cs (Indexer.DefineMethod): Incorporate the interface
19203         type in the name of the method if we are doing explicit interface
19204         implementation.
19205
19206         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19207
19208         (BetterConversion): Fix extremely trivial bug where we were referring to
19209         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19210         again !
19211
19212         * ../errors/bug16.cs : Add although we have fixed it.
19213
19214 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19215
19216         * expression.cs (BaseIndexer): Begin implementation.
19217
19218         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19219
19220         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19221         production directly to remove a shift/reduce, and implement
19222         explicit interface implementation.
19223
19224         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19225         after a floating point suffix.
19226
19227         * expression.cs (DoNumericPromotions): Improved the conversion for
19228         uint/uint.  If we have a constant, we avoid doing a typecast to a
19229         larger type.
19230
19231         * class.cs (Indexer): Implement explicit interface implementation
19232         for indexers.
19233
19234 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19235
19236         * class.cs: make the default instance constructor public and hidebysig.
19237
19238 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19239
19240         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19241         so we can call it from elsewhere.
19242
19243         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19244         we emit it internally if the class has a defined indexer; otherwise the user
19245         emits it by decorating the class definition with the DefaultMemberAttribute.
19246
19247         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19248         attribute is not used on a type which defines an indexer.
19249
19250         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19251         character when we skip whitespace.
19252
19253         * ../errors/cs0646.cs : Add.
19254
19255 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19256
19257         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19258         again. 
19259
19260         * makefile: Add practical target `mcs3.exe' which builds the third
19261         generation compiler. 
19262
19263         * expression.cs (New): Fix structures constructor calling.
19264
19265         * class.cs (Property, Method, Indexer): Emit Final flag on the
19266         method if we are an interface implementation and we are not
19267         abstract. 
19268
19269         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19270         whether this property is referencing a `base' method.
19271
19272         * expression.cs (Invocation.EmitCall): take an extra argument:
19273         is_base, this is used to determine whether the `call' or
19274         `callvirt' opcode should be used.
19275
19276
19277         * delegate.cs: update EmitCall.
19278
19279         * class.cs (Method.Define): Set NewSlot for the cases where we are
19280         not implementing an interface method.
19281
19282         (Property.Define): ditto.
19283
19284 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19285
19286         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19287         'r'.  Allows mcs to parse itself fully.
19288
19289 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19290
19291         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19292         of the number of initializers that require the InitializeArray method.
19293
19294         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19295         update the above field where necessary.
19296
19297         (MakeByteBlob): Update accordingly.
19298
19299         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19300         greater than 2.
19301
19302         (EmitDynamicInitializers): Update in accordance with the new optimization.
19303
19304         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19305         same OpCode applies.
19306
19307         * cs-parser.jay : Fix some glaring errors I introduced.
19308
19309 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19310
19311         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19312         so that we can check for name clashes there too.
19313
19314         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19315         for interface indexers.
19316
19317         * interfaces.cs (Define): Emit the default member attribute.
19318
19319         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19320         variable was being referred to while setting the value ;-)
19321
19322 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19323
19324         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19325         byte-by-byte information when we know the data is zero.
19326
19327         Make the block always a multiple of 4, because
19328         DefineInitializedData has a bug.
19329
19330         * assign.cs: Fix, we should assign from the temporary, not from
19331         the source. 
19332
19333         * expression.cs (MakeByteBlob): Fix my incorrect code.
19334
19335 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * typemanager.cs (EnumToUnderlying): This function is used to get
19338         the underlying type from an enumeration, because it does not
19339         always work. 
19340
19341         * constant.cs: Use the I4_S form for values between -128 and 127.
19342
19343         * statement.cs (Block.LookupLabel): Looks up a label.
19344         (Block): Drop support for labeled blocks.
19345
19346         (LabeledStatement): New kind of statement that represents a label
19347         only.
19348
19349         (Goto): Finally implement this bad boy.
19350
19351         * cs-parser.jay: Update to reflect new mechanism to implement
19352         labels.
19353
19354 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19355
19356         * codegen.cs (EmitContext.This): a codegen property that keeps the
19357         a single instance of this instead of creating many different this
19358         instances. 
19359
19360         * delegate.cs (Delegate.DoResolve): Update to use the property;
19361
19362         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19363
19364         * expression.cs (BaseAccess.DoResolve): Ditto.
19365
19366 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19367
19368         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19369         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19370
19371         (InitCoreTypes): Update accordingly.
19372
19373         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19374         so we can quickly store the state.
19375
19376         (ApplyAttributes): Set the correct implementation flags
19377         for InternalCall methods.
19378
19379 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19380
19381         * expression.cs (EmitCall): if a method is not virtual, then do
19382         not use callvirt on it.
19383
19384         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19385         user defined stuff) requires the use of stobj, which takes an
19386         address on the stack instead of an array and an index.  So emit
19387         the Ldelema operation for it.
19388
19389         (EmitStoreOpcode): Use stobj for valuetypes.
19390
19391         (UnaryMutator.EmitCode): Use the right 1 value depending on
19392         whether we are dealing with int64/uint64, float or doubles.
19393
19394         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19395         constructors that I implemented last night.
19396
19397         (Constructor.IsDefault): Fix to work properly for static
19398         constructors.
19399
19400         * cs-parser.jay (CheckDef): report method signature errors.
19401         Update error number 103 to be 132.
19402
19403         * decl.cs: New AdditionResult enumeration value: MethodExists.
19404         Although we do this check for methods later on in the semantic
19405         analysis, catching repeated default constructors is so easy that
19406         we catch these here. 
19407
19408         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19409         promotions code.
19410
19411         (ParameterReference.EmitAssign, Emit): handle
19412         bools as bytes.
19413
19414         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19415         (ArrayAccess.EmitStoreOpcode): ditto.
19416
19417         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19418
19419         * expression.cs (MakeByteBlob): Complete all the missing types
19420         (uint, short, ushort, byte, sbyte)
19421
19422         * class.cs: Only init instance field initializers on instance
19423         constructors. 
19424
19425         Rename `constructors' to instance_constructors. 
19426
19427         (TypeContainer.AddConstructor): Only add constructors to the list
19428         if it is not static.
19429
19430         Make sure that we handle default_static_constructor independently
19431         everywhere where we handle instance_constructors
19432
19433 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19434
19435         * class.cs: Do not lookup or create a base initializer for a
19436         static constructor.
19437
19438         (ConstructorInitializer.Resolve): use the proper type to lookup
19439         for constructors.
19440
19441         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19442
19443         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19444         in DeclSpace. 
19445
19446         * decl.cs: CloseType is now an virtual method, the default
19447         implementation just closes this type.
19448
19449 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19450
19451         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19452         to PreserveSig by default. Also emit HideBySig on such methods.
19453
19454         Basically, set the defaults to standard values.
19455
19456         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19457         argument, if candidate is better, it can't be worse than the best !
19458
19459         (Invocation): Re-write bits to differentiate between methods being
19460         applicable in their expanded form and their normal form - for params
19461         methods of course.
19462
19463         Get rid of use_standard everywhere as only standard conversions are allowed
19464         in overload resolution. 
19465
19466         More spec conformance.
19467
19468 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19469
19470         * driver.cs: Add --timestamp, to see where the compiler spends
19471         most of its time.
19472
19473         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19474         `this' in static code.
19475
19476         (SimpleName.DoResolve): Implement in terms of a helper function
19477         that allows static-references to be passed upstream to
19478         MemberAccess.
19479
19480         (Expression.ResolveWithSimpleName): Resolve specially simple
19481         names when called by MemberAccess to implement the special
19482         semantics. 
19483
19484         (Expression.ImplicitReferenceConversion): Handle conversions from
19485         Null to reference types before others, as Null's type is
19486         System.Object. 
19487
19488         * expression.cs (Invocation.EmitCall): Handle the special case of
19489         calling methods declared on a reference type from a ValueType
19490         (Base classes System.Object and System.Enum)
19491
19492         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19493         the left hand side is a TypeExpr, not on every enumeration. 
19494
19495         (Binary.Resolve): If types are reference types, then do a cast to
19496         object on operators != and == of both arguments.
19497
19498         * typemanager.cs (FindMembers): Extract instance and static
19499         members if requested.
19500
19501         * interface.cs (PopulateProperty): Use void_type instead of null
19502         as the return type for the setter method.
19503
19504         (PopulateIndexer): ditto.
19505
19506 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19507
19508         * support.cs (ReflectionParameters): Fix minor bug where we
19509         were examining the wrong parameter for the ParamArray attribute.
19510
19511         Cope with requests for the type of the parameter at position
19512         greater than the params parameter's. We now return the element
19513         type of the params array as that makes more sense.
19514
19515         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19516         accordingly as we no longer have to extract the element type
19517         ourselves.
19518
19519         (Invocation.OverloadResolve): Update.
19520
19521 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19522
19523         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19524         against IEnumerator, test whether the return value is a descendant
19525         of the IEnumerator interface.
19526
19527         * class.cs (Indexer.Define): Use an auxiliary method to implement
19528         the other bits of the method definition.  Begin support for
19529         explicit interface implementation.
19530
19531         (Property.DefineMethod): Use TypeManager.void_type instead of null
19532         for an empty return value.
19533
19534 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19535
19536         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19537         dealing with a FieldExpr which is composed of a FieldBuilder, in
19538         the code path we did extract the constant, but we should have
19539         obtained the underlying value to be able to cast it (otherwise we
19540         end up in an infinite loop, this is what Ravi was running into).
19541
19542         (ArrayCreation.UpdateIndices): Arrays might be empty.
19543
19544         (MemberAccess.ResolveMemberAccess): Add support for section
19545         14.5.4.1 that deals with the special case of E.I when E is a type
19546         and something else, that I can be a reference to a static member.
19547
19548         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19549         handle a particular array type to create byte blobs, it is just
19550         something we dont generate byteblobs for.
19551
19552         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19553         arguments. 
19554
19555         * location.cs (Push): remove the key from the hashtable that we
19556         are about to add.   This happens for empty files.
19557
19558         * driver.cs: Dispose files after we have parsed them.
19559
19560         (tokenize): new function that only runs the tokenizer on its
19561         input, for speed testing.
19562
19563 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19564
19565         * class.cs (Event.Define): Define the private field only if there
19566         are no accessors defined.
19567
19568         * expression.cs (ResolveMemberAccess): If there is no associated
19569         field with the event, that means we have an event defined with its
19570         own accessors and we should flag error cs0070 since transforming
19571         ourselves into a field is not valid in that case.
19572
19573         * ecore.cs (SimpleName.DoResolve): Same as above.
19574
19575         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19576         and charset to sane values.
19577
19578 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19579
19580         * assign.cs (DoResolve): Perform check on events only if they 
19581         are being accessed outside the declaring type.
19582
19583         * cs-parser.jay (event_declarations): Update rules to correctly
19584         set the type of the implicit parameter etc.
19585
19586         (add_accessor, remove_accessor): Set current local parameters.
19587
19588         * expression.cs (Binary): For delegate addition and subtraction,
19589         cast the return value from the method into the appropriate delegate
19590         type.
19591
19592 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19593
19594         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19595         of these as the workaround is unnecessary.
19596
19597         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19598         delegate data - none of that is needed at all.
19599
19600         Re-write bits to extract the instance expression and the delegate method
19601         correctly.
19602
19603         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19604         on delegates too.
19605
19606         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19607         of attaching attributes instead of duplicating code everywhere.
19608
19609         * everywhere : Update code to do attribute emission using the above method.
19610
19611 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19612
19613         * expression.cs (IsParamsMethodApplicable): if there are not
19614         parameters, return immediately.
19615
19616         * ecore.cs: The 0 literal can be implicity converted to an enum
19617         type. 
19618
19619         (SimpleName.DoResolve): First lookup the type, then lookup the
19620         members. 
19621
19622         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19623         want to get its address.  If the InstanceExpression is not
19624         addressable, store the result in a temporary variable, then get
19625         the address of it.
19626
19627         * codegen.cs: Only display 219 errors on warning level or above. 
19628
19629         * expression.cs (ArrayAccess): Make it implement the
19630         IMemoryLocation interface.
19631
19632         (Binary.DoResolve): handle the operator == (object a, object b)
19633         and operator != (object a, object b) without incurring into a
19634         BoxedCast (because 5 != o should never be performed).
19635
19636         Handle binary enumerator operators.
19637
19638         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19639         value type, otherwise use Ldelem_ref.
19640
19641         Use precomputed names;
19642
19643         (AddressOf): Implement address of
19644
19645         * cs-parser.jay (labeled_statement): Fix recursive block
19646         addition by reworking the production.
19647
19648         * expression.cs (New.DoEmit): New has a special case:
19649                 
19650                  If we are dealing with a ValueType, we have a few
19651                  situations to deal with:
19652                 
19653                     * The target of New is a ValueType variable, that is
19654                       easy, we just pass this as the variable reference
19655                 
19656                     * The target of New is being passed as an argument,
19657                       to a boxing operation or a function that takes a
19658                       ValueType.
19659                 
19660                       In this case, we need to create a temporary variable
19661                       that is the argument of New.
19662
19663
19664 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19665
19666         * rootcontext.cs (LookupType): Check that current_type is not null before
19667         going about looking at nested types.
19668
19669         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19670         not implement the IAssignMethod interface any more.
19671
19672         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19673         where we tranform them into FieldExprs if they are being resolved from within
19674         the declaring type.
19675
19676         * ecore.cs (SimpleName.DoResolve): Do the same here.
19677
19678         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19679
19680         * ../errors/bug10.cs : Add.
19681
19682         * ../errors/cs0070.cs : Add.
19683
19684         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19685
19686         * assign.cs : Get rid of EventIsLocal everywhere.
19687
19688 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19689
19690         * ecore.cs (ConvertIntLiteral): finished the implementation.
19691
19692         * statement.cs (SwitchLabel): Convert the value we are using as a
19693         key before looking up the table.
19694
19695 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19696
19697         * codegen.cs (EmitTopBlock): Require a Location argument now.
19698
19699         * cs-parser.jay (constructor_declarator): We need to setup
19700         current_local_parameters before we parse the
19701         opt_constructor_initializer, to allow the variables to be bound
19702         to the constructor arguments.
19703
19704         * rootcontext.cs (LookupType): First lookup nested classes in our
19705         class and our parents before we go looking outside our class.
19706
19707         * expression.cs (ConstantFold): Extract/debox the values at the
19708         beginnning. 
19709
19710         * rootcontext.cs (EmitCode): Resolve the constants first before we
19711         resolve the types.  This is not really needed, but it helps debugging.
19712
19713         * statement.cs: report location.
19714
19715         * cs-parser.jay: pass location to throw statement.
19716
19717         * driver.cs: Small bug fix.
19718
19719         * report.cs: Updated format to be 4-zero filled digits.
19720
19721 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19722
19723         * expression.cs (CheckIndices): Fix minor bug where the wrong
19724         variable was being referred to ;-)
19725
19726         (DoEmit): Do not call EmitStaticInitializers when the 
19727         underlying type is System.Object.
19728
19729 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19730
19731         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19732         and do the usual workaround for SRE.
19733
19734         * class.cs (MyEventBuilder.EventType): New member to get at the type
19735         of the event, quickly.
19736
19737         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19738
19739         * assign.cs (Assign.DoResolve): Handle the case when the target
19740         is an EventExpr and perform the necessary checks.
19741
19742         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19743         interface.
19744
19745         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19746
19747         (EventExpr): Set the type in the constructor itself since we 
19748         are meant to be born fully resolved.
19749
19750         (EventExpr.Define): Revert code I wrote earlier.
19751                 
19752         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19753         instance expression is null. The instance expression is a This in that case
19754         or a null, depending on whether it is a static method or not.
19755
19756         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19757         refers to more than one method.
19758
19759         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19760         and accordingly flag errors.
19761
19762 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19763
19764         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19765
19766 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19767
19768         * location.cs (ToString): Provide useful rutine.
19769
19770 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19771
19772         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19773         objects, return the actual integral boxed.
19774
19775         * statement.cs (SwitchLabel): define an ILLabel for each
19776         SwitchLabel. 
19777
19778         (Switch.CheckSwitch): If the value is a Literal, extract
19779         the underlying literal.
19780
19781         Also in the unused hashtable we had, add the SwitchLabel so we can
19782         quickly look this value up.
19783
19784         * constant.cs: Implement a bunch of new constants.  Rewrite
19785         Literal based on this.  Made changes everywhere to adapt to this.
19786
19787         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19788         dereferencing array only once, and also copes with enumrations.
19789
19790         bytes are two bytes wide, not one.
19791
19792         (Cast): Perform constant conversions.
19793
19794         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19795         wrappers to the literals here.
19796
19797         * expression.cs (DoNumericPromotions): long literals can converted
19798         to ulong implicity (this is taken care of elsewhere, but I was
19799         missing this spot).
19800
19801         * ecore.cs (Expression.Literalize): Make the return type Literal,
19802         to improve type checking.
19803
19804         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19805
19806 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19807
19808         * literal.cs: Revert code from ravi that checked the bounds.  The
19809         bounds are sane by the definition of the type itself. 
19810
19811         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19812         need to actually look up in our parent hierarchy for interfaces
19813         implemented. 
19814
19815         * const.cs: Use the underlying type for enumerations
19816
19817         * delegate.cs: Compute the basename for the delegate creation,
19818         that should fix the delegate test case, and restore the correct
19819         Type Lookup semantics in rootcontext
19820
19821         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19822         referencing a nested type with the Reflection API is using the "+"
19823         sign. 
19824
19825         * cs-parser.jay: Do not require EOF token at the end.
19826
19827 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19828
19829         * rootcontext.cs (LookupType): Concatenate type names with
19830         a '.' instead of a '+' The test suite passes again.
19831
19832         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19833         field of the enumeration.
19834
19835         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19836         the case when the member is an EventExpr.
19837
19838         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19839         static has an associated instance expression.
19840
19841         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19842
19843         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19844
19845         * class.cs (Event.Define): Register event and perform appropriate checks
19846         for error #111.
19847
19848         We define the Add and Remove methods even if the use provides none because
19849         in that case, we provide default implementations ourselves.
19850
19851         Define a private field of the type of the event. This is done by the CSC compiler
19852         and we should be doing it too ;-)
19853
19854         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19855         More methods we use in code we generate.
19856
19857         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19858         is important.
19859
19860         (InitCoreTypes): Update accordingly for the above.
19861
19862         * class.cs (Event.Emit): Generate code for default accessors that we provide
19863
19864         (EmitDefaultMethod): Do the job in the above.
19865
19866         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19867         appropriate place.
19868
19869 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19870
19871         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19872         builders even if we were missing one.
19873
19874         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19875         pass the Basename as our class name instead of the Name.  The
19876         basename will be correctly composed for us.
19877
19878         * parameter.cs (Paramters): Now takes a Location argument.
19879
19880         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19881         make all the code call directly LookupType in RootContext and take
19882         this chance to pass the Location information everywhere.
19883
19884         * Everywhere: pass Location information.
19885
19886 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19887
19888         * class.cs (Constructor.Define): Updated way of detecting the
19889         length of the parameters.
19890
19891         (TypeContainer.DefineType): Use basename as the type name for
19892         nested types.
19893
19894         (TypeContainer.Define): Do not recursively define types here, as
19895         definition is taken care in order by the RootContext.
19896
19897         * tree.cs: Keep track of namespaces in a per-file basis.
19898
19899         * parameter.cs (Parameter.ComputeSignature): Update to use
19900         DeclSpace. 
19901
19902         (Parameters.GetSignature): ditto.
19903
19904         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19905         instead of a TypeContainer.
19906
19907         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19908         resolve names.  Because we need to be resolve in our context, not
19909         our parents.
19910
19911         * driver.cs: Implement response files.
19912
19913         * class.cs (TypeContainer.DefineType): If we are defined, do not
19914         redefine ourselves.
19915
19916         (Event.Emit): Emit the code for add/remove handlers.
19917         (Event.Define): Save the MethodBuilders for add/remove.
19918
19919         * typemanager.cs: Use pair here too.
19920
19921         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19922         DictionaryEntry requires the first argument to be non-null.  
19923
19924         (enum_declaration): Compute full name for registering the
19925         enumeration.
19926
19927         (delegate_declaration): Instead of using
19928         formal_parameter_list, use opt_formal_parameter_list as the list
19929         can be empty.
19930
19931         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19932         (EventParsing): New property that controls whether `add' and
19933         `remove' are returned as tokens or identifiers (for events);
19934
19935 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19936
19937         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19938         use MyEventBuilder only and let it wrap the real builder for us.
19939
19940         (MyEventBuilder): Revamp constructor etc.
19941
19942         Implement all operations that we perform on EventBuilder in precisely the same
19943         way here too.
19944
19945         (FindMembers): Update to use the EventBuilder member.
19946
19947         (Event.Emit): Update accordingly.
19948
19949 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19950
19951         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19952         by calling the appropriate methods.
19953
19954         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19955         useful.
19956
19957         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19958
19959 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19960
19961         * delegate.cs (Delegate.Populate): Check that the return type
19962         and various parameters types are indeed accessible.
19963
19964         * class.cs (Constructor.Define): Same here.
19965
19966         (Field.Define): Ditto.
19967
19968         (Event.Define): Ditto.
19969
19970         (Operator.Define): Check that the underlying Method defined itself
19971         correctly - so it's MethodBuilder should not be null.
19972
19973         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19974         expression happens to be null.
19975
19976         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19977         members but as of now we don't seem to be able to do anything really useful with it.
19978
19979         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19980         not the EventBuilder.
19981
19982 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19983
19984         * cs-tokenizer.cs: Add support for defines.
19985         Add support for #if, #elif, #else, #endif
19986
19987         (eval_var): evaluates a variable.
19988         (eval): stubbed for evaluating functions.
19989
19990         * cs-parser.jay: Pass the defines information
19991
19992         * driver.cs: Add --define command line option.
19993
19994         * decl.cs: Move MemberCore here.
19995
19996         Make it the base class for DeclSpace.  This allows us to catch and
19997         report 108 and 109 for everything now.
19998
19999         * class.cs (TypeContainer.Define): Extract all the members
20000         before populating and emit the warning 108 (new keyword required
20001         to override) instead of having each member implement this.
20002
20003         (MemberCore.Define): New abstract method, we will be using this in
20004         the warning reporting engine in Populate.
20005
20006         (Operator.Define): Adjust to new MemberCore protocol. 
20007
20008         * const.cs (Const): This does not derive from Expression, it is a
20009         temporary object we use to create fields, it is a MemberCore. 
20010
20011         * class.cs (Method.Define): Allow the entry point to be in a
20012         specific class.
20013
20014         * driver.cs: Rewrite the argument handler to clean it up a bit.
20015
20016         * rootcontext.cs: Made it just an auxiliary namespace feature by
20017         making everything static.
20018
20019         * driver.cs: Adapt code to use RootContext type name instead of
20020         instance variable.
20021
20022         * delegate.cs: Remove RootContext argument.
20023
20024         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20025         argument. 
20026
20027         * class.cs (Event.Define): The lookup can fail.
20028
20029         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20030
20031         * expression.cs: Resolve the this instance before invoking the code.
20032
20033 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20034
20035         * cs-parser.jay: Add a production in element_access that allows
20036         the thing to become a "type" reference.  This way we can parse
20037         things like "(string [])" as a type.
20038
20039         Note that this still does not handle the more complex rules of
20040         casts. 
20041
20042
20043         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20044
20045         * ecore.cs: (CopyNewMethods): new utility function used to
20046         assemble the list of methods from running FindMembers.
20047
20048         (MemberLookup): Rework FindMembers so that 
20049
20050 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20051
20052         * class.cs (TypeContainer): Remove Delegates who fail to be
20053         defined.
20054
20055         * delegate.cs (Populate): Verify that we dont get null return
20056         values.   TODO: Check for AsAccessible.
20057
20058         * cs-parser.jay: Use basename to emit error 574 (destructor should
20059         have the same name as container class), not the full name.
20060
20061         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20062         possible representation.  
20063
20064         Also implements integer type suffixes U and L.
20065
20066 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20067
20068         * expression.cs (ArrayCreation.DoResolve): We need to do the
20069         argument resolution *always*.
20070
20071         * decl.cs: Make this hold the namespace.  Hold the root context as
20072         well.
20073         (LookupType): Move here.
20074
20075         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20076
20077         * location.cs (Row, Name): Fixed the code, it was always returning
20078         references to the first file.
20079
20080         * interface.cs: Register properties defined through interfaces.
20081
20082         * driver.cs: Add support for globbing on the command line
20083
20084         * class.cs (Field): Make it derive from MemberCore as well.
20085         (Event): ditto.
20086
20087 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20088
20089         * class.cs (Event::Define): Check that the type of the event is a delegate
20090         type else flag error #66.
20091
20092         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20093         same.
20094
20095         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20096         values of EntryPoint, CharSet etc etc.
20097
20098         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20099
20100         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20101         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20102         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20103         which needs this to do its work.
20104
20105         * ../errors/cs0066.cs : Add.
20106
20107 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20108
20109         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20110         helper functions.
20111
20112         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20113         clears out the parameters field.
20114         (MemberSignatureCompare): Cleanup
20115
20116         (MemberCore): New base class used to share code between MethodCore
20117         and Property.
20118
20119         (RegisterRequiredImplementations) BindingFlags.Public requires
20120         either BindingFlags.Instace or Static.  Use instance here.
20121
20122         (Property): Refactored code to cope better with the full spec.
20123
20124         * parameter.cs (GetParameterInfo): Return an empty array instead
20125         of null on error.
20126
20127         * class.cs (Property): Abstract or extern properties have no bodies.
20128
20129         * parameter.cs (GetParameterInfo): return a zero-sized array.
20130
20131         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20132         method modifier validation to the typecontainer so we can reuse
20133         this on properties.
20134
20135         (MethodCore.ParameterTypes): return an empty sized array of types.
20136
20137         (Property.Define): Test property modifier validity.
20138
20139         Add tests for sealed/override too.
20140
20141         (Method.Emit): abstract or extern methods have no bodies.
20142
20143 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20144
20145         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20146         thing.
20147
20148         (Method::Define, ::Emit): Modify accordingly.
20149
20150         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20151
20152         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20153
20154         * makefile: Pass in /unsafe.
20155
20156 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20157
20158         * class.cs (MakeKey): Kill routine.
20159
20160         * class.cs (TypeContainer.Define): Correctly define explicit
20161         method implementations (they require the full interface name plus
20162         the method name).
20163
20164         * typemanager.cs: Deply the PtrHashtable here and stop using the
20165         lame keys.  Things work so much better.
20166
20167         This of course broke everyone who depended on `RegisterMethod' to
20168         do the `test for existance' test.  This has to be done elsewhere.
20169
20170         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20171         the object stupid Equals method (because, that like fails all over
20172         the place).  We still do not use it.
20173
20174         * class.cs (TypeContainer.SetRequiredInterface,
20175         TypeContainer.RequireMethods): Killed these two routines and moved
20176         all the functionality to RegisterRequiredImplementations.
20177
20178         (TypeContainer.RegisterRequiredImplementations): This routine now
20179         registers all the implementations required in an array for the
20180         interfaces and abstract methods.  We use an array of structures
20181         which can be computed ahead of time to reduce memory usage and we
20182         also assume that lookups are cheap as most classes will not
20183         implement too many interfaces.
20184
20185         We also avoid creating too many MethodSignatures.
20186
20187         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20188         clear the "pending" bit if we find that there are problems with
20189         the declaration.
20190
20191         (TypeContainer.VerifyPendingMethods): Update to report errors of
20192         methods that look like implementations but are not.
20193
20194         (TypeContainer.Define): Add support for explicit interface method
20195         implementation. 
20196
20197 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20198
20199         * typemanager.cs: Keep track of the parameters here instead of
20200         being a feature of the TypeContainer.
20201
20202         * class.cs: Drop the registration of parameters here, as
20203         InterfaceMethods are also interface declarations.
20204
20205         * delegate.cs: Register methods with the TypeManager not only with
20206         the TypeContainer.  This code was buggy.
20207
20208         * interface.cs: Full registation here.
20209
20210 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * expression.cs: Remove reducer for binary expressions, it can not
20213         be done this way.
20214
20215         * const.cs: Put here the code that used to go into constant.cs
20216
20217         * constant.cs: Put here the code for constants, this is a new base
20218         class for Literals.
20219
20220         * literal.cs: Make Literal derive from Constant.
20221
20222 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20223
20224         * statement.cs (Return.Emit): Report error 157 if the user
20225         attempts to return from a finally block.
20226
20227         (Return.Emit): Instead of emitting a return, jump to the end of
20228         the function.
20229
20230         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20231         LocalBuilder to store the result of the function.  ReturnLabel is
20232         the target where we jump.
20233
20234
20235 2001-12-09  Radek Doulik  <rodo@ximian.com>
20236
20237         * cs-parser.jay: remember alias in current namespace
20238
20239         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20240         namespaces
20241
20242         * class.cs (LookupAlias): lookup alias in my_namespace
20243
20244         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20245         aliases hashtable
20246         (LookupAlias): lookup alias in this and if needed in parent
20247         namespaces
20248
20249 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20250
20251         * support.cs: 
20252
20253         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20254         making things static.  I need this to avoid passing the
20255         TypeContainer when calling ParameterType.
20256
20257         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20258         that did string manipulation to compute the type and then call
20259         GetType.  Use Parameter.ParameterType instead.
20260
20261         * cs-tokenizer.cs: Consume the suffix for floating values.
20262
20263         * expression.cs (ParameterReference): figure out whether this is a
20264         reference parameter or not.  Kill an extra variable by computing
20265         the arg_idx during emission.
20266
20267         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20268         function that returns whether a parameter is an out/ref value or not.
20269
20270         (Parameter.ParameterType): The type of the parameter (base,
20271         without ref/out applied).
20272
20273         (Parameter.Resolve): Perform resolution here.
20274         (Parameter.ExternalType): The full type (with ref/out applied).
20275
20276         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20277         support for expressions on the using statement.
20278
20279 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20280
20281         * statement.cs (Using.EmitLocalVariableDecls): Split the
20282         localvariable handling of the using statement.
20283
20284         (Block.EmitMeta): Keep track of variable count across blocks.  We
20285         were reusing slots on separate branches of blocks.
20286
20287         (Try.Emit): Emit the general code block, we were not emitting it. 
20288
20289         Check the type of the declaration to be an IDisposable or
20290         something that can be implicity converted to it. 
20291
20292         Emit conversions if required.
20293
20294         * ecore.cs (EmptyExpression): New utility class.
20295         (Expression.ImplicitConversionExists): New utility function.
20296
20297 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20298
20299         * statement.cs (Using): Implement.
20300
20301         * expression.cs (LocalVariableReference): Support read only variables.
20302
20303         * statement.cs: Remove the explicit emit for the Leave opcode.
20304         (VariableInfo): Add a readonly field.
20305
20306 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * ecore.cs (ConvCast): new class used to encapsulate the various
20309         explicit integer conversions that works in both checked and
20310         unchecked contexts.
20311
20312         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20313         properly generate the overflow opcodes.
20314
20315 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20316
20317         * statement.cs: The correct type for the EmptyExpression is the
20318         element_type, not the variable type.  Ravi pointed this out.
20319
20320 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20321
20322         * class.cs (Method::Define): Handle PInvoke methods specially
20323         by using DefinePInvokeMethod instead of the usual one.
20324
20325         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20326         above to do the task of extracting information and defining the method.
20327
20328 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20329
20330         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20331         of the condition for string type.
20332
20333         (Emit): Move that here. 
20334
20335         (ArrayCreation::CheckIndices): Keep string literals in their expression
20336         form.
20337
20338         (EmitDynamicInitializers): Handle strings appropriately.
20339
20340 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20341
20342         * codegen.cs (EmitContext): Replace multiple variables with a
20343         single pointer to the current Switch statement.
20344
20345         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20346         EmitContext.
20347
20348 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20349
20350         * statement.cs 
20351
20352         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20353         default'.
20354
20355         (Foreach.Emit): Foreach on arrays was not setting
20356         up the loop variables (for break/continue).
20357
20358         (GotoCase): Semi-implented.
20359
20360 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20361
20362         * attribute.cs (CheckAttribute): Handle system attributes by using
20363         Attribute.GetAttributes to examine information we need.
20364
20365         (GetValidPlaces): Same here.
20366
20367         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20368
20369         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20370
20371         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20372
20373         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20374
20375         (Method::Emit): Handle the case when we are a PInvoke method.
20376
20377 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * expression.cs: Use ResolveWithSimpleName on compound names.
20380
20381 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20382
20383         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20384         before trying to reduce it.
20385
20386         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20387
20388         * constant.cs (LookupConstantValue): Implement.
20389
20390         (EmitConstant): Use the above in emitting the constant.
20391
20392         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20393         that are user-defined by doing a LookupConstantValue on them.
20394
20395         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20396         too, like above.
20397
20398 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20399
20400         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20401
20402         (BaseAccess.DoResolve): Implement.
20403
20404         (MemberAccess.DoResolve): Split this routine into a
20405         ResolveMemberAccess routine that can be used independently
20406
20407 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20410         As that share bits of the implementation.  Is returns a boolean,
20411         while As returns the Type that is being probed.
20412
20413 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20414
20415         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20416         instead of a Literal - much easier.
20417
20418         (EnumInTransit): Remove - utterly useless :-)
20419
20420         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20421
20422         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20423
20424         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20425         chain when we have no associated expression.
20426
20427 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20428
20429         * constant.cs (Define): Use Location while reporting the errror.
20430
20431         Also emit a warning when 'new' is used and there is no inherited
20432         member to hide.
20433
20434         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20435         populated.
20436
20437         (LookupEnumValue): Implement to lookup an enum member's value and define it
20438         if necessary.
20439
20440         (Populate): Re-write accordingly to use the above routine.
20441
20442 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20443
20444         * expression.cs (This): Fix prototype for DoResolveLValue to
20445         override the base class DoResolveLValue.
20446
20447         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20448         declarations) 
20449
20450         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20451         (we need to load the address of the field here).  This fixes
20452         test-22. 
20453
20454         (FieldExpr.DoResolveLValue): Call the DoResolve
20455         function to initialize the Instance expression.
20456
20457         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20458         correctly the GetEnumerator operation on a value type.
20459
20460         * cs-parser.jay: Add more simple parsing error catches.
20461
20462         * statement.cs (Switch): Add support for string switches.
20463         Handle null specially.
20464
20465         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20466
20467 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20468
20469         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20470
20471         (declare_local_constant): New helper function.
20472
20473         * statement.cs (AddConstant): Keep a separate record of constants
20474
20475         (IsConstant): Implement to determine if a variable is a constant.
20476
20477         (GetConstantExpression): Implement.
20478
20479         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20480
20481         * statement.cs (IsVariableDefined): Re-write.
20482
20483 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20484
20485         * class.cs (TypeContainer::FindMembers): Look for constants
20486         in the case when we are looking for MemberTypes.Field
20487
20488         * expression.cs (MemberAccess::DoResolve): Check that in the
20489         case we are a FieldExpr and a Literal, we are not being accessed
20490         by an instance reference.
20491
20492         * cs-parser.jay (local_constant_declaration): Implement.
20493
20494         (declaration_statement): Implement for constant declarations.
20495
20496 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20497
20498         * statement.cs (Switch): Catch double defaults.
20499
20500         (Switch): More work on the switch() statement
20501         implementation.  It works for integral values now, need to finish
20502         string support.
20503
20504
20505 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20508         integer literals into other integer literals.  To be used by
20509         switch. 
20510
20511 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20512
20513         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20514         some memory.
20515
20516         (EmitDynamicInitializers): Cope with the above since we extract data
20517         directly from ArrayData now.
20518
20519         (ExpectInitializers): Keep track of whether initializers are mandatory
20520         or not.
20521
20522         (Bounds): Make it a hashtable to prevent the same dimension being 
20523         recorded for every element in that dimension.
20524
20525         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20526         from being found.
20527
20528         Also fix bug which was causing the indices to be emitted in the reverse
20529         order.
20530
20531 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20532
20533         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20534         unfinished.  They do not work, because the underlying code is
20535         sloppy.
20536
20537 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20538
20539         * cs-parser.jay: Remove bogus fixme.
20540
20541         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20542         on Switch statement.
20543
20544 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20545
20546         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20547         the same. 
20548
20549         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20550         parameter. Apparently, any expression is allowed. 
20551
20552         (ValidateInitializers): Update accordingly.
20553
20554         (CheckIndices): Fix some tricky bugs thanks to recursion.
20555
20556         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20557         I was being completely brain-dead.
20558
20559         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20560         and re-write acordingly.
20561
20562         (DelegateInvocation): Re-write accordingly.
20563
20564         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20565
20566         (MakeByteBlob): Handle types more correctly.
20567
20568         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20569         initialization from expressions but it is incomplete because I am a complete
20570         Dodo :-|
20571
20572 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20573
20574         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20575         on If.  Basically, we have to return `true' (ie, we do return to
20576         our caller) only if both branches of the if return.
20577
20578         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20579         short-circuit operators, handle them as short circuit operators. 
20580
20581         (Cast.DoResolve): Resolve type.
20582         (Cast.Cast): Take an expression as the target type.
20583
20584         * cs-parser.jay (cast_expression): Remove old hack that only
20585         allowed a limited set of types to be handled.  Now we take a
20586         unary_expression and we resolve to a type during semantic
20587         analysis.
20588
20589         Use the grammar productions from Rhys to handle casts (this is
20590         not complete like Rhys syntax yet, we fail to handle that corner
20591         case that C# has regarding (-x), but we will get there.
20592
20593 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20594
20595         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20596         field which is an array type.
20597
20598         * cs-parser.jay (declare_local_variables): Support array initialization too.
20599
20600         * typemanager.cs (MakeKey): Implement.
20601
20602         (everywhere): Use the above appropriately.
20603
20604         * cs-parser.jay (for_statement): Update for array initialization while
20605         declaring variables.
20606
20607         * ecore.cs : The error message was correct, it's the variable's names that
20608         were misleading ;-) Make the code more readable.
20609
20610         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20611         the correct type etc.
20612
20613         (ConvertExplicit): Handle Enum types by examining the underlying type.
20614
20615 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20616
20617         * parameter.cs (GetCallingConvention): Always return
20618         CallingConventions.Standard for now.
20619
20620 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20621
20622         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20623         and `r' after calling DoNumericPromotions.
20624
20625         * ecore.cs: Fix error message (the types were in the wrong order).
20626
20627         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20628         BindingFlags.Instance as well 
20629
20630         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20631         implicit int literal conversion in an empty cast so that we
20632         propagate the right type upstream.
20633
20634         (UnboxCast): new class used to unbox value types.
20635         (Expression.ConvertExplicit): Add explicit type conversions done
20636         by unboxing.
20637
20638         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20639         the target type before applying the implicit LongLiterals to ULong
20640         literal cast.
20641
20642 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20643
20644         * cs-parser.jay (for_statement): Reworked the way For works: now
20645         we declare manually any variables that are introduced in
20646         for_initializer to solve the problem of having out-of-band code
20647         emition (that is what got for broken).
20648
20649         (declaration_statement): Perform the actual variable declaration
20650         that used to be done in local_variable_declaration here.
20651
20652         (local_variable_declaration): Do not declare anything, just pass
20653         the information on a DictionaryEntry
20654
20655 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20656
20657         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20658         re-write of the logic to now make it recursive.
20659
20660         (UpdateIndices): Re-write accordingly.
20661
20662         Store element data in a separate ArrayData list in the above methods.
20663
20664         (MakeByteBlob): Implement to dump the array data into a byte array.
20665
20666 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20667
20668         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20669         into CheckIndices.
20670
20671         * constant.cs (Define): Implement.
20672
20673         (EmitConstant): Re-write fully.
20674
20675         Pass in location info.
20676
20677         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20678         respectively.
20679
20680         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20681         DictionaryEntry since we need location info too.
20682
20683         (constant_declaration): Update accordingly.
20684
20685         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20686         code into another method : UpdateIndices.
20687
20688 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20689
20690         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20691         some type checking etc.
20692
20693 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20694
20695         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20696         bits to provide dimension info if the user skips doing that.
20697
20698         Update second constructor to store the rank correctly.
20699
20700 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20701
20702         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20703         and try to implement.
20704
20705         * ../errors/cs0150.cs : Add.
20706
20707         * ../errors/cs0178.cs : Add.
20708
20709 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20710
20711         * statement.cs: Implement foreach on multi-dimensional arrays. 
20712
20713         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20714         name of the params argument.
20715
20716         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20717         initializing the array.
20718
20719         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20720         we can use this elsewhere.
20721
20722         * statement.cs: Finish implementation of foreach for single
20723         dimension arrays.
20724
20725         * cs-parser.jay: Use an out-of-band stack to pass information
20726         around, I wonder why I need this.
20727
20728         foreach_block: Make the new foreach_block the current_block.
20729
20730         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20731         function used to return a static Parameters structure.  Used for
20732         empty parameters, as those are created very frequently.
20733
20734         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20735
20736 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20737
20738         * interface.cs : Default modifier is private, not public. The
20739         make verify test passes again.
20740
20741 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20742
20743         * support.cs (ReflectionParameters): Fix logic to determine
20744         whether the last parameter is a params one. Test 9 passes again.
20745
20746         * delegate.cs (Populate): Register the builders we define with
20747         RegisterParameterForBuilder. Test 19 passes again.
20748
20749         * cs-parser.jay (property_declaration): Reference $6 instead
20750         of $$ to get at the location.
20751
20752         (indexer_declaration): Similar stuff.
20753
20754         (attribute): Ditto.
20755
20756         * class.cs (Property): Register parameters for the Get and Set methods
20757         if they exist. Test 23 passes again.
20758
20759         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20760         call to EmitArguments as we are sure there aren't any params arguments. 
20761         Test 32 passes again.
20762
20763         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20764         IndexOutOfRangeException. 
20765
20766         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20767         Test 33 now passes again.
20768
20769 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20770
20771         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20772         broke a bunch of things.  Will have to come up with a better way
20773         of tracking locations.
20774
20775         * statement.cs: Implemented foreach for single dimension arrays.
20776
20777 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20780         an error.  This removes the lookup from the critical path.
20781
20782         * cs-parser.jay: Removed use of temporary_loc, which is completely
20783         broken. 
20784
20785 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20786
20787         * support.cs (ReflectionParameters.ParameterModifier): Report
20788         whether the argument is a PARAMS argument or not.
20789
20790         * class.cs: Set the attribute `ParamArrayAttribute' on the
20791         parameter argument.
20792
20793         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20794         and cons_param_array_attribute (ConstructorInfo for
20795         ParamArrayAttribute)., 
20796
20797         * codegen.cs: Emit the return using the `Return' statement, that
20798         way we can report the error correctly for missing return values. 
20799
20800         * class.cs (Method.Emit): Clean up.
20801
20802         * expression.cs (Argument.Resolve): Take another argument: the
20803         location where this argument is used.  Notice that this is not
20804         part of the "Argument" class as to reduce the size of the
20805         structure (we know the approximate location anyways).
20806
20807         Test if the argument is a variable-reference, if not, then
20808         complain with a 206.
20809
20810         (Argument.Emit): Emit addresses of variables.
20811
20812         (Argument.FullDesc): Simplify.
20813
20814         (Invocation.DoResolve): Update for Argument.Resolve.
20815
20816         (ElementAccess.DoResolve): ditto.
20817
20818         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20819         method should be virtual, as this method is always virtual.
20820
20821         (NewDelegate.DoResolve): Update for Argument.Resolve.
20822
20823         * class.cs (ConstructorInitializer.DoResolve): ditto.
20824
20825         * attribute.cs (Attribute.Resolve): ditto.
20826
20827 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20828
20829         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20830
20831         * expression.cs (ParameterReference): Drop IStackStorage and implement
20832         IAssignMethod instead. 
20833
20834         (LocalVariableReference): ditto.
20835
20836         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20837         IAssignMethod instead. 
20838
20839 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20840
20841         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20842         enumerations that are used in heavily used structures derive from
20843         byte in a laughable and pathetic attempt to reduce memory usage.
20844         This is the kind of pre-optimzations that you should not do at
20845         home without adult supervision.
20846
20847         * expression.cs (UnaryMutator): New class, used to handle ++ and
20848         -- separatedly from the other unary operators.  Cleans up the
20849         code, and kills the ExpressionStatement dependency in Unary.
20850
20851         (Unary): Removed `method' and `Arguments' from this class, making
20852         it smaller, and moving it all to SimpleCall, so I can reuse this
20853         code in other locations and avoid creating a lot of transient data
20854         strucutres when not required.
20855
20856         * cs-parser.jay: Adjust for new changes.
20857
20858 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20859
20860         * enum.cs (Enum.Populate): If there is a failure during
20861         definition, return
20862
20863         * cs-parser.jay (opt_enum_base): we used to catch type errors
20864         here, but this is really incorrect.  The type error should be
20865         catched during semantic analysis.
20866
20867 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20868
20869         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20870         current_local_parameters as expected since I, in my stupidity, had forgotten
20871         to do this :-)
20872
20873         * attribute.cs (GetValidPlaces): Fix stupid bug.
20874
20875         * class.cs (Method::Emit): Perform check on applicability of attributes.
20876
20877         (Constructor::Emit): Ditto.
20878
20879         (Field::Emit): Ditto.
20880
20881         (Field.Location): Store location information.
20882
20883         (Property, Event, Indexer, Operator): Ditto.
20884
20885         * cs-parser.jay (field_declaration): Pass in location for each field.
20886
20887         * ../errors/cs0592.cs : Add.
20888
20889 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20890
20891         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20892
20893         (InitCoreTypes): Update accordingly.
20894
20895         (RegisterAttrType, LookupAttr): Implement.
20896
20897         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20898         info about the same.
20899
20900         (Resolve): Update to populate the above as necessary.
20901
20902         (Error592): Helper.
20903
20904         (GetValidPlaces): Helper to the above.
20905
20906         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20907
20908         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20909
20910 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20911
20912         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20913
20914         * ../errors/cs0617.cs : Add.
20915
20916 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20917
20918         * enum.cs (Emit): Rename to Populate to be more consistent with what
20919         we expect it to do and when exactly it is called.
20920
20921         * class.cs, rootcontext.cs : Update accordingly.
20922
20923         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20924         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20925
20926         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20927
20928         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20929         of a fieldinfo using the above, when dealing with a FieldBuilder.
20930
20931 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20932
20933         * ../errors/cs0031.cs : Add.
20934
20935         * ../errors/cs1008.cs : Add.
20936
20937         * ../errrors/cs0543.cs : Add.
20938
20939         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20940         enum type.
20941
20942         (FindMembers): Implement.
20943
20944         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20945         enums and delegates too.
20946
20947         (enum_types): Rename to builder_to_enum.
20948
20949         (delegate_types): Rename to builder_to_delegate.
20950
20951         * delegate.cs (FindMembers): Implement.
20952
20953 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20954
20955         * typemanager.cs (IsEnumType): Implement.
20956
20957         * enum.cs (Emit): Re-write parts to account for the underlying type
20958         better and perform checking etc.
20959
20960         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20961         of the underlying type.
20962
20963         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20964         value
20965
20966         * enum.cs (error31): Helper to report error #31.
20967
20968         * cs-parser.jay (enum_declaration): Store location of each member too.
20969
20970         * enum.cs (member_to_location): New hashtable. 
20971
20972         (AddEnumMember): Update location hashtable.
20973
20974         (Emit): Use the location of each member while reporting errors.
20975
20976 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20977
20978         * cs-parser.jay: A for_initializer if is a
20979         local_variable_declaration really ammount to have an implicit
20980         block with the variable declaration and no initializer for for.
20981
20982         * statement.cs (For.Emit): Cope with null initializers.
20983
20984         This fixes the infinite loop on for initializers.
20985
20986 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20987
20988         * enum.cs: More cleanup.
20989
20990         * ecore.cs: Remove dead code.
20991
20992         * class.cs (Property.Emit): More simplification.
20993         (Event.Emit): ditto.
20994
20995         Reworked to have less levels of indentation.
20996
20997 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20998
20999         * class.cs (Property): Emit attributes.
21000
21001         (Field): Ditto.
21002
21003         (Event): Ditto.
21004
21005         (Indexer): Ditto.
21006
21007         (Operator): Ditto.
21008
21009         * enum.cs (Emit): Ditto.
21010
21011         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21012         Enums too.
21013
21014         * class.cs (Field, Event, etc.): Move attribute generation into the
21015         Emit method everywhere.
21016
21017         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21018         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21019         as we had no way of defining nested enums !
21020
21021         * rootcontext.cs : Adjust code accordingly.
21022
21023         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21024
21025 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21026
21027         * expression.cs (EvalConstantExpression): Move into ecore.cs
21028
21029         * enum.cs (Enum): Rename some members and make them public and readonly
21030         according to our convention.
21031
21032         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21033         nothing else.
21034
21035         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21036
21037         (Enum::Emit): Write a simple version for now which doesn't try to compute
21038         expressions. I shall modify this to be more robust in just a while.
21039
21040         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21041
21042         (TypeContainer::CloseType): Create the Enum types too.
21043
21044         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21045
21046         * expression.cs (EvalConstantExpression): Get rid of completely.
21047
21048         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21049         user-defined values and other cases.
21050
21051         (IsValidEnumLiteral): Helper function.
21052
21053         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21054         out there in the case we had a literal FieldExpr.
21055
21056         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21057
21058         (Literalize): Revamp a bit to take two arguments.
21059
21060         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21061
21062 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21063
21064         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21065
21066         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21067
21068         (Resolve): Use the above to ensure we have proper initializers.
21069
21070 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21071
21072         * expression.cs (Expression::EvalConstantExpression): New method to 
21073         evaluate constant expressions.
21074
21075         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21076
21077 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21078
21079         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21080         in an array.
21081
21082         (Binary.ResolveOperator): Handle operator != (object a, object b)
21083         and operator == (object a, object b);
21084
21085         (Binary.DoNumericPromotions): Indicate whether the numeric
21086         promotion was possible.
21087
21088         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21089         Implement.  
21090
21091         Made the ArrayAccess implement interface IAssignMethod instead of
21092         IStackStore as the order in which arguments are passed reflects
21093         this.
21094
21095         * assign.cs: Instead of using expr.ExprClass to select the way of
21096         assinging, probe for the IStackStore/IAssignMethod interfaces.
21097
21098         * typemanager.cs: Load InitializeArray definition.
21099
21100         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21101         static data that can be used to initialize arrays. 
21102
21103 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21104
21105         * expression.cs: Handle operator== and operator!= for booleans.
21106
21107         (Conditioal.Reduce): Implement reducer for the ?: operator.
21108
21109         (Conditional.Resolve): Implement dead code elimination.
21110
21111         (Binary.Resolve): Catch string literals and return a new
21112         concatenated string.
21113
21114         (Unary.Reduce): Implement reduction of unary expressions.
21115
21116         * ecore.cs: Split out the expression core handling here.
21117
21118         (Expression.Reduce): New method used to perform constant folding
21119         and CSE.  This is needed to support constant-expressions. 
21120
21121         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21122         targets, and optimize for !x.
21123
21124 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21125
21126         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21127         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21128         set custom atttributes.
21129
21130         * literal.cs (Literal::GetValue): New abstract method to return the actual
21131         value of the literal, cast as an object.
21132
21133         (*Literal): Implement GetValue method.
21134
21135         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21136         expressions to the arraylist but objects of type Argument.
21137
21138         * class.cs (TypeContainer::Emit): Emit our attributes too.
21139
21140         (Method::Emit, Constructor::Emit): Ditto.
21141
21142         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21143         to be ignoring earlier.
21144
21145 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21146
21147         * attribute.cs (AttributeSection::Define): Implement to do the business
21148         of constructing a CustomAttributeBuilder.
21149
21150         (Attribute): New trivial class. Increases readability of code.  
21151
21152         * cs-parser.jay : Update accordingly.
21153
21154         (positional_argument_list, named_argument_list, named_argument): New rules
21155
21156         (attribute_arguments): Use the above so that we are more correct.
21157
21158 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21159
21160         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21161         to perform all checks for a method with a params parameter.
21162
21163         (Invocation::OverloadResolve): Update to use the above method and therefore
21164         cope correctly with params method invocations.
21165
21166         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21167         params too.
21168
21169         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21170         constructors in our parent too because we can't afford to miss out on 
21171         protected ones ;-)
21172
21173         * attribute.cs (AttributeSection): New name for the class Attribute
21174
21175         Other trivial changes to improve readability.
21176
21177         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21178         use the new class names.
21179
21180 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21181
21182         * class.cs (Method::Define): Complete definition for params types too
21183
21184         (Indexer::Define): Ditto.
21185
21186         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21187         Cope everywhere with a request for info about the array parameter.
21188
21189 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21190
21191         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21192
21193         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21194         local_variable_type to extract the string corresponding to the type.
21195
21196         (local_variable_type): Fixup the action to use the new helper method.
21197
21198         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21199         go.
21200
21201         * expression.cs : Clean out code which uses the above.
21202
21203 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21204
21205         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21206         and bale out if necessary by returning a false.
21207
21208         (RegisterProperty): Ditto.
21209
21210         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21211         and print out appropriate error messages.
21212
21213         * interface.cs (everywhere): Ditto.
21214
21215         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21216         location to constructor.
21217
21218         * class.cs (Property, Event, Indexer): Update accordingly.
21219
21220         * ../errors/cs111.cs : Added.
21221
21222         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21223         of a method, as laid down by the spec.
21224
21225         (Invocation::OverloadResolve): Use the above method.
21226
21227 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21228
21229         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21230         now take a TypeContainer and a Parameters object.
21231
21232         (ParameterData): Modify return type of ParameterModifier method to be 
21233         Parameter.Modifier and not a string.
21234
21235         (ReflectionParameters, InternalParameters): Update accordingly.
21236
21237         * expression.cs (Argument::GetParameterModifier): Same here.
21238
21239         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21240         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21241         symbol in it at all so maybe this is only for now.
21242
21243 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21244
21245         * support.cs (InternalParameters): Constructor now takes an extra argument 
21246         which is the actual Parameters class.
21247
21248         (ParameterDesc): Update to provide info on ref/out modifiers.
21249
21250         * class.cs (everywhere): Update call to InternalParameters to pass in
21251         the second argument too.
21252
21253         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21254         to return the modifier info [ref/out etc]
21255
21256         (InternalParameters, ReflectionParameters): Implement the above.
21257
21258         * expression.cs (Argument::ParameterModifier): Similar function to return
21259         info about the argument's modifiers.
21260
21261         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21262         too.
21263
21264         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21265         a new SetFormalParameters object which we pass to InternalParameters.
21266
21267 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21268
21269         * expression.cs (NewArray): Merge into the ArrayCreation class.
21270
21271 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21272
21273         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21274         NewUserdefinedArray into one as there wasn't much of a use in having
21275         two separate ones.
21276
21277         * expression.cs (Argument): Change field's name to ArgType from Type.
21278
21279         (Type): New readonly property which returns the proper type, taking into 
21280         account ref/out modifiers.
21281
21282         (everywhere): Adjust code accordingly for the above.
21283
21284         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21285         whether we are emitting for a ref or out parameter.
21286
21287         * expression.cs (Argument::Emit): Use the above field to set the state.
21288
21289         (LocalVariableReference::Emit): Update to honour the flag and emit the
21290         right stuff.
21291
21292         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21293
21294         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21295
21296         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21297
21298         (ReflectionParameters, InternalParameters): Implement the above method.
21299
21300         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21301         reporting errors.
21302
21303         (Invocation::FullMethodDesc): Ditto. 
21304
21305 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21306
21307         * cs-parser.jay: Add extra production for the second form of array
21308         creation. 
21309
21310         * expression.cs (ArrayCreation): Update to reflect the above
21311         change. 
21312
21313         * Small changes to prepare for Array initialization.
21314
21315 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21316
21317         * typemanager.cs (ImplementsInterface): interface might be null;
21318         Deal with this problem;
21319
21320         Also, we do store negative hits on the cache (null values), so use
21321         this instead of calling t.GetInterfaces on the type everytime.
21322
21323 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21324
21325         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21326
21327         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21328         split functionality out into different classes.
21329
21330         (New::FormArrayType): Move into NewBuiltinArray.
21331
21332         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21333         quite useless.
21334
21335         (NewBuiltinArray): New class to handle creation of built-in arrays.
21336
21337         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21338         account creation of one-dimensional arrays.
21339
21340         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21341
21342         (NewUserdefinedArray::DoResolve): Implement.
21343
21344         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21345
21346         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21347         we maintain inside the TypeManager. This is necessary to perform lookups on the
21348         module builder.
21349
21350         (LookupType): Update to perform GetType on the module builders too.     
21351
21352         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21353
21354         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21355
21356 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21357
21358         * expression.cs (New::DoResolve): Implement guts of array creation.
21359
21360         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21361
21362 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21363
21364         * expression.cs: Fix bug I introduced lsat night that broke
21365         Delegates. 
21366
21367         (Expression.Resolve): Report a 246 error (can not resolve name)
21368         if we find a SimpleName in the stream.
21369
21370         (Expression.ResolveLValue): Ditto.
21371
21372         (Expression.ResolveWithSimpleName): This function is a variant of
21373         ResolveName, this one allows SimpleNames to be returned without a
21374         warning.  The only consumer of SimpleNames is MemberAccess
21375
21376 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21377
21378         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21379         might arrive here.  I have my doubts that this is correct.
21380
21381         * statement.cs (Lock): Implement lock statement.
21382
21383         * cs-parser.jay: Small fixes to support `lock' and `using'
21384
21385         * cs-tokenizer.cs: Remove extra space
21386
21387         * driver.cs: New flag --checked, allows to turn on integer math
21388         checking. 
21389
21390         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21391         Threading.Monitor.Exit 
21392
21393 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21394
21395         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21396         Expression Class to be IndexerAccess.
21397
21398         Notice that Indexer::DoResolve sets the eclass to Value.
21399
21400 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21401
21402         * class.cs (TypeContainer::Emit): Emit code for indexers.
21403
21404         * assign.cs (IAssignMethod): New interface implemented by Indexers
21405         and Properties for handling assignment.
21406
21407         (Assign::Emit): Simplify and reuse code. 
21408
21409         * expression.cs (IndexerAccess, PropertyExpr): Implement
21410         IAssignMethod, clean up old code. 
21411
21412 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21413
21414         * typemanager.cs (ImplementsInterface): New method to determine if a type
21415         implements a given interface. Provides a nice cache too.
21416
21417         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21418         method.
21419
21420         (ConvertReferenceExplicit): Ditto.
21421
21422         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21423         various methods, with correct names etc.
21424
21425         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21426         Operator.UnaryNegation.
21427
21428         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21429         we have a unary plus or minus operator.
21430
21431         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21432         UnaryMinus.
21433
21434         * everywhere : update accordingly.
21435
21436         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21437         respectively.
21438
21439         * class.cs (Method::Define): For the case where we are implementing a method
21440         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21441         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21442
21443 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21444
21445         * interface.cs (FindMembers): Implement to work around S.R.E
21446         lameness.
21447
21448         * typemanager.cs (IsInterfaceType): Implement.
21449
21450         (FindMembers): Update to handle interface types too.
21451
21452         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21453         use IsAssignableFrom as that is not correct - it doesn't work.
21454
21455         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21456         and accordingly override EmitStatement.
21457
21458         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21459         using the correct logic :-)
21460
21461 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21462
21463         * ../errors/cs-11.cs : Add to demonstrate error -11 
21464
21465 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21466
21467         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21468         then pass this as a hint to ResolveLValue.
21469
21470         * expression.cs (FieldExpr): Add Location information
21471
21472         (FieldExpr::LValueResolve): Report assignment to readonly
21473         variable. 
21474
21475         (Expression::ExprClassFromMemberInfo): Pass location information.
21476
21477         (Expression::ResolveLValue): Add new method that resolves an
21478         LValue. 
21479
21480         (Expression::DoResolveLValue): Default invocation calls
21481         DoResolve. 
21482
21483         (Indexers): New class used to keep track of indexers in a given
21484         Type. 
21485
21486         (IStackStore): Renamed from LValue, as it did not really describe
21487         what this did.  Also ResolveLValue is gone from this interface and
21488         now is part of Expression.
21489
21490         (ElementAccess): Depending on the element access type
21491
21492         * typemanager.cs: Add `indexer_name_type' as a Core type
21493         (System.Runtime.CompilerServices.IndexerNameAttribute)
21494
21495         * statement.cs (Goto): Take a location.
21496
21497 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21498
21499         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21500         if two delegates are compatible.
21501
21502         (NewDelegate::DoResolve): Update to take care of the case when
21503         we instantiate a delegate from another delegate.
21504
21505         * typemanager.cs (FindMembers): Don't even try to look up members
21506         of Delegate types for now.
21507
21508 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21509
21510         * delegate.cs (NewDelegate): New class to take care of delegate
21511         instantiation.
21512
21513         * expression.cs (New): Split the delegate related code out into 
21514         the NewDelegate class.
21515
21516         * delegate.cs (DelegateInvocation): New class to handle delegate 
21517         invocation.
21518
21519         * expression.cs (Invocation): Split out delegate related code into
21520         the DelegateInvocation class.
21521
21522 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21523
21524         * expression.cs (New::DoResolve): Implement delegate creation fully
21525         and according to the spec.
21526
21527         (New::DoEmit): Update to handle delegates differently.
21528
21529         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21530         because of which we were printing out arguments in reverse order !
21531
21532         * delegate.cs (VerifyMethod): Implement to check if the given method
21533         matches the delegate.
21534
21535         (FullDelegateDesc): Implement.
21536
21537         (VerifyApplicability): Implement.
21538
21539         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21540         delegate invocations too.
21541
21542         (Invocation::Emit): Ditto.
21543
21544         * ../errors/cs1593.cs : Added.
21545
21546         * ../errors/cs1594.cs : Added.
21547
21548         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21549
21550 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21551
21552         * typemanager.cs (intptr_type): Core type for System.IntPtr
21553
21554         (InitCoreTypes): Update for the same.
21555
21556         (iasyncresult_type, asynccallback_type): Ditto.
21557
21558         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21559         correct.
21560
21561         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21562         too.
21563
21564         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21565         the builders for the 4 members of a delegate type :-)
21566
21567         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21568         type.
21569
21570         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21571
21572         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21573
21574 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21575
21576         * statement.cs (Break::Emit): Implement.   
21577         (Continue::Emit): Implement.
21578
21579         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21580         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21581         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21582         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21583         end loop
21584
21585         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21586         properties that track the label for the current loop (begin of the
21587         loop and end of the loop).
21588
21589 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21590
21591         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21592         use of emitting anything at all.
21593
21594         * class.cs, rootcontext.cs : Get rid of calls to the same.
21595
21596         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21597
21598         (Populate): Define the constructor correctly and set the implementation
21599         attributes.
21600
21601         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21602         have been defined.
21603
21604         (AddDelegateType): Implement.
21605
21606         (IsDelegateType): Implement helper method.
21607
21608         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21609
21610         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21611         and accordingly handle it.
21612
21613         * delegate.cs (Populate): Take TypeContainer argument.
21614         Implement bits to define the Invoke method. However, I still haven't figured out
21615         how to take care of the native int bit :-(
21616
21617         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21618         Qualify the name of the delegate, not its return type !
21619
21620         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21621         conversion.
21622
21623         (StandardConversionExists): Checking for array types turns out to be recursive.
21624
21625         (ConvertReferenceExplicit): Implement array conversion.
21626
21627         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21628
21629 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21630
21631         * cs-parser.jay (delegate_declaration): Store the fully qualified
21632         name as it is a type declaration.
21633
21634         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21635         readonly.
21636
21637         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21638         as TypeContainer::DefineType.
21639
21640         (Populate): Method in which all the definition of the various methods (Invoke)
21641         etc is done.
21642
21643         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21644         see.
21645
21646         (CloseDelegate): Finally creates the delegate.
21647
21648         * class.cs (TypeContainer::DefineType): Update to define delegates.
21649         (Populate, Emit and CloseType): Do the same thing here too.
21650
21651         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21652         delegates in all these operations.
21653
21654 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21655
21656         * expression.cs: LocalTemporary: a new expression used to
21657         reference a temporary that has been created.
21658
21659         * assign.cs: Handle PropertyAccess back here, so that we can
21660         provide the proper semantic access to properties.
21661
21662         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21663         a few more explicit conversions. 
21664
21665         * modifiers.cs: `NEW' modifier maps to HideBySig.
21666
21667         * expression.cs (PropertyExpr): Make this into an
21668         ExpressionStatement, and support the EmitStatement code path. 
21669
21670         Perform get/set error checking, clean up the interface.
21671
21672         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21673         them into toplevel access objects.
21674
21675 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21676
21677         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21678         SRE.
21679
21680         * typemanager.cs: Keep track here of our PropertyBuilders again to
21681         work around lameness in SRE.
21682
21683 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21684
21685         * expression.cs (LValue::LValueResolve): New method in the
21686         interface, used to perform a second resolution pass for LValues. 
21687
21688         (This::DoResolve): Catch the use of this in static methods.
21689
21690         (This::LValueResolve): Implement.
21691
21692         (This::Store): Remove warning, assigning to `this' in structures
21693         is 
21694
21695         (Invocation::Emit): Deal with invocation of
21696         methods on value types.  We need to pass the address to structure
21697         methods rather than the object itself.  (The equivalent code to
21698         emit "this" for structures leaves the entire structure on the
21699         stack instead of a pointer to it). 
21700
21701         (ParameterReference::DoResolve): Compute the real index for the
21702         argument based on whether the method takes or not a `this' pointer
21703         (ie, the method is static).
21704
21705         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21706         value types returned from functions when we need to invoke a
21707         method on the sturcture.
21708
21709
21710 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21711
21712         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21713         defining the type in the Modulebuilder or Typebuilder. This is to take
21714         care of nested types which need to be defined on the TypeBuilder using
21715         DefineNestedMethod.
21716
21717         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21718         methods in RootContext, only ported to be part of TypeContainer.
21719
21720         (TypeContainer::GetInterfaceOrClass): Ditto.
21721
21722         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21723
21724         * interface.cs (Interface::DefineInterface): New method. Does exactly
21725         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21726         too.
21727
21728         (Interface::GetInterfaces): Move from RootContext here and port.
21729
21730         (Interface::GetInterfaceByName): Same here.
21731
21732         * rootcontext.cs (ResolveTree): Re-write.
21733
21734         (PopulateTypes): Re-write.
21735
21736         * class.cs (TypeContainer::Populate): Populate nested types too.
21737         (TypeContainer::Emit): Emit nested members too.
21738
21739         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21740         instead just use the name argument passed in as it is already fully
21741         qualified.
21742
21743         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21744         to TypeContainer mapping to see if a type is user-defined.
21745
21746         * class.cs (TypeContainer::CloseType): Implement. 
21747
21748         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21749         the default constructor.
21750
21751         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21752         twice.
21753
21754         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21755
21756         * interface.cs (CloseType): Create the type here.
21757
21758         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21759         the hierarchy.
21760
21761         Remove all the methods which are now in TypeContainer.
21762
21763 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21764
21765         * delegate.cs (Define): Re-write bits to define the delegate
21766         correctly.
21767
21768 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21769
21770         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21771
21772         * expression.cs (ImplicitReferenceConversion): handle null as well
21773         as a source to convert to any reference type.
21774
21775         * statement.cs (Return): Perform any implicit conversions to
21776         expected return type.  
21777
21778         Validate use of return statement.  
21779
21780         * codegen.cs (EmitContext): Pass the expected return type here.
21781
21782         * class.cs (Method, Constructor, Property): Pass expected return
21783         type to EmitContext.
21784
21785 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21786
21787         * expression.cs: Make DoResolve take an EmitContext instead of a
21788         TypeContainer.
21789
21790         Replaced `l' and `location' for `loc', for consistency.
21791
21792         (Error, Warning): Remove unneeded Tc argument.
21793
21794         * assign.cs, literal.cs, constant.cs: Update to new calling
21795         convention. 
21796
21797         * codegen.cs: EmitContext now contains a flag indicating whether
21798         code is being generated in a static method or not.
21799
21800         * cs-parser.jay: DecomposeQI, new function that replaces the old
21801         QualifiedIdentifier.  Now we always decompose the assembled
21802         strings from qualified_identifier productions into a group of
21803         memberaccesses.
21804
21805 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21806
21807         * rootcontext.cs: Deal with field-less struct types correctly now
21808         by passing the size option to Define Type.
21809
21810         * class.cs: Removed hack that created one static field. 
21811
21812 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21813
21814         * statement.cs: Moved most of the code generation here. 
21815
21816 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21817
21818         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21819         seem very right.
21820
21821         (ElementAccess): Remove useless bits for now - keep checks as the spec
21822         says.
21823
21824 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21825
21826         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21827         and start performing checks according to the spec.
21828
21829 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21830
21831         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21832         rank_specifiers instead.
21833
21834         (rank_specifiers): Change the order in which the rank specifiers are stored
21835
21836         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21837
21838         * expression.cs (ElementAccess): Implement the LValue interface too.
21839
21840 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21841
21842         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21843         except that user defined conversions are not included.
21844
21845         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21846         perform the conversion of the return type, if necessary.
21847
21848         (New::DoResolve): Check whether we are creating an array or an object
21849         and accordingly do the needful.
21850
21851         (New::Emit): Same here.
21852
21853         (New::DoResolve): Implement guts of array creation.
21854
21855         (New::FormLookupType): Helper function.
21856
21857 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21858
21859         * codegen.cs: Removed most of the code generation here, and move the
21860         corresponding code generation bits to the statement classes. 
21861
21862         Added support for try/catch/finalize and throw.
21863
21864         * cs-parser.jay: Added support for try/catch/finalize.
21865
21866         * class.cs: Catch static methods having the flags override,
21867         virtual or abstract.
21868
21869         * expression.cs (UserCast): This user cast was not really doing
21870         what it was supposed to do.  Which is to be born in fully resolved
21871         state.  Parts of the resolution were being performed at Emit time! 
21872
21873         Fixed this code.
21874
21875 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21876
21877         * expression.cs: Implicity convert the result from UserCast.
21878
21879 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21880
21881         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21882         prevented it from working correctly. 
21883
21884         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21885         merely ConvertImplicit.
21886
21887 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21888
21889         * typemanager.cs: Make the LookupTypeContainer function static,
21890         and not per-instance.  
21891
21892         * class.cs: Make static FindMembers (the one that takes a Type
21893         argument). 
21894
21895         * codegen.cs: Add EmitForeach here.
21896
21897         * cs-parser.jay: Make foreach a toplevel object instead of the
21898         inline expansion, as we need to perform semantic analysis on it. 
21899
21900 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21901
21902         * expression.cs (Expression::ImplicitUserConversion): Rename to
21903         UserDefinedConversion.
21904
21905         (Expression::UserDefinedConversion): Take an extra argument specifying 
21906         whether we look for explicit user conversions too.
21907
21908         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21909
21910         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21911
21912         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21913         with the appropriate arguments.
21914
21915         * cs-parser.jay (cast_expression): Record location too.
21916
21917         * expression.cs (Cast): Record location info.
21918
21919         (Expression::ConvertExplicit): Take location argument.
21920
21921         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21922         to determine if we are doing explicit conversions.
21923
21924         (UserCast::Emit): Update accordingly.
21925
21926         (Expression::ConvertExplicit): Report an error if everything fails.
21927
21928         * ../errors/cs0030.cs : Add.
21929
21930 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21933         virtual and newslot bits. 
21934
21935         * class.cs (TypeContainer::RegisterRequiredImplementations):
21936         Record methods we need.
21937
21938         (TypeContainer::MakeKey): Helper function to make keys for
21939         MethodBases, since the Methodbase key is useless.
21940
21941         (TypeContainer::Populate): Call RegisterRequiredImplementations
21942         before defining the methods.   
21943
21944         Create a mapping for method_builders_to_methods ahead of time
21945         instead of inside a tight loop.
21946
21947         (::RequireMethods):  Accept an object as the data to set into the
21948         hashtable so we can report interface vs abstract method mismatch.
21949
21950 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21951
21952         * report.cs: Make all of it static.
21953
21954         * rootcontext.cs: Drop object_type and value_type computations, as
21955         we have those in the TypeManager anyways.
21956
21957         Drop report instance variable too, now it is a global.
21958
21959         * driver.cs: Use try/catch on command line handling.
21960
21961         Add --probe option to debug the error reporting system with a test
21962         suite. 
21963
21964         * report.cs: Add support for exiting program when a probe
21965         condition is reached.
21966
21967 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21968
21969         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21970         we do a forcible conversion regardless of type, to check if 
21971         ForceConversion returns a null.
21972
21973         (Binary::error19): Use location to report error.
21974
21975         (Unary::error23): Use location here too.
21976
21977         * ../errors/cs0019.cs : Check in.
21978
21979         * ../errors/cs0023.cs : Check in.
21980
21981         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21982         case of a non-null MethodInfo object with a length of 0 !
21983
21984         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21985         an applicable member - according to the spec :-)
21986         Also fix logic to find members in base types.
21987
21988         (Unary::ResolveOperator): Same here.
21989
21990         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21991         as I was getting thoroughly confused between this and error19 :-)
21992
21993         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21994         (::FindMostEncompassedType): Implement.
21995         (::FindMostEncompassingType): Implement.
21996         (::StandardConversionExists): Implement.
21997
21998         (UserImplicitCast): Re-vamp. We now need info about most specific
21999         source and target types so that we can do the necessary conversions.
22000
22001         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22002         mathematical union with no duplicates.
22003
22004 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22005
22006         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22007         in order from base classes to child classes, so that we can in
22008         child classes look up in our parent for method names and
22009         attributes (required for handling abstract, virtual, new, override
22010         constructs: we need to instrospect our base class, and if we dont
22011         populate the classes in order, the introspection might be
22012         incorrect.  For example, a method could query its parent before
22013         the parent has any methods and would determine that the parent has
22014         no abstract methods (while it could have had them)).
22015
22016         (RootContext::CreateType): Record the order in which we define the
22017         classes.
22018
22019 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22020
22021         * class.cs (TypeContainer::Populate): Also method definitions can
22022         fail now, keep track of this.
22023
22024         (TypeContainer::FindMembers): Implement support for
22025         DeclaredOnly/noDeclaredOnly flag.
22026
22027         (Constructor::Emit) Return the ConstructorBuilder.
22028
22029         (Method::Emit) Return the MethodBuilder. 
22030         Check for abstract or virtual methods to be public.
22031
22032         * rootcontext.cs (RootContext::CreateType): Register all the
22033         abstract methods required for the class to be complete and the
22034         interface methods that must be implemented. 
22035
22036         * cs-parser.jay: Report error 501 (method requires body if it is
22037         not marked abstract or extern).
22038
22039         * expression.cs (TypeOf::Emit): Implement.
22040
22041         * typemanager.cs: runtime_handle_type, new global type.
22042
22043         * class.cs (Property::Emit): Generate code for properties.
22044
22045 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22046
22047         * expression.cs (Unary::ResolveOperator): Find operators on base type
22048         too - we now conform exactly to the spec.
22049
22050         (Binary::ResolveOperator): Same here.
22051
22052         * class.cs (Operator::Define): Fix minor quirk in the tests.
22053
22054         * ../errors/cs0215.cs : Added.
22055
22056         * ../errors/cs0556.cs : Added.
22057
22058         * ../errors/cs0555.cs : Added.
22059
22060 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22061
22062         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22063         single integer which is really efficient
22064
22065 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22066
22067         *  expression.cs (Expression::ImplicitUserConversion): Use location
22068         even in the case when we are examining True operators.
22069  
22070         * class.cs (Operator::Define): Perform extensive checks to conform
22071         with the rules for operator overloading in the spec.
22072
22073         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22074         some of the other conversions mentioned in the spec.
22075
22076         * typemanager.cs (array_type): New static member for the System.Array built-in
22077         type.
22078
22079         (cloneable_interface): For System.ICloneable interface.
22080
22081         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22082         we start resolving the tree and populating types.
22083
22084         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22085  
22086 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22087
22088         * expression.cs (Expression::ExprClassFromMemberInfo,
22089         Expression::Literalize): Create literal expressions from
22090         FieldInfos which are literals.
22091
22092         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22093         type casts, because they were wrong.  The test suite in tests
22094         caught these ones.
22095
22096         (ImplicitNumericConversion): ushort to ulong requires a widening
22097         cast. 
22098
22099         Int32 constant to long requires widening cast as well.
22100
22101         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22102         for integers because the type on the stack is not i4.
22103
22104 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22105
22106         * expression.cs (report118): require location argument. 
22107
22108         * parameter.cs: Do not dereference potential null value.
22109
22110         * class.cs: Catch methods that lack the `new' keyword when
22111         overriding a name.  Report warnings when `new' is used without
22112         anything being there to override.
22113
22114         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22115
22116         * class.cs: Only add constructor to hashtable if it is non-null
22117         (as now constructors can fail on define).
22118
22119         (TypeManager, Class, Struct): Take location arguments.
22120
22121         Catch field instance initialization in structs as errors.
22122
22123         accepting_filter: a new filter for FindMembers that is static so
22124         that we dont create an instance per invocation.
22125
22126         (Constructor::Define): Catch errors where a struct constructor is
22127         parameterless 
22128
22129         * cs-parser.jay: Pass location information for various new
22130         constructs. 
22131
22132         * delegate.cs (Delegate): take a location argument.
22133
22134         * driver.cs: Do not call EmitCode if there were problesm in the
22135         Definition of the types, as many Builders wont be there. 
22136
22137         * decl.cs (Decl::Decl): Require a location argument.
22138
22139         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22140         into integers, and find the most appropiate integer for it.
22141
22142         * literal.cs: Implement ULongLiteral.
22143
22144         * rootcontext.cs: Provide better information about the location of
22145         failure when CreateType fails.
22146
22147 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22148
22149         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22150         as well.
22151
22152         * expression.cs (Binary::CheckShiftArguments): Add missing type
22153         computation.
22154         (Binary::ResolveOperator): Add type to the logical and and logical
22155         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22156         before.
22157
22158         (Binary::DoNumericPromotions): In the case where either argument
22159         is ulong (and most signed types combined with ulong cause an
22160         error) perform implicit integer constant conversions as well.
22161
22162 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22163
22164         * expression.cs (UserImplicitCast): Method should always be
22165         non-null. 
22166         (Invocation::BetterConversion): Simplified test for IntLiteral.
22167
22168         (Expression::ImplicitNumericConversion): Split this routine out.
22169         Put the code that performs implicit constant integer conversions
22170         here. 
22171
22172         (Expression::Resolve): Become a wrapper around DoResolve so we can
22173         check eclass and type being set after resolve.
22174
22175         (Invocation::Badness): Remove this dead function
22176
22177         (Binary::ResolveOperator): Do not compute the expensive argumnets
22178         unless we have a union for it.
22179
22180         (Probe::Emit): Is needs to do an isinst and then
22181         compare against null.
22182
22183         (::CanConvert): Added Location argument.  If the Location argument
22184         is null (Location.Null), then we do not report errors.  This is
22185         used by the `probe' mechanism of the Explicit conversion.  We do
22186         not want to generate an error for something that the user
22187         explicitly requested to be casted.  But the pipeline for an
22188         explicit cast first tests for potential implicit casts.
22189
22190         So for now, if the Location is null, it means `Probe only' to
22191         avoid adding another argument.   Might have to revise this
22192         strategy later.
22193
22194         (ClassCast): New class used to type cast objects into arbitrary
22195         classes (used in Explicit Reference Conversions).
22196
22197         Implement `as' as well.
22198
22199         Reverted all the patches from Ravi below: they were broken:
22200
22201                 * The use of `level' as a mechanism to stop recursive
22202                   invocations is wrong.  That was there just to catch the
22203                   bug with a strack trace but not as a way of addressing
22204                   the problem.
22205
22206                   To fix the problem we have to *understand* what is going
22207                   on and the interactions and come up with a plan, not
22208                   just get things going.
22209
22210                 * The use of the type conversion cache that I proposed
22211                   last night had an open topic: How does this work across
22212                   protection domains.  A user defined conversion might not
22213                   be public in the location where we are applying the
22214                   conversion, a different conversion might be selected
22215                   (ie, private A->B (better) but public B->A (worse),
22216                   inside A, A->B applies, but outside it, B->A will
22217                   apply).
22218
22219                 * On top of that (ie, even if the above is solved),
22220                   conversions in a cache need to be abstract.  Ie, `To
22221                   convert from an Int to a Short use an OpcodeCast', not
22222                   `To convert from an Int to a Short use the OpcodeCast on
22223                   the variable 5' (which is what this patch was doing).
22224
22225 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22226
22227         * expression.cs (Invocation::ConversionExists): Re-write to use
22228         the conversion cache
22229
22230         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22231         cache all conversions done, not just user-defined ones.
22232
22233         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22234         to determine if a conversion exists instead of acutually trying to 
22235         perform the conversion. It's faster too.
22236
22237         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22238         and only then attempt the implicit conversion.
22239
22240 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22241
22242         * expression.cs (ConvertImplicit): Use a cache for conversions
22243         already found. Check level of recursion and bail out if necessary.
22244
22245 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22246
22247         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22248         Export standard methods that we expect for string operations.
22249
22250         * statement.cs (Block::UsageWarning): Track usage of variables and
22251         report the errors for not used variables.
22252
22253         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22254         operator. 
22255
22256 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22257
22258         * codegen.cs: remove unnneded code 
22259
22260         * expression.cs: Removed BuiltinTypeAccess class
22261
22262         Fix the order in which implicit conversions are
22263         done.  
22264
22265         The previous fixed dropped support for boxed conversions (adding a
22266         test to the test suite now)
22267
22268         (UserImplicitCast::CanConvert): Remove test for source being null,
22269         that code is broken.  We should not feed a null to begin with, if
22270         we do, then we should track the bug where the problem originates
22271         and not try to cover it up here.
22272
22273         Return a resolved expression of type UserImplicitCast on success
22274         rather than true/false.  Ravi: this is what I was talking about,
22275         the pattern is to use a static method as a "constructor" for
22276         objects. 
22277
22278         Also, do not create arguments until the very last minute,
22279         otherwise we always create the arguments even for lookups that
22280         will never be performed. 
22281
22282         (UserImplicitCast::Resolve): Eliminate, objects of type
22283         UserImplicitCast are born in a fully resolved state. 
22284
22285         * typemanager.cs (InitCoreTypes): Init also value_type
22286         (System.ValueType). 
22287
22288         * expression.cs (Cast::Resolve): First resolve the child expression.
22289
22290         (LValue): Add new method AddressOf to be used by
22291         the `&' operator.  
22292
22293         Change the argument of Store to take an EmitContext instead of an
22294         ILGenerator, because things like FieldExpr need to be able to call
22295         their children expression to generate the instance code. 
22296
22297         (Expression::Error, Expression::Warning): Sugar functions for
22298         reporting errors.
22299
22300         (Expression::MemberLookup): Accept a TypeContainer instead of a
22301         Report as the first argument.
22302
22303         (Expression::ResolvePrimary): Killed.  I still want to improve
22304         this as currently the code is just not right.
22305
22306         (Expression::ResolveMemberAccess): Simplify, but it is still
22307         wrong. 
22308
22309         (Unary::Resolve): Catch errors in AddressOf operators.
22310
22311         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22312         index to a byte for the short-version, or the compiler will choose
22313         the wrong Emit call, which generates the wrong data.
22314
22315         (ParameterReference::Emit, ::Store): same.
22316
22317         (FieldExpr::AddressOf): Implement.
22318
22319         * typemanager.cs: TypeManager: made public variable instead of
22320         property.
22321
22322         * driver.cs: document --fatal.
22323
22324         * report.cs (ErrorMessage, WarningMessage): new names for the old
22325         Error and Warning classes.
22326
22327         * cs-parser.jay (member_access): Turn built-in access to types
22328         into a normal simplename
22329
22330 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22331
22332         * expression.cs (Invocation::BetterConversion): Fix to cope
22333         with q being null, since this was introducing a bug.
22334
22335         * expression.cs (ConvertImplicit): Do built-in conversions first.
22336
22337 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22338
22339         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22340
22341 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22342
22343         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22344         I had introduced long ago (what's new ?).
22345
22346         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22347         the work of all the checking. 
22348         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22349         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22350
22351         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22352         that is the right way. 
22353
22354         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22355         overloading resolution. Use everywhere instead of cutting and pasting code.
22356
22357         (Binary::ResolveOperator): Use MakeUnionSet.
22358
22359         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22360         we have to convert to bool types. Not complete yet.
22361
22362 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22363
22364         * typemanager.cs (TypeManager::CSharpName): support ushort.
22365
22366         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22367         to provide an expression that performsn an implicit constant int
22368         conversion (section 6.1.6).
22369         (Expression::ConvertImplicitRequired): Reworked to include
22370         implicit constant expression conversions.
22371
22372         (Expression::ConvertNumericExplicit): Finished.
22373
22374         (Invocation::Emit): If InstanceExpression is null, then it means
22375         that we perform a call on this.
22376
22377 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22378
22379         * expression.cs (Unary::Emit): Remove some dead code.
22380         (Probe): Implement Resolve and Emit for `is'.
22381         (Expression::ConvertImplicitRequired): Attempt to do constant
22382         expression conversions here.  Maybe should be moved to
22383         ConvertImplicit, but I am not sure.
22384         (Expression::ImplicitLongConstantConversionPossible,
22385         Expression::ImplicitIntConstantConversionPossible): New functions
22386         that tell whether is it possible to apply an implicit constant
22387         expression conversion.
22388
22389         (ConvertNumericExplicit): Started work on explicit numeric
22390         conversions.
22391
22392         * cs-parser.jay: Update operator constants.
22393
22394         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22395         (Parameters::GetSignature): Hook up VerifyArgs here.
22396         (Parameters::VerifyArgs): Verifies that no two arguments have the
22397         same name. 
22398
22399         * class.cs (Operator): Update the operator names to reflect the
22400         ones that the spec expects (as we are just stringizing the
22401         operator names).
22402
22403         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22404         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22405         previous usage did only work for our methods.
22406         (Expression::ConvertImplicit): Handle decimal implicit numeric
22407         conversions as well.
22408         (Expression::InternalTypeConstructor): Used to invoke constructors
22409         on internal types for default promotions.
22410
22411         (Unary::Emit): Implement special handling for the pre/post
22412         increment/decrement for overloaded operators, as they need to have
22413         the same semantics as the other operators.
22414
22415         (Binary::ResolveOperator): ditto.
22416         (Invocation::ConversionExists): ditto.
22417         (UserImplicitCast::Resolve): ditto.
22418
22419 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22420
22421         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22422         operator, return after emitting body. Regression tests pass again !
22423
22424         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22425         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22426         (Invocation::OverloadResolve): Ditto.
22427         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22428
22429         * everywhere : update calls to the above methods accordingly.
22430
22431 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22432
22433         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22434
22435         * expression.cs (ExpressionStatement): New base class used for
22436         expressions that can appear in statements, so that we can provide
22437         an alternate path to generate expression that do not leave a value
22438         on the stack.
22439
22440         (Expression::Emit, and all the derivatives): We no longer return
22441         whether a value is left on the stack or not.  Every expression
22442         after being emitted leaves a single value on the stack.
22443
22444         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22445         facilties of ExpressionStatement if possible.
22446
22447         * cs-parser.jay: Update statement_expression.
22448
22449 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22450
22451         * driver.cs: Change the wording of message
22452
22453 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22454
22455         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22456         the type of the expression to the return type of the method if
22457         we have an overloaded operator match ! The regression tests pass again !
22458         (Unary::ResolveOperator): Ditto.
22459
22460         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22461         to find "op_Implicit", not "implicit" ;-)
22462         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22463         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22464
22465         * everywhere : Correct calls to the above accordingly.
22466
22467         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22468         (ConvertImplicit): Do user-defined conversion if it exists.
22469
22470 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22471
22472         * assign.cs: track location.
22473         (Resolve): Use implicit conversions on assignment.
22474
22475         * literal.cs: Oops.  Not good, Emit of short access values should
22476         pass (Bytes) or the wrong argument will be selected.
22477
22478         * expression.cs (Unary::Emit): Emit code for -expr.
22479
22480         (Unary::ResolveOperator): Handle `Substract' for non-constants
22481         (substract from zero from the non-constants).
22482         Deal with Doubles as well. 
22483
22484         (Expression::ConvertImplicitRequired): New routine that reports an
22485         error if no implicit conversion exists. 
22486
22487         (Invocation::OverloadResolve): Store the converted implicit
22488         expressions if we make them
22489
22490 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22491
22492         * class.cs (ConstructorInitializer): Take a Location argument.
22493         (ConstructorBaseInitializer): Same here.
22494         (ConstructorThisInitializer): Same here.
22495
22496         * cs-parser.jay : Update all calls accordingly.
22497
22498         * expression.cs (Unary, Binary, New): Take location argument.
22499         Update accordingly everywhere.
22500
22501         * cs-parser.jay : Update all calls to the above to take a location
22502         argument.
22503
22504         * class.cs : Ditto.
22505
22506 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22507
22508         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22509         (Invocation::BetterConversion): Same here
22510         (Invocation::ConversionExists): Ditto.
22511
22512         (Invocation::ConversionExists): Implement.
22513
22514 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22515
22516         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22517         Also take an additional TypeContainer argument.
22518
22519         * All over : Pass in TypeContainer as argument to OverloadResolve.
22520
22521         * typemanager.cs (CSharpName): Update to check for the string type and return
22522         that too.
22523
22524         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22525         a given method.
22526
22527 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22528
22529         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22530         (Invocation::BetterFunction): Implement.
22531         (Invocation::BetterConversion): Implement.
22532         (Invocation::ConversionExists): Skeleton, no implementation yet.
22533
22534         Okay, things work fine !
22535
22536 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22537
22538         * typemanager.cs: declare and load enum_type, delegate_type and
22539         void_type. 
22540
22541         * expression.cs (Expression::Emit): Now emit returns a value that
22542         tells whether a value is left on the stack or not.  This strategy
22543         might be reveted tomorrow with a mechanism that would address
22544         multiple assignments.
22545         (Expression::report118): Utility routine to report mismatches on
22546         the ExprClass.
22547
22548         (Unary::Report23): Report impossible type/operator combination
22549         utility function.
22550
22551         (Unary::IsIncrementableNumber): Whether the type can be
22552         incremented or decremented with add.
22553         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22554         complemented. 
22555         (Unary::ResolveOperator): Implement ++, !, ~,
22556
22557         (Invocation::Emit): Deal with new Emit convetion.
22558
22559         * All Expression derivatives: Updated their Emit method to return
22560         whether they leave values on the stack or not.
22561
22562         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22563         stack for expressions that are statements. 
22564
22565 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22566
22567         * expression.cs (LValue): New interface.  Must be implemented by
22568         LValue objects.
22569         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22570         LValue interface.
22571
22572         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22573         interface for generating code, simplifies the code.
22574
22575 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22576
22577         * expression.cs (everywhere): Comment out return statements in ::Resolve
22578         methods to avoid the warnings.
22579
22580 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22581
22582         * driver.cs (parse): Report error 2001 if we can not open the
22583         source file.
22584
22585         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22586         not resolve it.
22587
22588         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22589         object. 
22590
22591         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22592         otherwise nested blocks end up with the same index.
22593
22594         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22595
22596         * expression.cs:  Instead of having FIXMEs in the Resolve
22597         functions, throw exceptions so it is obvious that we are facing a
22598         bug. 
22599
22600         * cs-parser.jay (invocation_expression): Pass Location information.
22601
22602         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22603         Use a basename for those routines because .NET does not like paths
22604         on them. 
22605
22606         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22607         already defined.
22608
22609 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22610
22611         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22612         are loading the correct data types (throws an exception if not).
22613         (TypeManager::InitCoreTypes): Use CoreLookupType
22614
22615         * expression.cs (Unary::ResolveOperator): return the child
22616         expression for expressions which are just +expr.
22617         (Unary::ResolveOperator): Return negative literals for -LITERAL
22618         expressions (otherwise they are Unary {Literal}).
22619         (Invocation::Badness): Take into account `Implicit constant
22620         expression conversions'.
22621
22622         * literal.cs (LongLiteral): Implement long literal class.
22623         (IntLiteral): export the `Value' of the intliteral. 
22624
22625 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22626
22627         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22628
22629         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22630         instead of 'Operator'
22631
22632         * expression.cs (Binary::ResolveOperator): Update accordingly.
22633         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22634         and 'Minus'
22635
22636         * cs-parser.jay (unary_expression): Update to use the new names.
22637
22638         * gen-treedump.cs (GetUnary): Same here.
22639
22640         * expression.cs (Unary::Resolve): Implement.
22641         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22642         operators are found instead of making noise ;-)
22643         (Unary::ResolveOperator): New method to do precisely the same thing which
22644         Binary::ResolveOperator does for Binary expressions.
22645         (Unary.method, .Arguments): Add.
22646         (Unary::OperName): Implement.   
22647         (Unary::ForceConversion): Copy and Paste !
22648
22649         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22650         a unary operator.
22651
22652         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22653         for the inbuilt operators. Only overloading works for now ;-)
22654
22655 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22656
22657         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22658         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22659
22660         * expression.cs (This::Emit): Implement. 
22661         (This::Resolve): Implement.
22662         (TypeOf:Resolve): Implement.
22663         (Expression::ResolveSimpleName): Add an implicit this to instance
22664         field references. 
22665         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22666         Bind instance variable to Field expressions.
22667         (FieldExpr::Instance): New field used to track the expression that
22668         represents the object instance.
22669         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22670         binding 
22671         (FieldExpr::Emit): Implement.
22672
22673         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22674         the last instruction contains a return opcode to avoid generating
22675         the last `ret' instruction (this generates correct code, and it is
22676         nice to pass the peverify output).
22677
22678         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22679         initializer for static and instance variables.
22680         (Constructor::Emit): Allow initializer to be null in the case of
22681         static constructors.  Only emit initializer for instance
22682         constructors. 
22683
22684         (TypeContainer::FindMembers): Return a null array if there are no
22685         matches.
22686
22687         Also fix the code for the MemberTypes.Method branch, as it was not
22688         scanning that for operators (or tried to access null variables before).
22689
22690         * assign.cs (Assign::Emit): Handle instance and static fields. 
22691
22692         * TODO: Updated.
22693
22694         * driver.cs: Stop compilation if there are parse errors.
22695
22696         * cs-parser.jay (constructor_declaration): Provide default base
22697         initializer for non-static constructors.
22698         (constructor_declarator): Do not provide a default base
22699         initializers if none was specified.
22700         Catch the fact that constructors should not have parameters.
22701
22702         * class.cs: Do not emit parent class initializers for static
22703         constructors, that should be flagged as an error.
22704
22705 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22706
22707         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22708         Move back code into TypeContainer::Populate.
22709
22710 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22711
22712         * class.cs (TypeContainer::AddConstructor): Fix the check to
22713         compare against Name, not Basename. 
22714         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22715
22716         * cs-parser.jay : Update accordingly.
22717
22718         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22719         for methods, don't forget to look into the operators too.
22720         (RegisterMethodBuilder): Helper method to take care of this for
22721         methods, constructors and operators.
22722         (Operator::Define): Completely revamp.
22723         (Operator.OperatorMethod, MethodName): New fields.
22724         (TypeContainer::Populate): Move the registering of builders into
22725         RegisterMethodBuilder.
22726         (Operator::Emit): Re-write.
22727
22728         * expression.cs (Binary::Emit): Comment out code path to emit method
22729         invocation stuff for the case when we have a user defined operator. I am
22730         just not able to get it right !
22731
22732 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22733
22734         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22735         argument. 
22736
22737         (Expression::MemberLookup): Provide a version that allows to
22738         specify the MemberTypes and BindingFlags. 
22739
22740         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22741         so it was not fetching variable information from outer blocks.
22742
22743         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22744         Beforefieldinit as it was buggy.
22745
22746         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22747         that Ravi put here.  
22748
22749         * class.cs (Constructor::Emit): Only emit if block is not null.
22750         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22751         deal with this by semantically definining it as if the user had
22752         done it.
22753
22754         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22755         constructors as we now "emit" them at a higher level.
22756
22757         (TypeContainer::DefineDefaultConstructor): Used to define the
22758         default constructors if none was provided.
22759
22760         (ConstructorInitializer): Add methods Resolve and Emit. 
22761
22762         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22763
22764 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22765
22766         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22767         the default constructor builder with our hashtable for methodbuilders
22768         to methodcores.
22769
22770         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22771         and argument_count is 0 in which case we have a match.
22772         (Binary::ResolveOperator): More null checking and miscellaneous coding
22773         style cleanup.
22774
22775 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22776
22777         * rootcontext.cs (IsNameSpace): Compare against null.
22778
22779         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22780
22781         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22782         and Unary::Operator.
22783
22784         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22785         accordingly.
22786
22787         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22788         we have overloaded operators.
22789         (Binary::ResolveOperator): Implement the part which does the operator overload
22790         resolution.
22791
22792         * class.cs (Operator::Emit): Implement.
22793         (TypeContainer::Emit): Emit the operators we have too.
22794
22795         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22796         the case when we have a user-defined operator.
22797
22798 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22799
22800         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22801
22802 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22803
22804         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22805         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22806         (Constructor::Emit): Implement.
22807         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22808         if we have no work to do. 
22809         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22810         Emit method.
22811
22812         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22813         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22814
22815         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22816         of parent.parent.
22817
22818 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22819
22820         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22821         in the source.
22822         (Tree::RecordNamespace): Method to do what the name says ;-)
22823         (Tree::Namespaces): Property to get at the namespaces hashtable.
22824
22825         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22826         keep track.
22827
22828         * rootcontext.cs (IsNamespace): Fixed it :-)
22829
22830 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22831
22832         * class.cs (TypeContainer::FindMembers): Add support for
22833         constructors. 
22834         (MethodCore): New class that encapsulates both the shared aspects
22835         of a Constructor and a Method.  
22836         (Method, Constructor): Factored pieces into MethodCore.
22837
22838         * driver.cs: Added --fatal which makes errors throw exceptions.
22839         Load System assembly as well as part of the standard library.
22840
22841         * report.cs: Allow throwing exceptions on errors for debugging.
22842
22843         * modifiers.cs: Do not use `parent', instead use the real type
22844         container to evaluate permission settings.
22845
22846         * class.cs: Put Ravi's patch back in.  He is right, and we will
22847         have to cope with the
22848
22849 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22850
22851         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22852         FamORAssem, not FamANDAssem.
22853
22854 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22855
22856         * driver.cs: Added --parse option that only parses its input files
22857         and terminates.
22858
22859         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22860         incorrect.  IsTopLevel is not used to tell whether an object is
22861         root_types or not (that can be achieved by testing this ==
22862         root_types).  But to see if this is a top-level *class* (not
22863         necessarly our "toplevel" container). 
22864
22865 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22866
22867         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22868         parent instead of a direct call to GetType.
22869
22870 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22871
22872         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22873         Modifiers.TypeAttr. This should just be a call to that method.
22874
22875         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22876         object so that we can determine if we are top-level or not.
22877
22878         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22879         TypeContainer too.
22880
22881         * enum.cs (Enum::Define): Ditto.
22882
22883         * modifiers.cs (FieldAttr): Re-write.
22884
22885         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22886         (TypeContainer::HaveStaticConstructor): New property to provide access
22887         to precisely that info.
22888
22889         * modifiers.cs (MethodAttr): Re-write.
22890         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22891
22892         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22893         of top-level types as claimed.
22894
22895 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22896
22897         * expression.cs (MemberLookup): Fruitless attempt to lookup
22898         constructors.  Maybe I need to emit default constructors?  That
22899         might be it (currently .NET emits this for me automatically).
22900         (Invocation::OverloadResolve): Cope with Arguments == null.
22901         (Invocation::EmitArguments): new function, shared by the new
22902         constructor and us.
22903         (Invocation::Emit): Handle static and instance methods.  Emit
22904         proper call instruction for virtual or non-virtual invocations.
22905         (New::Emit): Implement.
22906         (New::Resolve): Implement.
22907         (MemberAccess:Resolve): Implement.
22908         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22909         to track instances.
22910         (FieldExpr::Resolve): Set type.
22911
22912         * support.cs: Handle empty arguments.
22913                 
22914         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22915         SimpleLookup): Auxiliary routines to help parse a qualifier
22916         identifier.  
22917
22918         Update qualifier_identifier rule.
22919
22920         * codegen.cs: Removed debugging messages.
22921
22922         * class.cs: Make this a global thing, this acts just as a "key" to
22923         objects that we might have around.
22924
22925         (Populate): Only initialize method_builders_to_methods once.
22926
22927         * expression.cs (PropertyExpr): Initialize type from the
22928         PropertyType. 
22929
22930         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22931         Resolve pattern.  Attempt to implicitly convert value to boolean.
22932         Emit code.
22933
22934         * expression.cs: Set the type for the int32/int32 argument case.
22935         (Binary::ResolveOperator): Set the return type to boolean for
22936         comparission operators
22937
22938         * typemanager.cs: Remove debugging print code.
22939
22940         (Invocation::Resolve): resolve type.
22941
22942         * class.cs: Allocate a MemberInfo of the correct size, as the code
22943         elsewhere depends on the test to reflect the correct contents.
22944
22945         (Method::) Keep track of parameters, due to System.Reflection holes
22946
22947         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22948         mapping here.
22949
22950         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22951         of the exact size and return that.
22952
22953         (Class::LookupMethodByBuilder): New function that maps
22954         MethodBuilders to its methods.  Required to locate the information
22955         on methods because System.Reflection bit us again.
22956
22957         * support.cs: New file, contains an interface ParameterData and
22958         two implementations: ReflectionParameters and InternalParameters
22959         used to access Parameter information.  We will need to grow this
22960         as required.
22961
22962         * expression.cs (Invocation::GetParameterData): implement a cache
22963         and a wrapper around the ParameterData creation for methods. 
22964         (Invocation::OverloadResolve): Use new code.
22965
22966 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22967
22968         * class.cs (TypeContainer::EmitField): Remove and move into 
22969         (Field::Define): here and modify accordingly.
22970         (Field.FieldBuilder): New member.
22971         (TypeContainer::Populate): Update accordingly.
22972         (TypeContainer::FindMembers): Implement.
22973
22974 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22975
22976         * statement.cs: (VariableInfo::VariableType): New field to be
22977         initialized with the full type once it is resolved. 
22978
22979 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22980
22981         * parameter.cs (GetParameterInfo): Use a type cache to compute
22982         things only once, and to reuse this information
22983
22984         * expression.cs (LocalVariableReference::Emit): Implement.
22985         (OpcodeCast::Emit): fix.
22986
22987         (ParameterReference::Resolve): Implement.
22988         (ParameterReference::Emit): Implement.
22989
22990         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22991         that are expressions need to stay as Expressions.
22992
22993         * typemanager.cs (CSharpName): Returns the C# name of a type if
22994         possible. 
22995
22996         * expression.cs (Expression::ConvertImplicit): New function that
22997         implements implicit type conversions.
22998
22999         (Expression::ImplicitReferenceConversion): Implements implicit
23000         reference conversions.
23001
23002         (EmptyCast): New type for transparent casts.
23003
23004         (OpcodeCast): New type for casts of types that are performed with
23005         a sequence of bytecodes.
23006
23007         (BoxedCast): New type used for casting value types into reference
23008         types.  Emits a box opcode.
23009
23010         (Binary::DoNumericPromotions): Implements numeric promotions of
23011         and computation of the Binary::Type.
23012
23013         (Binary::EmitBranchable): Optimization.
23014
23015         (Binary::Emit): Implement code emission for expressions.
23016
23017         * typemanager.cs (TypeManager): Added two new core types: sbyte
23018         and byte.
23019
23020 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23021
23022         * class.cs (TypeContainer::FindMembers): Method which does exactly
23023         what Type.FindMembers does, only we don't have to use reflection. No
23024         implementation yet.
23025
23026         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23027         typecontainer objects as we need to get at them.
23028         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23029
23030         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23031         typecontainer object.
23032
23033         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23034         of just a Report object.
23035
23036 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23037
23038         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23039         "remove_"
23040         (TypeContainer::Populate): Now define the delegates of the type too.
23041         (TypeContainer.Delegates): Property to access the list of delegates defined
23042         in the type.
23043
23044         * delegates.cs (Delegate::Define): Implement partially.
23045
23046         * modifiers.cs (TypeAttr): Handle more flags.
23047
23048 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23049
23050         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23051         and not <=
23052         (Operator::Define): Re-write logic to get types by using the LookupType method
23053         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23054         (Indexer::Define): Ditto.
23055         (Event::Define): Ditto.
23056         (Property::Define): Ditto.
23057
23058 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23059
23060         * class.cs (TypeContainer::Populate): Now define operators too. 
23061         (TypeContainer.Operators): New property to access the list of operators
23062         in a type.
23063         (Operator.OperatorMethodBuilder): New member to hold the method builder
23064         for the operator we are defining.
23065         (Operator::Define): Implement.
23066
23067 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23068
23069         * class.cs (Event::Define): Make the prefixes of the accessor methods
23070         addOn_ and removeOn_ 
23071
23072         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23073         of the location being passed in too. Ideally, this should go later since all
23074         error reporting should be done through the Report object.
23075
23076         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23077         (Populate): Iterate thru the indexers we have and define them too.
23078         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23079         for the get and set accessors.
23080         (Indexer::Define): Implement.
23081
23082 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23083
23084         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23085         my previous implementation, did not work.
23086
23087         * typemanager.cs: Add a couple of missing types (the longs).
23088
23089         * literal.cs: Use TypeManager.bool_type instead of getting it.
23090
23091         * expression.cs (EventExpr): New kind of expressions.
23092         (Expressio::ExprClassFromMemberInfo): finish
23093
23094 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23095
23096         * assign.cs: Emit stores to static fields differently.
23097
23098 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23099
23100         * Merge in changes and adjust code to tackle conflicts. Backed out my
23101         code in Assign::Resolve ;-) 
23102
23103 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23104
23105         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23106         instead Report.Error and also pass in the location.
23107         (CSharpParser::Lexer): New readonly property to return the reference
23108         to the Tokenizer object.
23109         (declare_local_variables): Use Report.Error with location instead of plain 
23110         old error.
23111         (CheckDef): Ditto.
23112
23113         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23114         (Operator.CheckBinaryOperator): Ditto.
23115
23116         * cs-parser.jay (operator_declarator): Update accordingly.
23117
23118         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23119         (CheckBinaryOperator): Same here.
23120
23121         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23122         on the name without any prefixes of namespace names etc. This is because we
23123         already might have something already fully qualified like 
23124         'System.Console.WriteLine'
23125
23126         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23127
23128 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23129
23130         * cs-tokenizer.cs (location): Return a string which also contains
23131         the file name.
23132
23133         * expression.cs (ElementAccess): New class for expressions of the
23134         type 'element access.'
23135         (BaseAccess): New class for expressions of the type 'base access.'
23136         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23137         respectively.
23138
23139         * cs-parser.jay (element_access): Implement action.
23140         (base_access): Implement actions.
23141         (checked_expression, unchecked_expression): Implement.
23142
23143         * cs-parser.jay (local_variable_type): Correct and implement.
23144         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23145
23146         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23147
23148         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23149         name and the specifiers.
23150
23151         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23152
23153         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23154         making them all public ;-)
23155
23156         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23157         class anyways.
23158
23159 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23160
23161         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23162         PropertyExprs.
23163         (FieldExpr, PropertyExprs): New resolved expressions.
23164         (SimpleName::MemberStaticCheck): Perform static checks for access
23165         to non-static fields on static methods. Maybe this should be
23166         generalized for MemberAccesses. 
23167         (SimpleName::ResolveSimpleName): More work on simple name
23168         resolution. 
23169
23170         * cs-parser.jay (primary_expression/qualified_identifier): track
23171         the parameter index.
23172
23173         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23174         (EmitContext::EmitBoolExpression): Chain to expression generation
23175         instead of temporary hack.
23176         (::EmitStatementExpression): Put generic expression code generation.
23177
23178         * assign.cs (Assign::Emit): Implement variable assignments to
23179         local variables, parameters and fields.
23180
23181 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23182
23183         * statement.cs (Block::GetVariableInfo): New method, returns the
23184         VariableInfo for a variable name in a block.
23185         (Block::GetVariableType): Implement in terms of GetVariableInfo
23186
23187         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23188         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23189
23190 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23191
23192         * cs-parser.jay (operator_declaration): Continue on my quest : update
23193         to take attributes argument.
23194         (event_declaration): Ditto.
23195         (enum_declaration): Ditto.
23196         (indexer_declaration): Ditto.
23197
23198         * class.cs (Operator::Operator): Update constructor accordingly.
23199         (Event::Event): Ditto.
23200
23201         * delegate.cs (Delegate::Delegate): Same here.
23202
23203         * enum.cs (Enum::Enum): Same here.
23204
23205 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23206
23207         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23208
23209         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23210
23211         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23212         being passed around as an arraylist.
23213         (Attributes::AddAttribute): Method to add attribute sections.
23214
23215         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23216         (struct_declaration): Update accordingly.
23217         (constant_declaration): Update.
23218         (field_declaration): Update.
23219         (method_header): Update.
23220         (fixed_parameter): Update.
23221         (parameter_array): Ditto.
23222         (property_declaration): Ditto.
23223         (destructor_declaration): Ditto.
23224
23225         * class.cs (Struct::Struct): Update constructors accordingly.
23226         (Class::Class): Ditto.
23227         (Field::Field): Ditto.
23228         (Method::Method): Ditto.
23229         (Property::Property): Ditto.
23230         (TypeContainer::OptAttribute): update property's return type.
23231
23232         * interface.cs (Interface.opt_attributes): New member.
23233         (Interface::Interface): Update to take the extra Attributes argument.
23234
23235         * parameter.cs (Parameter::Parameter): Ditto.
23236
23237         * constant.cs (Constant::Constant): Ditto.
23238
23239         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23240         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23241         the attributes as a parameter.
23242         (InterfaceProperty): Update constructor call.
23243         (InterfaceEvent): Ditto.
23244         (InterfaceMethod): Ditto.
23245         (InterfaceIndexer): Ditto.
23246
23247         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23248         pass the attributes too.
23249         (interface_event_declaration): Ditto.
23250         (interface_property_declaration): Ditto.
23251         (interface_method_declaration): Ditto.
23252         (interface_declaration): Ditto.
23253
23254 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23255
23256         * class.cs (Method::Define): Track the "static Main" definition to
23257         create an entry point. 
23258
23259         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23260         EntryPoint if we find it. 
23261
23262         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23263         (EmitContext::ig): Make this variable public.
23264
23265         * driver.cs: Make the default output file be the first file name
23266         with the .exe extension.  
23267
23268         Detect empty compilations
23269
23270         Handle various kinds of output targets.  Handle --target and
23271         rename -t to --dumper.
23272
23273         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23274         methods inherited from Expression return now an Expression.  This
23275         will is used during the tree rewriting as we resolve them during
23276         semantic analysis.
23277
23278         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23279         the spec.  Missing entirely is the information about
23280         accessability of elements of it.
23281
23282         (Expression::ExprClassFromMemberInfo): New constructor for
23283         Expressions that creates a fully initialized Expression based on
23284         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23285         a Type.
23286
23287         (Invocation::Resolve): Begin implementing resolution of invocations.
23288
23289         * literal.cs (StringLiteral):  Implement Emit.
23290
23291 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23292
23293         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23294         member.
23295
23296 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23297
23298         * cs-parser.jay (attribute_arguments): Implement actions.
23299         (attribute): Fix bug in production. Implement action.
23300         (attribute_list): Implement.
23301         (attribute_target): Implement.
23302         (attribute_target_specifier, opt_target_specifier): Implement
23303         (CheckAttributeTarget): New method to check if the attribute target
23304         is valid.
23305         (attribute_section): Implement.
23306         (opt_attributes): Implement.
23307
23308         * attribute.cs : New file to handle attributes.
23309         (Attribute): Class to hold attribute info.
23310
23311         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23312         (attribute_section): Modify production to use 2 different rules to 
23313         achieve the same thing. 1 s/r conflict down !
23314         Clean out commented, useless, non-reducing dimension_separator rules.
23315
23316         * class.cs (TypeContainer.attributes): New member to hold list
23317         of attributes for a type.
23318         (Struct::Struct): Modify to take one more argument, the attribute list.
23319         (Class::Class): Ditto.
23320         (Field::Field): Ditto.
23321         (Method::Method): Ditto.
23322         (Property::Property): Ditto.
23323
23324         * cs-parser.jay (struct_declaration): Update constructor call to
23325         pass in the attributes too.
23326         (class_declaration): Ditto.
23327         (constant_declaration): Ditto.
23328         (field_declaration): Ditto.
23329         (method_header): Ditto.
23330         (fixed_parameter): Ditto.
23331         (parameter_array): Ditto.
23332         (property_declaration): Ditto.
23333
23334         * constant.cs (Constant::Constant): Update constructor similarly.
23335         Use System.Collections.
23336
23337         * parameter.cs (Parameter::Parameter): Update as above.
23338
23339 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23340
23341         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23342         (TypeContainer.delegates): New member to hold list of delegates.
23343
23344         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23345         this time as I seem to be on crack ;-)
23346
23347 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23348
23349         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23350         tell whether an identifier represents a namespace.
23351
23352         * expression.cs (NamespaceExpr): A namespace expression, used only
23353         temporarly during expression resolution.
23354         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23355         utility functions to resolve names on expressions.
23356
23357 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23358
23359         * codegen.cs: Add hook for StatementExpressions. 
23360
23361         * class.cs: Fix inverted test for static flag in methods.
23362
23363 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23364
23365         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23366         to make it coincide with MS' number.
23367         (Operator::CheckBinaryOperator): Ditto.
23368
23369         * ../errors/errors.txt : Remove error numbers added earlier.
23370
23371         * ../errors/cs1019.cs : Test case for error # 1019
23372
23373         * ../errros/cs1020.cs : Test case for error # 1020
23374
23375         * cs-parser.jay : Clean out commented cruft.
23376         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23377         used anywhere - non-reducing rule.
23378         (namespace_declarations): Non-reducing rule - comment out.
23379
23380         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23381         with TypeContainer::AddEnum.
23382
23383         * delegate.cs : New file for delegate handling classes.
23384         (Delegate): Class for declaring delegates.
23385
23386         * makefile : Update.
23387
23388         * cs-parser.jay (delegate_declaration): Implement.
23389
23390 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23391
23392         * class.cs (Event::Define): Implement.
23393         (Event.EventBuilder): New member.
23394
23395         * class.cs (TypeContainer::Populate): Update to define all enums and events
23396         we have.
23397         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23398         readonly fields for all these cases ?
23399
23400 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23401
23402         * class.cs (Property): Revamp to use the convention of making fields readonly.
23403         Accordingly modify code elsewhere.
23404
23405         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23406         the Define method of the Property class.
23407
23408         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23409         trivial bug.
23410         (TypeContainer::Populate): Update to define all the properties we have. Also
23411         define all enumerations.
23412
23413         * enum.cs (Define): Implement.
23414
23415 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23416
23417         * cs-parser.jay (overloadable_operator): The semantic value is an
23418         enum of the Operator class.
23419         (operator_declarator): Implement actions.
23420         (operator_declaration): Implement.
23421
23422         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23423         validity of definitions.
23424         (Operator::CheckBinaryOperator): Static method to check for binary operators
23425         (TypeContainer::AddOperator): New method to add an operator to a type.
23426
23427         * cs-parser.jay (indexer_declaration): Added line to actually call the
23428         AddIndexer method so it gets added ;-)
23429
23430         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23431         already taken care of by the MS compiler ?  
23432
23433 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23434
23435         * class.cs (Operator): New class for operator declarations.
23436         (Operator::OpType): Enum for the various operators.
23437
23438 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23439
23440         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23441         ostensibly handle this in semantic analysis.
23442
23443         * cs-parser.jay (general_catch_clause): Comment out
23444         (specific_catch_clauses, specific_catch_clause): Ditto.
23445         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23446         (catch_args, opt_catch_args): New productions.
23447         (catch_clause): Rewrite to use the new productions above
23448         (catch_clauses): Modify accordingly.
23449         (opt_catch_clauses): New production to use in try_statement
23450         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23451         and re-write the code in the actions to extract the specific and
23452         general catch clauses by being a little smart ;-)
23453
23454         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23455         Hooray, try and catch statements parse fine !
23456
23457 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23458
23459         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23460         string from the hashtable of variables.
23461
23462         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23463         I end up making that mistake ;-)
23464         (catch_clauses): Fixed gross error which made Key and Value of the 
23465         DictionaryEntry the same : $1 !!
23466
23467 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23468
23469         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23470
23471         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23472         when the add and remove accessors are specified. 
23473
23474 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23475
23476         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23477         information about indexer_declarator.
23478         (indexer_declarator): Implement actions.
23479         (parsing_indexer): New local boolean used to keep track of whether
23480         we are parsing indexers or properties. This is necessary because 
23481         implicit_parameters come into picture even for the get accessor in the 
23482         case of an indexer.
23483         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23484
23485         * class.cs (Indexer): New class for indexer declarations.
23486         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23487         (TypeContainer::indexers): New member to hold list of indexers for the
23488         type.
23489
23490 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23491
23492         * cs-parser.jay (add_accessor_declaration): Implement action.
23493         (remove_accessor_declaration): Implement action.
23494         (event_accessors_declaration): Implement
23495         (variable_declarators): swap statements for first rule - trivial.
23496
23497         * class.cs (Event): New class to hold information about event
23498         declarations.
23499         (TypeContainer::AddEvent): New method to add an event to a type
23500         (TypeContainer::events): New member to hold list of events.
23501
23502         * cs-parser.jay (event_declaration): Implement actions.
23503
23504 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23505
23506         * cs-parser.jay (dim_separators): Implement. Make it a string
23507         concatenating all the commas together, just as they appear.
23508         (opt_dim_separators): Modify accordingly
23509         (rank_specifiers): Update accordingly. Basically do the same
23510         thing - instead, collect the brackets here.
23511         (opt_rank_sepcifiers): Modify accordingly.
23512         (array_type): Modify to actually return the complete type string
23513         instead of ignoring the rank_specifiers.
23514         (expression_list): Implement to collect the expressions
23515         (variable_initializer): Implement. We make it a list of expressions
23516         essentially so that we can handle the array_initializer case neatly too.
23517         (variable_initializer_list): Implement.
23518         (array_initializer): Make it a list of variable_initializers
23519         (opt_array_initializer): Modify accordingly.
23520
23521         * expression.cs (New::NType): Add enumeration to help us
23522         keep track of whether we have an object/delegate creation
23523         or an array creation.
23524         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23525         members to hold data about array creation.
23526         (New:New): Modify to update NewType
23527         (New:New): New Overloaded contructor for the array creation
23528         case.
23529
23530         * cs-parser.jay (array_creation_expression): Implement to call
23531         the overloaded New constructor.
23532
23533 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23534
23535         * class.cs (TypeContainer::Constructors): Return member
23536         constructors instead of returning null.
23537
23538 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23539
23540         * typemanager.cs (InitCoreTypes): Initialize the various core
23541         types after we have populated the type manager with the user
23542         defined types (this distinction will be important later while
23543         compiling corlib.dll)
23544
23545         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23546         on Expression Classification.  Now all expressions have a method
23547         `Resolve' and a method `Emit'.
23548
23549         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23550         generation from working.     Also add some temporary debugging
23551         code. 
23552
23553 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23554
23555         * codegen.cs: Lots of code generation pieces.  This is only the
23556         beginning, will continue tomorrow with more touches of polish.  We
23557         handle the fundamentals of if, while, do, for, return.  Others are
23558         trickier and I need to start working on invocations soon.
23559
23560         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23561         s.InitStatement. 
23562
23563         * codegen.cs (EmitContext): New struct, used during code
23564         emission to keep a context.   Most of the code generation will be
23565         here. 
23566
23567         * cs-parser.jay: Add embedded blocks to the list of statements of
23568         this block.  So code generation proceeds in a top down fashion.
23569
23570 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23571
23572         * statement.cs: Add support for multiple child blocks.
23573
23574 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23575
23576         * codegen.cs (EmitCode): New function, will emit the code for a
23577         Block of code given a TypeContainer and its ILGenerator. 
23578
23579         * statement.cs (Block): Standard public readonly optimization.
23580         (Block::Block constructors): Link children. 
23581         (Block::Child): Child Linker.
23582         (Block::EmitVariables): Emits IL variable declarations.
23583
23584         * class.cs: Drop support for MethodGroups here, delay until
23585         Semantic Analysis.
23586         (Method::): Applied the same simplification that I did before, and
23587         move from Properties to public readonly fields.
23588         (Method::ParameterTypes): Returns the parameter types for the
23589         function, and implements a cache that will be useful later when I
23590         do error checking and the semantic analysis on the methods is
23591         performed.
23592         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23593         and made a method, optional argument tells whether this is a class
23594         or a structure to apply the `has-this' bit.
23595         (Method::GetCallingConvention): Implement, returns the calling
23596         convention. 
23597         (Method::Define): Defines the type, a second pass is performed
23598         later to populate the methods.
23599
23600         (Constructor::ParameterTypes): implement a cache similar to the
23601         one on Method::ParameterTypes, useful later when we do semantic
23602         analysis. 
23603
23604         (TypeContainer::EmitMethod):  New method.  Emits methods.
23605
23606         * expression.cs: Removed MethodGroup class from here.
23607
23608         * parameter.cs (Parameters::GetCallingConvention): new method.
23609
23610 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23611
23612         * class.cs (TypeContainer::Populate): Drop RootContext from the
23613         argument. 
23614
23615         (Constructor::CallingConvention): Returns the calling convention.
23616         (Constructor::ParameterTypes): Returns the constructor parameter
23617         types. 
23618
23619         (TypeContainer::AddConstructor): Keep track of default constructor
23620         and the default static constructor.
23621
23622         (Constructor::) Another class that starts using `public readonly'
23623         instead of properties. 
23624
23625         (Constructor::IsDefault): Whether this is a default constructor. 
23626
23627         (Field::) use readonly public fields instead of properties also.
23628
23629         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23630         track of static constructors;  If none is used, turn on
23631         BeforeFieldInit in the TypeAttributes. 
23632
23633         * cs-parser.jay (opt_argument_list): now the return can be null
23634         for the cases where there are no arguments. 
23635
23636         (constructor_declarator): If there is no implicit `base' or
23637         `this', then invoke the default parent constructor. 
23638
23639         * modifiers.cs (MethodAttr): New static function maps a set of
23640         modifiers flags into a MethodAttributes enum
23641         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23642         MethodAttr, TypeAttr to represent the various mappings where the
23643         modifiers are used.
23644         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23645
23646 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23647
23648         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23649         method arguments.
23650
23651         * interface.cs (PopulateIndexer): Implemented the code generator
23652         for interface indexers.
23653
23654 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23655
23656         * interface.cs (InterfaceMemberBase): Now we track the new status
23657         here.  
23658
23659         (PopulateProperty): Implement property population.  Woohoo!  Got
23660         Methods and Properties going today. 
23661
23662         Removed all the properties for interfaces, and replaced them with
23663         `public readonly' fields. 
23664
23665 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23666
23667         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23668         initialize their hashtables/arraylists only when they are needed
23669         instead of doing this always.
23670
23671         * parameter.cs: Handle refs and out parameters.
23672
23673         * cs-parser.jay: Use an ArrayList to construct the arguments
23674         instead of the ParameterCollection, and then cast that to a
23675         Parameter[] array.
23676
23677         * parameter.cs: Drop the use of ParameterCollection and use
23678         instead arrays of Parameters.
23679
23680         (GetParameterInfo): Use the Type, not the Name when resolving
23681         types. 
23682
23683 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23684
23685         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23686         and instead use public readonly fields.
23687
23688         * class.cs: Put back walking code for type containers.
23689
23690 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23691
23692         * class.cs (MakeConstant): Code to define constants.
23693
23694         * rootcontext.cs (LookupType): New function.  Used to locate types 
23695
23696
23697 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23698
23699         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23700         this System.Reflection code is.  Kudos to Microsoft
23701
23702         * typemanager.cs: Implement a type cache and avoid loading all
23703         types at boot time.  Wrap in LookupType the internals.  This made
23704         the compiler so much faster.  Wow.  I rule!
23705
23706         * driver.cs: Make sure we always load mscorlib first (for
23707         debugging purposes, nothing really important).
23708
23709         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23710         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23711
23712         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23713         on namespaces that have been imported using the `using' keyword.
23714
23715         * class.cs (TypeContainer::TypeAttr): Virtualize.
23716         (Class::TypeAttr): Return attributes suitable for this bad boy.
23717         (Struct::TypeAttr): ditto.
23718         Handle nested classes.
23719         (TypeContainer::) Remove all the type visiting code, it is now
23720         replaced with the rootcontext.cs code
23721
23722         * rootcontext.cs (GetClassBases): Added support for structs. 
23723
23724 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23725
23726         * interface.cs, statement.cs, class.cs, parameter.cs,
23727         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23728         Drop use of TypeRefs, and use strings instead.
23729
23730 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23731
23732         * rootcontext.cs: 
23733
23734         * class.cs (Struct::Struct): set the SEALED flags after
23735         checking the modifiers.
23736         (TypeContainer::TypeAttr): new property, returns the
23737         TypeAttributes for a class.  
23738
23739         * cs-parser.jay (type_list): Oops, list production was creating a
23740         new list of base types.
23741
23742         * rootcontext.cs (StdLib): New property.
23743         (GetInterfaceTypeByName): returns an interface by type name, and
23744         encapsulates error handling here.
23745         (GetInterfaces): simplified.
23746         (ResolveTree): Encapsulated all the tree resolution here.
23747         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23748         types. 
23749
23750         * driver.cs: Add support for --nostdlib, to avoid loading the
23751         default assemblies.
23752         (Main): Do not put tree resolution here. 
23753
23754         * rootcontext.cs: Beginning of the class resolution.
23755
23756 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23757
23758         * rootcontext.cs: Provide better error reporting. 
23759
23760         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23761
23762         * rootcontext.cs (CreateInterface): Handle the case where there
23763         are no parent interfaces.
23764
23765         (CloseTypes): Routine to flush types at the end.
23766         (CreateInterface): Track types.
23767         (GetInterfaces): Returns an array of Types from the list of
23768         defined interfaces.
23769
23770         * typemanager.c (AddUserType): Mechanism to track user types (puts
23771         the type on the global type hash, and allows us to close it at the
23772         end). 
23773
23774 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23775
23776         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23777         RecordInterface instead.
23778
23779         * cs-parser.jay: Updated to reflect changes above.
23780
23781         * decl.cs (Definition): Keep track of the TypeBuilder type that
23782         represents this type here.  Not sure we will use it in the long
23783         run, but wont hurt for now.
23784
23785         * driver.cs: Smaller changes to accomodate the new code.
23786
23787         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23788         when done. 
23789
23790         * rootcontext.cs (CreateInterface):  New method, used to create
23791         the System.TypeBuilder type for interfaces.
23792         (ResolveInterfaces): new entry point to resolve the interface
23793         hierarchy. 
23794         (CodeGen): Property, used to keep track of the code generator.
23795
23796 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23797
23798         * cs-parser.jay: Add a second production for delegate_declaration
23799         with `VOID'.
23800
23801         (enum_body): Put an opt_comma here instead of putting it on
23802         enum_body or enum_member_declarations so we can handle trailing
23803         commas on enumeration members.  Gets rid of a shift/reduce.
23804
23805         (type_list): Need a COMMA in the middle.
23806
23807         (indexer_declaration): Tell tokenizer to recognize get/set
23808
23809         * Remove old targets.
23810
23811         * Re-add the parser target.
23812
23813 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23814
23815         * cs-parser.jay: Add precendence rules for a number of operators
23816         ot reduce the number of shift/reduce conflicts in the grammar.
23817
23818 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23819
23820         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23821         and put it here.
23822
23823         Get rid of old crufty code.
23824
23825         * rootcontext.cs: Use this to keep track of the parsed
23826         representation and the defined types available to the program. 
23827
23828         * gen-treedump.cs: adjust for new convention.
23829
23830         * type.cs: Split out the type manager, and the assembly builder
23831         from here. 
23832
23833         * typemanager.cs: the type manager will live here now.
23834
23835         * cil-codegen.cs: And the code generator here. 
23836
23837 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23838
23839         * makefile: Fixed up for easy making.
23840
23841 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23842
23843         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23844         the 
23845
23846         (unary_expression): Expand pre_increment_expression and
23847         post_decrement_expression to reduce a shift/reduce.
23848
23849 2001-07-11  Simon Cozens
23850
23851         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23852
23853         Improve allow_keyword_as_indent name.
23854
23855 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23856
23857         * Adjustments for Beta2. 
23858
23859 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23860
23861         * decl.cs: Added `Define' abstract method.
23862         (InTransit): new property, used to catch recursive definitions. 
23863
23864         * interface.cs: Implement `Define'. 
23865
23866         * modifiers.cs: Map Modifiers.constants to
23867         System.Reflection.TypeAttribute flags.
23868
23869         * class.cs: Keep track of types and user-defined types.
23870         (BuilderInit): New method for creating an assembly
23871         (ResolveType): New function to launch the resolution process, only
23872         used by interfaces for now.
23873
23874         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23875         that are inserted into the name space. 
23876
23877 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23878
23879         * ARGH.  I have screwed up my tree so many times due to the use of
23880         rsync rather than using CVS.  Going to fix this at once. 
23881
23882         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23883         load types.
23884
23885 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23886
23887         * Experiment successful: Use System.Type rather that our own
23888         version of Type.  
23889
23890 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23891
23892         * cs-parser.jay: Removed nsAliases from here.
23893
23894         Use new namespaces, handle `using XXX;' 
23895
23896         * namespace.cs: Reimplemented namespace handling, use a recursive
23897         definition of the class.  Now we can keep track of using clauses
23898         and catch invalid using clauses.
23899
23900 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23901
23902         * gen-treedump.cs: Adapted for all the renaming.
23903
23904         * expression.cs (Expression): this class now has a Type property
23905         which returns an expression Type.
23906
23907         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23908         `Type', as this has a different meaning now in the base
23909
23910 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23911
23912         * interface.cs, class.cs: Removed from all the sources the
23913         references to signature computation, as we can not do method
23914         signature computation during the parsing time, as we are not
23915         trying to solve at that point distinguishing:
23916
23917         class X {
23918                 void a (Blah x) {}
23919                 void a (NS.Blah x) {}
23920         }
23921
23922         Which depending on the context might be valid or not, as we do not
23923         know if Blah is the same thing as NS.Blah at that point.
23924
23925         * Redid everything so the code uses TypeRefs now instead of
23926         Types.  TypeRefs are just temporary type placeholders, that need
23927         to be resolved.  They initially have a pointer to a string and the
23928         current scope in which they are used.  This is used later by the
23929         compiler to resolve the reference to an actual Type. 
23930
23931         * DeclSpace is no longer a CIR.Type, and neither are
23932         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23933         are all DeclSpaces, but no Types. 
23934
23935         * type.cs (TypeRefManager): This implements the TypeRef manager,
23936         which keeps track of all the types that need to be resolved after
23937         the parsing has finished. 
23938
23939 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23940
23941         * ARGH.  We are going to have to store `foreach' as a class rather
23942         than resolving it, as we need to verify error 1579 after name
23943         resolution.   *OR* we could keep a flag that says `This request to
23944         IEnumerator comes from a foreach statement' which we can then use
23945         to generate the error.
23946
23947 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23948
23949         * class.cs (TypeContainer.AddMethod): we now add methods to the
23950         MethodGroup instead of the method hashtable.  
23951
23952         * expression.cs: Add MethodGroup abstraction, which gets us one
23953         step closer to the specification in the way we handle method
23954         declarations.  
23955
23956         * cs-parser.jay (primary_expression): qualified_identifier now
23957         tried to match up an identifier to a local variable reference or
23958         to a parameter reference.
23959
23960         current_local_parameters is now a parser global variable that
23961         points to the current parameters for the block, used during name
23962         lookup.
23963
23964         (property_declaration): Now creates an implicit `value' argument to
23965         the set accessor.
23966
23967 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23968
23969         * parameter.cs: Do not use `param' arguments as part of the
23970         signature, per the spec.
23971
23972 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23973
23974         * decl.cs: Base class for classes, structs and interfaces.  This
23975         is the "Declaration Space" 
23976
23977         * cs-parser.jay: Use CheckDef for checking declaration errors
23978         instead of having one on each function.
23979
23980         * class.cs: Factor out some code for handling error handling in
23981         accordance to the "Declarations" section in the "Basic Concepts"
23982         chapter in the ECMA C# spec.
23983
23984         * interface.cs: Make all interface member classes derive from
23985         InterfaceMemberBase.
23986
23987 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23988
23989         * Many things: all interfaces are parsed and generated in
23990         gen-treedump.  Support for member variables, constructors,
23991         destructors, properties, constants is there.
23992
23993         Beginning of the IL backend, but very little done, just there for
23994         testing purposes. 
23995
23996 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23997
23998         * cs-parser.jay: Fix labeled statement.
23999
24000         * cs-tokenizer.cs (escape): Escape " and ' always.
24001         ref_line, ref_name: keep track of the line/filename as instructed
24002         by #line by the compiler.
24003         Parse #line.
24004
24005 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24006
24007         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24008         to match the values in System.CodeDOM.
24009
24010         Divid renamed to Divide.
24011
24012         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24013         statements. 
24014         (Statements.set): remove.
24015
24016         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24017         statements. 
24018
24019         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24020         falseStatements always have valid values. 
24021
24022         * cs-parser.jay: Use System.CodeDOM now.
24023