* attribute.cs (GetMarshal): Work even if "DefineCustom" is
[mono.git] / mcs / mcs / ChangeLog
1 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2
3         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4         internal.
5
6         Fix #75941.
7         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8         flow-branching for LocalVariableReferences in case we were invoked
9         from a MemberAccess.
10         * expression.cs (LocalVariableReference.VerifyAssigned): New.
11         Carved out of ...
12         (LocalVariableReference.DoResolveBase): ... this.
13         (MemberAccess.Resolve): Do the check that was disabled during
14         SimpleNameResolve.
15
16 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
17
18         * class.cs :
19           (PartialContainer.Create): check abstract/sealed/static strictly
20           but abstract/sealed can exist only at one side. Fixed bug #75883.
21
22 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
23
24         Fix #75945.
25         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
26         specified, don't default to UnmanagedType.I4.
27
28 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
29
30         * expression.cs : conditional operator should check possibly
31           incorrect assign expression. Fixed bug #75946.
32
33 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
34
35         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
36           Reverting the change. gmcs is much complex than mcs on this matter.
37
38 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
39
40         * cs-tokenizer.cs : To read another token ahead of the actual 
41           consumption, use new SavedToken and cache token instead of moving
42           back the stream with SeekableStreamReader (it seemed problematic).
43         * cs-parser.jay,
44           driver.cs : Thus use StreamReader directly.
45         * support.cs : Thus removed SeekableStreamReader.
46
47 2005-08-30  Raja R Harinath  <rharinath@novell.com>
48
49         Fix #75934.
50         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
51         (ScopeInfo.EmitScopeType): Use it to construct field names from
52         names of captured locals.
53
54         Fix #75929.
55         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
56         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
57         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
58         (ExplicitConversion): Remove enum cases already handled by
59         implicit conversion.  Move implicit conversion check to the beginning.
60         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
61         * expression.cs (ArrayCreation.EmitDynamicInitializers):
62         Don't treat System.Enum as a struct.
63
64 2005-08-30  Jb Evain  <jbevain@gmail.com>
65
66         * attribute.cs: handles as expression in parameters.
67
68 2005-08-30  Raja R Harinath  <rharinath@novell.com>
69
70         Fix #75802.
71         * class.cs (TypeContainer.VerifyClsName): Don't use a
72         PartialContainer when verifying CLS compliance.
73         (AbstractPropertyEventMethod): Set Parent here, ...
74         (PropertyMethod): ... not here.
75
76 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
77
78         * attribute.cs : escaped attribute name should not be allowed to be
79           resolved (e.g. @class as classAttribute). Fixed bug #75930.
80
81 2005-08-29  Raja R Harinath  <rharinath@novell.com>
82
83         Fix #75927.
84         * convert.cs (ImplicitStandardConversionExists): Allow zero also
85         when converting a long constant to unsigned long.
86         * expression.cs (Invocation.OverloadResolve): Add sanity check to
87         detect where IsApplicable and VerifyArgumentsCompat disagree.
88
89 2005-08-29  Raja R Harinath  <rharinath@novell.com>
90         and Carlos Alberto Cortez  <carlos@unixmexico.org>
91
92         Fix #75848.
93         * class.cs (TypeContainer.CanElideInitializer): New helper.
94         (TypeContainer.EmitFieldInitializers): Use it to determine if we
95         can safely emitting the initializer of a field.
96
97 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
98
99         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
100           allowed inside a switch (without loop). Fixed bug #75433.
101
102 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
103
104         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
105         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
106
107 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
108
109         * driver.cs : kinda reverting the default encoding changes (not exact 
110           revert since I noticed that "codepage:reset" might not work fine).
111
112 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
113
114         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
115           Location. Now getter and setter store location correctly.
116           (errors/cs0111-12.cs now reports the expected location.)
117
118 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
119
120         * driver.cs : Use default encoding on the environment.
121           Removed (now that) extra parameter for SeekableStreamReader.
122         * support.cs : (SeekableStreamReader) third .ctor() argument for
123           StreamReader is not required (always true). preamble size could
124           be acquired in simpler and safe way.
125
126 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
127
128         * cs-parser.jay: report CS0642 at warning level 3
129           and report CS0642 for an if else statement also
130           fixes bug #74745. Patch by John Luke (and a bit
131           modified by me).
132           Removed extra CS0642 warning check for "while",
133           "for" and "fixed".
134         * statement.cs: In Block.Resolve(), CS0642 check
135           is reimplemented to check a sequence of an empty
136           statement and a block.
137
138           Both fix bug #66777.
139
140 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
141
142         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
143         detection until I fix it.
144         
145         * cs-tokenizer.cs: Changed error message.
146         
147         * cs-parser.jay: Fixed 2 error locations.
148         
149         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
150         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
151         properties.
152         
153         * enum.cs (GetSignatureForError): Fixed.
154         
155         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
156         method detection.
157         
158         * class.cs,
159         * typemanager.cs (RegisterProperty): Removed.
160         
161         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
162
163 2005-08-24  Raja R Harinath  <rharinath@novell.com>
164
165         Fix #75874.
166         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
167         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
168
169 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
170
171         * expression.cs : tiny fix is required for not warning positive ulong.
172           See test-441.cs.
173
174 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
175
176         * expression.cs : add CS0652 check for constant and integral
177           expression. Fixed bug #53974.
178
179 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
180
181         * expression.cs : in DoNumericPromotions(), check if there is implicit
182           conversion overload for string (to check CS0034). Fixed bug #52492.
183
184 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
185
186         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
187
188 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
189
190         * ecore.cs : report location when it is *not* Null.
191
192 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
193
194         * codegen.cs,
195           ecore.cs,
196           flowanalysis.cs,
197           expression.cs:
198           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
199           correctly. Fixed bug #75721.
200
201 2005-08-23  Raja R Harinath  <rharinath@novell.com>
202
203         * support.cs (SeekableStreamReader.Position): Avoid an expensive
204         loop that performs 'min (pos, char_count)'.
205
206         Fix #75862.
207         * expression.cs (Unary.ResolveOperator): Don't discard implicit
208         converted value in Operator.OnesComplement.
209
210 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
211
212         * anonymous.cs: If the anon method is pulled into a helper class,
213         it needs to be `internal' not `private'. Fixes runtime behavior on
214         msft. bug #75704
215
216 2005-08-20  Martin Baulig  <martin@ximian.com>
217
218         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
219         scope if we don't already have it.
220
221         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
222         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
223         fixes #75867.
224
225 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
226
227         Fix #75803
228         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
229         is a partial class.
230
231 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
232
233         The big constants rewrite
234         Fix #75746, #75685 and more
235         As a side effect saved 1MB for MWF ;-)
236         
237         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
238         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
239         enum based for corlib compilation.
240         
241         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
242         subtractions.
243         
244         * class.cs (FixedField.Define): Use ResolveAsConstant.
245         
246         * const.cs (IConstant): Interface constants and enums.
247         (Const.ResolveValue): New method for constant resolvning.
248         (ExternalConstant): Constants from imported assemblies.
249         
250         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
251         conversion; like enums.
252         (Constant.ToType): Converts this constant to different type.
253         (Constant.Increment): Adds 1.
254         
255         * convert.cs (ImplicitConversionRequired): Simplified.
256         
257         * cs-parser.jay: Create EnumMember directly.
258         
259         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
260         
261         * doc.cs (GenerateEnumDocComment): Removed.
262         
263         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
264         (ConvertIntLiteral): Removed.
265         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
266         
267         * enum.cs (EnumMember): Implement IConstant.
268         (Enum.IsValidEnumConstant): Removed.
269         (Enum.GetNextDefaultValue): Removed.
270         (Enum.FindMembers): Updated.
271         (Enum.GenerateDocComment): Iterate enum members.
272         
273         * expression.cs (Cast.TryReduce): Handle enums correctly.
274         (New.Constantify): Made public.
275         (MemberAccess.DoResolve): Removed contant specific if(s).
276         
277         * literal.cs (NullLiteral): Implement new abstract methods.
278         
279         * statement.cs (GotoCase.Resolve): Use new constant methods.
280         (SwitchLabel.ResolveAndReduce): Use new constant methods.
281         
282         * typemanager.cs (LookupEnum): Removed.
283         (IsEnumType): Fixed to work with corlib.
284         (RegisterConstant): Removed.
285         (LookupConstant): Removed.
286         (GetConstant): Changed to work with IConstant.
287
288 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
289
290         * location.cs : Fixed overflown (>255) column number.
291
292 2005-08-03  Raja R Harinath  <rharinath@novell.com>
293
294         First cut of the qualified-alias-member feature.
295         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
296         token.
297         * cs-parser.jay (DOUBLE_COLON): New token.
298         (namespace_or_type_name): Add rule for recognizing
299         qualified-alias-members.
300         (primary_expression): Likewise.
301         (element_access): Allow QualifiedAliasMember as a possible
302         type-bearing expression.
303         (local_variable_type, local_variable_pointer_type): Likewise.
304         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
305         aliases in the current and enclosing namespace declarations.
306         (NamespaceEntry.UsingAlias): Add CS0440 warning.
307         * decl.cs (MemberName.is_double_colon): New.
308         (MemberName.MemberName): Add new constructor for alias-member.
309         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
310         * expression.cs (QualifiedAliasMember): New expression type.
311
312 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
313
314         * location.cs : it borked when no argument was specified.
315
316 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
317
318         * location.cs : tiny ToString() format fix.
319
320 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
321
322         * statement.cs : oops, it was missing.
323
324 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
325
326         A set of fixes for precise line/column location.
327
328         * location.cs :
329           "token" field now holds a file/line "delta", a line number offset 
330           from the segment, and a column number. See also:
331           http://lists.ximian.com/pipermail/mono-devel-list/2004-
332           December/009508.html
333           Removed static IsNull. Use instance IsNull property instead.
334         * cs-tokenizer.cs :
335           For some tokens it stores Location. For Identifier it stores
336           LocatedToken which is a pair of string name and location.
337           Column numbers are adjusted only at getChar().
338         * report.cs :
339           Use Location.ToString() for reporting (it now contains column).
340         * cs-parser.jay :
341           Largely modified to use LocatedToken instead of
342           string (IDENTIFIER), and to acquire Location from some tokens.
343         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
344           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
345           codegen.cs :
346           Now MemberName holds Location. DeclSpace.ctor() receives Location
347           as a parameter. Removed extra parameters to all derived classes.
348           Replaced Location.IsNull() with instance property.
349         * assign.cs, expression.cs :
350           Added .ctor() overload that omits Location.
351         * attribute.cs :
352           Added "nameEscaped" flag that indicates the identifier was escaped
353           in the source file. This fixes bug #57047.
354
355 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
356
357         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
358         New method, looking for lo-case imported cls type.
359
360         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
361         here.
362
363         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
364
365         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
366
367         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
368         all_imported_types.
369         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
370
371         Optimized to save 3.5 MB for SWF compilation.
372
373 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
374
375         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
376         (PartialContainer.Create): Moved logic AddToContainer.
377         (PartialContainer.MarkForDuplicationCheck): Shares name.
378         
379         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
380         place.
381         
382         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
383         initialization.
384         (Namespace.GetSignatureForError): New method.
385         
386         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
387         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
388
389 2005-08-01  Raja R Harinath  <rharinath@novell.com>
390
391         Fix #75669.
392         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
393         member lookup rather than qualifier_type, since qualifier_type can
394         be null.
395
396 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
397
398         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
399         enum member.
400
401 2005-07-31  Miguel de Icaza  <miguel@novell.com>
402
403         * statement.cs: Copy the local exception into the exception
404         captured local.  Fixes 75674
405
406 2005-07-31  Raja R Harinath  <harinath@gmail.com>
407
408         Fix #75658.
409         * expression.cs (Invocation.OverloadResolve): Don't report error
410         CS1501 if error CS1502 has been reported.
411         (New.DoResolve): Delegate CS1501 reporting to
412         Invocation.OverloadResolve.
413
414         Fix #75656.
415         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
416         invariant-meaning-in-block property in an enclosing block if
417         necessary.
418
419 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
420
421         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
422         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
423         (Switch.CheckSwitch): Just save 50kb for SWF.
424
425 2005-07-27  Martin Baulig  <martin@ximian.com>
426
427         * anonymous.cs (CaptureContext.AddField): Added
428         `AnonymousContainer am' argument; compute its toplevel scope if
429         it's not already computed.  Fixes #75649.
430
431 2005-07-26  Raja R Harinath  <rharinath@novell.com>
432
433         Fix #75628.
434         * class.cs (Constructor.Emit): Reset block to null if the block
435         resolve fails.
436
437 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
438
439         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
440
441 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
442
443         * class.cs (MethodData.Define): Check whether accessor implementing
444         interface is public.
445
446         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
447
448 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
449
450         Fix #57245
451         * namespace.cs (LookupType): Moved same type check to...
452         
453         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
454         with the same name.
455
456 2005-07-21  Raja R Harinath  <rharinath@novell.com>
457
458         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
459         already found a typebuilder.
460         * class.cs (MethodCore.IsDuplicateImplementation): Compare
461         MemberNames, not strings.
462
463         * const.cs (Error_ExpressionMustBeConst): 
464         Rename from Error_EpressionMustBeConst.
465         * const.cs, class.cs, statement.cd: Update.
466
467 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
468
469         Fix #65573
470
471         * const.cs (Const.LookupConstantValue): Report missing contant expression
472         everytime.
473         (Error_EpressionMustBeConstant): Only one error method.
474
475         * class.cs, statement.c: Updated.
476
477 2005-07-20  Raja R Harinath  <rharinath@novell.com>
478
479         * statement.cs (Block.Flags): Add back HasVarargs.
480         (Block.flags): Make protected.
481         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
482
483         * typemanager.cs (types, typecontainers, user_types): Remove.
484         (UserTypes, TypeContainers): Likewise.
485         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
486         (CleanUp, Reset): Update.
487         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
488         (GetNestedType): Use Type.GetNestedType.
489         (CoreLookupType): Take two arguments, the namespace and the
490         basename of the type.  Update to use the Namespace.Lookup
491         mechanism.
492         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
493         (RealMemberLookup): Use IsNestedChildOf instead of playing with
494         string concatenation and substring matches.
495         * class.cs, enum.cs, delegate.cs: Update to changes.
496
497 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
498
499         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
500         Expression and made virtual.
501
502         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
503         (ImplicitStandardConversionExists): Fixed `byte' typo ?
504
505         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
506
507         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
508         error message.
509
510         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
511         change.
512
513 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
514
515         Fix #57707
516         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
517         AssemblyCultureAttribute is not used on executable.
518
519         * rootcontext.cs,
520         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
521
522 2005-07-16  Raja R Harinath  <rharinath@novell.com>
523
524         Fix #60638.
525         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
526         New.  Reports CS0252/CS0253.
527         Mostly taken from preliminary patch by Duncak Mak.
528         (Binary.DoResolveOperator): Store results of operator lookup.
529         Use them to detect if we need to warn about unintended reference
530         comparisons.
531
532 2005-07-15  Raja R Harinath  <rharinath@novell.com>
533
534         Fix #72969.
535         * namespace.cs (Namespace.Lookup): Add back location parameter.
536         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
537         * delegate.cs, ecore.cs, expression.cs: Update to changes.
538
539         * codegen.cs (EmitContext.DeclSpace): Make readonly.
540         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
541         (Namespace.LookupType): ... this.
542         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
543         of namespaces.
544         * typemanager.cs (LookupTypeReflection): Remove buggy code that
545         purported to handle pointers.
546         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
547         CoreLookupType.
548
549 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
550
551         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
552         type as namespace.
553
554 2005-07-15  Raja R Harinath  <rharinath@novell.com>
555
556         * namespace.cs (Namespace.Lookup): Drop location parameter.
557         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
558         (NamespaceEntry.Lookup): ... this.
559         (NamespaceEntry.Error_AmbiguousTypeReference):
560         Move here from DeclSpace.
561         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
562         names ...
563         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
564         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
565         Move to NamespaceEntry.
566         * delegate.cs, expression.cs: Update to changes.
567
568 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
569
570         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
571         CheckAttributeType and refactored.
572         (Attribute.ResolvePossibleAttributeType): Changed to reuse
573         ResolveAsTypeTerminal error handling.
574         (ResolveAsTypeTerminal): Introduced because of global attributes extra
575         handling.
576         (GetSignatureForError): Print errors in same way.
577
578         * class.cs,
579         * codegen.cs: Reflect attribute GetSignatureForError change.
580
581         * ecore.cs,
582         * expression.cs: Add silent parameter to ResolveAsTypeStep.
583
584         * namespace.cs (UsingEntry): Refactored to make fields private.
585
586         * assign.cs,
587         statement.cs: Error_UnexpectedKind has extra parameter.
588
589 2005-07-14  Raja R Harinath  <rharinath@novell.com>
590
591         * ecore.cs (IAlias): Remove.
592         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
593         that implement the interface.
594         * namespace.cs (Namespace): Likewise.
595         (Namespace.declspaces): Renamed from 'defined_names'.
596         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
597         DeclSpace instead of an IAlias.
598         * tree.cs (Tree.AddDecl): Update.
599
600 2005-07-12  Raja R Harinath  <rharinath@novell.com>
601
602         * statement.cs (Block.Flags); Remove HasVarargs.
603         (Block.HasVarargs): Move to ToplevelBlock.
604         (Block.ThisVariable, Block.AddThisVariable): Likewise.
605         (Block.Variables): Make protected.  Initialize variable hashtable
606         if necessary.
607         (Block.AddVariable): Update.
608         (Block.Resolve): Update to changes.
609         (ToplevelBlock.HasVarargs): New boolean.
610         (ToplevelBlock.ThisVariable): Move here from Block.
611         (ToplevelBlock.AddThisVariable): Likewise.
612         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
613         * expression.cs (This.ResolveBase): Update to changes.
614         (ArglistAccess.DoResolve): Likewise.
615
616 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
617
618         Fix #75321
619         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
620
621         * class.cs (TypeContainer.VerifyMembers): Distinguish between
622         not used and not used & assigned.
623         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
624
625 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
626
627         Fix #75053
628         * expression.cs (Is.DoResolve): null is never provided type.
629
630 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
631
632         Fix #52496
633         * cs-parser.jay: Less strict event error rule to catch more errors.
634
635 2005-07-08  Martin Baulig  <martin@ximian.com>
636
637         Fix test-iter-10.cs - distinguish whether we `yield' in a property
638         gettter (allowed) or setter (not allowed).
639
640         * class.cs (Accessor): Implement IIteratorContainer.
641         (Accessor.Yields): New public field.
642         (PropertyBase.PropertyMethod.Define): Handle iterators on a
643         per-accessor basis.
644
645         * cs-parser.jay
646         (get_accessor_declaration, set_accessor_declaration): Set the
647         `yields' flag on the accessor, not the property.
648         (property_declaration): Do the iterators check on a per-accessor
649         basis and not for the whole property.
650
651 2005-07-08  Martin Baulig  <martin@ximian.com>
652
653         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
654         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
655
656 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
657
658         Fix #74975
659         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
660         (ExtractSecurityPermissionSet): Cope with self referencing security
661         attributes properly.
662
663         * driver.cs (SetOutputFile): Made public property OutputFile.
664
665 2005-07-07  Raja R Harinath  <rharinath@novell.com>
666
667         Fix #75486.
668         * class.cs (TypeContainer.first_nonstatic_field): Rename from
669         has_nonstatic_fields.  Make into a FieldBase pointer.
670         (TypeContainer.AddField): Add CS0282 check.
671         (TypeContainer.EmitType): Update.
672
673 2005-07-06  Miguel de Icaza  <miguel@novell.com>
674
675         * cs-tokenizer.cs (consume_identifier): Do not create strings to
676         compare if they start with __.
677
678 2005-07-06  Raja R Harinath  <rharinath@novell.com>
679
680         * statement.cs (Switch.SwitchGoverningType): Only look at
681         UserCasts that don't need implicit standard conversions to one of
682         the allowed switch types (Fixes test-322.cs).
683         (LocalInfo.Resolve): Re-enable sanity-test.
684
685 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
686
687         * cs-tokenizer.cs (consume_identifier): Detect double undescores
688         
689         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
690         
691         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
692
693 2005-07-06  Raja R Harinath  <rharinath@novell.com>
694
695         Fix #75472.
696         * ecore.cs (SimpleName.GetSignatureForError): Add.
697         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
698         (MemberAccess.GetSignatureForError): Add.
699
700 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
701  
702         The big error and warning messages review.
703         
704         * anonymous.cs,
705         * assign.cs,
706         * attribute.cs,
707         * class.cs,
708         * codegen.cs,
709         * convert.cs,
710         * cs-parser.jay,
711         * cs-tokenizer.cs,
712         * decl.cs,
713         * delegate.cs,
714         * doc.cs,
715         * driver.cs,
716         * ecore.cs,
717         * enum.cs,
718         * expression.cs,
719         * flowanalysis.cs,
720         * iterators.cs,
721         * literal.cs,
722         * location.cs,
723         * modifiers.cs,
724         * namespace.cs,
725         * parameter.cs,
726         * pending.cs,
727         * report.cs,
728         * rootcontext.cs,
729         * statement.cs,
730         * support.cs,
731         * tree.cs,
732         * typemanager.cs: Updated.
733         
734         * class.cs: (MethodCore.SetYields): Moved here to share.
735         (PropertyMethod.Define): Moved iterator setup here.
736         
737         * iterators.cs: Add orig_method to have full access to parent
738         container.
739
740 2005-07-05  Raja R Harinath  <rharinath@novell.com>
741
742         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
743         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
744         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
745         variable of struct type.
746         * expression.cs (Unary.ResolveOperator): Update to change.
747         (Indirection.VerifyFixed): Likewise.
748         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
749         (ParameterReference.VerifyFixed): Value parameters are fixed.
750         (This.VerifyFixed): Treat 'this' as a value parameter.
751         * statement.cs (LocalInfo.IsFixed): Remove.
752
753 2005-07-01  Martin Baulig  <martin@ximian.com>
754
755         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
756         `ec.EmitThis ()' to get the correct scope.
757
758 2005-07-01  Martin Baulig  <martin@ximian.com>
759
760         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
761         instance is a ParameterReference; fixes #75299.
762
763 2005-07-01  Martin Baulig  <martin@ximian.com>
764
765         Reverted Marek's latest patch (r46725):
766         - it contains structural changes which are neither mentioned in
767           the ChangeLog nor explained anywhere; for example the additional
768           argument of EmitContext's and Iterator's .ctor's and the
769           TypeContainer.DefineMembers() change.
770         - structural changes like this should go in in seperate patches
771           and not be hidden in a huge patch which just seems to affect
772           warnings and errors.
773           a big and hard to understand patch.
774         - it breaks iterators and causes regressions, for instance in
775           test-iter-03.cs.      
776
777 2005-06-30  Raja R Harinath  <rharinath@novell.com>
778
779         Fix #75412.
780         * expression.cs (Indexers.map): Remove.
781         (Indexers.Append): Filter out inaccessible setters and getters.
782         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
783
784         Fix #75283.
785         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
786         Refactored from ...
787         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
788         (FieldExpr.Emit, PropertyExpr.Emit): Update.
789         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
790         * expression.cs (Invocation.EmitCall): Add CS0120 check.
791
792 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
793
794         Fix #75322
795         * class.cs (FieldBase.GetInitializerExpression): One more field
796         for backup.
797
798 2005-06-28  Miguel de Icaza  <miguel@novell.com>
799
800         * pending.cs: Do not define a proxy if the base method is virtual,
801         it will be picked up by the runtime (bug 75270).
802
803 2005-06-08  Martin Baulig  <martin@ximian.com>
804
805         The big Iterators rewrite :-)
806
807         * iterators.cs: Rewrite this to use the anonymous methods framework.
808
809         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
810         before the TypeContainers; see 2test-21.cs.
811
812         * class.cs
813         (TypeContainer.DefineType): Don't create a new EmitContext if we
814         already have one (this only happens if we're an Iterator).
815         (TypeContainer.Define): Also call Define() on all our iterators.
816         (Method.CreateEmitContext): Added support for iterators.
817
818         * anonymous.cs
819         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
820         (AnonymousContainer.CreateMethodHost): Moved here from
821         AnonymousMethod and made abstract.
822         (AnonymousContainer.CreateScopeType): New abstract method.
823         (AnonymousContainer.IsIterator): New public property.
824         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
825         get the ScopeTypeBuilder rather than manually defining it here. 
826         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
827         iterators here.
828
829         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
830         before RootContext.DefineTypes().
831
832         * codegen.cs (EmitContext.RemapToProxy): Removed.
833         (EmitContext.CurrentAnonymousMethod): Changed type from
834         AnonymousMethod -> AnonymousContainer.
835         (EmitContext.ResolveTopBlock): Protect from being called twice.
836         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
837         (EmitContext.EmitThis): Removed the iterators hacks; use the
838         anonymous methods framework for that.
839
840         * statement.cs
841         (ToplevelBlock.Container): Make this a property, not a field.
842         (ToplevelBlock.ReParent): New public method; move the
843         ToplevelBlock into a new container.
844         (Foreach.TemporaryVariable): Simplify.
845
846 2005-06-05  Martin Baulig  <martin@ximian.com>
847
848         * statement.cs (LocalInfo.CompilerGenerated): New flag.
849         (Block.AddTemporaryVariable): New public method; creates a new
850         `LocalInfo' for a temporary variable.
851         (Block.EmitMeta): Create the LocalBuilders for all the temporary
852         variables here.
853         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
854         non-iterator variables.
855
856 2005-06-05  Martin Baulig  <martin@ximian.com>
857
858         * statement.cs (Foreach.TemporaryVariable): Create the
859         LocalBuilder in the Emit phase and not in Resolve since in some
860         situations, we don't have an ILGenerator during Resolve; see
861         2test-19.cs for an example.
862
863 2005-06-04  Martin Baulig  <martin@ximian.com>
864
865         **** Merged r45395 from GCS ****
866
867         The big Foreach rewrite - Part II.
868
869         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
870         with `PropertyInfo ienumerator_getcurrent'.
871
872         * codegen.cs (VariableStorage): Removed.
873
874         * statement.cs
875         (Foreach): Derive from Statement, not ExceptionStatement.
876         (Foreach.CollectionForeach): New nested class.  Moved all the code
877         dealing with collection foreach here.
878         (Foreach.ForeachHelperMethods): Removed.
879         (Foreach.TemporaryVariable): Implement IMemoryLocation.
880
881 2005-05-23  Martin Baulig  <martin@ximian.com>
882
883         * statement.cs (Try.DoResolve): Don't create a `finally' if we
884         don't need to.  Fix #75014.
885
886 2005-05-20  Martin Baulig  <martin@ximian.com>
887
888         Merged r44808 from GMCS.
889
890         * class.cs (TypeContainer.CircularDepException): Removed.
891         (TypeContainer.DefineType): Removed the `InTransit' stuff.
892         (TypeContainer.CheckRecursiveDefinition): Check for circular class
893         (CS0146) and interface (CS0529) dependencies here.
894
895 2005-06-21  Raja R Harinath  <rharinath@novell.com>
896
897         * expression.cs (Invocation.EmitCall): Fix initialization
898         'this_call' to reflect current behaviour.  Fix indentation.
899
900         * convert.cs (FindMostEncompassedType): Add two trivial special
901         cases (number_of_types == 0 || number_of_types == 1).
902         (FindMostEncompasingType): Likewise.
903
904 2005-06-17  Raja R Harinath  <rharinath@novell.com>
905
906         Some cleanups preparing for the fix of #75283.
907         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
908         error testing.
909         (EventExpr.InstanceResolve): Likewise.
910         (EventExpr.DoResolve): Remove redundant checks.
911
912 2005-06-10  Duncan Mak  <duncan@novell.com>
913
914         * cs-tokenizer.cs (process_directives): New flag for controlling
915         the processing of preprocessor directives.
916         (x_token): After seeing a '#', return Token.NONE instead of going
917         to handle_preprocessing_directive() when not processing
918         directives. This avoids unnecessary processing during the token peek in
919         is_punct().
920
921         This fixes #74939.
922
923         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
924         the existing error reporting methods instead of Report.Error.
925
926         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
927         after Raja's rewrite.
928
929 2005-06-08  Miguel de Icaza  <miguel@novell.com>
930
931         * class.cs: Small fix.
932
933 2005-06-08  Raja R Harinath  <rharinath@novell.com>
934
935         Fix #75160.
936         * class.cs (GetPartialBases): Fix return value check of
937         part.GetClassBases.
938
939 2005-06-07  Raja R Harinath  <rharinath@novell.com>
940
941         Ensure that partial classes are registered in their enclosing
942         namespace.  Initial part of fix of #75160.
943         * tree.cs (Tree.RecordDecl): Add new namespace argument.
944         Register declspace with namespace here, not in
945         DeclSpace.RecordDecl.
946         * cs-parser.jay: Pass namespace to RecordDecl.
947         * class.cs (PartialContainer.Create): Likewise.
948         (ClassPart.DefineType): New sanity-check.  Throws an exception if
949         called.
950         * decl.cs (Declspace.RecordDecl): Remove.
951         * namespace.cs (NamespaceEntry.DefineName): Remove.
952
953 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
954
955         * rootcontext.cs: Reset TargetExt as well.
956
957 2005-06-03  Raja R Harinath  <rharinath@novell.com>
958
959         * ecore.cs (Expression.Resolve): Emit CS0654 error when
960         -langversion:ISO-1.
961
962 2005-06-02  Raja R Harinath  <rharinath@novell.com>
963
964         Fix #75080, cs0119.cs.
965         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
966         of ...
967         (Expression.Resolve): ... this.  Use it.  Remove bogus code
968         allowing ExprClass.Type and ExprClass.Namespace for
969         ResolveFlags.VariableOrValue.
970         (Expression.Resolve) [1-argument variant]: Change default resolve
971         flags based on language version.
972         (Expression.Error_UnexpectedKind): Use a simple string array
973         rather than an ArrayList.
974         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
975         not ExprClass.Type.
976         (TypeOfVoid.DoResolve): Likewise.
977         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
978         flags argument -- it always has the same value.
979
980 2005-05-31  Raja R Harinath  <rharinath@novell.com>
981
982         Fix #75081.
983         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
984         Use it in the error message.
985         * assign.cs, expression.cs, statement.cs: Update.
986
987 2005-05-30  Raja R Harinath  <rharinath@novell.com>
988
989         Fix #75088.
990         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
991         the "almostMatchedMember" case too.
992         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
993         that failed the accessibility checks to 'almost_match'.
994
995 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
996
997         * attribute.cs: Use internal MethodBuilder methods to set
998         ExactSpelling and SetLastError on PInvoke methods, instead
999         of passing them via charset.  Fixes #75060.
1000
1001 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1002
1003         * parameter.cs (Parameter): Remove TODO comment.
1004         (Parameter.DefineParameter): Remove Location parameter.
1005         (Parameters.LabelParameters): Likewise.
1006         * class.cs (Constructor.Emit): Update to change.
1007         (MethodData.Emit): Likewise.
1008         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1009         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1010
1011 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1012
1013         * parameter.cs,
1014           Removed Parameters.Location and added Parameter.Location instead.
1015           Removed Location parameter from Emit() and GetSignature().
1016         * anonymous.cs,
1017           class.cs,
1018           cs-parser.jay,
1019           delegate.cs,
1020           iterators.cs,
1021           statement.cs :
1022           Modified all related calls.
1023
1024 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1025
1026         Improve user-defined conversion handling.
1027         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1028         applicable operators.
1029         (AddConversionOperators): New.  Helper for GetConversionOperators.
1030         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1031         there is only one most encompassed/encompassing type.
1032         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1033         "applicable operator" handling.
1034         (UserConversion): Move cache here from GetConversionOperators.
1035         Directly cache the chosen operator, rather than the whole
1036         MethodGroup.
1037         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1038         case.  Allow conversion of decimal to sbyte and byte too.
1039         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1040         New static methods.  Used to avoid allocating EmptyExpressions in
1041         convert.cs.
1042
1043 2005-05-24  Duncan Mak  <duncan@novell.com>
1044
1045         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1046         another class, used in Convert.ExplicitNumericConversion.
1047         (CastToDecimal): New class, similar to above, but casts to
1048         System.Decimal, used in Convert.ImplicitNumericConversion and also
1049         in explicit convesion from double/float to decimal.
1050
1051         * convert.cs (ImplicitNumericConversion): Handle implicit
1052         conversions to System.Decimal.
1053         (ExplicitNumericConversion): handle explicit conversions to
1054         System.Decimal.
1055
1056         This fixes #68711.
1057         
1058 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1059
1060         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1061         know the type at this stage, just break through.   Fixes #75008 
1062
1063 2005-05-19  Martin Baulig  <martin@ximian.com>
1064
1065         * delegate.cs
1066         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1067         to disable error reporting.
1068
1069         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1070         here since we don't want to report an error; see the new test-336.cs.
1071
1072 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1073
1074         * statement.cs (ToplevelBlock.GetParameterReference)
1075         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1076         Move here from class Block.
1077         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1078         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1079
1080 2005-05-18  Martin Baulig  <martin@ximian.com>
1081
1082         Fix #74978.
1083
1084         * flowanalysis.cs
1085         (FlowBranching.Reachability): Add non-static public And() and Or()
1086         methods.
1087         (FlowBranchingSwitch): New class; do the `break_origins' thing
1088         like in FlowBranchingLoop.
1089         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1090         reachability, not just locals and parameters.
1091         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1092         switch; MergeBreakOrigins() now takes care of that.
1093
1094 2005-05-18  Martin Baulig  <martin@ximian.com>
1095
1096         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1097         a loop and may leave it, reset the barrier; fixes #74974.
1098
1099 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1100         
1101         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1102         is back.
1103         
1104         * cs-parser.jay: Catch more lexical errors.
1105         
1106         * report.cs: Add one more Error method.
1107         
1108         * rootcontext.cs,
1109         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1110
1111 2005-05-17  Martin Baulig  <martin@ximian.com>
1112
1113         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1114         #70970. 
1115
1116 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1117
1118         Fix test-382.cs.  Emit values of decimal constants.
1119         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1120         Carved out of ...
1121         (TypeContainer.AddField): ... this.
1122         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1123         with initializers to include 'Const's.
1124         (ClassPart.RegisterFieldForInitialization): Forward to
1125         PartialContainer.
1126         * const.cs (Const.Const): Pass initializer to base class.
1127         (Const.Define): In case of decimal constants, register them for
1128         initialization in a static constructor.
1129
1130 2005-05-14  Martin Baulig  <martin@ximian.com>
1131
1132         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1133         do not call ResolveUnreachable() on unreachable statements in
1134         here, see the comment in the source code.
1135
1136 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1137
1138         Fix #74934.
1139         * expression.cs (BinaryResolveOperator): If one of the operands of
1140         an equality comparison is 'null' and the other is a pointer type,
1141         convert the null to a NullPointer.
1142         * convert.cs (ImplicitReferenceConversion): If the expression is a
1143         NullLiteral and the target type is a pointer type, return a
1144         NullPointer instead.
1145         (ImplicitConversionStandard): Likewise.
1146
1147 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1148         
1149         * cs-parser.jay: Set readonly context based on special constructs.
1150         
1151         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1152         readonly variable error handling.
1153         
1154         * rootcontext.cs (EmitCode): Don't verify members when error
1155         occurred.
1156         
1157         * statement.cs (LocalInfo): Add reaodnly context information.
1158         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1159
1160 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1161
1162         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1163         for #74041 to initialize 'resolved' to false only for explicit
1164         blocks.  Fixes #74873.
1165
1166 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1167
1168         Fix #74920.
1169         * typemanager.cs (unmanaged_enclosing_types): New.
1170         (IsUnmanagedType): Avoid infloops by using
1171         'unmanaged_enclosing_types' to talk with recursive invocations.
1172
1173 2005-05-13  Martin Baulig  <martin@ximian.com>
1174
1175         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1176         instance variable, not a local.  Fix #74873.
1177         (Block.ResolveUnreachable): Set it to true here.
1178
1179 2005-05-11  Duncan Mak  <duncan@novell.com>
1180
1181         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1182         continuing to process for 'arg'.
1183         (handle_preprocessing_directive): Check the argument of the #endif
1184         directive and report error CS1025 if there are any trailing
1185         characters.
1186
1187         According to the C# spec, having even whitespace after the #endif
1188         directive is illegal; however, because we call arg.TrimEnd ()
1189         beforehand, we have the same behavior as csc, allowing whitespace
1190         after the directive.
1191
1192         Fixes #74892.
1193
1194 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1195
1196         Fix #74863.
1197         
1198         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1199         (Constructor.GetObsoleteAttribute): Implemented correctly.
1200
1201 2005-05-10  Martin Baulig  <martin@ximian.com>
1202
1203         * support.cs (ReflectionParameters.ParameterModifier): Use
1204         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1205         and `ParameterAttributes.In'.  Fixes #74884.
1206
1207 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1208
1209         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1210         
1211         * expression.cs (Argument.GetParameterModifier): Turned to property.
1212         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1213         
1214         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1215         its C# equivalent.
1216         
1217 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1218
1219         Fix #74852.
1220         * decl.cs (MemberCache.AddMethods): Register override methods,
1221         rather than non-override methods.
1222         * typemanager.cs (RegisterOverride): New.
1223         (IsOverride): Update.
1224
1225 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1226
1227         Fix #73105.
1228         
1229         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1230         recursive declaration.
1231         
1232         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1233         
1234 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1235
1236         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1237         
1238         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1239
1240 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1241
1242         Fix #74797.
1243         * decl.cs (DeclSpace.FamilyAccessible): 
1244         Use TypeManager.IsNestedFamilyAccessible.
1245
1246         Fix reopened #64812.
1247         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1248         internal'.
1249
1250 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1251             Abin Thomas  <projectmonokochi@rediffmail.com>
1252             Anoob V E  <projectmonokochi@rediffmail.com>
1253             Harilal P R  <projectmonokochi@rediffmail.com>
1254
1255         Fix #64812.
1256         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1257         allow access to all static members.
1258
1259 2005-05-04  Martin Baulig  <martin@ximian.com>
1260
1261         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1262
1263 2005-05-04  Martin Baulig  <martin@ximian.com>
1264
1265         Fix #74655.
1266
1267         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1268         section at the end; make things work if `default' is not the last
1269         section.        
1270
1271 2005-05-04  Martin Baulig  <martin@ximian.com>
1272
1273         Fix #70400.
1274
1275         * statement.cs (Switch): Replaced the `got_default' field with a
1276         `default_section' one.
1277         (Switch.CheckSwitch): Set `default_section' here.
1278         (Switch.Resolve): If we're a constant switch and the constant is
1279         not found, use the default section.
1280
1281 2005-05-03  Martin Baulig  <martin@ximian.com>
1282
1283         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1284
1285         * statement.cs (Foreach.ArrayForeach): New nested class.
1286         (Foreach.TemporaryVariable): New nested class.
1287         (Foreach.EmitArrayForeach): Removed; this is now in the new
1288         ArrayForeach class.
1289
1290 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1291
1292         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1293         more conservative.
1294         (VerifyPendingMethods): Revert change below.
1295
1296         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1297         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1298         that used to trigger warning -28.  Remove warning -28.
1299         * expression.cs (Invocation.OverloadResolve): Use
1300         TypeManager.IsOverride to distinguish override methods.
1301
1302         Fix #74773.
1303         * pending.cs (VerifyPendingMethods): If a base type implements the
1304         requested interface, don't bother checking individual methods of
1305         the base type.  As a side-effect, this prevents the creation of
1306         unnecessary proxies.
1307
1308 2005-05-02  Martin Baulig  <martin@ximian.com>
1309
1310         Fix #70182.
1311
1312         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1313         Also `And' the locals if the old vector is null.
1314         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1315         null; in this case we basically reset all the variables.        
1316
1317 2005-05-02  Martin Baulig  <martin@ximian.com>
1318
1319         Fix #74529.
1320
1321         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1322         Added `FlowBranching branching' argument; always `and' the
1323         variables instead of `or'ing them unless we're an infinite loop.
1324
1325         * statement.cs (While.Resolve): Create a new sibling unless we're
1326         infinite.       
1327
1328 2005-05-02  Martin Baulig  <martin@ximian.com>
1329
1330         Fix #70140.
1331
1332         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1333         arguments; use it instead of creating a new TopLevelBlock.
1334         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1335         our ConstructorInitializer.
1336
1337         * statement.cs
1338         (TopLevelBlock.TopLevelBranching): New public property.
1339         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1340         and create our `TopLevelBranching'.
1341
1342         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1343         anonymous method host, use `block.TopLevelBranching' rather than
1344         creating a new branching.
1345
1346 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1347
1348         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1349         a ScopeInfo, if any of the current children is a child of the new
1350         entry, move those children there.
1351
1352 2005-04-30  Martin Baulig  <martin@ximian.com>
1353
1354         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1355         at the beginning of a SwitchSection.  Fix #73335.
1356
1357 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1358
1359         Fix #74378
1360         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1361         
1362         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1363         (FieldExpr.DoResolve): Obsolete members are ignored for field
1364         initializers.
1365         
1366 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1367
1368         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1369         of arrays detection.
1370
1371         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1372         verification.
1373         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1374
1375         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1376         arrays report.
1377
1378 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1379
1380         * cs-parser.jay: Use the prefered version of -unsafe in error
1381         message.
1382
1383 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1384
1385         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1386         circumstances.
1387
1388 2005-04-20  John Luke  <john.luke@gmail.com>
1389
1390         * driver.cs: fix typo in error message, --outout to --output
1391
1392 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1393
1394         * codegen.cs (InRefOutArgumentResolving): New field.
1395         
1396         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1397         fields outside contructor.
1398         
1399         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1400         
1401 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1402
1403         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1404         parameter code was not completed ever, so it was not as up-to-date
1405         as local variables.  Must finish it.
1406
1407         The bug fix was to compare the Toplevel of the block, not the
1408         current block.  Thanks for Ben for pointing this out. 
1409
1410 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1411
1412         * decl.cs (AddMethods): Use the declaring type of the problem
1413         method to determine if we want to squash a warning.
1414
1415 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1416
1417         * attribute.cs: Removed debug output.
1418
1419         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1420         
1421         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1422         Report.Stderr.
1423         
1424 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1425
1426         Fix #74481.
1427         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1428         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1429         all null comparisons against reference types.
1430
1431 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1432
1433         Fix# 74565
1434         * class.cs (TypeContainer.CircularDepException) New nested
1435         exception class.
1436         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1437         (TypeContainer.DefineType): Removed error, reset InTransit before
1438         exit.
1439         (Class.DefineType): Throw exception when is in Transit.
1440         Catch exception and report error.
1441         (Struct.DefineType): Throw exception when is in Transit.
1442         Catch exception and report error.
1443         (Interface.DefineType): Throw exception when is in Transit.
1444         Catch exception and report error.
1445
1446         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1447         handle nested exception handlers.
1448
1449         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1450         a catch.
1451
1452         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1453         InFinally and InCatch storage.
1454
1455         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1456         (Catch.Resolve): Set and Restore ec.InCatch.
1457         (Try.Resolve): Set and Restore ec.InFinally.
1458         (Try.HasCatch): True when try has catch.
1459
1460 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1461
1462         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1463           for the same event member, so exclude such cases from warning 419.
1464           Fixed bug #74633.
1465
1466 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1467
1468         * expression.cs (Binary.ResolveOperator): Apply patch from John
1469         Luke to fix bug 59864: operators &, | and ^ on enumerations
1470         require that the same enum type on both sides.
1471
1472         * driver.cs: Add warnings to old flag usage, this is to assist
1473         people who produce Makefiles and hope that the Makefiles will be
1474         used on Windows.
1475
1476         * class.cs (TypeContainer.EmitType): Moved the definition of the
1477         special $PRIVATE$ field from the resolve phase to the Emit phase.
1478         During resolve we do not know if we are a struct with
1479         HasExplicitLayout, we know this only after the attributes for the
1480         type are emitted.
1481
1482         Set the FieldOffset to zero on the dummy field that we create for
1483         the class.   Fixes 74590.
1484
1485 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1486
1487         Fix #73834.
1488         * ecore.cs (PropertyExpr.resolved): New.
1489         (DoResolve): Use it to handle a case of double resolution here.
1490         Handle a case of identical-name-and-type-name.
1491         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1492         resolution by storing the results of expression resolution back
1493         into the "probes" array.
1494
1495 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1496
1497         Fix cs0208-7.cs and cs0208-8.cs.
1498         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1499         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1500         error reporting to point out the reason a struct is not unmanaged.
1501
1502 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1503
1504         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1505           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1506
1507 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1508
1509         Fix #74528.
1510         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1511         IdenticalNameAndTypeName here.
1512         (EventExpr.InstanceResolve): Likewise.
1513
1514 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1515
1516         C# 2.0 DefaultCharSetAttribute implementation
1517         
1518         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1519         which allows us to set GlobalNamespace for every resolve.
1520         (Attribute.ResolveArguments): Cut from Resolve.
1521         (Attribute.GetCharSetValue): Returns CharSet named argument.
1522         (Attribute.DefinePInvokeMethod): Gets default charset from
1523         module settings.
1524         (GlobalAttribute.ResolveAsTypeStep): Override.
1525         (GlobalAttribute.ResolveArguments): Override.
1526         
1527         * class.cs (TypeAttr): Is protected.
1528         
1529         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1530         (ModuleClass.DefaultCharSetType): New memeber.
1531         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1532         
1533         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1534         charset from module.
1535         
1536         * delegate.cs (TypeAttr): Override.
1537         (Delegate.DefineType): Use this TypeAttr.
1538         
1539         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1540         at very early stage (before types are defined) to resolve model
1541         module attributes. It will probably not work with corlib but it
1542         should be ok.
1543         
1544         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1545         charset from module.
1546         
1547         * typemanager.cs (default_charset_type): New type.
1548
1549 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1550
1551         * decl.cs (MemberCache.AddMethods): Don't warn if
1552         System.Object.Finalize has buggy MethodAttributes.
1553
1554         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1555         removed below.
1556
1557 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1558
1559         * doc.cs : detect ambiguous reference to overloaded members.
1560           Fixed bug #71603. MS 1.1 csc does not detect it.
1561
1562 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1563
1564         * doc.cs : delegates must not be referenced with parameters.
1565           Fixed bug #71605.
1566
1567 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1568
1569         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1570
1571 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1572
1573         * driver.cs (MainDriver): Stop processing if the CLS stage found
1574         errors. 
1575
1576         (CompilerCallableEntryPoint.InvokeCompiler): Always
1577         reset after execution;   Take a TextWriter argument for the
1578         output.
1579
1580         * report.cs: Use the error stream instead of hardcoding stderr. 
1581
1582 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1583
1584         * class.cs: Reduce code paths to test, too small of an
1585         optimization to make it worth the extra testing.  Always perform
1586         it. 
1587
1588 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1589
1590         Fix #74510.
1591         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1592         operators that had errors reported on them.
1593
1594 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1595
1596         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1597         argument types.
1598         (Attribute.Resolve): Add named argument type checking.
1599         
1600         * class.cs (FixedField.Define): Use IsPrimitiveType
1601         
1602         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1603         
1604         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1605         unsafe parameter types.
1606         
1607         * statement.cs (Using.ResolveExpression): Add better error description.
1608         
1609         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1610         
1611 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1612
1613         Fix #74484.
1614         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1615         AttributeUsageAttribute in the emitcontext of the attribute class,
1616         not in the emitcontext of the attributable entity it was attached to.
1617         * cs-parser.jay: Use 'current_class', not 'current_container',
1618         when creating a GlobalAttribute.
1619
1620 2005-04-08  Alp Toker  <alp@atoker.com>
1621
1622         * pending.cs: The fix to #58413 failed to compile methods implementing
1623         interfaces with/without params modifiers and vice versa, even though
1624         params modifiers aren't part of the signature. Make the modifier check
1625         less strict as in csc.
1626
1627 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1628             Anoob V E  <projectmonokochi@rediffmail.com>
1629             Harilal P R  <projectmonokochi@rediffmail.com>
1630
1631         Fix #58413.
1632         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1633         modifiers of pending methods.
1634         (PendingImplementation.PendingImplementation): Initialize it.
1635         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1636         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1637         with ParameterData.  Add check for modifiers.
1638         * class.cs (MethodData.Define): Update to changes.
1639
1640 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1641
1642         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1643
1644 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1645
1646         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1647         property.
1648         
1649         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1650         
1651         * rootcontext.cs,
1652         * typemanager.cs: Registered RequiredAttributeAttribute.
1653         
1654 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1655
1656         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1657         Warning CS0169 is back at level 3.
1658         (IMethodData.SetMemberIsUsed): New method.
1659         
1660         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1661         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1662         
1663         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1664
1665         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1666         contants.
1667         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1668         is used.
1669         
1670         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1671         is used.
1672         
1673         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1674         to avoid the problems with nested types.
1675
1676 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1677             Anoob V.E  <projectmonokochi@rediffmail.com>
1678             Harilal P.R  <projectmonokochi@rediffmail.com>
1679             Raja R Harinath  <rharinath@novell.com>
1680
1681         Fix #73820.
1682         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1683         attribute.
1684         * typemanager (GetConstructor): Make public.
1685
1686 2005-04-05  John Luke  <john.luke@gmail.com>
1687             Raja R Harinath  <rharinath@novell.com>
1688
1689         Fix #62232.
1690         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1691         struct too.  Return false quicker in a few cases.
1692         (VerifyUnManaged): Use it.
1693
1694 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1695
1696         Fix #74041.
1697         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1698         not 'unreachable_seen'.
1699
1700 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1701
1702         * attribute.cs (Attribute.GetValue): Removed unused.
1703         
1704         * codegen.cs (CodeGen.TrimExt): Removed unused.
1705         
1706         * cs-parser.jay (output): Removed unused.
1707         
1708         * cs-tokenizer.cs (hex_digits): Removed unused.
1709         
1710         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1711         
1712         * expression.cs (Indirection.LoadExprValue): Removed unused.
1713         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1714         
1715         * iterators.cs (Iterator.param_types): Removed unused.
1716         
1717         * statement.cs (Goto.block): Removed unused.
1718         (ToplevelBlock.did): Removed unused.
1719         (Switch.ResolveConstantSwitch): Removed unused.
1720
1721 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1722
1723         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1724         resetting thingy.
1725
1726 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1727
1728         Fix #74232 and cs0208-3.cs.
1729         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1730         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1731         unmanaged type.  Don't use FieldBuilders when 't' is a
1732         TypeBuilder.  Use ModFlags and MemberType fields.
1733         * class.cs (MemberBase.member_type): Rename from MemberType.
1734         (MemberBase.MemberType): New property.  Determines member_type on
1735         demand.
1736         (MemberBase.DoDefine): Don't initialize MemberType here.
1737         (FieldMember.Define): Likewise.
1738
1739 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1740
1741         Fix #74241
1742         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1743         Attributes are emitted there.
1744         
1745 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1746
1747         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1748         keyword in 'partial enum' too.
1749         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1750         is not allowed).
1751         Report from Kamil Skalski <nazgul@omega.pl>.
1752
1753         Fix #74309.
1754         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1755         have partial containers too.
1756
1757         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1758         in block' checks to Block.CheckInvariantMeaningInBlock.
1759         * statement.cs (Block.GetKnownVariableInfo): Make private.
1760         (Block.IsVariableUsedInChildBlock): Remove.
1761         (Block.IsVariableUsedInBlock): Likewise.
1762         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1763         conflicting declaration.
1764         (Block.AddVariable): Make error messages less long-winded and more
1765         specific.  Show location of conflicting declaration.
1766         * parameter.cs (Parameters.Location): New readonly property.
1767
1768 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1769
1770         Clean up semantics of invoking ResolveMemberAccess.
1771         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1772         can have an instance, ensure that we pass in a non-TypeExpression
1773         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1774         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1775         argument.  Update to changes and simplify.
1776         (FieldExpr.Emitinstance): Remove CS0120 check.
1777         (PropertyExpr.EmitInstance): Likewise.
1778         * expression.cs (Argument.Resolve): Likewise.
1779         (Invocation.DoResolve): Update to changes in semantics of
1780         InstanceExpression.
1781
1782 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1783
1784         Fix #74241
1785         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1786         customization.
1787         
1788         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1789
1790 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1791
1792         Fix difference in behaviour with commandline invocation.
1793         * driver.cs (Driver.Reset): New.
1794         (CompilerCallableEntryPoint): Call it.
1795
1796         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1797         variable" warnings if the boolean expression failed to resolve.
1798
1799 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1800
1801         * attribute.cs: Fix the union of several permissions when some of them
1802         are unrestricted (so the result isn't an unrestricted permission set).
1803         Fix #74036.
1804
1805 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1806
1807         * ecore.cs (MemberExpr): New class.  Convert from interface
1808         IMemberExpr.
1809         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1810         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1811         error checks.
1812         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1813         (MethodGroupExpr.IsExplicitImpl): Remove.
1814         (Expression.GetFieldFromEvent): Remove.
1815         (SimpleName.MemberStaticCheck): Remove.
1816         (SimpleName.DoSimpleNameResolve): Update to changes.
1817         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1818         (MemberAccess.IdenticalNameAndTypeName): Remove.
1819         (MemberAccess.error176): Move to MemberExpr.
1820         (MemberAccess.DoResolve): Update to changes.
1821         (BaseAccess.DoResolve): Likewise.
1822
1823 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1824
1825         C# 2.0 Conditional attribute class implementation
1826         
1827         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1828         Analyzes class whether it has attribute which has ConditionalAttribute
1829         and its condition is not defined.
1830         
1831         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1832         (Class.IsExcluded): New method. Search for at least one defined
1833         condition in ConditionalAttribute of attribute class.
1834
1835 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1836
1837         * ecore.cs (PropertyExpr): Derive from Expression, not
1838         ExpressionStatement.
1839         (PropertyExpr.EmitStatement): Remove.
1840
1841 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1842
1843         Fix #74060.
1844         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1845         internal field "value__" of an enum be private.  The examples for
1846         "value__" that I found on MSDN all used FieldAttributes.Private.
1847
1848         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1849         Don't mention IL method attribute names.
1850
1851         Fix #47991.  Remove a TODO.
1852         * statement.cs (Block.Toplevel): Make into a field.
1853         (Block.Parameters): Move into ToplevelBlock.
1854         (Block.known_variables): Rename from child_variable_names.
1855         (Block.Block): Remove variants that take Parameters.  Initialize
1856         'Toplevel' with the immediately surrounding toplevel block.
1857         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1858         LocalInfo parameter.
1859         (Block.GetKnownVariableInfo): New.
1860         (Block.IsVariableNameUsedInChildBlock): Update.
1861         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1862         the block, even though it may not be in scope.
1863         (Block.AddVariable): Remove Parameters parameter.  Use
1864         Toplevel.Parameters instead.
1865         (Block.AddConstant): Remove Parameters parameter.
1866         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1867         (Block.IsParamaterReference): Likewise.
1868         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1869         (ToplevelBlock.Parameters): New.  Moved from Block.
1870         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1871         initialize Parameters to a non-null value.
1872         * cs-parser.jay: Update to changes.
1873         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1874         simple names that mean different things in the same block.  Use
1875         Block.IsVariableNameUsedInBlock.
1876
1877 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1878
1879         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1880         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1881         GetTypeHandle.  It is possible for a reflected type to derive from
1882         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1883         System.Array during mscorlib compilation).
1884         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1885         contain a method_hash, don't create one either.  Don't create a
1886         deep copy of the base cache's method_hash.
1887         (MemberCache.SetupCache): Rename back from DeepCopy.
1888         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1889         already initialized.  If we see an override function, add its
1890         underlying base virtual function to the member_hash too.
1891
1892         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1893
1894 2005-03-26  Raja R Harinath  <harinath@acm.org>
1895
1896         Fix #73038.
1897         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1898         fails to resolve, ensure that the LHS is still resolved as an
1899         lvalue.
1900
1901 2005-03-25  Raja R Harinath  <harinath@acm.org>
1902
1903         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1904         ec.ContainerType.
1905         (Enum.current_ec): Remove.
1906         (Enum.LookupEnumValue): Remove EmitContext argument.
1907         Just uses the one created during DefineType.
1908         (Enum.FindMembers): Update.
1909         * expression.cs (MemberAccess.DoResolve): Update.
1910
1911 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1912
1913         * assign.cs (Assign.DoResolve): Check for CS1717 when
1914         source and target are same (uses Equals).
1915
1916         * expression.cs (LocalVariableReference, ParameterReference,
1917         This): Implemented Equals, GetHashCode.
1918
1919         * statement.cs (Block.GetParameterReference): Removed useless
1920         local variable.
1921
1922 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1923
1924         Fix cs0128.cs
1925         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1926         blocks before deciding whether the error is cs0136 or cs0128.
1927
1928         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1929         (using_alias_directive, using_namespace_directive): Pass
1930         MemberName, not an expression to Namespace.UsingAlias and
1931         Namespace.Using.
1932         (MakeName): Use the MemberName of the namespace.
1933         * namespace.cs (Namespace.MemberName): New.
1934         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1935         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1936         Likewise.
1937         * decl.cs (MemberName.Name): Make readonly.
1938         (MemberName.FromDotted): New "constructor".
1939         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1940         (MemberCore.Name): Compute from MemberName on demand.
1941         (MemberCore.SetMemberName): Provide a way to change the
1942         MemberName.
1943         (MemberCore.AddToContainer): Don't take a fullname parameter.
1944         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1945         fully qualified name of the container to the member name.
1946         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1947         only if the type is a member of the root container.
1948         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1949         MemberName.Left rather than searching for an embedded ".".
1950         (PartialContainer.CreatePart): Update to changes in RootContext.
1951         (MemberBase.ShortName): Turn into a property.  Use
1952         MemberCore.SetMemberName.
1953         (MemberBase.ExplicitInterfaceName): Remove.
1954         (MemberBase.UpdateMemberName): Remove.
1955         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1956         (PropertyBase.SetMemberName): New override.
1957         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1958         (Tree.GetDecl): New.
1959         (Tree.AllDecls): Rename from Decls.
1960         * attribute.cs, enum.cs, report.cs: Update to changes.
1961         * driver.cs (MainDriver): Use MemberName.FromDotted on
1962         RootContext.MainClass.
1963
1964 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1965
1966         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1967         checks.
1968
1969         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1970
1971 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1972
1973         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1974         property accessor modifiers.
1975
1976         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1977         fixed buffer attribute (CS1716).
1978         (PropertyMethod.HasCustomAccessModifier): When property accessor
1979         has custom modifier.
1980
1981         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1982         modifiers.
1983         (PropertyExpr.DoResolveLValue): Add CS0272.
1984
1985 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1986
1987         * convert.cs: When converting to a pointer, use the proper Conv.U
1988         or Conv.I depending on the source data type.
1989
1990         * cs-tokenizer.cs: Make the size for large decimal constants,
1991         fixes #72957.
1992
1993 2005-03-17  Martin Baulig  <martin@ximian.com>
1994
1995         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1996         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1997
1998 2005-03-17  Martin Baulig  <martin@ximian.com>
1999
2000         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2001         to bool so we can return an error condition.
2002         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2003         returned an error.
2004
2005 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2006
2007         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2008         attributes.
2009
2010 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2011
2012         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2013         Refactor to avoid traversing the list of assemblies, and to avoid
2014         string concatenation.
2015         * typemanager.cs (guid_attr_type): Remove.
2016         (negative_hits, pointers, references): Remove hashes.
2017         (type_hash): New.
2018         (GetConstructedType): New.  Uses type_hash to handle constructed
2019         types (arrays, references, pointers).
2020         (GetReferenceType, GetPointerType): Use it.
2021         (GetNestedType): New.  Uses type_hash to handle nested types of
2022         reflected types.
2023         (LookupType, LookupTypeDirect): Remove.
2024         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2025         'types' hash and LookupTypeReflection directly.
2026         (params_string, params_object): Use GetConstructedType.
2027         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2028         top-level types.
2029         (Namespace.Lookup): Use cached_types.
2030         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2031         provided by old TypeManager.LookupType.
2032         * rootcontext.cs (MakeFQN): Remove.
2033         * decl.cs (DeclSpace.MakeFQN): Likewise.
2034         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2035         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2036         TypeManager.GetConstructedType.
2037         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2038
2039 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2040
2041         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2042         indexers.
2043
2044         * cs-parser.jay: Reports CS1527 for any namespace element.
2045
2046         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2047         Added CS0407.
2048
2049         * expression.cs (ParameterReference.IsAssigned): Changed error to
2050         CS0269.
2051         (Error_WrongNumArguments): Moved CS0245 detection here.
2052
2053         * statement.cs (Return.Resolve): Add CS1622 report.
2054
2055 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2056
2057         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2058
2059 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2060
2061         * attribute.cs expression.cs: Get rid of some allocations.
2062
2063 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2064
2065         * doc.cs : just eliminate the latest change.
2066
2067 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2068
2069         * doc.cs : commented out the latest change. It breaks xml-030.cs
2070
2071 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2072
2073         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2074           fail. So invoke CreateType() in FindDocumentedType().
2075
2076 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2077
2078         * cs-tokenizer.cs : added IsKeyword().
2079         * doc.cs : Detect keyword incorrectly used as identifier.
2080           Allow identifiers prefixed by @.
2081
2082 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2083
2084         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2085         It caused exception in namespace resolving (again!).
2086         
2087         * class.cs (Class.ctor): Removed exit.
2088         (PropertyMethod.ctor): ditto.
2089         
2090         * codegen.cs (Codegen.Reset): Reset static data.
2091         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2092         
2093         * cs-tokenizer.cs (Cleanup): Removed.
2094         
2095         * driver.cs (GetSystemDir): Rewrote to one line command.
2096         It caused problem with unloaded dynamic modules.
2097         (UnixParseOption): Removed Exit.
2098         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2099         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2100         Now can be mcs used as library.
2101         
2102         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2103         empty location.
2104         
2105         * location.cs (Reset): Reset static data.
2106         
2107         * namespace.cs (Reset): Reset static data.
2108         
2109         * report.cs (Report.Reset): Reset static data.
2110         
2111         * rootcontext.cs (RootContext.Reset): Reset static data.
2112         
2113         * tree.cs (RootTypes.ctor): Use Location.Null
2114         
2115         * typemanager.cs (TypeManager.Reset): Reset static data.
2116         (CoreLookupType): Removed Exit.
2117         (TypeHandle.Reset): Reset static data.
2118         
2119 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2120
2121         Fix #73516.
2122         * typemanager.cs (ComputeNamespaces): Import namespaces from
2123         referenced modules too.
2124
2125 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2126
2127         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2128         than '.'.
2129
2130 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2131
2132         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2133         enclosing DeclSpace.  This ensures that a name-lookup populates
2134         more caches and there are fewer 'TypeExpression's.  Carve out
2135         nested type lookup into ...
2136         (LookupNestedTypeInHierarchy): ... this.
2137
2138 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2139
2140         Clean up a few partial-class semantics.  
2141         Fixes test-357.cs and cs1618-2.cs.
2142         * cs-parser.jay (struct_declaration): Use 'current_class' as
2143         parent of newly-created struct.  Remove call to Register ().
2144         Use 'pop_current_class' to complete handing the current struct.
2145         (interface_declaration): Likewise.
2146         (class_declaration): Likewise.
2147         (enum_declaration): Use 'current_class' as parent of newly created
2148         enum.
2149         (delegate_declaration): Likewise.
2150         (pop_current_class): New function.  This is used to handle closing
2151         up the 'current_class' and 'current_container', and pointing them
2152         to the enclosing class/container.
2153         (CSharpParser): Initialize 'current_class' too.
2154         * decl.cs (MemberCore): Add check for invariant: a partial
2155         container is not a parsed entity, and thus does not enclose any
2156         parsed members.
2157         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2158         (DeclSpace.BaseTypeExpr): Use it.
2159         (DeclSpace.LookupType): Add check for invariant.
2160         * class.cs (TypeContainer): Add check for invariant: a nested
2161         class should have the same NamespaceEntry as its enclosing class.
2162         (TypeContainer.EmitFieldInitializers): Make virtual.
2163         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2164         MemberCore.
2165         (TypeContainer.Register): Remove.
2166         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2167         null.  Use TypeResolveEmitContext for resolving base types and
2168         interfaces.  Move initialization of Parts.TypeBuilder here from
2169         ...
2170         (TypeContainer.DefineNestedTypes): ... here.
2171         (PartialContainer): Take a Namespace not a NamespaceEntry.
2172         (PartialContainer.Create): Don't use Register.  Call the
2173         appropriate Add... function directly.
2174         (ClassPart): Take both the PartialContainer and the enclosing
2175         class as constructor arguments.
2176         (ClassPart.EmitFieldInitializers): Override.
2177         (ClassPart.PartFindNestedTypes): Remove.
2178         (FieldBase.GetInitializerExpression): Resolve the initializer
2179         expression in the emit context of the enclosing class.
2180         * tree.cs (RootTypes): Remove Register ().
2181         
2182 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2183
2184         * cs-parser.jay: Removed CS0134.
2185         
2186         * driver.cs: Removed CS1901.
2187         
2188         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2189         for predefined types.
2190
2191 2005-03-07  Duncan Mak  <duncan@novell.com>
2192
2193         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2194         well. Fixes bug #73454.
2195
2196 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2197
2198         * cs-tokenizer.cs (xtoken): Add CS1035.
2199         
2200         * class.cs (MethodData.Define): Add CS0683.
2201         (FieldMember.ctor): Add CS0681.
2202
2203 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2204
2205         * ecore.cs (SimpleName.DoResolve): Rename from
2206         SimpleName.DoResolveAllowStatic.
2207         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2208         Pass 'intermediate' flag to MemberStaticCheck.
2209         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2210         of "intermediate" lookups via MemberAccess.
2211         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2212         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2213
2214 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2215
2216         Fix #73394.
2217         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2218         slipped in because of variable names that are identical to a
2219         builtin type's BCL equivalent ('string String;', 'int Int32;').
2220         (PropertyExpr.EmitInstance): Likewise.
2221
2222 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2223
2224         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2225         
2226         * report.cs (warning_ignore_table): Made public.
2227
2228 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2229
2230         Fix #73282.
2231         * class.cs (MethodData.Emit): Pass 'container' to
2232         container.GetObsoleteAttribute instead of 'container.Parent'.
2233
2234 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2235
2236         * cs-parser.jay: Add 1534 error test.
2237
2238         * iterators.cs (Yield.CheckContext): Add error 1629.
2239         (Iterator.ctor): Save unsafe modifier.
2240         (MoveNextMethod.DoEmit): Restore unsafe context.
2241
2242         * namespace.cs (UsingAlias): Better error message.
2243
2244 2005-03-03  Dan Winship  <danw@novell.com>
2245
2246         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2247         the warning message [#73219]
2248
2249 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2250
2251         Fix compile with MCS 1.0.0.0.
2252         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2253         w_restore to not depend on string constant folding.
2254
2255 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2256
2257         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2258         CS0246 check to users who passed 'silent = false'.
2259         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2260         check.
2261         (SimpleName.SimpleNameResolve): Update.
2262         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2263         (MemberAccess.IdenticalNameAndTypeName): Update.
2264         * doc.cs (FindDocumentedTypeNonArray): Update.
2265
2266 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2267
2268         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2269         * parameters.cs (ComputeAndDefineParameters): Remove.
2270         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2271         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2272         Use GetParameterInfo.
2273
2274 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2275
2276         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2277
2278 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2279
2280         Unify DeclSpace.LookupType and DeclSpace.FindType.
2281         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2282         is in charge of defining nested types on demand.
2283         (DeclSpace.LookupType): Use it when the current_type is a
2284         TypeBuilder.  Use LookupTypeDirect for reflected types.
2285         (DeclSpace.FindType): Remove.
2286         (DeclSpace.LookupInterfaceOrClass): Likewise.
2287         (DeclSpace.DefineTypeAndParents): Likewise.
2288         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2289         DeclSpace.LookupType.
2290         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2291         * typemanager.cs (LookupType): Simplify.
2292         (AddUserType): Remove type from negative_hits.
2293         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2294         * class.cs (TypeContainer.FindMembers): Move handling of nested
2295         types ...
2296         (TypeContainer.FindMembers_NestedTypes): ... here.
2297         (TypeContainer.FindNestedType): Implement override.
2298         (ClassPart.FindNestedType): Delegate to PartialContainer.
2299         (ClassPart.PartFindNestedType): Looks up the nested types of the
2300         part alone.
2301
2302 2005-03-02  Martin Baulig  <martin@ximian.com>
2303
2304         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2305         static constructor in static classes.
2306
2307 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2308
2309         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2310         sizeParamIndex is not specified.
2311
2312 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2313
2314         Fix #73117
2315         * report.cs (WarningMessage.IsEnabled): Missing null check.
2316
2317 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2318
2319         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2320         in the fields and not in the properties.
2321
2322 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2323
2324         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2325         fields as well.
2326
2327 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2328
2329         * attribute.cs: Small refactoring (improved robustness).
2330         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2331         (ValidateGuid): Removed.
2332         (Resolve): Removed referenced to above mentioned.
2333         (GetAttributeUsage): Made private and changed to work without
2334         class assistance.
2335         (GetIndexerAttributeValue): Don't crash.
2336         (GetConditionalAttributeValue): Ditto.
2337         (GetClsCompliantAttributeValue): Ditto.
2338         (ExtractSecurityPermissionSet): All attributes exceptions are
2339         error 648.
2340         (GetPropertyValue): New helper.
2341         (GetMethodImplOptions): New method.
2342         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2343         some missing properties.
2344         
2345         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2346         (Method.ApplyAttributeBuilder): Updated.
2347         
2348         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2349         exception.
2350
2351 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2352
2353         Fix #73052.
2354         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2355         non-simple types (array, pointer, reference).
2356
2357 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2358
2359         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2360
2361         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2362         for operators.
2363         (Method.CheckBase): Catch wrong destructor here.
2364         (MethodData.Define): Add errors 550, 668.
2365
2366         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2367
2368         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2369
2370         * pending.cs (VerifyPendingMethods): Add error 551.
2371
2372         * typemanager.cs (CSharpName): Next error report helper.
2373
2374 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2375
2376         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2377         attributes. Removed useless attribute double check.
2378         It saves almost 2MBs for corlib.
2379
2380 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2381
2382         Fix #72924.
2383         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2384         called twice in case of error.
2385
2386 2005-02-23  Chris Toshok  <toshok@ximian.com>
2387
2388         Fix compiler portions of #72827.
2389         * statement.cs (Block.Emit): call Begin/EndScope on the
2390         EmitContext instead of the ILGenerator.
2391
2392         * codegen.cs (EmitContext.BeginScope): new method, call
2393         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2394         we have one.)
2395         (EmitContext.BeginScope): same, but EndScope and CloseScope
2396
2397         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2398         offset and call the superclass's OpenScope(int) with it.
2399         (SymbolWriter.CloseScope): get the current il
2400         offset and call superclass's CloseScope(int) with it.
2401
2402 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2403
2404         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2405         CS1677 for out and ref as well.
2406
2407         * class.cs (Method.Define): Add error CS1599 detection.
2408         
2409         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2410         
2411         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2412         
2413         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2414         
2415         * support.cs.cs (ModifierDesc): New helper method.
2416
2417 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2418             Abin Thomas  <projectmonokochi@rediffmail.com>
2419             Anoob V E  <projectmonokochi@rediffmail.com>
2420             Harilal P R  <projectmonokochi@rediffmail.com>
2421
2422         Fix #57851, #72718.
2423         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2424         MemberLookup (used for error reporting) actually returns a result.
2425         Fix error report number (122, not 112).
2426
2427 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2428             Anoob V E  <projectmonokochi@rediffmail.com>
2429             Harilal P R  <projectmonokochi@rediffmail.com>
2430
2431         Fix #71134.
2432         * pending.cs (PendingImplementation.GetAbstractMethods):
2433         Find NonPublic members too.
2434
2435 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2436
2437         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2438         Fixed error 217.
2439         
2440         * class.cs (MethodCore.CheckMethodAgainstBase):
2441         Add error 239 report.
2442
2443 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2444
2445         Fix #68955.
2446         * expression.cs (Invocation.IsApplicable): Make public.
2447         (Invocation.IsParamsMethodApplicable): Likewise.
2448         * delegate.cs (Delegate.VerifyApplicability): Don't use
2449         Invocation.VerifyArgumentCompat for parameter applicability
2450         testing.  Use Invocation.IsApplicable and
2451         Invocation.IsParamsMethodApplicable.
2452
2453 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2454
2455         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2456         
2457         * class.cs (Operator.Define): Add error 217 report.
2458         
2459 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2460
2461         * namespace.cs (UsingEntry.Resolve): Undo change below.
2462
2463 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2464
2465         Fix #72756.
2466         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2467         disable the error message when the extended MemberLookup also
2468         fails.
2469         (Expression.MemberLookupFinal): Update.
2470         (SimpleName.DoSimpleNameResolve): Update.
2471         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2472         Don't use MemberLookupFinal.
2473         (New.DoResolve): Update.
2474         (BaseAccess.CommonResolve): Update.
2475
2476 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2477
2478         Fix #72732.
2479         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2480         occured previously, don't resolve again.
2481
2482 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2483
2484         Fix #69949
2485         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2486         argument. Call ResolveAttributeUsage for unresolved.
2487         when types doesn't match ctor arguments.
2488         
2489         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2490         for nested attribute classes.
2491         (Class.attribute_usage): Removed.
2492         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2493         for attribute class.
2494         
2495         * ecore.cs (IsAttribute): Removed.
2496         
2497         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2498         
2499         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2500         now normal types.
2501         (attribute_types): Removed.
2502         (EmitCode): Global attributes are emited as the latest.
2503
2504 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2505
2506         * class.cs (EmitFieldInitializers): Don't emit field initializer
2507         for default values when optimilization is on.
2508         
2509         * constant.cs (Constant.IsDefaultValue): New property.
2510         
2511         * driver.cs: Add /optimize handling.
2512         
2513         * constant.cs,
2514         * ecore.cs,
2515         * literal.cs: Implement new IsDefaultValue property.
2516         
2517         * rootcontext.cs (Optimize): New field, holds /optimize option.
2518
2519 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2520
2521         Fix crasher in re-opened #72347.
2522         * namespace.cs (Namespace.Lookup): Return null if
2523         DeclSpace.DefineType returns null.
2524
2525         Fix #72678.
2526         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2527
2528 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2529
2530         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2531         now returns null if it cannot resolve to an lvalue.
2532         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2533         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2534         returned null.  Remove check for SimpleName.
2535         (EventExpr.DoResolveLValue): New.
2536         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2537         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2538         error from ...
2539         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2540         avoid CS0131 error.
2541         (Unary.ResolveOperator): Move CS0211 check ...
2542         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2543         CS0131 error.
2544         (Unary.DoResolveLValue): Simplify.
2545         (AddressOf.DoResolveLValue): New.
2546         (ArrayAccess.DoResolveLValue): New.
2547
2548 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2549
2550         * attribute.cs (Attribute.Resolve): Add arguments casting for
2551         when types doesn't match ctor arguments.
2552
2553 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2554
2555         Fix parts of #63202.
2556         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2557         lookup of operator in base type.  Ensure that all checks happen
2558         when the operator resolves to an "op_..." method.
2559
2560 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2561
2562         Fix #71992.
2563         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2564         'ignore_cs0104' parameter.  Pass it to ...
2565         (NamespaceEntry.Lookup): ... this.
2566         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2567         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2568         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2569         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2570         Update.  Request that cs0104 errors be ignored.
2571         (ComposedCast.ResolveAsTypeStep): Update.
2572
2573 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2574
2575         Fix #59209.
2576         * expression.cs (Invocation.BetterFunction): Remove support for
2577         comparing virtual functions and their overrides.
2578         (Invocation.IsOverride): New.
2579         (Invocation.OverloadResolve): Don't consider 'override' functions
2580         during candidate selection.  Store them in a lookaside list.
2581         If the selected method is a 'virtual' function, use the list to
2582         find any overrides that are closer to the LHS type.
2583
2584 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2585
2586         * expression.cs (New.DoResolve): Add complex core type reduction.
2587         (New.Constantify): Converts complex core type syntax like 'new int ()'
2588         to simple constant.
2589         
2590 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2591
2592         * decl.cs (EntryType.EntryType): New constructor to create an
2593         updated copy of a cache entry.
2594         (MemberCache.AddMethods): Use it.
2595         (MemberCache.ClearDeclaredOnly): Remove.
2596         (MemberCache.MemberCache): Update.
2597
2598 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2599
2600         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2601         variable.  This one is represents the actual low-level declaration
2602         of the method, as opposed to the semantic level `IsStatic'.   
2603
2604         An anonymous method which is hosted into a static method might be
2605         actually an instance method.  IsStatic would reflect the
2606         container, while MethodIsStatic represents the actual code
2607         generated.
2608
2609         * expression.cs (ParameterReference): Use the new MethodIsStatic
2610         instead of IsStatic.
2611
2612         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2613         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2614         set on the current EmitContext. 
2615
2616         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2617         resolve our casted expression as an LValue.  This triggers the
2618         proper LValue processing that is later required by Assign.
2619
2620         This fixes 72347.
2621
2622         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2623
2624 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2625
2626         C# 2.0 Fixed buffer implementation
2627
2628         * anonymous.cs: Update after RegisterHelperClass renaming.
2629
2630         * attribute.cs (AttributeTester.fixed_buffer_cache):
2631         Cache of external fixed buffers.
2632         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2633         implementation if field is fixed buffer else null.
2634
2635         * class.cs
2636         (TypeContainer.AddField): Accept FieldMember instead of Field.
2637         (FieldBase.IsFieldClsCompliant): Extracted code from
2638         VerifyClsCompliance descendant customization.
2639         (FixedField): New class handles fixed buffer fields.
2640         (FixedFieldExternal): Keeps information about imported fixed
2641         buffer.
2642         (IFixedField): Make access to internal or external fixed buffer
2643         same.
2644
2645         * cs-parser.jay: Add fixed buffer parsing.
2646
2647         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2648         buffer.
2649
2650         * expression.cs (Indirection): Extended implementation to accept
2651         fixed buffer field.
2652         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2653         (ElementAccess.MakePointerAccess): Get type as parameter.
2654         (DoResolve): Add fixed buffer field expression conversion.
2655         (DoResolveLValue): Ditto.
2656         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2657         (ArrayPtr): Derives from FixedBufferPtr.
2658         (ArrayPtr.Emit): Add extra emit for array elements.
2659
2660         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2661
2662         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2663         for compiler generated types.
2664         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2665
2666         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2667         and consume less memory.
2668         (Fixed.Resolve): Add fixed buffer case.
2669
2670         * typemanager.cs (compiler_generated_attr_ctor,
2671         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2672         (HasElementType): Add our own implementation to work on every
2673         runtime.
2674
2675 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2676
2677         * anonymous.cs (CaptureContext): Track whether `this' has been
2678         referenced.   
2679
2680         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2681         only captured `this' if it was implicitly done (instance
2682         methods/variables were used). 
2683
2684         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2685         `this' must be captured.
2686
2687 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2688  
2689         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2690         is null it means that there has been no need to capture anything,
2691         so we just create a sibling.
2692
2693         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2694
2695         Just a partial fix.  The other half is fairly elusive.
2696         
2697 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2698
2699         Fix #52586, cs0121-4.cs.
2700         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2701         and return a hashtable.
2702         (MemberCache.ClearDeclaredOnly): New.
2703         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2704         the method_hash of a base type too.
2705         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2706         type methods.  Overwrite entries with the same MethodHandle so
2707         that the ReflectedType is correct.  The process leaves in base
2708         virtual functions and their overrides as distinct entries.
2709         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2710         matters since it was boxed in a ArrayList before.
2711         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2712         modifier.
2713         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2714         case of a virtual function and its override (choose the overload
2715         as better).
2716         (Invocation.OverloadResolve): Avoid 'override' members during
2717         'applicable_type' calculation.
2718
2719 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2720
2721         Combine two near-redundant caches.
2722         * typemanager.cs (method_params): Rename from method_internal_params.
2723         (TypeManager.GetParameterData): New.  Replace
2724         Invocation.GetParameterData.
2725         (TypeManager.LookupParametersByBuilder): Remove.
2726         * expression.cs (Invocation.method_parameter_cache): Remove.
2727         (Invocation.GetParameterData): Remove.
2728         Update to changes.
2729         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2730         Update to changes.
2731
2732 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2733
2734         Fix #72015.
2735         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2736         TypeManager.multicast_delegate_type is null, resolve it by looking
2737         up "System.MulticastDelegate".
2738         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2739
2740 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2741             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2742             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2743
2744         Fix cs0164.cs.
2745         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2746         (LabeledStatement.AddReference): New.  Set 'referenced'.
2747         (Goto.Resolve): Use it.
2748
2749 2005-02-05  John Luke  <john.luke@gmail.com>
2750
2751         * driver.cs: remove duplicate -doc line in Usage ()
2752
2753 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2754
2755         * location.cs (Location.AddFile): Fix CS2002 error report.
2756
2757 2005-02-02  Martin Baulig  <martin@ximian.com>
2758
2759         * delegate.cs (Delegate.DefineType): Report an internal error if
2760         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2761         details.        
2762
2763 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2764
2765         Fix a crasher in a variant of #31984.
2766         * const.cs (Constant.CheckBase): New override that defers the
2767         new-or-override check in case the base type hasn't been populated
2768         yet.
2769         (Constant.Define): Ensure the new-or-override check is performed.
2770
2771 2005-02-01  Duncan Mak  <duncan@ximian.com>
2772
2773         * const.cs (LookupConstantValue): Check that `ce' is not null
2774         before calling GetValue ().
2775
2776 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2777
2778         Fix test-334.cs (#69519).
2779         * cs-parser.jay (using_alias_directive): Pass in an expression to
2780         NamespaceEntry.UsingAlias.
2781         (using_namespace_directive): Pass in an expression to
2782         NamespaceEntry.Using.
2783         (namespace_name): Don't flatten to a string.
2784         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2785         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2786         ResolveAsTypeStep.
2787         (NamespaceEntry.UsingEntry): Likewise.
2788         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2789         changes.
2790         (NamespaceEntry.LookupForUsing): Remove.
2791         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2792         names.
2793         (NamespaceEntry.Lookup): Remove support for dotted names.
2794
2795 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2796
2797         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2798         split into two.
2799         (NamespaceEntry.ImplicitParent): Compute on demand.
2800         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2801         parallels the current.
2802         (NamespaceEntry.LookupForUsing): Use it.
2803         (NamespaceEntry.Lookup): If the current namespace-entry is
2804         implicit, don't search aliases and using tables.
2805
2806 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2807
2808         Fix #31984.
2809         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2810         BaseCache here.
2811         (TypeContainer.BaseCache): Compute on demand.
2812         (TypeContainer.FindMembers): Define constants and types if they're
2813         not already created.
2814         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2815         check.
2816         * const.cs (Constant.Define): Make idempotent.
2817
2818 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2819
2820         * pending.cs: Produce better code (no nops produced by using Ldarg
2821         + value).
2822         
2823         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2824         i - 1' it should be arg + 1.
2825
2826         Fixes bug #71819.
2827
2828 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2829
2830         * attribute.cs (Attribute.CheckAttributeType): Make private
2831         non-virtual.
2832         (Attribute.ResolveType): Make virtual.
2833         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2834         handling of RootContext.Tree.Types.
2835
2836 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2837
2838         Update attribute-handling to use the SimpleName/MemberAccess
2839         mechanisms.
2840         * cs-parser.jay (attribute): Pass in an expression to the
2841         constructors of Attribute and GlobalAttribute.
2842         * attribute.cs (Attribute): Take an expression for the name.
2843         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2844         passed in attribute name expression.
2845         (Attribute.CheckAttributeType): Use it.
2846         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2847         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2848         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2849         argument to prevent error messages if the lookup fails.
2850
2851 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2852
2853         * expression.cs (Indirection): Implemented IVariable interface
2854         to support indirection in AddressOf operator.
2855         (PointerArithmetic.Emit): Add optimalization for case where
2856         result can be precomputed.
2857
2858 2005-01-26  Martin Baulig  <martin@ximian.com>
2859
2860         * class.cs (TypeContainer.AttributeTargets): Return the correct
2861         AttributeTargets depending on our `Kind' instead of throwing an
2862         exception; fixes #71632.
2863
2864 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2865
2866         Fix #71257
2867         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2868         constant members.
2869
2870 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix #71602.
2873         * expression.cs (MemberAccess.DoResolve): Don't complain with
2874         cs0572 when the LHS of a member access has identical name and type
2875         name.
2876
2877 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2878
2879         Fix #71651, #71675
2880         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2881         CreatePermission.
2882         Create custom PermissionSet only for PermissionSetAttribute.
2883
2884 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2885
2886         Fix #71649
2887         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2888         delegates in static class.
2889
2890 2005-01-24  Martin Baulig  <martin@ximian.com>
2891
2892         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2893         merging an implicit block, just use its reachability.
2894
2895         * statement.cs (Block.Resolve): Make the unreachable code check
2896         work wrt. implicit blocks; see test-337 from #63842.
2897
2898 2005-01-21  Alp Toker  <alp@atoker.com>
2899  
2900         * cs-parser.jay: destructor_declaration's container is PartialContainer
2901         not Class when partial types are used, so use Kind prop instead of
2902         'is'.
2903         
2904 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2905
2906         * cs-parser.jay: Improve error reporting when an interface
2907         declares new types.
2908
2909 2005-01-20  Dick Porter  <dick@ximian.com>
2910
2911         * support.cs: SeekableStreamReader fix from Sandor Dobos
2912         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2913         chars are read.  Fixes bug 70369.
2914
2915 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2916
2917         * cs-parser.jay (catch_clause): Simplify current_block handling
2918         somewhat.
2919
2920 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2921
2922         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2923         code with ImplicitStandardConversion to handle the implicit
2924         conversion of method groups into valid delegate invocations. 
2925
2926         The problem is that in parameter handling we were using this code
2927         path.  Fixes bug #64698
2928
2929 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2930
2931         * cs-parser.jay: Fix several infelicities.
2932         - Avoid assigning to the parser value stack.  Code like 
2933           '$3 = null' is unclean.  Synthesize a value for the code block
2934           instead. 
2935         - Avoid using oob_stack for storing location information.  Use ...
2936         (_mark_): ... this.  New (empty) rule.  Saves the current location
2937         in $$.
2938         (foreach_statement): Avoid using oob_stack for current_block
2939         handling.  Use technique used in for_statement and
2940         using_statement.  Synthesize a value for the code block to store
2941         additional intermediate information.
2942
2943 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2944
2945         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2946         of a different type is only allowed to private fields of a
2947         containing type, not on fields of a base class.
2948
2949         See test-174.cs and error cs0122-9.cs
2950
2951 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2952
2953         Fix test-335.cs (bug #58126).
2954         * cs-parser.jay (argument): Split out non-expression parts of the
2955         rule into 'non_simple_argument'.
2956         (invocation_expression): Support parenthesized invocations with
2957         multiple arguments, and with single non-simple arguments.
2958
2959 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2960
2961         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2962         places.
2963
2964 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2965
2966         Fix cs0038-1.cs, cs1640-6.cs.
2967         * ecore.cs (Expression.Resolve): Remove special-case for
2968         SimpleName in error-handling.
2969         (Expression.almostMatchedMembers): Relax access permission to
2970         protected.
2971         (Expression.MemberLookupFailed): Handle duplicates in
2972         almostMatchedMembers list.
2973         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2974         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2975         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2976         overload if the passed in MemberInfo is a MethodBase.
2977
2978 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2979
2980         Fix #70749
2981         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2982         for non-CAS & merge permission sets properly.
2983
2984 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2985
2986         Improve standard-compliance of simple name and member access 
2987         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2988         * ecore.cs (FullNamedExpression): New abstract base class 
2989         for Namespaces and TypeExpressions.
2990         (ResolveFlags.SimpleName): Remove.
2991         (SimpleName): Remove support for dotted names.
2992         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2993         DeclSpace.FindType and DeclSpace.LookupType.
2994         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2995         (Expression.ExprClassName): Make member function.
2996         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2997         a namespace.  Remove creation of dotted "SimpleName"s.
2998         (MemberAccess.DoResolve): Likewise.
2999         * decl.cs (DeclSpace.Cache): Make private.
3000         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3001         (DeclSpace.FindType): Update.
3002         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3003         FullNamedExpression.
3004         * namespace.cs (Namespace): Derive from FullNamedExpression
3005         so that it can be part of expression resolution.
3006         (Namespace.Lookup): Return an FullNamedExpression.
3007         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3008         namespace.
3009         * rootcontext.cs (NamespaceLookup): Remove.
3010         (LookupType): Move to DeclSpace.
3011         * attribute.cs (CheckAttributeType): Update.
3012         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3013         (FindDocumentedTypeNonArray): Likewise.
3014
3015 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3016
3017         Fix cs0509.cs, cs1632.cs.
3018         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3019         is the same as IsInterface.
3020         (TypeContainer.GetClassBases): Likewise.
3021         * statement.cs (LabeledStatement.ig): New field.
3022         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3023         label.
3024         (LabeledStatement.DoEmit): Check that the label was created with
3025         the same ILGenerator.
3026
3027 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3028
3029         Fix #71058
3030         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3031         accessors to its properties.
3032
3033         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3034         from accessors to property.
3035         
3036 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3037
3038         Fix #70722
3039         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3040         only for overrides.
3041         
3042 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3043
3044         * attribute.cs: Check for null and empty strings.  
3045
3046         I have lost another battle to Paolo.
3047
3048 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3049
3050         Fix #70942
3051         * class.cs (PropertyMethod): Set Parent field in ctors.
3052         (SetMethod.InternalParameters): Add unsafe switch hack.
3053         Override MarkForDuplicationCheck where it is appropriate.
3054
3055         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3056         It says whether container allows members with the same name.
3057         Base default is no.
3058         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3059         Removed is_method parameter.
3060
3061 2005-01-06  Duncan Mak  <duncan@ximian.com>
3062
3063         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3064         because the previous change led to incorrect reporting of CS1032
3065         ("Cannot define/undefine preprocessor symbols after first token in
3066         file"). Instead of using `tokens_seen' as the only flag that
3067         triggers CS1040, introduce `comments_seen'. This new flag is used
3068         to signify having seen comments on the current line, so it is
3069         unset after a newline.
3070
3071 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3072
3073         * doc.cs : When searching for a type, find nested type too.
3074           This fixes bug #71040.
3075
3076 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3077
3078         * doc.cs :
3079           - Warn missing member comment on those classes which also does not
3080             have doc comments. Fixed bug #71041.
3081           - Don't warn missing doc comment on default constructor.
3082             Fixed bug #71042.
3083
3084 2005-01-06  Duncan Mak  <duncan@ximian.com>
3085
3086         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3087         comments, set `tokens_seen' to true. This allows us to detect
3088         misplaced preprocessor directives (i.e. not at the beginning of
3089         the a line, nor after whitespaces). In that case, report error
3090         CS1040. This fixes bug #56460.
3091
3092         * cs-parser.jay (interface_member_declaration): Add checks for
3093         IsExplicitImpl, and report CS0541 error if an interface member is
3094         defined as an explicit interface declaration.
3095
3096 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3097
3098         Fix #70817
3099         * class.cs (PropertyMethod): Set Parent field in ctors.
3100         (SetMethod.InternalParameters): Add unsafe switch hack.
3101         
3102         * decl.cs (MemberCore.Parent): Cannot be readonly.
3103
3104 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3105
3106         * decl.cs (DeclSpace.ResolveType): Remove.
3107         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3108         Merge in code from ...
3109         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3110         * class.cs, enum.cs: Update to changes.
3111
3112 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3113
3114         * anonymous.cs: Ensure that we init the scope of our parent if it
3115         has not been initialized yet.
3116
3117 2004-12-30  Duncan Mak  <duncan@ximian.com>
3118
3119         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3120         if field.FieldBuilder is null. Fixes #70758.
3121
3122         * convert.cs: Fixed some typos and updated some of the comments.
3123         (ImplicitStandardConversionExists):
3124         (TryImplicitIntConversion): If `target_type' is an interface and
3125         the type of `ic' implements this interface, return true or a new
3126         BoxedCast instead of null. This fixes #70468.
3127
3128 2004-12-29  Duncan Mak  <duncan@ximian.com>
3129
3130         * expression.cs (Argument.Emit): Check that Expr is
3131         IMemoryLocation before casting to it, and report CS1510 otherwise.
3132
3133         This fixes #70402.
3134
3135 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3136
3137         * statement.cs (Block.ThisVariable): remove the recursion here, to
3138         make the --profile more sane.
3139
3140 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3141
3142         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3143         assembly, by JB Evain.
3144
3145 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3146
3147         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3148           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3149         "parent" refers to enclosing type/class.  "base" refers to superclass.
3150
3151 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3152
3153         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3154         Ensure that we only have GlobalAttributes.
3155         * attribute.cs (Attribute.Emit): Make non-virtual.
3156         (GlobalAttribute.Emit): Remove.
3157         (Attribute.Resolve): Make virtual.
3158         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3159         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3160         the argument. Don't create one.
3161         (Attribute.GetObsoleteAttribute): Likewise.
3162         (Attribute.GetClsCompliantAttributeValue): Likewise.
3163         * class.cs, decl.cs: Update to changes.
3164
3165 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3166
3167         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3168         
3169         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3170         
3171         * statement.cs (Foreach.Resolve): Add error 186 report.
3172
3173 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3174
3175         * expression.cs (Conditional.DoResolve): Add warning 429.
3176         
3177         * statement.cs (If.Resolve): Add warning 665.
3178
3179 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3180
3181         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3182         except when in the parser, and in GlobalAttribute.
3183         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3184         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3185         RootContext.Tree.Types.NamespaceEntry once work is done.
3186         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3187         and resets RootContext.Tree.Types.NamespaceEntry.
3188
3189 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3190
3191         * cs-parser.jay: Don't create a block for every variable.
3192
3193 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3194
3195         * location.cs: Provide extra information.
3196
3197         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3198         variables from the captured environment, it is the ldarg_0.
3199
3200 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3201
3202         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3203         find a conclusion.
3204         
3205         * class.cs: Changed warning level for 169 to avoid developer
3206         displeasure from warning flooding. It will be changed back when they
3207         fix most of current BCL warnings.
3208         
3209         * RootContext.cs: Pushed default WarningLevel to 3.
3210         
3211         * statement.cs: Removed unused variable.
3212
3213 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3214
3215         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3216         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3217         Add error 502 report.
3218         (StaticClass.DefineType): Add error 441 report.
3219         (Class.AllowedModifiersProp): New virtual property as temporary
3220         extension to AllowedModifiers.
3221         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3222         to share implementation with StaticClass and don't call virtual
3223         methods from ctor.
3224         
3225         * driver.cs (MainDriver): Add error 1558 test.
3226
3227         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3228         report. Moved error 36 test here.
3229
3230         * statement.cs (Throw.Resolve): Add error 724 report.
3231
3232         * typemanager.cs: Add out_attribute_type core type.
3233         
3234 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3235
3236         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3237         3018 report.
3238         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3239
3240         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3241         3017 report.
3242         
3243         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3244
3245         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3246         Add error 3023 report.
3247         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3248
3249         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3250         implementation.
3251
3252 2004-12-12  John Luke  <john.luke@gmail.com>
3253
3254         * driver.cs (AddArgs): take -- into account when
3255         adding arguments, fixes bug 65710 
3256
3257 2004-12-12  Martin Baulig  <martin@ximian.com>
3258
3259         * expression.cs (Unary.TryReduceNegative): Added support for
3260         SByteConstant and ByteConstant.
3261         (Unary.Reduce): Check error values from TryReduceNegative().
3262
3263 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3264
3265         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3266         and report exception as error 182.
3267
3268 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3269
3270         * driver.cs (Main): Fix message when there are warnings.
3271
3272 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3273
3274         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3275
3276 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3277
3278         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3279         Reduced number of warnings.
3280         
3281         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3282
3283 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3284
3285         * driver.cs: Removed message.
3286
3287         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3288
3289 2004-12-08    <vargaz@freemail.hu>
3290
3291         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3292
3293 2004-12-08  Martin Baulig  <martin@ximian.com>
3294
3295         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3296         instead of a CS3002 for properties and indexer.
3297
3298 2004-12-08  Martin Baulig  <martin@ximian.com>
3299
3300         * decl.cs (MemberName.ToString): Make this work again.
3301
3302 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3303
3304         * attribute.cs (Resolve): Add error 591 detection.
3305
3306         * class.cs (FieldMember.Define): Add error 1547 detection.
3307         (Indexer.Define): Add error 620 detection.
3308         (Operator.Define): Add error 590 detection.
3309
3310         * ecore.cs: Missing argument for error 79.
3311
3312         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3313         detection.
3314
3315 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3316
3317         Fix #70106
3318         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3319         only.
3320
3321 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3322
3323         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3324           Some operator comments were suppressed.
3325         * doc.cs : Implicit/explicit operator name in doc comments are like
3326           "op_Explicit(type)~returnType", so added suffix handling.
3327
3328 2004-12-07  Martin Baulig  <martin@ximian.com>
3329
3330         * decl.cs
3331         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3332         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3333         (DeclSpace.ec): New protected field; store the EmitContext here.
3334         (DeclSpace.EmitContext): New public property; moved here from
3335         `TypeContainer'.
3336         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3337         EmitContext.
3338
3339         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3340         (Enum.Emit): Don't create a new EmitContext.
3341
3342         * delegate.cs (Delegate.DefineType): Always create the
3343         EmitContext.
3344
3345         * iterators.cs (Iterators.DefineIterator): Create a new
3346         EmitContext and store it in `ec'.
3347
3348 2004-08-24  Martin Baulig  <martin@ximian.com>
3349
3350         * typemanager.cs
3351         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3352         this for accessibility checks.
3353         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3354         IsNestedFamilyAccessible.
3355         (TypeManager.IsSubclassOf): New method, do what the name actually
3356         says.   
3357
3358 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3359
3360         Fix crash on cs0657-17.cs.
3361         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3362         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3363         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3364         the case where the NamespaceEntry gets overwritten.
3365
3366 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3367
3368         Fixed #69195, #56821
3369         * ecore.cs (ResolveBoolean): Tiny refactoring.
3370
3371         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3372         of right expression resolving when left is false constant and
3373         operator is LogicalAnd OR true constant and operator is LogicalOr.
3374
3375         * statement.cs (ResolveUnreachable): Always reports warning.
3376
3377 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3378
3379         * class.cs: Distinguish between 1721 and 1722 (just a little help
3380         for the programmer).
3381
3382 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3383
3384         * delegate.cs: Only allow this on new versions of the language. 
3385
3386 2004-12-02  Duncan Mak  <duncan@ximian.com>
3387
3388         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3389         Expression class.
3390         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3391         here as a static method. Take an additional bool out parameter
3392         `must_do_cs1540_check' for signaling to InstanceResolve.
3393         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3394         member field from PropertyExpr class and made it an argument of
3395         the method instead.
3396         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3397         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3398         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3399         and `remove_accessor' as well as InstanceResolve: report CS0122
3400         where applicable.
3401
3402         Fixes #70129.
3403
3404 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3405
3406         Fix test-327.cs, test-328.cs, and put in early infrastructure
3407         for eventually fixing #52697.
3408         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3409         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3410         from other methods.
3411         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3412         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3413         (VerifyUsing, error246): Update.
3414         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3415         'NamespaceEntry.LookupNamespaceOrType'.
3416
3417 2004-12-03  Martin Baulig  <martin@ximian.com>
3418
3419         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3420         method as our child, call AnonymousMethod.Compatible() on it.
3421
3422 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3423
3424         Disable XML documentation support in 'basic' profile.
3425         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3426         Redirect XmlElement to System.Object.
3427         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3428         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3429         * mcs.exe.sources: Add doc-bootstrap.cs.
3430         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3431         of doc.cs.
3432
3433 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3434
3435         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3436           comments are allowed.
3437
3438 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3439
3440         * delegate.cs: Add checks for subtypes in paramaters and return values
3441         in VerifyMethod () to add support for Covariance/Contravariance
3442         in delegates.
3443         
3444 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3445
3446         * report.cs: Remove extra closing parenthesis.
3447
3448         * convert.cs (Error_CannotImplicitConversion): If the name of the
3449         types are the same, provide some extra information.
3450
3451         * class.cs (FieldBase): Use an unused bit field from the field to
3452         encode the `has_offset' property from the FieldMember.  This saves
3453         a couple of Ks on bootstrap compilation.
3454
3455         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3456         method as our child, return the AnonymousMethod resolved
3457         expression.
3458
3459         * expression.cs (New.DoResolve): Allow return values from
3460         NewDelegate to also include AnonymousMethods.
3461
3462         Fixes #70150.
3463
3464 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3465
3466         Fix bug #70102
3467         * attribute.cs (Resolve): Improved implementation of params
3468         attribute arguments.
3469
3470         * support.cs (ParameterData): Add HasParams to be faster.
3471
3472 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3473
3474         all things are for /doc support:
3475
3476         * doc.cs: new file that supports XML documentation generation.
3477         * mcs.exe.sources: added doc.cs.
3478         * driver.cs:
3479           Handle /doc command line option.
3480           Report error 2006 instead of 5 for missing file name for /doc.
3481           Generate XML documentation when required, after type resolution.
3482         * cs-tokenizer.cs:
3483           Added support for picking up documentation (/// and /** ... */),
3484           including a new XmlCommentState enumeration.
3485         * cs-parser.jay:
3486           Added lines to fill Documentation element for field, constant,
3487           property, indexer, method, constructor, destructor, operator, event
3488           and class, struct, interface, delegate, enum.
3489           Added lines to warn incorrect comment.
3490         * rootcontext.cs :
3491           Added Documentation field (passed only when /doc was specified).
3492         * decl.cs:
3493           Added DocComment, DocCommentHeader, GenerateDocComment() and
3494           OnGenerateDocComment() and some supporting private members for
3495           /doc feature to MemberCore.
3496         * class.cs:
3497           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3498         * delegate.cs:
3499           Added overriden DocCommentHeader.
3500         * enum.cs:
3501           Added overriden DocCommentHeader and GenerateDocComment().
3502
3503 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3504
3505         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3506         unwrapping the enumeration values, chain to
3507         DoConstantNumericPromotions again, so we can promote things to the
3508         fundamental types (takes care of enums that are bytes, sbytes).
3509
3510         Fixes bug #62054.
3511
3512 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3513
3514         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3515         Fix long-standing bug in type-lookup.  Use FindType instead of
3516         LookupType when ec.ResolvingTypeTree.
3517         (Attribute.ResolveType, Attribute.Resolve)
3518         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3519         Update to changes.
3520         (Attributes.Search): Remove internal version.  Update.
3521         (Attributes.SearchMulti): Update.
3522         (Attributes.GetClsCompliantAttribute): Remove.
3523         (Attributes.GetIndexerNameAttribute): Remove.
3524         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3525         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3526         * class.cs (Indexer.Define): Likewise.
3527
3528 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3529
3530         Fix bug #68790
3531         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3532         MarshallByReference members access.
3533
3534         * expression.cs: Use CheckMarshallByRefAccess;
3535         Better error CS0197 message.
3536
3537         * report.cs: Print whole related error message.
3538
3539 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3540
3541         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3542         the current directory to help debugging.
3543
3544 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3545
3546         * class (GetClassBases): Better error 60 report.
3547         (EventProperty): Disabled warning 67 detection.
3548
3549 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3550
3551         Fix bug #60324
3552         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3553
3554         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3555         precise values.
3556
3557 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3558
3559         Fix bug #49488
3560         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3561
3562         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3563
3564 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3565
3566         * attribute.cs (Attribute.Resolve): Refine error reporting and
3567         report a cs0117 if the identifier does not exist, to distinguish
3568         from 0617 which is a miss-use of the actual identifier.
3569
3570         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3571         between cs0070 and cs0079.
3572
3573         * class.cs (MemberBase.DoDefine): When reporting a wrong
3574         accessibility level, we use MethodCore to compare instead of
3575         Method (this was a regression in some refactoring effort).
3576
3577         So now we correctly report cs0056 again.
3578
3579         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3580         testing the target_type (which was known to be object_type) and
3581         not the source type (which is anonymous_method).
3582
3583         Fixed reporting of error cs1660.
3584
3585         * expression.cs (UserCast.Source): Expose the underlying cast.
3586
3587         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3588         allowed types to find a match to int32 first (most common).
3589
3590         In addition, it ignores any ImplicitUserConversions that did an
3591         internal implicit conversion (as the switch statement allows only
3592         one integral conversion to exist).
3593
3594         * class.cs (PartialContainer.Create): rename `name' to
3595         `member_name' for clarity.  Then replace the string calls with a
3596         call to MemberName.GetPartialName, as now using
3597         MemberName.ToString is an error (this is due to the side effects
3598         it had, that were fixed in the past).
3599
3600         This will restore the error reporting on a number of partial class
3601         errors that were missusing this (and getting an exception as a
3602         results, which is now just a plain textual warning, because
3603         yyparse debug output would crash otherwise).
3604
3605 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3606
3607         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3608
3609 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3610
3611         * rootcontext.cs (LookupType): Make sure to cache lookups that
3612         don't give us a negative result. This saves about 5% of corlib
3613         compilation time.
3614
3615 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3616
3617         * report.cs (AbstractMessage.Print): messages are sent to stderr
3618
3619         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3620         non-interface in the list of interfaces (at this point, either
3621         parent was properly set, or a base class is being listed in the
3622         interfaces section).
3623
3624         This flags error 1722, and resolves the crash from bug 69259.
3625
3626 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3627
3628         * statement.cs (Using.EmitExpressionFinally): make this work right
3629         for valuetypes. Fixes 69926.
3630
3631 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3632
3633         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3634         converted to an enum" here, before we try to change the underlying
3635         type.  This code exists, but it is a different code path than the
3636         one used while encoding constants.
3637
3638         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3639         old bug: when converting from the null literal to a pointer,
3640         return an EmptyCast, not the NullLiteral.
3641
3642         This fixes #69921, the recent null_type changes probably made this
3643         bug more prominent.
3644
3645         (ImplicitReferenceConversionExists): In addition, resynchronized
3646         the code here, so it matches the same code in
3647         ImplicitReferenceConversionExists for the `from any class-type S
3648         to any interface-type T'.
3649         
3650
3651 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3652
3653         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3654
3655 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3656
3657         * cs-parser.jay: Use verbosity accordingly. 
3658
3659 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3660
3661         * expression.cs (Unary.ResolveOperator): Do not report warning;
3662         AddressOf reads from variable.
3663         
3664         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3665
3666 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3667
3668         Fix bug #69462
3669
3670         * attribute.cs (Attributable): Removed CheckTargets.
3671         (Attributes.Emit): Explicit attribute targets are tested here.
3672
3673         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3674         not enabled for interfaces.
3675
3676         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3677         (GetAssemblyName): Ouch next bug there.
3678
3679 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3680
3681         * expression.cs: Error 275 added.
3682         
3683 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3684
3685         Fix bug #69177 (Implemented decimal constant support)
3686
3687         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3688         (BinaryFold): Add DecimalConstant.
3689
3690         * const.cs (Define): Decimal constant 
3691         (is not constant.
3692         (ChangeType): Add decimal type handling.
3693         (LookupConstantValue): Don't set value for decimal type but
3694         emit DecimalConstantAttribute. Needed for constant optimization.
3695
3696         * constant.cs (ToDecimal): New method.
3697         (ConvertToDecimal): New method.
3698         (IntConstant): Implemented ConvertToDecimal.
3699         (DecimalConstant.Emit): Emit optimized version for decimals in
3700         int range.
3701
3702         * expression.cs (ResolveOperator): Changed order of constant
3703         reduction to work correctly with native types which have
3704         overloaded operators.
3705         (ResolveMemberAccess): Extract constant value from attribute
3706         for decimal type.
3707
3708         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3709
3710         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3711         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3712         (ChangeType): Decimal is special.
3713         (TypeToCoreType): Add decimal type.
3714
3715 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3716
3717         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3718         decimal types.
3719
3720 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3721
3722         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3723         test cs1667-5.cs.
3724
3725 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3726
3727         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3728
3729         * pending.cs (PendingImplementation): Grab only interfaces.
3730
3731 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3732
3733         * statement.cs (ForeachHelperMethods): Add location member and
3734         error 202 detection.
3735
3736 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3737
3738         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3739         automatically handled by executable.make.
3740         (PROGRAM): Make profile-specific.
3741
3742 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3743
3744         * expression.cs (DoResolveBase): Fixed wrong warning for out
3745         variables.
3746
3747 2004-11-18  Martin Baulig  <martin@ximian.com>
3748
3749         Merged latest changes into gmcs.  Please keep this comment in
3750         here, it makes it easier for me to see what changed in MCS since
3751         the last time I merged.
3752
3753 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3754
3755         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3756         (TypeHandle.GetMemberCache): New.
3757         (TypeHandle.TypeHandle): Update.
3758         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3759         (TypeManager.LookupParentInterfacesCache):
3760         Rename from LookupInterfaceCache.  Optimize slightly.
3761         (TypeManager.MemberLookup_FindMembers): Update.
3762         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3763         multi-type variant.
3764         (AddCacheContents): Rename from AddHashtable.
3765         * class.cs (TypeContainer.parent_container): Remove.
3766         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3767         (TypeContainer.DoDefineMembers): Don't initialize it.
3768         Update to name changes.
3769         
3770 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3771
3772         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3773         that factors the code to check access modifiers on override.  
3774
3775         (PropertyBase): Use the code here.
3776
3777         Patch from Lluis S'anchez, fixes bug #69361.
3778
3779 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3780
3781         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3782         routine that is used to report the use of a captured variable
3783         whose address has been taken.
3784
3785         There are two checks: one when variables are being captured and
3786         the other check is when the address of a variable is taken. 
3787         
3788         (because an anonymous methods might be resolved before *or* after
3789         the address has been taken) and 
3790
3791         * expression.cs (Conditional.DoResolve): Remove the special
3792         casing that Martin added to trueExpr and falseExpr being both
3793         NullLiteral.  We get the right behavior now just by introducing
3794         the null_type into the compiler. 
3795
3796         * convert.cs (ExplicitConversion): Change the code to use
3797         null_type instead of testing `expr is NullLiteral'.
3798         (ImplicitConversionStandard): use null_type too.
3799         (ImplicitReferenceConversionExists): use null_type too.
3800         (ImplicitReferenceConversion): use null_type too.
3801
3802         * literal.cs: The type of `NullLiteral' is now null_type instead
3803         of object_type. 
3804         (Resolve): Set the type here.
3805
3806         * typemanager.cs: Introduce null_type.
3807
3808 2004-11-17  Martin Baulig  <martin@ximian.com>
3809
3810         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3811         direction, like FindMembers() does.  Fixes #69546, testcase is in
3812         test-315.cs.    
3813
3814 2004-11-16  Martin Baulig  <martin@ximian.com>
3815
3816         This is based on a patch from Marek Safar, see bug #69082.
3817         Fixes bugs #63705 and #67130.
3818
3819         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3820         method; create a MemberCache for an interface type and cache the
3821         result.
3822
3823         * decl.cs (IMemberContainer.ParentContainer): Removed.
3824         (IMemberContainer.ParentCache): New property.
3825         (MemberCache.SetupCacheForInterface): Removed.
3826         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3827         to create a cache for an interface's "parent".
3828
3829         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3830         interfaces too.
3831
3832 2004-11-16  Martin Baulig  <martin@ximian.com>
3833
3834         Merged back from gmcs; these changes already went into gmcs a
3835         couple of weeks ago.
3836
3837         * typemanager.cs
3838         (TypeManager.AddUserType): Removed the `ifaces' argument.
3839         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3840         `TypeExpr []'.
3841         (TypeManager.AddUserInterface): Removed.
3842         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3843         `TypeExpr []'.
3844         (TypeManager.GetInterfaces): Likewise.
3845         (TypeManager.GetExplicitInterfaces): Likewise.
3846
3847         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3848
3849         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3850         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3851
3852 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3853
3854         * statement.cs: Avoid adding bools to a hashtable.
3855
3856 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3857
3858         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3859         calling an unsafe method from a safe location.
3860
3861 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3862
3863         Fix #69167
3864         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3865
3866 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3867
3868         * namespace.cs (VerifyUsing): use GetPartialName instead of
3869         ToString. 
3870
3871 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3872
3873         * statement.cs (Return.Resolve): Fix regression in typo: if
3874         `in_exc', we have to request a NeedReturnLabel, this was a typo
3875         introduced in the anonymous method check-in.  Fixes #69131.
3876
3877         * Indexers were using the ShortName when defining themselves,
3878         causing a regression in the compiler bootstrap when applying the
3879         patch from 2004-11-02 (first part), now they use their full name
3880         and the bug is gone.
3881
3882 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3883
3884         * driver.cs: Strip the path from the names of embedded resources. Fixes
3885         #68519.
3886
3887 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3888
3889         Fix error message regression: cs0104-2.cs.
3890         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3891         (AliasEntry.Resolve): Update.
3892         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3893         'silent' flag.
3894         (RootContext.LookupType): Update.
3895
3896 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3897
3898         * cs-parser.jay: Add support for handling accessor modifiers
3899         * class: Add support port accessor modifiers and error checking,
3900         define PropertyMethod.Define as virtual (not abstract anymore)
3901         * ecore.cs: Add checking for proeprties access with access modifiers
3902         * iterators.cs: Modify Accessor constructor call based in the modified
3903         constructor
3904 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3905
3906         * expression.cs (StringConcat): Handle being called twice,
3907         as when we have a concat in a field init with more than two
3908         ctors in the class
3909
3910 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3911
3912         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3913         special case explicit implementations, we should always produce
3914         the .property or .event declaration.
3915         
3916         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3917         since it will not return correct data if people use this
3918         unresolved in the presence of using statements (see test-313).
3919
3920         * class.cs (MethodData.Define): If we are an explicit interface
3921         implementation, set the method name to the full name of the
3922         interface plus the name of the method.  
3923
3924         Notice that using the method.MethodName.GetFullName() does not
3925         work, as it will only contain the name as declared on the source
3926         file (it can be a shorthand in the presence of using statements)
3927         and not the fully qualifed type name, for example:
3928
3929         using System;
3930
3931         class D : ICloneable {
3932                 object ICloneable.Clone ()  {
3933                 }
3934         }
3935
3936         Would produce a method called `ICloneable.Clone' instead of
3937         `System.ICloneable.Clone'.
3938
3939         * namespace.cs (Alias.Resolve): Use GetPartialName.
3940         
3941 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3942
3943         * cs-parser.jay: Add error 1055 report.
3944
3945 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3946
3947         * assign.cs (Assign.DoResolve): Only do the transform of
3948         assignment into a New if the types are compatible, if not, fall
3949         through and let the implicit code deal with the errors and with
3950         the necessary conversions. 
3951
3952 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3953
3954         * cs-parser.jay: Add error 1031 report.
3955
3956         * cs-tokenizer.cs: Add location for error 1038.
3957
3958 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3959
3960         * cs-parser.jay: Add error 1016 report.
3961
3962 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3963
3964         * cs-parser.jay: Add errors 1575,1611 report.
3965
3966 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3967
3968         * cs-parser.jay: Add error 1001 report.
3969
3970 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3971
3972         Fix #68850
3973         * attribute.cs (GetMarshal): Add method argument for
3974         caller identification.
3975
3976         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3977         agument for GetMarshal and RuntimeMissingSupport.
3978
3979 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3980
3981         * attribute.cs (ExtractSecurityPermissionSet): Removed
3982         TypeManager.code_access_permission_type.
3983
3984         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3985
3986 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3987
3988         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3989         for obsolete use of a variable here.   Fixes regression on errors
3990         cs0619-25 and cs0619-26.
3991
3992 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3993
3994         Fix #62358, implemented security attribute encoding.
3995
3996         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3997         Tests permitted SecurityAction for assembly or other types.
3998         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3999         data from SecurityPermissionAttribute to PermisionSet class.
4000
4001         * class.cs (ApplyAttributeBuilder): Added special handling
4002         for System.Security.Permissions.SecurityAttribute based types.
4003
4004         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4005         special handling for System.Security.Permissions.SecurityAttribute
4006         based types.
4007
4008         * enum.cs (ApplyAttributeBuilder): Added special handling
4009         for System.Security.Permissions.SecurityAttribute based types.
4010
4011         * parameter.cs (ApplyAttributeBuilder): Added special handling
4012         for System.Security.Permissions.SecurityAttribute based types.
4013
4014         * rootcontext.cs: Next 2 core types.
4015
4016         * typemanager.cs (TypeManager.security_permission_attr_type):
4017         Built in type for the SecurityPermission Attribute.
4018         (code_access_permission_type): Build in type.
4019
4020 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4021
4022         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4023         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4024         all of this information into
4025         EmitContext.EmitCapturedVariableInstance.
4026         
4027         * codegen.cs (EmitCapturedVariableInstance): move here the
4028         funcionality of emitting an ldarg.0 in the presence of a
4029         remapping.   This centralizes the instance emit code.
4030
4031         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4032         then emit a load of this: it means that we have reached the
4033         topmost ScopeInfo: the one that contains the pointer to the
4034         instance of the class hosting the anonymous method.
4035
4036         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4037         captures to the topmost CaptureContext.
4038
4039 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4040
4041         * expression.cs (LocalVariableReference): Move the knowledge about
4042         the iterators into codegen's EmitCapturedVariableInstance.
4043
4044 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4045
4046         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4047         all code paths return a value from an anonymous method (it is the
4048         same as the 161 error, but for anonymous methods).
4049
4050 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4051
4052         The introduction of anonymous methods in the compiler changed
4053         various ways of doing things in the compiler.  The most
4054         significant one is the hard split between the resolution phase
4055         and the emission phases of the compiler.
4056
4057         For instance, routines that referenced local variables no
4058         longer can safely create temporary variables during the
4059         resolution phase: they must do so from the emission phase,
4060         since the variable might have been "captured", hence access to
4061         it can not be done with the local-variable operations from the runtime.
4062         
4063         * statement.cs 
4064
4065         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4066         is a toplevel block.
4067
4068         (ToplevelBlock): A new kind of Block, these are the blocks that
4069         are created by the parser for all toplevel method bodies.  These
4070         include methods, accessors and anonymous methods.
4071
4072         These contain some extra information not found in regular blocks:
4073         A pointer to an optional CaptureContext (for tracking captured
4074         local variables and parameters).  A pointer to the parent
4075         ToplevelBlock.
4076         
4077         (Return.Resolve): Catch missmatches when returning a value from an
4078         anonymous method (error 1662).
4079         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4080         phase.
4081
4082         (Break.Resolve): ditto.
4083
4084         (SwitchLabel): instead of defining the labels during the
4085         resolution phase, we now turned the public ILLabel and ILLabelCode
4086         labels into methods called GetILLabelCode() and GetILLabel() that
4087         only define the label during the Emit phase.
4088
4089         (GotoCase): Track the SwitchLabel instead of the computed label
4090         (its contained therein).  Emit the code by using
4091         SwitchLabel.GetILLabelCode ().
4092
4093         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4094         whether the Local has been captured or not.
4095
4096         (LocalInfo.IsCaptured): New property, used to tell whether the
4097         local has been captured.
4098         
4099         * anonymous.cs: Vastly updated to contain the anonymous method
4100         support.
4101
4102         The main classes here are: CaptureContext which tracks any
4103         captured information for a toplevel block and ScopeInfo used to
4104         track the activation frames for various local variables.   
4105
4106         Each toplevel block has an optional capture context associated
4107         with it.  When a method contains an anonymous method both the
4108         toplevel method and the anonymous method will create a capture
4109         context.   When variables or parameters are captured, they are
4110         recorded on the CaptureContext that owns them, for example:
4111
4112         void Demo () {
4113              int a;
4114              MyDelegate d = delegate {
4115                  a = 1;
4116              }
4117         }
4118
4119         Here `a' will be recorded as captured on the toplevel
4120         CapturedContext, the inner captured context will not have anything
4121         (it will only have data if local variables or parameters from it
4122         are captured in a nested anonymous method.
4123
4124         The ScopeInfo is used to track the activation frames for local
4125         variables, for example:
4126
4127         for (int i = 0; i < 10; i++)
4128                 for (int j = 0; j < 10; j++){
4129                    MyDelegate d = delegate {
4130                         call (i, j);
4131                    }
4132                 }
4133
4134         At runtime this captures a single captured variable `i', but it
4135         captures 10 different versions of the variable `j'.  The variable
4136         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4137         recorded on a child.  
4138
4139         The toplevel ScopeInfo will also track information like the `this'
4140         pointer if instance variables were referenced (this is necessary
4141         as the anonymous method lives inside a nested class in the host
4142         type of the method). 
4143
4144         (AnonymousMethod): Expanded to track the Toplevel, implement
4145         `AnonymousMethod.Compatible' to tell whether an anonymous method
4146         can be converted to a target delegate type. 
4147
4148         The routine now also produces the anonymous method content
4149
4150         (AnonymousDelegate): A helper class that derives from
4151         DelegateCreation, this is used to generate the code necessary to
4152         produce the delegate for the anonymous method that was created. 
4153
4154         * assign.cs: API adjustments for new changes in
4155         Convert.ImplicitStandardConversionExists.
4156
4157         * class.cs: Adjustments to cope with the fact that now toplevel
4158         blocks are of type `ToplevelBlock'. 
4159
4160         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4161         insteda of standard blocks.
4162
4163         Flag errors if params arguments are passed to anonymous methods.
4164
4165         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4166         `CurrentAnonymousMethod' which points to the current Anonymous
4167         Method.  The variable points to the AnonymousMethod class that
4168         holds the code being compiled.  It is set in the new EmitContext
4169         created for the anonymous method.
4170
4171         (EmitContext.Phase): Introduce a variable and an enumeration to
4172         assist in enforcing some rules about when and where we are allowed
4173         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4174         only one that enfonces this right now).
4175
4176         (EmitContext.HaveCaptureInfo): new helper method that returns
4177         whether we have a CapturedContext initialized.
4178
4179         (EmitContext.CaptureVariable): New method used to register that a
4180         LocalInfo must be flagged for capturing. 
4181
4182         (EmitContext.CapturedParameter): New method used to register that a
4183         parameters must be flagged for capturing. 
4184         
4185         (EmitContext.CapturedField): New method used to register that a
4186         field must be flagged for capturing. 
4187
4188         (EmitContext.HaveCapturedVariables,
4189         EmitContext.HaveCapturedFields): Return whether there are captured
4190         variables or fields. 
4191
4192         (EmitContext.EmitMethodHostInstance): This is used to emit the
4193         instance for the anonymous method.  The instance might be null
4194         (static methods), this (for anonymous methods that capture nothing
4195         and happen to live side-by-side with the current method body) or a
4196         more complicated expression if the method has a CaptureContext.
4197
4198         (EmitContext.EmitTopBlock): Routine that drives the emission of
4199         code: it will first resolve the top block, then emit any metadata
4200         and then emit the code.  The split is done so that we can extract
4201         any anonymous methods and flag any captured variables/parameters.
4202         
4203         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4204         during this phase, the ILGenerator should not be used as labels
4205         and local variables declared here might not be accessible to any
4206         code that is part of an anonymous method.  
4207
4208         Exceptions to this include the temporary variables that are
4209         created by some statements internally for holding temporary
4210         variables. 
4211         
4212         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4213         metadata for a cb
4214
4215         (EmitContext.TemporaryReturn): This method is typically called
4216         from the Emit phase, and its the only place where we allow the
4217         ReturnLabel to be defined other than the EmitMeta.  The reason is
4218         that otherwise we would have to duplicate a lot of logic in the
4219         Resolve phases of various methods that today is on the Emit
4220         phase. 
4221
4222         (EmitContext.NeedReturnLabel): This no longer creates the label,
4223         as the ILGenerator is not valid during the resolve phase.
4224
4225         (EmitContext.EmitThis): Extended the knowledge in this class to
4226         work in anonymous methods in addition to iterators. 
4227
4228         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4229         code is necessary on the stack to access the instance to a local
4230         variable (the variable will be accessed as a field).
4231
4232         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4233         EmitContext.EmitAddressOfParameter): Routines to support
4234         parameters (not completed at this point). 
4235         
4236         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4237         will also remove the parameters.
4238
4239         * convert.cs (Convert): Define a `ConstantEC' which points to a
4240         null.  This is just to prefity some code that uses
4241         ImplicitStandardConversion code and do not have an EmitContext
4242         handy.
4243
4244         The idea is to flag explicitly that at that point in time, it is
4245         known that the conversion will not trigger the delegate checking
4246         code in implicit conversions (which requires a valid
4247         EmitContext). 
4248
4249         Everywhere: pass new EmitContext parameter since
4250         ImplicitStandardConversionExists now requires it to check for
4251         anonymous method conversions. 
4252
4253         (Convert.ImplicitStandardConversionExists): If the type of an
4254         expression is the anonymous_method_type, and the type is a
4255         delegate, we invoke the AnonymousMethod.Compatible method to check
4256         whether an implicit conversion is possible. 
4257
4258         (Convert.ImplicitConversionStandard): Only do implicit method
4259         group conversions if the language level is not ISO_1.
4260
4261         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4262         MethodInfo for the Invoke method.  used by Delegate and
4263         AnonymousDelegate.
4264
4265         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4266         method conversions if the target type is a delegate.
4267
4268         Removed extra debugging nops.
4269
4270         (LocalVariableReference): Turn the `local_info' into a public
4271         field. 
4272
4273         Add `prepared' field, the same hack used for FieldExprs to cope
4274         with composed assignments, as Local variables do not necessarily
4275         operate purely on the stack as they used to: they can be captured
4276         fields. 
4277
4278         Add `temp' for a temporary result, like fields.
4279
4280         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4281
4282         It now copes with Local variables that are captured and emits the
4283         proper instance variable to load it from a field in the captured
4284         case. 
4285
4286         (ParameterReference.DoResolveBase): During the resolve phase,
4287         capture parameters if we are in an anonymous method.
4288
4289         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4290         anonymous method, use the EmitContext helper routines to emit the
4291         parameter reference.
4292
4293         * iterators.cs: Set RemapToProxy to true/false during the
4294         EmitDispose class.
4295
4296         * parameters.cs (GetParameterByName): New helper method. 
4297
4298         * typemanager.cs (anonymous_method_type) a new type that
4299         represents an anonyous method.  This is always an internal type,
4300         used as a fencepost to test against the anonymous-methodness of an
4301         expression. 
4302         
4303 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4304
4305         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4306         561 report.
4307         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4308
4309 2004-10-18  Martin Baulig  <martin@ximian.com>
4310
4311         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4312         `Type' directly, but call ResolveType() on it.
4313         (Catch.Resolve): Likewise.
4314         (Foreach.Resolve): Likewise.
4315
4316 2004-10-18  Martin Baulig  <martin@ximian.com>
4317
4318         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4319         `Type' directly, but call ResolveType() on it.
4320         (Probe.DoResolve): Likewise.
4321         (ArrayCreation.LookupType): Likewise.
4322         (TypeOf.DoResolve): Likewise.
4323         (SizeOf.DoResolve): Likewise.
4324
4325 2004-10-18  Martin Baulig  <martin@ximian.com>
4326
4327         * expression.cs (Invocation.BetterFunction): Put back
4328         TypeManager.TypeToCoreType().
4329
4330 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4331
4332         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4333         the ResolveType.
4334
4335 2004-10-18  Martin Baulig  <martin@ximian.com>
4336
4337         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4338         `Type' directly, but call ResolveType() on it.
4339
4340 2004-10-18  Martin Baulig  <martin@ximian.com>
4341
4342         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4343         `Type' directly, but call ResolveType() on it.
4344         (MemberBase.DoDefine): Likewise.
4345
4346         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4347         `Type' directly, but call ResolveType() on it.
4348         (ComposedCast.DoResolveAsTypeStep): Likewise.
4349
4350         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4351         `Type' directly, but call ResolveType() on it.
4352
4353 2004-10-17  John Luke  <john.luke@gmail.com>
4354
4355         * class.cs (Operator.GetSignatureForError): use CSharpName
4356
4357         * parameter.cs (Parameter.GetSignatureForError): Returns
4358         correct name even if was not defined.
4359
4360 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4361
4362         Fix #65816.
4363         * class.cs (TypeContainer.EmitContext): New property.
4364         (DefineNestedTypes): Create an emitcontext for each part.
4365         (MethodCore.DoDefineParameters): Use container's emitcontext.
4366         Pass type array to InternalParameters.
4367         (MemberBase.DoDefine): Use container's emitcontext.
4368         (FieldMember.Define): Likewise.
4369         (Event.Define): Likewise.
4370         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4371         Pass type array to InternalParameters.
4372         (SetIndexerMethod.GetParameterInfo): Likewise.
4373         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4374         * delegate.cs (Define): Pass emitcontext to
4375         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4376         array to InternalParameters.
4377         * expression.cs (ParameterReference.DoResolveBase): Pass
4378         emitcontext to GetParameterInfo.
4379         (ComposedCast.DoResolveAsTypeStep): Remove check on
4380         ec.ResolvingTypeTree.
4381         * parameter.cs (Parameter.Resolve): Change argument to
4382         EmitContext.  Use ResolveAsTypeTerminal.
4383         (Parameter.GetSignature): Change argument to EmitContext.
4384         (Parameters.ComputeSignature): Likewise.
4385         (Parameters.ComputeParameterTypes): Likewise.
4386         (Parameters.GetParameterInfo): Likewise.
4387         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4388         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4389         * support.cs (InternalParameters..ctor): Remove variant that takes
4390         a DeclSpace.
4391         * typemanager.cs (system_intptr_expr): New.
4392         (InitExpressionTypes): Initialize it.
4393
4394 2004-10-12  Chris Toshok  <toshok@ximian.com>
4395
4396         * cs-parser.jay: fix location for try_statement and catch_clause.
4397
4398 2004-10-11  Martin Baulig  <martin@ximian.com>
4399
4400         * report.cs: Don't make --fatal abort on warnings, we have
4401         -warnaserror for that.
4402
4403 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4404
4405         More DeclSpace.ResolveType avoidance.
4406         * decl.cs (MemberCore.InUnsafe): New property.
4407         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4408         with newly created EmitContext.
4409         (FieldMember.Define): Likewise.
4410         * delegate.cs (Delegate.Define): Likewise.
4411         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4412         only if normal name-lookup fails.
4413         (TypeExpr.DoResolve): Enable error-checking.
4414         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4415         (SizeOf.DoResolve): Likewise.
4416         (ComposedCast.DoResolveAsTypeStep): Likewise.
4417         (StackAlloc.DoResolve): Likewise.
4418         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4419         (Block.Unsafe): New property.
4420         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4421         (Unsafe): Set 'unsafe' flag of contained block.
4422         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4423         (Fixed.Resolve): Likewise.
4424         (Catch.Resolve): Likewise.
4425         (Using.ResolveLocalVariableDecls): Likewise.
4426         (Foreach.Resolve): Likewise.
4427
4428 2004-10-05  John Luke <john.luke@gmail.com>
4429
4430         * cs-parser.jay: add location to error CS0175
4431
4432 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4433
4434         * ecore.cs (Expression.Constantity): Add support for turning null
4435         into a constant.
4436
4437         * const.cs (Const.Define): Allow constants to be reference types
4438         as long as the value is Null.
4439
4440 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4441
4442         * namespace.cs (NamespaceEntry.Using): No matter which warning
4443         level is set, check if this namespace name has already been added.
4444
4445 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4446
4447         * expression.cs: reftype [!=]= null should always use br[true,false].
4448         # 67410
4449
4450 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4451
4452         Fix #67108
4453         * attribute.cs: Enum conversion moved to 
4454         GetAttributeArgumentExpression to be applied to the all
4455         expressions.
4456
4457 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4458
4459         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4460         * class.c (TypeContainer.DefineType): Flag error if
4461         base types aren't accessible due to access permissions.
4462         * decl.cs (DeclSpace.ResolveType): Move logic to
4463         Expression.ResolveAsTypeTerminal.
4464         (DeclSpace.ResolveTypeExpr): Thin layer over
4465         Expression.ResolveAsTypeTerminal.
4466         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4467         Refactor code into NestedAccess.  Use it.
4468         (DeclSpace.NestedAccess): New.
4469         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4470         argument to silence errors.  Check access permissions.
4471         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4472         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4473         (Cast.DoResolve): Likewise.
4474         (New.DoResolve): Likewise.
4475         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4476         (TypeOf.DoResolve): Likewise.
4477
4478         * expression.cs (Invocation.BetterConversion): Return the Type of
4479         the better conversion.  Implement section 14.4.2.3 more faithfully.
4480         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4481         section 14.4.2.2 explicit.
4482         (Invocation.OverloadResolve): Update.
4483         (Invocation): Remove is_base field.
4484         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4485         (Invocation.Emit): Likewise.
4486
4487 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4488
4489         * README: Update to changes.
4490
4491 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4492
4493         * cs-parser.jay: Reverted 642 warning fix.
4494
4495 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4496
4497         Fix bug #66615
4498         * decl.cs (FindMemberWithSameName): Indexer can have more than
4499         1 argument.
4500
4501 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4502
4503         * expression.cs (LocalVariableReference.DoResolveLValue):
4504         Do not report warning 219 for out values.
4505         (EmptyExpression.Null): New member to avoid extra allocations.
4506
4507 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4508
4509         * cs-parser.jay: Fix wrong warning 642 report.
4510
4511         * cs-tokenizer.cs (CheckNextToken): New helper;
4512         Inspect next character if is same as expected.
4513
4514 2004-09-23  Martin Baulig  <martin@ximian.com>
4515
4516         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4517         (Convert.ImplicitReferenceConversionExists): Likewise.
4518
4519 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4520
4521         * class.cs (Operator.Define): Add error 448 and 559 report.
4522
4523 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4524
4525         * class.cs (MemberBase.IsTypePermitted): New protected
4526         method for checking error CS0610.
4527
4528 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4529
4530         * class.cs (TypeContainer.HasExplicitLayout): New property
4531         Returns whether container has StructLayout attribute set Explicit.
4532         (FieldMember): New abstract class for consts and fields.
4533         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4534         (Field): Reuse FieldMember.
4535
4536         * const.cs (Const): Reuse FieldMember.
4537
4538         * rootcontext.cs: EmitConstants call moved to class.
4539
4540 2004-09-22  Martin Baulig  <martin@ximian.com>
4541
4542         Thanks to Peter Sestoft for this bug report.
4543
4544         * expression.cs (Conditional): If both the `trueExpr' and the
4545         `falseExpr' is a NullLiteral, return a NullLiteral.
4546
4547 2004-09-22  Martin Baulig  <martin@ximian.com>
4548
4549         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4550         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4551         for the "get_Current" call.
4552
4553 2004-09-22  Martin Baulig  <martin@ximian.com>
4554
4555         Marek and me just fixed one of our oldest bugs: #28562 :-)
4556
4557         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4558
4559         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4560         we're an EnumConstant, just return that.
4561         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4562         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4563         to get the value which'll actually be written into the attribute.
4564         However, we have to use GetValue() to access the attribute's value
4565         in the compiler.        
4566
4567 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4568
4569         * constant.cs (Constant.IsNegative): New abstract property
4570         IsNegative.
4571
4572         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4573         (StackAlloc.DoResolve): Reused IsNegative.
4574
4575 2004-09-21  Martin Baulig  <martin@ximian.com>
4576
4577         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4578         if we're used in an iterator, we may be called from different
4579         methods.
4580
4581         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4582         we actually have an exception block.
4583
4584 2004-09-20  John Luke <jluke@cfl.rr.com>
4585
4586         * class.cs, cs-parser.jay: Improve the error report for 1520:
4587         report the actual line where the error happens, not where the
4588         class was declared.
4589
4590         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4591         Pass location information that was available elsewhere.
4592
4593 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4594
4595         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4596         runtime to delay sign assemblies.
4597
4598 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4599
4600         * cs-parser.jay: Do not report the stack trace, this is barely
4601         used nowadays.
4602
4603 2004-08-22  John Luke  <john.luke@gmail.com>
4604  
4605         * driver.cs : check that a resource id is not already used
4606         before adding it, report CS1508 if it is, bug #63637
4607
4608 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4609
4610         * ecore.cs: Removed dead code.
4611
4612 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4613
4614         * class.cs: Do not report warning CS0067 on the interfaces.
4615
4616 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4617
4618         * cs-parser.jay: Add error 504 report.
4619
4620 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4621
4622         * rootcontext.cs: WarningLevel is 4 by default now.
4623
4624         * statement.cs (Fixed.Resolve): Do not null
4625         VariableInfo.
4626
4627 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4628
4629         Fixed bug #55780
4630         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4631         deep search when property is not virtual.
4632         (PropertyExpr.ResolveAccessors): Make one call for both
4633         accessors.
4634
4635 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4636
4637         Fixed bug #65766
4638         * statement.cs: Error 152 report constains also location.
4639
4640 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4641
4642         Fixed bug #65766
4643         * const.cs: Explicitly set constant as static.
4644
4645 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4646
4647         Fixed bug #64226
4648         * cs-parser.jay: Add error 1017 report.
4649
4650 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4651
4652         Fixed bug #59980, #64224
4653         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4654
4655         * typemanager.cs (IsSpecialMethod): Simplified
4656
4657 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4658
4659         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4660         condition with better params.
4661
4662 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4663
4664         Fixed bug #65238
4665         * attribute.cs (Resolve): Property has to have both
4666         accessors.
4667
4668 2004-09-14  Martin Baulig  <martin@ximian.com>
4669
4670         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4671
4672 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4673
4674         Fixed bug #61902
4675         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4676         called and is obsolete then this member suppress message
4677         when call is inside next [Obsolete] method or type.
4678
4679         * expression.cs: Use TestObsoleteMethodUsage member.
4680
4681 2004-09-14  Martin Baulig  <martin@ximian.com>
4682
4683         * cs-parser.jay: Sync a bit with the GMCS version.
4684
4685 2004-09-14  Martin Baulig  <martin@ximian.com>
4686
4687         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4688         (CSharpParser.yacc_verbose_flag): New public field.
4689
4690         * genericparser.cs: Removed.
4691
4692 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4693
4694         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4695
4696 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4697
4698         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4699
4700 2004-09-10  Martin Baulig  <martin@ximian.com>
4701
4702         Backported my MemberName changes from GMCS into MCS.
4703
4704         - we are now using a special `MemberName' class instead of using
4705         strings; in GMCS, the `MemberName' also contains the type
4706         arguments.
4707
4708         - changed the grammar rules a bit:
4709           * the old `member_name' is now a `namespace_or_type_name':
4710             The rule is that we use `namespace_or_type_name' everywhere
4711             where we expect either a "member name" (GetEnumerator) or a
4712             "member name" with an explicit interface name
4713             (IEnumerable.GetEnumerator).
4714             In GMCS, the explicit interface name may include type arguments
4715             (IEnumerable<T>.GetEnumerator).
4716           * we use `member_name' instead of just `IDENTIFIER' for
4717             "member names":
4718             The rule is that we use `member_name' wherever a member may
4719             have type parameters in GMCS.       
4720
4721         * decl.cs (MemberName): New public class.
4722         (MemberCore.MemberName): New public readonly field.
4723         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4724         (DeclSpace): Likewise.
4725
4726         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4727         * enum.cs (Enum.ctor): Likewise.
4728
4729         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4730         MemberName.     
4731         (AliasEntry.ctor): Take a MemberName, not an Expression.
4732         (AliasEntry.UsingAlias): Likewise.
4733
4734         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4735         (IMethodData.MemberName): Changed type from string to MemberName.
4736         (MemberBase.ExplicitInterfaceName): Likewise.
4737         (AbstractPropertyEventMethod.SetupName): Make this private.
4738         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4739         argument; compute the member name here.
4740         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4741         on the `member.MemberName' and the `prefix'.
4742
4743         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4744         not `type_name'.
4745         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4746         thus, we get a `MemberName' instead of a `string'.  These
4747         declarations may have type parameters in GMCS.
4748         (interface_method_declaration, delegate_declaration): Likewise.
4749         (class_declaration, interface_declaration): Likewise.
4750         (method_header): Use `namespace_or_type_name' instead of
4751         `member_name'.  We may be an explicit interface implementation.
4752         (property_declaration, event_declaration): Likewise.
4753         (member_name): This is now just an `IDENTIFIER', not a
4754         `namespace_or_type_name'.
4755         (type_name, interface_type): Removed.
4756         (namespace_or_type_name): Return a MemberName, not an Expression.
4757         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4758         call GetTypeExpression() on the MemberName to get an expression.
4759         (IndexerDeclaration.interface_type): Changed type from string to
4760         MemberName.
4761         (MakeName): Operate on MemberName's instead of string's.
4762
4763 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4764
4765         Fix bug #55770.
4766         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4767         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4768         lookup to avoid symbols introduced by 'using'.
4769         * rootcontext.cs (NamespaceLookup): Update.
4770
4771 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4772
4773         * class.cs (TypeContainer.DoDefineMembers): Do not call
4774         DefineDefaultConstructor for static classes.
4775
4776 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4777
4778         * attribute.cs (Attribute.Resolve): Add error 653 report.
4779
4780         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4781         report.
4782         (Method.ApplyAttributeBuilder): Add error 685 report.
4783         (Operator.Define): Add error 564 report.
4784
4785         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4786
4787         * expression.cs (Invocation.DoResolve): Add error
4788         245 and 250 report.
4789
4790         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4791         error 674 report.
4792
4793 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4794
4795         * class.cs (ConstructorInitializer.Resolve):
4796         Wrong error number (515->516).
4797
4798 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4799
4800         * class.cs (Indexer.Define): Add error 631 report.
4801
4802 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4803
4804         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4805
4806 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4807
4808         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4809
4810 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4811
4812         * cs-parser.jay: Added error CS0241 report.
4813
4814 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4815
4816         * cs-parser.jay (fixed_statement): Introduce a scope for the
4817         declaration in the 'fixed' statement.
4818
4819 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4820
4821         * cs-parser.jay: Added CS0230 error report.
4822
4823 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4824
4825         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4826
4827 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4828
4829         * expression.cs (Argument.Resolve): Added error CS0192 and
4830         CS0199 report.
4831
4832 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4833
4834         C# 2.0 #pragma warning feature
4835
4836         * cs-tokenizer.cs (PreProcessPragma): New method; 
4837         Handles #pragma directive.
4838
4839         * report.cs (WarningRegions): New class; Support
4840         class for #pragma warning directive. It tests whether
4841         warning is enabled for a given line.
4842
4843 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4844
4845         * const.cs: Add more descriptive error report, tahnks to
4846         Sebastien. 
4847
4848 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4849
4850         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4851
4852 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4853
4854         * expression.cs: Apply patch from Ben: Remove dead code from
4855         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4856         as that code just threw an exception anwyays.
4857
4858         * const.cs: Remove the call to the turnintoconstant, for details
4859         see bug: #63144
4860         
4861         * literal.cs: The type of the null-literal is the null type;  So
4862         we use a placeholder type (literal.cs:System.Null, defined here)
4863         for it.
4864
4865         * expression.cs (Conditional.DoResolve): Remove some old code that
4866         is no longer needed, conversions have been fixed.
4867
4868         (ArrayCreationExpression.DoResolve): Return false if we fail to
4869         resolve the inner expression.
4870
4871 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4872
4873         Fix test-290.cs.
4874         * cs-parser.jay (delegate_declaration): Record a delegate
4875         declaration as a type declaration.
4876         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4877
4878 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4879
4880         * parameter.cs: Do not crash if the type can not be resolved. 
4881
4882         * expression.cs: Report errors with unsafe pointers, fixes #64896
4883
4884 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4885
4886         * expression.cs: Pointer arith always needs to do a conv.i
4887         if the operand is a long. fix 65320
4888
4889 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4890
4891         Fixed cs0619-37.cs, cs0619-38.cs
4892
4893         * enum.cs (GetObsoleteAttribute): Removed.
4894
4895         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4896         on Enum member is double staged. The first is tested member
4897         and then enum.
4898
4899 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4900
4901         Fixed #56986, #63631, #65231
4902
4903         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4904         adds member to name container.
4905         (TypeContainer.AddToTypeContainer): New method, adds type to
4906         name container.
4907         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4908         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4909         AddOperator): Simplified by reusing AddToMemberContainer.
4910         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4911         instead of field.
4912         (Method.CheckForDuplications): Fixed implementation to test all
4913         possibilities.
4914         (MemberBase): Detection whether member is explicit interface
4915         implementation is now in constructor.
4916         (MemberBase.UpdateMemberName): Handles IndexerName.
4917         (Accessor): Changed to keep also location information.
4918         (AbstractPropertyEventMethod): Is derived from MemberCore.
4919         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4920         will be emited or not.
4921         (PropertyBase.AreAccessorsDuplicateImplementation):
4922         Tests whether accessors are not in collision with some method.
4923         (Operator): Is derived from MethodCore to simplify common
4924         operations.
4925
4926         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4927         must be performed.
4928         (DeclSpace.AddToContainer): Adds the member to defined_names
4929         table. It tests for duplications and enclosing name conflicts.
4930
4931         * enum.cs (EnumMember): Clean up to reuse the base structures
4932
4933 2004-09-03  Martin Baulig  <martin@ximian.com>
4934
4935         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4936         into TypeContainer, to make partial classes work again.
4937
4938 2004-09-03  Martin Baulig  <martin@ximian.com>
4939
4940         * rootcontext.cs (RootContext.V2): Removed.
4941
4942 2004-03-23  Martin Baulig  <martin@ximian.com>
4943
4944         * expression.cs (Invocation.OverloadResolve): Added `bool
4945         may_fail' argument and use it instead of the Location.IsNull() hack.
4946
4947 2004-09-03  Martin Baulig  <martin@ximian.com>
4948
4949         Merged latest changes into gmcs.  Please keep this comment in
4950         here, it makes it easier for me to see what changed in MCS since
4951         the last time I merged.
4952
4953 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4954
4955         Fix #61128.
4956         * expression.cs (BetterConversion): Don't allow either conversion 
4957         to be null.  Remove redundant implicit conversion test when 'q ==
4958         null' -- when this function is invoked, we already know that the
4959         implicit conversion exists.
4960         (BetterFunction): Assume that 'best' is non-null.  Remove
4961         redundant reimplementation of IsApplicable when 'best' is null.
4962         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4963         number of arguments.
4964         (IsAncestralType): Extract from OverloadResolve.
4965         (OverloadResolve): Make robust to the MethodGroupExpr being
4966         unsorted.  Implement all the logic of Section 14.5.5.1, and
4967         support overloading of methods from multiple applicable types.
4968         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4969
4970         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4971         (RealError, Warning): Append type of report to related symbol.
4972
4973 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4974
4975         * enum.cs: Fixed CLS-Compliance checks for enum members.
4976         Error tests cs3008-8.cs, cs3014-8.cs
4977
4978 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4979
4980         Fixed bug #62342, #63102
4981         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4982         like ImplementMethod.
4983
4984 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4985
4986         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4987         Fixed bug #65170.
4988
4989 2004-09-02  Martin Baulig  <martin@ximian.com>
4990
4991         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4992         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4993         on the MethodBase.
4994
4995 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4996
4997         C# 2.0 Static classes implemented
4998
4999         * class.cs (TypeContainer): instance_constructors,
5000         initialized_fields, initialized_static_fields,
5001         default_constructor, base_inteface_types are protected to be
5002         accessible from StaticClass.
5003         (TypeContainer.DefineDefaultConstructor): New virtual method
5004         for custom default constructor generating
5005         (StaticClass): New class to handle "Static classes" feature.
5006
5007         * cs-parser.jay: Handle static keyword on class like instance
5008         of StaticClass.
5009
5010         * driver.cs: Added "/langversion" command line switch with two
5011         options (iso-1, default).
5012
5013 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5014
5015         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5016
5017 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5018
5019         * delegate.cs: Style.
5020
5021 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5022
5023         * delegate.cs: Add seperate instance expr field for miguel.
5024
5025 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5026
5027         * PointerArithmetic (Resolve): make sure we are not doing
5028         pointer arith on void*. Also, make sure we are resolved
5029         by not setting eclass until resolve.
5030
5031         All callers: Make sure that PointerArithmetic gets resolved.
5032
5033 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5034
5035         * ArrayCreation (LookupType): If the type does not resolve 
5036         to an array, give an error.
5037
5038 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5039
5040         * statement.cs (Try.Resolve): Fixed bug #64222
5041
5042 2004-08-27  Martin Baulig  <martin@ximian.com>
5043
5044         * class.cs
5045         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5046         crash here.     
5047
5048 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5049
5050         * ecore.cs (Constantify): Get underlying type via
5051         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5052         Windows in special cases.
5053
5054 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5057         for obtaining also private methods.
5058         (GetRemoveMethod): Used GetRemoveMethod (true)
5059         for obtaining also private methods.
5060
5061 2004-08-24  Martin Baulig  <martin@ximian.com>
5062
5063         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5064         MethodAttributes.HideBySig for operators.
5065
5066 2004-08-23  Martin Baulig  <martin@ximian.com>
5067
5068         Back to the old error reporting system :-)
5069
5070         * report.cs (Message): Removed.
5071         (Report.MessageData, ErrorData, WarningData): Removed.
5072         (Report.Error, Warning): Back to the old system.
5073
5074 2004-08-23  Martin Baulig  <martin@ximian.com>
5075
5076         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5077
5078         * class.cs (TypeContainer.ParentContainer): New public virtual
5079         method; replaces the explicit interface implementation.
5080         (ClassPart.ParentContainer): Override.
5081
5082 2004-08-23  Martin Baulig  <martin@ximian.com>
5083
5084         * statement.cs (Switch): Added support for constant switches; see
5085         #59428 or test-285.cs.
5086
5087 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5088
5089         Fixed bug #62740.
5090         * statement.cs (GetEnumeratorFilter): Removed useless
5091         logic because C# specs is strict. GetEnumerator must be
5092         public.
5093
5094 2004-08-22  Martin Baulig  <martin@ximian.com>
5095
5096         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5097         a switch and may break, reset the barrier.  Fixes #59867.
5098
5099 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5100
5101         CLS-Compliance speed up (~5% for corlib)
5102
5103         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5104         New method. Tests container for CLS-Compliant names
5105
5106         * class.cs (TypeContainer.VerifyClsName): New method.
5107         Checks whether container name is CLS Compliant.
5108         (Constructor): Implements IMethodData.
5109
5110         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5111         low-case table for CLS Compliance test.
5112         (MemberCache.VerifyClsParameterConflict): New method.
5113         Checks method parameters for CS3006 error.
5114
5115         * enum.cs (EnumMember): Is derived from MemberCore.
5116         (Enum.VerifyClsName): Optimized for better performance.
5117
5118 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5119
5120         * report.cs: Renamed Error_T to Error and changed all
5121         references.
5122
5123 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5124
5125         * class.cs (TypeContainer.IndexerArrayList): New inner class
5126         container for indexers.
5127         (TypeContainer.DefaultIndexerName): New constant for default
5128         indexer name. Replaced all "Item" with this constant.
5129         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5130
5131         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5132         DefaultMemberAttribute constructor.
5133
5134 2004-08-05  Martin Baulig  <martin@ximian.com>
5135
5136         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5137         Fix bug #59429.
5138
5139 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5140
5141         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5142         multi platforms problem.
5143
5144         * compiler.csproj: Included shared files.
5145
5146 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5147
5148         Fix bug 60333, 55971 in the more general way
5149         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5150         Added arg_type argument for constant conversion.
5151         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5152
5153 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5154
5155         Fix bug #59760
5156         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5157         OperatorArrayList, MethodCoreArrayList for typecontainer
5158         containers. Changed class member types to these new types.
5159         (MethodArrayList.DefineMembers): Added test for CS0659.
5160
5161 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5162
5163         * cfold.cs: Synchronize the folding with the code in expression.cs
5164         Binary.DoNumericPromotions for uint operands.
5165
5166         * attribute.cs: Revert patch from Raja, it introduced a regression
5167         while building Blam-1.2.1 (hard to isolate a test case).
5168
5169 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5170
5171         Fix for #55382
5172         * class.cs:
5173         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5174         name collision.
5175         (MethodCore.parent_method): New member. The method we're overriding
5176         if this is an override method.
5177         (MethodCore.CheckBase): Moved from Method class and made common.
5178         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5179         private.
5180         (MethodCore.CheckForDuplications): New abstract method. For custom
5181         member duplication search in a container
5182         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5183         method and its return type.
5184         (Event.conflict_symbol): New member. Symbol with same name in the
5185         parent class.
5186
5187         * decl.cs:
5188         (MemberCache.FindMemberWithSameName): New method. The method
5189         is looking for conflict with inherited symbols.
5190
5191 2004-08-04  Martin Baulig  <martin@ximian.com>
5192
5193         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5194
5195         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5196
5197 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5198
5199         * report.cs (Message): New enum for better error, warning reference in
5200         the code.
5201         (MessageData): New inner abstract class. It generally handles printing of
5202         error and warning messages.
5203         Removed unused Error, Warning, Message methods.
5204
5205 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5206
5207         Fix for cs0592-8.cs test
5208         * attribute.cs
5209         (Attributable.ValidAttributeTargets): Made public.
5210         (Attribute.ExplicitTarget): New member for explicit target value.
5211         (Attribute.CheckTargets): Now we translate explicit attribute
5212         target to Target here.
5213
5214 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5215
5216         * ecore.cs (MethodGroupExpr): new IsBase property.
5217
5218         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5219
5220         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5221         rather than an instance expr.
5222
5223         (DelegateCreation.Emit): Use the method group rather than
5224         the instance expression. Also, if you have base.Foo as the
5225         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5226
5227         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5228
5229         (NewDelegate.DoResolve): Only check for the existance of Invoke
5230         if the method is going to be needed. Use MethodGroupExpr.
5231
5232         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5233
5234         * expression.cs: For pointer arith., make sure to use
5235         the size of the type, not the size of the pointer to
5236         the type.
5237
5238 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5239
5240         Fix for #60722
5241         * class.cs (Class): Added error CS0502 test.
5242
5243 2004-08-03  John Luke  <jluke@cfl.rr.com>
5244             Raja R Harinath  <rharinath@novell.com>
5245
5246         Fix for #60997.
5247         * attribute.cs (Attribute.complained_before): New flag.
5248         (Attribute.ResolveType, Attribute.Resolve),
5249         (Attribute.DefinePInvokeMethod): Set it.
5250         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5251         
5252 2004-08-03  Martin Baulig  <martin@ximian.com>
5253
5254         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5255         use a user-defined operator; we still need to do numeric
5256         promotions in case one argument is a builtin type and the other
5257         one has an implicit conversion to that type.  Fixes #62322.
5258
5259 2004-08-02  Martin Baulig  <martin@ximian.com>
5260
5261         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5262         (LocalInfo.IsThis): New public property.
5263         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5264
5265 2004-08-01  Martin Baulig  <martin@ximian.com>
5266
5267         * class.cs (TypeContainer.GetClassBases): Don't set the default
5268         here since we may get called from GetPartialBases().
5269         (TypeContainer.DefineType): If GetClassBases() didn't return a
5270         parent, use the default one.
5271
5272 2004-07-30  Duncan Mak  <duncan@ximian.com>
5273
5274         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5275
5276 2004-07-30  Martin Baulig  <martin@ximian.com>
5277
5278         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5279
5280         * class.cs (SourceMethod): New public class, derive from the
5281         symbol writer's ISourceMethod.
5282         (Method): Use the new symbol writer API.
5283
5284         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5285         as argument and use the new symbol writer.
5286
5287         * location.cs
5288         (SourceFile): Implement the symbol writer's ISourceFile.
5289         (Location.SymbolDocument): Removed.
5290         (Location.SourceFile): New public property.
5291
5292         * symbolwriter.cs: Use the new symbol writer API.
5293
5294 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5295
5296         * Makefile (install-local): Remove.  Functionality moved to
5297         executable.make.
5298
5299 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5300
5301         * Makefile: Install mcs.exe.config file together with mcs.exe.
5302         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5303         correct runtime version.
5304         
5305 2004-07-25  Martin Baulig  <martin@ximian.com>
5306
5307         * class.cs
5308         (TypeContainer.RegisterOrder): Removed, this was unused.
5309         (TypeContainer, interface_order): Removed.
5310         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5311         TypeContainer as argument since we can also be called with a
5312         `PartialContainer' for a partial class/struct/interface.
5313         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5314         of checking whether we're an `Interface' - we could be a
5315         `PartialContainer'.
5316         (PartialContainer.Register): Override; call
5317         AddClass()/AddStruct()/AddInterface() on our parent.
5318
5319         * cs-parser.jay (interface_member_declaration): Add things to the
5320         `current_container', not the `current_class'.
5321
5322         * rootcontext.cs (RegisterOrder): The overloaded version which
5323         takes an `Interface' was unused, removed.
5324
5325         * typemanager.cs (TypeManager.LookupInterface): Return a
5326         `TypeContainer', not an `Interface'.
5327         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5328         contain a `PartialContainer' for an interface, so check it's
5329         `Kind' to figure out what it is.
5330
5331 2004-07-25  Martin Baulig  <martin@ximian.com>
5332
5333         * class.cs (Class.DefaultTypeAttributes): New public constant.
5334         (Struct.DefaultTypeAttributes): Likewise.
5335         (Interface.DefaultTypeAttributes): Likewise.
5336         (PartialContainer.TypeAttr): Override this and add the
5337         DefaultTypeAttributes.
5338
5339 2004-07-25  Martin Baulig  <martin@ximian.com>
5340
5341         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5342         we can just use the `Parent' field instead.
5343
5344 2004-07-25  Martin Baulig  <martin@ximian.com>
5345
5346         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5347
5348 2004-07-25  Martin Baulig  <martin@ximian.com>
5349
5350         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5351         our parts before defining any methods.
5352         (TypeContainer.VerifyImplements): Make this virtual.
5353         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5354         on our PartialContainer.
5355
5356 2004-07-25  Martin Baulig  <martin@ximian.com>
5357
5358         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5359
5360         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5361         argument, we can just use the `Parent' field instead.
5362
5363         * class.cs
5364         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5365         (MemberBase.DoDefine): Likewise.
5366
5367 2004-07-24  Martin Baulig  <martin@ximian.com>
5368
5369         * decl.cs (MemberCore.Parent): New public field.
5370         (DeclSpace.Parent): Moved to MemberCore.
5371
5372         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5373         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5374         parent's .ctor.
5375         (FieldBase, Field, Operator): Likewise.
5376         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5377         (EventField, Event): Likewise.
5378
5379 2004-07-23  Martin Baulig  <martin@ximian.com>
5380
5381         * class.cs (PartialContainer): New public class.
5382         (ClassPart): New public class.
5383         (TypeContainer): Added support for partial classes.
5384         (TypeContainer.GetClassBases): Splitted some of the functionality
5385         out into GetNormalBases() and GetPartialBases().
5386
5387         * cs-tokenizer.cs (Token.PARTIAL): New token.
5388         (Tokenizer.consume_identifier): Added some hacks to recognize
5389         `partial', but only if it's immediately followed by `class',
5390         `struct' or `interface'.
5391
5392         * cs-parser.jay: Added support for partial clases.
5393
5394 2004-07-23  Martin Baulig  <martin@ximian.com>
5395
5396         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5397         a `DeclSpace' and also made it readonly.
5398         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5399         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5400         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5401
5402         * cs-parser.jay: Pass the `current_class', not the
5403         `current_container' (at the moment, this is still the same thing)
5404         to a new Method, Property, Event, Indexer or Constructor.
5405
5406 2004-07-23  Martin Baulig  <martin@ximian.com>
5407
5408         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5409         and removed the `current_interface' one.
5410         (struct_declaration, class_declaration, interface_declaration):
5411         Set `current_class' to the newly created class/struct/interface;
5412         set their `Bases' and call Register() before parsing their body.
5413
5414 2004-07-23  Martin Baulig  <martin@ximian.com>
5415
5416         * class.cs (Kind): New public enum.
5417         (TypeContainer): Made this class abstract.
5418         (TypeContainer.Kind): New public readonly field.
5419         (TypeContainer.CheckDef): New public method; moved here from
5420         cs-parser.jay.
5421         (TypeContainer.Register): New public abstract method.
5422         (TypeContainer.GetPendingImplementations): New public abstract
5423         method.
5424         (TypeContainer.GetClassBases): Removed the `is_class' and
5425         `is_iface' parameters.
5426         (TypeContainer.DefineNestedTypes): Formerly known as
5427         DoDefineType().
5428         (ClassOrStruct): Made this class abstract.
5429
5430         * tree.cs (RootTypes): New public type. 
5431
5432 2004-07-20  Martin Baulig  <martin@ximian.com>
5433
5434         * tree.cs (Tree.RecordNamespace): Removed.
5435         (Tree.Namespaces): Removed.
5436
5437         * rootcontext.cs (RootContext.IsNamespace): Removed.
5438
5439         * cs-parser.jay (namespace_declaration): Just create a new
5440         NamespaceEntry here.
5441
5442 2004-07-20  Martin Baulig  <martin@ximian.com>
5443
5444         * statement.cs (ExceptionStatement): New abstract class.  This is
5445         now used as a base class for everyone who's using `finally'.
5446         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5447         our local variables before using them.
5448
5449         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5450         virtual method.  This is used by Yield.Resolve() to "steal" an
5451         outer block's `finally' clauses.
5452         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5453         argument.
5454
5455         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5456         version which takes an ExceptionStatement.  This version must be
5457         used to create exception branchings.
5458
5459         * iterator.cs
5460         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5461         (Iterator.EmitMoveNext): Added exception support; protect the
5462         block with a `fault' clause, properly handle 'finally' clauses.
5463         (Iterator.EmitDispose): Run all the `finally' clauses here.
5464
5465 2004-07-20  Martin Baulig  <martin@ximian.com>
5466
5467         * iterator.cs: This is the first of a set of changes in the
5468         iterator code.  Match the spec more closely: if we're an
5469         IEnumerable, then GetEnumerator() must be called.  The first time
5470         GetEnumerator() is called, it returns the current instance; all
5471         subsequent invocations (if any) must create a copy.
5472
5473 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5474
5475         * expression.cs: Resolve the constant expression before returning
5476         it. 
5477
5478 2004-07-19  Martin Baulig  <martin@ximian.com>
5479
5480         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5481         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5482         the return type of the new EmitContext.
5483
5484 2004-07-18  Martin Baulig  <martin@ximian.com>
5485
5486         * class.cs (Property.Define): Fix iterators.
5487
5488         * iterators.cs (Iterator.Define): Moved the
5489         `container.AddInterator (this)' call here from the .ctor; only do
5490         it if we resolved successfully.
5491
5492 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5493
5494         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5495         `true' for preprocessing directives that we parse.  The return
5496         value indicates whether we should return to regular tokenizing or
5497         not, not whether it was parsed successfully.
5498
5499         In the past if we were in: #if false ... #line #endif, we would
5500         resume parsing after `#line'.  See bug 61604.
5501
5502         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5503         building: IsEnumType should return true only for enums, not for
5504         enums or System.Enum itself.  This fixes #61593.
5505
5506         Likely what happened is that corlib was wrong: mcs depended on
5507         this bug in some places.  The bug got fixed, we had to add the
5508         hack, which caused bug 61593.
5509
5510         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5511         that was a workaround for the older conditions.
5512
5513 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5514
5515         * assign.cs: IAssignMethod has a new interface, as documented
5516         inline. All assignment code now uses this new api.
5517
5518         * ecore.cs, expression.cs: All classes which implement
5519         IAssignMethod now use the new interface.
5520
5521         * expression.cs (Invocation): add a hack to EmitCall so that
5522         IndexerAccess can be the target of a compound assignment without
5523         evaluating its arguments twice.
5524
5525         * statement.cs: Handle changes in Invocation api.
5526
5527 2004-07-16  Martin Baulig  <martin@ximian.com>
5528
5529         * iterators.cs: Rewrote this.  We're now using one single Proxy
5530         class for both the IEnumerable and the IEnumerator interface and
5531         `Iterator' derives from Class so we can use the high-level API.
5532
5533         * class.cs (TypeContainer.AddIterator): New method.
5534         (TypeContainer.DoDefineType): New protected virtual method, which
5535         is called from DefineType().
5536         (TypeContainer.DoDefineMembers): Call DefineType() and
5537         DefineMembers() on all our iterators.
5538         (TypeContainer.Emit): Call Emit() on all our iterators.
5539         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5540
5541         * codegen.cs (EmitContext.CurrentIterator): New public field.
5542
5543 2004-07-15  Martin Baulig  <martin@ximian.com>
5544
5545         * typemanager.cs
5546         (TypeManager.not_supported_exception_type): New type.   
5547
5548 2004-07-14  Martin Baulig  <martin@ximian.com>
5549
5550         * iterators.cs: Use real error numbers.
5551
5552 2004-07-14  Martin Baulig  <martin@ximian.com>
5553
5554         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5555         requires this to be a System.Collection.IEnumerable and not a
5556         class implementing that interface.
5557         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5558
5559 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5560
5561         * class.cs: Fixed previous fix, it broke some error tests.
5562
5563 2004-07-12  Martin Baulig  <martin@ximian.com>
5564
5565         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5566         Fixes #61293.
5567
5568 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5569
5570         * assign.cs (LocalTemporary): Add new argument: is_address,If
5571         `is_address' is true, then the value that we store is the address
5572         to the real value, and not the value itself.
5573         
5574         * ecore.cs (PropertyExpr): use the new local temporary
5575         stuff to allow us to handle X.Y += z (where X is a struct)
5576
5577 2004-07-08  Martin Baulig  <martin@ximian.com>
5578
5579         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5580         not always return, just like we're doing in Using.Resolve().
5581
5582 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5583
5584         * cs-parser.jay (fixed_statement): flag this as Pinned.
5585
5586 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5587
5588         * typemanager.cs (TypeManager): Removed MakePinned method, this
5589         mechanism is replaced with the .NET 2.x compatible mechanism of
5590         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5591
5592         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5593         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5594         `IsFixed' property which has a different meaning.
5595
5596 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5597
5598         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5599         visible from inside a nested class, not just the names of the
5600         immediately enclosing class.
5601         Fix for bug #60730.
5602
5603 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5604
5605         * expression.cs (BetterConversion): Remove buggy special-case
5606         handling of "implicit constant expression conversions".  At this
5607         point, we already know that the conversion is possible -- we're
5608         only checking to see which is better.
5609
5610 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5611
5612         * cs-parser.jay: Added error CS0210 test.
5613
5614 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5615
5616         * cs-parser.jay: Added error CS0134 test.
5617
5618 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5619
5620         Fix bug #52507
5621         * cs-parser.jay: Added error CS0145 test.
5622
5623 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5624
5625         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5626
5627 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5628         
5629         * expression.cs (StackAlloc.Resolve): The argument may not
5630         be a constant; deal with this case.
5631         
5632 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5633
5634         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5635         GetIndexerAttributeValue.
5636         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5637
5638         * class.cs (Indexer.Define): Added error tests for CS0415,
5639         CS0609.
5640
5641 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5642
5643         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5644         property code.
5645
5646 2004-06-23  Martin Baulig  <martin@ximian.com>
5647
5648         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5649         neither return nor throw, reset the barrier as well.  Fixes #60457.
5650
5651 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5652
5653         * class.cs : EventAttributes is now set to None by default.
5654           This fixes bug #60459.
5655
5656 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5657
5658         Fix bug #60219
5659         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5660         Don't throw exception but return null (it's sufficient now).
5661
5662 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * typemanager.cs (GetArgumentTypes): Faster implementation.
5665
5666 2004-06-18  Martin Baulig  <martin@ximian.com>
5667
5668         * attribute.cs (Attribute.Resolve): Check whether we're an
5669         EmptyCast which a Constant child.  Fixes #60333.
5670
5671 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5672
5673         * statement.cs (EmitCollectionForeach): Account for the fact that
5674         not all valuetypes are in areas which we can take the address of.
5675         For these variables, we store to a temporary variable. Also, make
5676         sure that we dont emit a `callvirt' on a valuetype method.
5677
5678 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5679
5680         * expression.cs (StackAlloc.DoReSolve): Added test for
5681         negative parameter (CS0247).
5682
5683 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5684
5685         Fix bug #59792
5686         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5687
5688 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5689
5690         Fix bug #59781
5691         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5692         ulong.
5693
5694 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5695
5696         Fix bug #58254 & cs1555.cs, cs1556.cs
5697         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5698
5699 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5700
5701         * cs-parser.jay: Added error CS1669 test for indexers.
5702
5703 2004-06-11  Martin Baulig  <martin@ximian.com>
5704
5705         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5706         call this twice: for params and varargs methods.
5707
5708 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5709
5710         * class.cs:
5711         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5712
5713 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5714
5715         * attribute.cs (Attribute.GetValidTargets): Made public.
5716
5717         * class.cs: 
5718         (AbstractPropertyEventMethod): New class for better code sharing.
5719         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5720         CS1667 report.
5721         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5722
5723 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5724
5725         Fix bug #59477.
5726         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5727         that the call to Resolve is part of a MemberAccess.
5728         (Expression.Resolve): Use it for SimpleName resolution.
5729         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5730         Add 'intermediate' boolean argument.
5731         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5732         error message when the SimpleName can be resolved ambiguously
5733         between an expression and a type.
5734         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5735         public.
5736         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5737         call on the left-side.
5738
5739 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5740
5741         * class.cs:
5742         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5743
5744 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5745
5746         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5747
5748 2004-06-11  Martin Baulig  <martin@ximian.com>
5749
5750         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5751         varargs methods if applicable.
5752
5753 2004-06-11  Martin Baulig  <martin@ximian.com>
5754
5755         * expression.cs (Invocation.EmitCall): Don't use
5756         `method.CallingConvention == CallingConventions.VarArgs' since the
5757         method could also have `CallingConventions.HasThis'.
5758
5759 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5760
5761         * class.cs (Event.GetSignatureForError): Implemented.
5762         Fixed crash in error test cs3010.cs
5763
5764 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5765
5766         * cs-tokenizer.cs: Change the way we track __arglist to be
5767         consistent with the other keywords.
5768
5769 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5770
5771         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5772         tomorrow.
5773
5774 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5775
5776         * codegen.cs: Check that all referenced assemblies have a strongname
5777         before strongnaming the compiled assembly. If not report error CS1577.
5778         Fix bug #56563. Patch by Jackson Harper.
5779         * typemanager.cs: Added a method to return all referenced assemblies.
5780         Fix bug #56563. Patch by Jackson Harper.
5781
5782 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5783
5784         * class.cs:
5785         (Method.ApplyAttributeBuilder): Moved and added conditional
5786         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5787
5788         * delegate.cs:
5789         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5790
5791 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5792
5793         Fixed #59640
5794         * class.cs: (EventField.attribute_targets): Changed default target.
5795
5796 2004-06-08  Martin Baulig  <martin@ximian.com>
5797
5798         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5799
5800 2004-06-08  Martin Baulig  <martin@ximian.com>
5801
5802         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5803
5804 2004-06-07  Martin Baulig  <martin@ximian.com>
5805
5806         Added support for varargs methods.
5807
5808         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5809         keyword.
5810
5811         * cs-parser.jay: Added support for `__arglist'.
5812
5813         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5814
5815         * expression.cs (Argument.AType): Added `ArgList'.
5816         (Invocation): Added support for varargs methods.
5817         (ArglistAccess): New public class.
5818         (Arglist): New public class.
5819
5820         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5821
5822         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5823         a method's top-level block if the method has varargs.
5824
5825         * support.cs (ReflectionParameters, InternalParameters): Added
5826         support for varargs methods.    
5827
5828 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5829
5830         * class.cs: Provide location in indexer error report.
5831
5832         * driver.cs: Use standard names.
5833
5834         * namespace.cs: Catch the use of using after a namespace has been
5835         declared also on using aliases.
5836
5837 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5838
5839         Bug #50820.
5840         * typemanager.cs (closure_private_ok, closure_invocation_type)
5841         (closure_qualifier_type, closure_invocation_assembly)
5842         (FilterWithClosure): Move to ...
5843         (Closure): New internal nested class.
5844         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5845         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5846         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5847         (MemberLookup, MemberLookupFailed): Use it.
5848         * expression.cs (New.DoResolve): Treat the lookup for the
5849         constructor as being qualified by the 'new'ed type.
5850         (Indexers.GetIndexersForTypeOrInterface): Update.
5851
5852 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5853
5854         * attribute.cs
5855         (GetConditionalAttributeValue): New method. Returns
5856         condition of ConditionalAttribute.
5857         (SearchMulti): New method.  Returns all attributes of type 't'.
5858         Use it when attribute is AllowMultiple = true.
5859         (IsConditionalMethodExcluded): New method.
5860
5861         * class.cs
5862         (Method.IsExcluded): Implemented. Returns true if method has conditional
5863         attribute and the conditions is not defined (method is excluded).
5864         (IMethodData): Extended interface for ConditionalAttribute support.
5865         (PropertyMethod.IsExcluded): Implemented.
5866
5867         * decl.cs
5868         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5869
5870         * expression.cs
5871         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5872         on the method.
5873
5874 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5875
5876         * expression.cs (ArrayCreationExpression): Make this just an
5877         `expression'. It can't be a statement, so the code here was
5878         dead.
5879
5880 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5881
5882         Fixed #59072
5883         * typemanager.cs (GetFullNameSignature): New method for
5884         MethodBase types.
5885
5886 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5887
5888         Fixed #56452
5889         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5890         Use this method when MethodBuilder is null.
5891         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5892         Added test for error CS0626 (MONO reports error for this situation).
5893         (IMethodData.GetSignatureForError): Extended interface.
5894
5895 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5896
5897         * attribute.cs
5898         (AttributeTester.GetObsoleteAttribute): Returns instance of
5899         ObsoleteAttribute when type is obsolete.
5900
5901         * class.cs
5902         (TypeContainer.VerifyObsoleteAttribute): Override.
5903         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5904         (MethodCode.VerifyObsoleteAttribute): Override.
5905         (MemberBase.VerifyObsoleteAttribute): Override.
5906
5907         * decl.cs
5908         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5909         and report proper error.
5910
5911         *delegate.cs
5912         Delegate.VerifyObsoleteAttribute): Override.
5913
5914         * ecore.cs
5915         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5916         and report proper error.
5917         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5918
5919         * enum.cs
5920         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5921         and enum member.
5922
5923         * expression.cs
5924         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5925         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5926         Added test for ObsoleteAttribute.
5927
5928         * statement.cs
5929         (Catch): Derived from Statement.
5930
5931 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5932  
5933         Fixed bug #59071 & cs0160.cs
5934  
5935         * statement.cs (Try.Resolve): Check here whether order of catch
5936         clauses matches their dependencies.
5937
5938 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
5939
5940         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
5941         caused a regression: #59343.  Referencing nested classes from an
5942         assembly stopped working.
5943
5944 2004-05-31  Martin Baulig  <martin@ximian.com>
5945
5946         MCS is now frozen for beta 2.
5947
5948 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5949
5950         * convert.cs: add a trivial cache for overload operator resolution.
5951
5952 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5953
5954         * decl.cs: If possible, use lookuptypedirect here. We can only do
5955         this if there is no `.' after the namespace. Avoids using
5956         LookupType, which does lots of slow processing.
5957         (FindNestedType) New method, does what it says :-).
5958         * namespace.cs: use LookupTypeDirect.
5959         * rootcontext.cs: use membercache, if possible.
5960         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5961
5962 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5963
5964         * expression.cs:
5965         According to the spec, 
5966
5967         In a member access of the form E.I, if E is a single identifier,
5968         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5969         field, property, localvariable, or parameter with the same type as
5970         the meaning of E as a type-name (§3.8), then both possible
5971         meanings of E are permitted.
5972
5973         We did not check that E as a simple-name had the same type as E as
5974         a type name.
5975
5976         This trivial check gives us 5-7% on bootstrap time.
5977
5978 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5979
5980         * expression.cs (Invocation.OverloadResolve): Avoid the
5981         use of hashtables and boxing here by allocating on demand.
5982
5983 2004-05-30  Martin Baulig  <martin@ximian.com>
5984
5985         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5986         we're doing a silent lookup.  Don't try to lookup nested types in
5987         TypeManager.object_type (thanks to Ben Maurer).
5988
5989 2004-05-30  Martin Baulig  <martin@ximian.com>
5990
5991         Committing a patch from Ben Maurer.
5992
5993         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5994
5995 2004-05-29  Martin Baulig  <martin@ximian.com>
5996
5997         * class.cs (IMethodData.ShouldIgnore): New method.
5998
5999         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6000         `Location' argument, we don't need it anywhere.  Use
6001         `IMethodData.ShouldIgnore ()' instead of
6002         `MethodData.GetMethodFlags ()'.
6003         (TypeManager.AddMethod): Removed.
6004         (TypeManager.AddMethod2): Renamed to AddMethod.
6005
6006 2004-05-29  Martin Baulig  <martin@ximian.com>
6007
6008         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6009
6010         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6011         converting from a class type S to an interface type and we already
6012         have an object on the stack, don't box it again.  Fixes #52578.
6013
6014 2004-05-29  Martin Baulig  <martin@ximian.com>
6015
6016         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6017         Added support for `params' parameters.  Fixes #59267.
6018
6019 2004-05-29  Martin Baulig  <martin@ximian.com>
6020
6021         * literal.cs (NullPointer): Provide a private .ctor which sets
6022         `type' to TypeManager.object_type.  Fixes #59048.
6023
6024 2004-05-29  Martin Baulig  <martin@ximian.com>
6025
6026         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6027         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6028
6029         * ecore.cs (EventExpr.instance_expr): Make the field private.
6030
6031 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6032
6033         Fixed bug #50080 & cs0214-2.cs
6034         * expression.cs (Cast.DoResolve): Check unsafe context here.
6035         
6036         * statement.cs (Resolve.DoResolve): Likewise.
6037
6038 2004-05-26  Martin Baulig  <martin@ximian.com>
6039
6040         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6041
6042         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6043         (RootContext.LookupType): Pass down the `silent' flag.
6044
6045 2004-05-25  Martin Baulig  <martin@ximian.com>
6046
6047         * expression.cs
6048         (MethodGroupExpr.IdenticalTypeName): New public property.
6049         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6050         expression actually refers to a type.
6051
6052 2004-05-25  Martin Baulig  <martin@ximian.com>
6053
6054         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6055         for #56176 and made it actually work.
6056
6057 2004-05-25  Martin Baulig  <martin@ximian.com>
6058
6059         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6060         (FieldExpr, PropertyExpr): Override and implement
6061         CacheTemporaries.  Fixes #52279.
6062
6063 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6064
6065         * location.cs: In the new compiler listing a file twice is a
6066         warning, not an error.
6067
6068 2004-05-24  Martin Baulig  <martin@ximian.com>
6069
6070         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6071         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6072
6073 2004-05-24  Martin Baulig  <martin@ximian.com>
6074
6075         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6076         walking the `using' list.  Fixes #53921.
6077
6078 2004-05-24  Martin Baulig  <martin@ximian.com>
6079
6080         * const.cs (Const.LookupConstantValue): Added support for
6081         EmptyCast's; fixes #55251.
6082
6083 2004-05-24  Martin Baulig  <martin@ximian.com>
6084
6085         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6086         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6087         which does the CS0135 check.  The reason is that we first need to
6088         check whether the variable actually exists.
6089
6090 2004-05-24  Martin Baulig  <martin@ximian.com>
6091
6092         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6093         than RootContext.LookupType() to find the explicit interface
6094         type.  Fixes #58584.
6095
6096 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6097
6098         * Makefile: Simplify.  Use executable.make.
6099         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6100
6101 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6102
6103         * decl.cs:
6104         * enum.cs:
6105         Use the invariant culture when doing String.Compare for CLS case
6106         sensitivity.
6107         
6108 2004-05-23  Martin Baulig  <martin@ximian.com>
6109
6110         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6111         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6112
6113         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6114         
6115 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6116
6117         * class.cs (MemberBase.Define): Reuse MemberType member for 
6118         resolved type. Other methods can use it too.
6119
6120 2004-05-23  Martin Baulig  <martin@ximian.com>
6121
6122         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6123         the variable also exists in the current block (otherwise, we need
6124         to report a CS0103).  Fixes #58670.
6125
6126 2004-05-23  Martin Baulig  <martin@ximian.com>
6127
6128         * flowanalysis.cs (Reachability.Reachable): Compute this
6129         on-the-fly rather than storing it as a field.
6130
6131 2004-05-23  Martin Baulig  <martin@ximian.com>
6132
6133         * flowanalysis.cs (Reachability.And): Manually compute the
6134         resulting `barrier' from the reachability.      
6135        
6136 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6137
6138         Fix bug #57835
6139         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6140         instance of ObsoleteAttribute when symbol is obsolete.
6141
6142         * class.cs
6143         (IMethodData): Extended interface for ObsoleteAttribute support.
6144
6145 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6146
6147         * attribute.cs: Fix bug #55970
6148
6149 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6150
6151         Fix bug #52705
6152         * attribute.cs
6153         (GetObsoleteAttribute): New method. Creates the instance of
6154         ObsoleteAttribute.
6155         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6156         ObsoleteAttribute when member is obsolete.
6157         (AttributeTester.Report_ObsoleteMessage): Common method for
6158         Obsolete error/warning reporting.
6159
6160         * class.cs
6161         (TypeContainer.base_classs_type): New member for storing parent type.
6162
6163         * decl.cs
6164         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6165         for this MemberCore.
6166
6167 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6168
6169         * attribute.cs, const.cs: Fix bug #58590
6170
6171 2004-05-21  Martin Baulig  <martin@ximian.com>
6172
6173         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6174         out parameters if the end of the method is unreachable.  Fixes
6175         #58098. 
6176
6177 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6178
6179         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6180         Hari was right, why extra method.
6181
6182 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6183
6184         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6185
6186 2004-05-20  Martin Baulig  <martin@ximian.com>
6187
6188         Merged this back from gmcs to keep the differences to a minumum.
6189
6190         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6191         instead of a Declspace.
6192         (Attribute.ResolveType): Likewise.
6193         (Attributes.Search): Likewise.
6194         (Attributes.Contains): Likewise.
6195         (Attributes.GetClsCompliantAttribute): Likewise.
6196
6197         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6198         argument.
6199         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6200         DeclSpace.
6201
6202 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6203
6204         Fix bug #58688 (MCS does not report error when the same attribute
6205         is assigned twice)
6206
6207         * attribute.cs (Attribute.Emit): Distinction between null and default.
6208
6209 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6210
6211         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6212         of a top-level attribute without an attribute target.
6213         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6214         Make non-static.
6215         (Attribute.Conditional_GetConditionName), 
6216         (Attribute.Obsolete_GetObsoleteMessage): Update.
6217         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6218         part of ScanForIndexerName.
6219         (Attribute.CanIgnoreInvalidAttribute): New function.
6220         (Attribute.ScanForIndexerName): Move to ...
6221         (Attributes.ScanForIndexerName): ... here.
6222         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6223         (Attributes.Search): New internal variant that can choose not to
6224         complain if types aren't resolved.  The original signature now
6225         complains.
6226         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6227         complaints suppressed.
6228         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6229         only if it not useful.
6230         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6231         top-level for attributes that are shared between the assembly
6232         and a top-level class.
6233         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6234         * class.cs: Update to reflect changes.
6235         (DefineIndexers): Fuse loops.
6236         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6237         a couple more variants of attribute names.
6238
6239 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6240
6241         Fix bug #52585 (Implemented explicit attribute declaration)
6242
6243         * attribute.cs:
6244         (Attributable.ValidAttributeTargets): New abstract method. It gets
6245         list of valid attribute targets for explicit target declaration.
6246         (Attribute.Target): It holds target itself.
6247         (AttributeSection): Removed.
6248         (Attribute.CheckTargets): New method. It checks whether attribute
6249         target is valid for the current element.
6250
6251         * class.cs:
6252         (EventProperty): New class. For events that are declared like
6253         property (with add and remove accessors).
6254         (EventField): New class. For events that are declared like field.
6255         class.cs
6256
6257         * cs-parser.jay: Implemented explicit attribute target declaration.
6258
6259         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6260         Override ValidAttributeTargets.
6261
6262         * parameter.cs:
6263         (ReturnParameter): Class for applying custom attributes on 
6264         the return type.
6265         (ParameterAtribute): New class. Class for applying custom
6266         attributes on the parameter type.
6267
6268 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6269
6270         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6271         definitions. 
6272
6273         (Method): Allow UNSAFE here.
6274
6275         * modifiers.cs: Support unsafe reporting.
6276
6277 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6278
6279         * decl.cs: Fix bug #58478.
6280
6281 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6282
6283         * statement.cs: When checking for unreachable code on an EmptyStatement,
6284         set the location. Fixes bug #58488.
6285
6286 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6287
6288         * driver.cs: Add -pkg handling.
6289
6290         From Gonzalo: UseShelLExecute=false
6291
6292 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6293
6294         * attribute.cs:
6295         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6296         for attribute.
6297         (Attribute.IsClsCompliaceRequired): Moved to base for better
6298         accesibility.
6299         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6300         when attribute is AttributeUsageAttribute.
6301         (Attribute.GetValidTargets): Simplified.
6302         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6303         attribute for this type.
6304         (Attribute.ApplyAttributes): Method renamed to Emit and make
6305         non-static.
6306         (GlobalAttributeSection): New class for special handling of global
6307         attributes (assembly, module).
6308         (AttributeSection.Emit): New method.
6309
6310         * class.cs: Implemented Attributable abstract methods.
6311         (MethodCore.LabelParameters): Moved to Parameter class.
6312         (Accessor): Is back simple class.
6313         (PropertyMethod): Implemented Attributable abstract class.
6314         (DelegateMethod): Implemented Attributable abstract class.
6315         (Event): New constructor for disctintion between normal Event
6316         and Event with accessors.
6317
6318         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6319
6320         * codegen.cs, const.cs, decl.cs, delegate.cs:
6321         (CommonAssemblyModulClass): Implemented Attributable abstract class
6322         and simplified.
6323
6324         * enum.cs: Implement IAttributeSupport interface.
6325         (EnumMember): New class for emum members. Implemented Attributable
6326         abstract class
6327
6328         * parameter.cs:
6329         (ParameterBase): Is abstract.
6330         (ReturnParameter): New class for easier [return:] attribute handling.
6331
6332         * typemanager.cs: Removed builder_to_attr.
6333
6334 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6335
6336         Fix bug #57151.
6337         * attribute.cs (Attribute.GetPositionalValue): New function.
6338         * class.cs (TypeContainer.VerifyMembers): New function.
6339         (TypeContainer.Emit): Use it.
6340         (ClassOrStruct): New base class for Class and Struct.
6341         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6342         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6343         class.
6344         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6345         then each non-static field should have a FieldOffset attribute.
6346         Otherwise, none of the fields should have a FieldOffset attribute.
6347         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6348         and FieldOffset attributes.
6349         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6350         (TypeManager.field_offset_attribute_type): New core types.
6351         (TypeManager.InitCoreTypes): Initialize them.
6352
6353 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6354
6355         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6356         Return correct type.
6357         From bug #58270.
6358
6359 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6360
6361         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6362         be implicitly converted to ulong.
6363         
6364         * expression.cs: The logic for allowing operator &, | and ^ worked
6365         was wrong, it worked before because we did not report an error in
6366         an else branch.  Fixes 57895.
6367
6368         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6369         allow volatile fields to be reference types.
6370
6371 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6372
6373         * driver.cs: Add support for /debug-
6374
6375 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6376
6377         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6378         Add a 'complain' parameter to silence errors.
6379         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6380         silently overlooked type-resolutions.
6381         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6382         to reflect changes.
6383         (Attributes.Search): New function.
6384         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6385         (Attributes.GetAttributeFullName): Remove hack.
6386         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6387         Update to reflect changes.
6388         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6389         Use Attributes.Search instead of nested loops.
6390
6391 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6392
6393         * decl.cs:
6394         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6395         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6396         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6397
6398         * report.cs: (Report.Warning): Renamed to Warning_T because of
6399         parameter collision.
6400
6401 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6402
6403         * expression.cs (MemberAccess.ResolveMemberAccess):
6404         Exit with non-zero status after Report.Error.
6405         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6406         Likewise.
6407         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6408
6409 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6410
6411         * support.cs: Don't hang when the file is empty.
6412
6413 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6414
6415         * support.cs: In SeekableStreamReader, compute the preamble size of the
6416           underlying stream. Position changes should take into account that initial
6417           count of bytes.
6418
6419 2004-05-03  Todd Berman  <tberman@sevenl.net>
6420
6421         * driver.cs: remove unused GetSysVersion function.
6422
6423 2004-05-03  Todd Berman  <tberman@sevenl.net>
6424
6425         * driver.cs: Remove the hack from saturday, as well as the hack
6426         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6427         link_paths to get that bit proper.
6428
6429 2004-05-01  Todd Berman  <tberman@sevenl.net>
6430
6431         * driver.cs: Try a LoadFrom before a Load, this checks the current
6432         path. This is currently a bug in mono that is be fixed, however, this
6433         provides a workaround for now. This will be removed when the bug
6434         is fixed.
6435
6436 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6437
6438         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6439         incomplete key pairs (#57941).
6440
6441 2004-05-01  Todd Berman  <tberman@sevenl.net>
6442
6443         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6444         from the GAC
6445
6446 2004-04-30  Jackson Harper  <jackson@ximian.com>
6447
6448         * codegen.cs: Open keys readonly.
6449         
6450 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6451
6452         * typemanager.cs: don't report cyclic struct layout when a struct
6453         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6454         which has 2 Pango.Rectangle fields.
6455
6456 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6457
6458         * expression.cs: Handle IntPtr comparisons with IL code
6459         rather than a method call.
6460
6461 2004-04-29  Martin Baulig  <martin@ximian.com>
6462
6463         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6464         the list of PropertyInfo's in class hierarchy and find the
6465         accessor.  Fixes #56013.
6466
6467 2004-04-29  Martin Baulig  <martin@ximian.com>
6468
6469         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6470
6471 2004-04-29  Martin Baulig  <martin@ximian.com>
6472
6473         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6474
6475         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6476
6477 2004-04-29  Martin Baulig  <martin@ximian.com>
6478
6479         * class.cs (ConstructorInitializer.Resolve): Check whether the
6480         parent .ctor is accessible.  Fixes #52146.
6481
6482 2004-04-29  Martin Baulig  <martin@ximian.com>
6483
6484         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6485
6486         * statement.cs (Using.EmitLocalVariableDecls): Use
6487         TypeManager.idisposable_type, not typeof (IDisposable).
6488         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6489
6490 2004-04-29  Martin Baulig  <martin@ximian.com>
6491
6492         * class.cs (Event.Define): Don't emit the field and don't set
6493         RTSpecialName and SpecialName for events on interfaces.  Fixes
6494         #57703. 
6495
6496 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6497
6498         Refactor Attribute.ApplyAttributes.
6499         * attribute.cs (Attributable): New base class for objects that can
6500         have Attributes applied on them.
6501         (Attribute): Make AttributeUsage fields public.
6502         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6503         (Attribute.IsInternalCall): New property.
6504         (Attribute.UsageAttr): Convert to a public read-only property.
6505         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6506         (Attribute.ResolveType, Attribute.Resolve)
6507         (Attribute.ScanForIndexerName): Update to reflect changes.
6508         (Attribute.CheckAttributeTarget): Re-format.
6509         (Attribute.ApplyAttributes): Refactor, to various
6510         Attributable.ApplyAttributeBuilder methods.
6511         * decl.cs (MemberCore): Make Attributable.
6512         * class.cs (Accessor): Make Attributable.
6513         (MethodData.ApplyAttributes): Use proper attribute types, not
6514         attribute names.
6515         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6516         (TypeContainer.ApplyAttributeBuilder)
6517         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6518         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6519         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6520         (Operator.ApplyAttributeBuilder): New factored-out methods.
6521         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6522         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6523         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6524         * parameter.cs (ParameterBase): New Attributable base class
6525         that can also represent Return types.
6526         (Parameter): Update to the changes.
6527
6528 2004-04-29  Jackson Harper  <jackson@ximian.com>
6529
6530         * driver.cs: Prefer the corlib system version when looking for
6531         assemblies in the GAC. This is still a hack, but its a better hack
6532         now.
6533         
6534 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6535
6536         * decl.cs, enum.cs: Improved error 3005 reporting.
6537   
6538         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6539         (related_symbols): New private member for list of symbols
6540         related to reported error/warning.
6541         
6542         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6543
6544 2004-04-29  Martin Baulig  <martin@ximian.com>
6545
6546         * ecore.cs (Expression.Constantify): If we're an enum and
6547         TypeManager.TypeToCoreType() doesn't give us another type, use
6548         t.UnderlyingSystemType.  Fixes #56178.  
6549
6550 2004-04-29  Martin Baulig  <martin@ximian.com>
6551
6552         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6553         interfaces and for each interface, only add members directly
6554         declared in that interface.  Fixes #53255.
6555
6556 2004-04-28  Martin Baulig  <martin@ximian.com>
6557
6558         * expression.cs (ConditionalLogicalOperator): Use a temporary
6559         variable for `left' to avoid that we evaluate it more than once;
6560         bug #52588.
6561
6562 2004-04-28  Martin Baulig  <martin@ximian.com>
6563
6564         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6565         `void[]' (CS1547).
6566
6567 2004-04-28  Martin Baulig  <martin@ximian.com>
6568
6569         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6570         void (CS1547).
6571
6572         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6573         whether the type is not void (CS1547).
6574
6575 2004-04-28  Martin Baulig  <martin@ximian.com>
6576
6577         * expression.cs (Unary.DoResolveLValue): Override this and report
6578         CS0131 for anything but Operator.Indirection.
6579
6580 2004-04-28  Martin Baulig  <martin@ximian.com>
6581
6582         Committing a patch from Ben Maurer; see bug #50820.
6583
6584         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6585         check for classes.
6586
6587         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6588         classes.        
6589
6590 2004-04-28  Martin Baulig  <martin@ximian.com>
6591
6592         Committing a patch from Ben Maurer; see bug #50820.
6593
6594         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6595         check for classes.
6596
6597         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6598         classes.        
6599
6600 2004-04-28  Martin Baulig  <martin@ximian.com>
6601
6602         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6603         (Block.AddLabel): Call DoLookupLabel() to only search in the
6604         current block.
6605
6606 2004-04-28  Martin Baulig  <martin@ximian.com>
6607
6608         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6609         comparing StringConstants and NullLiterals in Equality and Inequality.
6610
6611 2004-04-28  Jackson Harper  <jackson@ximian.com>
6612
6613         * driver.cs: Attempt to load referenced assemblies from the
6614         GAC. This is the quick and dirty version of this method that
6615         doesnt take into account versions and just takes the first
6616         canidate found. Will be good enough for now as we will not have more
6617         then one version installed into the GAC until I update this method.
6618
6619 2004-04-28  Martin Baulig  <martin@ximian.com>
6620
6621         * typemanager.cs (TypeManager.CheckStructCycles): New public
6622         static method to check for cycles in the struct layout.
6623
6624         * rootcontext.cs (RootContext.PopulateTypes): Call
6625         TypeManager.CheckStructCycles() for each TypeContainer.
6626         [Note: We only need to visit each type once.]
6627
6628 2004-04-28  Martin Baulig  <martin@ximian.com>
6629
6630         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6631
6632         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6633         success and added `out object value'.  Use a `bool resolved' field
6634         to check whether we've already been called rather than
6635         `ConstantValue != null' since this breaks for NullLiterals.
6636
6637 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6638
6639         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6640         setting of this flag, since the 'set' method may be non-public.
6641
6642 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6643
6644         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6645         check on current_vector.Block.
6646
6647 2004-04-27  Martin Baulig  <martin@ximian.com>
6648
6649         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6650         a field initializer.  Fixes #56459.
6651
6652 2004-04-27  Martin Baulig  <martin@ximian.com>
6653
6654         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6655         we're not attempting to use an indexer.  Fixes #52154.
6656
6657 2004-04-27  Martin Baulig  <martin@ximian.com>
6658
6659         * statement.cs (Return): Don't create a return label if we don't
6660         need it; reverts my change from January 20th.  Thanks to Ben
6661         Maurer for this.
6662
6663 2004-04-27  Martin Baulig  <martin@ximian.com>
6664
6665         According to the spec, `goto' can only leave a nested scope, but
6666         never enter it.
6667
6668         * statement.cs (Block.LookupLabel): Only lookup in the current
6669         block, don't recurse into parent or child blocks.
6670         (Block.AddLabel): Check in parent and child blocks, report
6671         CS0140/CS0158 if we find a duplicate.
6672         (Block): Removed this indexer for label lookups.
6673         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6674         this already does the error reporting for us.
6675
6676         * flowanalysis.cs
6677         (FlowBranching.UsageVector.Block): New public variable; may be null.
6678         (FlowBranching.CreateSibling): Added `Block' argument.
6679         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6680         label for the target of a `goto' and check whether we're not
6681         leaving a `finally'.
6682
6683 2004-04-27  Martin Baulig  <martin@ximian.com>
6684
6685         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6686         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6687         just for returns).
6688
6689 2004-04-27  Martin Baulig  <martin@ximian.com>
6690
6691         * statement.cs (Block.AddLabel): Also check for implicit blocks
6692         and added a CS0158 check.
6693
6694 2004-04-27  Martin Baulig  <martin@ximian.com>
6695
6696         * flowanalysis.cs (FlowBranchingLoop): New class.
6697         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6698         UsageVector's instead of an ArrayList.
6699         (FlowBranching.Label): Likewise.
6700         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6701         (FlowBranching.AddBreakVector): New method.
6702
6703 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6704
6705         * attribute.cs: Small regression fix: only convert the type if we
6706         the type is different, fixes System.Drawing build.
6707
6708 2004-04-27  Martin Baulig  <martin@ximian.com>
6709
6710         * attribute.cs (Attribute.Resolve): If we have a constant value
6711         for a named field or property, implicity convert it to the correct
6712         type.
6713
6714 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6715
6716         * statement.cs (Block.Block): Implicit blocks share
6717         'child_variable_names' fields with parent blocks.
6718         (Block.AddChildVariableNames): Remove.
6719         (Block.AddVariable): Mark variable as "used by a child block" in
6720         every surrounding block.
6721         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6722         been used in a child block, complain about violation of "Invariant
6723         meaning in blocks" rule.
6724         * cs-parser.jay (declare_local_variables): Don't use
6725         AddChildVariableNames.
6726         (foreach_statement): Don't create an implicit block: 'foreach'
6727         introduces a scope.
6728
6729 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6730
6731         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6732         converting from 0L to ulong.  Fixes 57522.
6733
6734 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6735
6736         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6737         derived class hides via 'new' keyword field from base class (test-242.cs).
6738         TODO: Handle this in the more general way.
6739         
6740         * class.cs (CheckBase): Ditto.
6741
6742 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6743
6744         * decl.cs (caching_flags): New member for storing cached values
6745         as bit flags.
6746         (MemberCore.Flags): New enum where bit flags for caching_flags
6747         are defined.
6748         (MemberCore.cls_compliance): Moved to caching_flags.
6749         (DeclSpace.Created): Moved to caching_flags.
6750
6751         * class.cs: Use caching_flags instead of DeclSpace.Created
6752         
6753 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6754
6755         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6756         if we are only a derived class, not a nested class.
6757
6758         * typemanager.cs: Same as above, but do this at the MemberLookup
6759         level (used by field and methods, properties are handled in
6760         PropertyExpr).   Allow for the qualified access if we are a nested
6761         method. 
6762
6763 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6764
6765         * class.cs: Refactoring.
6766         (IMethodData): New inteface; Holds links to parent members
6767         to avoid member duplication (reduced memory allocation).
6768         (Method): Implemented IMethodData interface.
6769         (PropertyBase): New inner classes for get/set methods.
6770         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6771         (Event): New inner classes for add/remove methods.
6772         (Event.DelegateMethod): Implemented IMethodData interface.
6773
6774         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6775         EmitContext (related to class.cs refactoring).
6776
6777 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6778
6779         * delegate.cs (Delegate.VerifyApplicability): If the number of
6780         arguments are the same as the number of parameters, first try to
6781         verify applicability ignoring  any 'params' modifier on the last
6782         parameter.
6783         Fixes #56442.
6784
6785 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6786
6787         * class.cs (TypeContainer.AddIndexer): Use
6788         'ExplicitInterfaceName' to determine if interface name was
6789         explicitly specified.  'InterfaceType' is not initialized at this time.
6790         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6791         Indexers array is already in the required order.  Initialize
6792         'IndexerName' only if there are normal indexers.
6793         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6794         (TypeContainer.Emit): Emit DefaultMember attribute only if
6795         IndexerName is initialized.
6796         Fixes #56300.
6797
6798 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6799
6800         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6801         Fixes #57007
6802
6803 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6804
6805         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6806         attributes.
6807         Fix for #56456.
6808
6809         * attribute.cs (Attribute.Resolve): Check for duplicate named
6810         attributes.
6811         Fix for #56463.
6812
6813 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6814
6815         * iterators.cs (MarkYield): track whether we are in an exception,
6816         and generate code accordingly.  Use a temporary value to store the
6817         result for our state.
6818
6819         I had ignored a bit the interaction of try/catch with iterators
6820         since their behavior was not entirely obvious, but now it is
6821         possible to verify that our behavior is the same as MS .NET 2.0
6822
6823         Fixes 54814
6824
6825 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6826
6827         * iterators.cs: Avoid creating temporaries if there is no work to
6828         do. 
6829
6830         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6831         Enumerations, use TypeManager.EnumToUnderlying and call
6832         recursively. 
6833
6834         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6835         bug #57013
6836
6837         (This.Emit): Use EmitContext.EmitThis to emit our
6838         instance variable.
6839
6840         (This.EmitAssign): Ditto.
6841
6842         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6843         codepaths, we will move all the functionality into
6844         Mono.CSharp.This 
6845
6846         (FieldExpr.EmitAssign): Ditto.
6847
6848         This fixes several hidden bugs that I uncovered while doing a code
6849         review of this today.
6850
6851         * codegen.cs (EmitThis): reworked so the semantics are more clear
6852         and also support value types "this" instances.
6853
6854         * iterators.cs: Changed so that for iterators in value types, we
6855         do not pass the value type as a parameter.  
6856
6857         Initialization of the enumerator helpers is now done in the caller
6858         instead of passing the parameters to the constructors and having
6859         the constructor set the fields.
6860
6861         The fields have now `assembly' visibility instead of private.
6862
6863 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6864
6865         * expression.cs (Argument.Resolve): Check if fields passed as ref
6866         or out are contained in a MarshalByRefObject.
6867
6868         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6869         another compiler type.
6870
6871 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6872
6873         * class.cs (Indexer.Define): use the new name checking method.
6874         Also, return false on an error.
6875         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6876         (is_identifier_[start/part]_character): make static.
6877
6878 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6879
6880         * expression.cs (Binary.ResolveOperator): Do no append strings
6881         twice: since we can be invoked more than once (array evaluation)
6882         on the same concatenation, take care of this here.  Based on a fix
6883         from Ben (bug #56454)
6884
6885 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6886
6887         * codegen.cs: Fix another case where CS1548 must be reported (when 
6888         delay-sign isn't specified and no private is available #56564). Fix
6889         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6890         error when MCS is used on the MS runtime and we need to delay-sign 
6891         (which seems unsupported by AssemblyBuilder - see #56621).
6892
6893 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6894
6895         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6896         (TypeManager.ComputeNamespaces): Faster implementation for
6897         Microsoft runtime.
6898
6899         * compiler.csproj: Updated AssemblyName to mcs.
6900
6901 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6902
6903         * rootcontext.cs: Add new types to the boot resolution.
6904
6905         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6906         MulticastDelegate is not allowed.
6907
6908         * typemanager.cs: Add new types to lookup: System.TypedReference
6909         and ArgIterator.
6910
6911         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6912         check for TypedReference or ArgIterator, they are not allowed. 
6913
6914         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6915         makes us properly catch 1510 in some conditions (see bug 56016 for
6916         details). 
6917
6918 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6919
6920         * CryptoConvert.cs: update from corlib version
6921         with endian fixes.
6922
6923 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6924
6925         * class.cs (Indexer.Define): Check indexername declaration
6926
6927 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6928
6929         * attribute.cs (IsClsCompliant): Fixed problem with handling
6930         all three states (compliant, not-compliant, undetected).
6931
6932 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6933
6934         * attribute.cs (Attribute): Location is now public.
6935         (Resolve): Store resolved arguments (pos_values) in attribute class.
6936         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6937         (GetClsCompliantAttributeValue): New method that gets
6938         CLSCompliantAttribute value.
6939         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6940         if exists else null.
6941         (AttributeTester): New class for CLS-Compliant verification routines.
6942
6943         * class.cs (Emit): Add CLS-Compliant verification.
6944         (Method.GetSignatureForError): Implemented.
6945         (Constructor.GetSignatureForError): Implemented
6946         (Constructor.HasCompliantArgs): Returns if constructor has
6947         CLS-Compliant arguments.
6948         (Constructor.Emit): Override.
6949         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6950         is needed to test only parameters.
6951         (FieldBase.GetSignatureForError): Implemented.
6952         (TypeContainer): New member for storing base interfaces.
6953         (TypeContainer.FindMembers): Search in base interfaces too.
6954
6955         * codegen.cs (GetClsComplianceAttribute): New method that gets
6956         assembly or module CLSCompliantAttribute value.
6957         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6958         for assembly.
6959         (ModuleClass.Emit): Add error 3012 test.
6960
6961         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6962
6963         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6964         state for all decl types.
6965         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6966         if CLS-Compliant tests are required.
6967         (IsClsCompliaceRequired): New method. Analyze whether code
6968         must be CLS-Compliant.
6969         (IsExposedFromAssembly): New method. Returns true when MemberCore
6970         is exposed from assembly.
6971         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6972         value or gets cached value.
6973         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6974         is explicitly marked with CLSCompliantAttribute.
6975         (IsIdentifierClsCompliant): New abstract method. This method is
6976         used to testing error 3005.
6977         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6978         for identifier and parameters CLS-Compliant testing.
6979         (VerifyClsCompliance): New method. The main virtual method for
6980         CLS-Compliant verifications.
6981         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6982         null. I don't know why is null (too many public members !).
6983         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6984         and get value of first CLSCompliantAttribute that found.
6985
6986         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6987         (VerifyClsCompliance): Override and add extra tests.
6988
6989         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6990         clscheck- disable CLS-Compliant verification event if assembly is has
6991         CLSCompliantAttribute(true).
6992
6993         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6994         ApllyAttribute is now called in emit section as in the other cases.
6995         Possible future Emit integration.
6996         (IsIdentifierClsCompliant): New override.
6997         (VerifyClsCompliance): New override.
6998         (GetEnumeratorName): Returns full enum name.
6999
7000         * parameter.cs (GetSignatureForError): Implemented.
7001
7002         * report.cs (WarningData): New struct for Warning message information.
7003         (LocationOfPreviousError): New method.
7004         (Warning): New method. Reports warning based on the warning table.
7005         (Error_T): New method. Reports error based on the error table.
7006
7007         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7008         verifications are done here.
7009
7010         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7011
7012         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7013         CLSCompliantAttribute.
7014         (all_imported_types): New member holds all imported types from other
7015         assemblies.
7016         (LoadAllImportedTypes): New method fills static table with exported types
7017         from all referenced assemblies.
7018         (Modules): New property returns all assembly modules.
7019
7020 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7021
7022         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7023         throwing a parser error.
7024
7025         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7026         which removes the hardcoded get_/set_ prefixes for properties, as
7027         IL allows for the properties to be named something else.  
7028
7029         Bug #56013
7030
7031         * expression.cs: Do not override operand before we know if it is
7032         non-null.  Fix 56207
7033
7034 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7035
7036         * typemanager.cs: support for pinned variables.
7037
7038 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7039
7040         * decl.cs, typemanager.cs: Avoid using an arraylist
7041         as a buffer if there is only one result set.
7042
7043 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7044
7045         * expression.cs: Make sure you cant call a static method
7046         with an instance expression, bug #56174.
7047
7048 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7049
7050         * class.cs (IsDuplicateImplementation): Improve error reporting to
7051         flag 663 (method only differs in parameter modifier).
7052
7053         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7054         in preprocessor directives.
7055
7056         * location.cs (LookupFile): Allow for the empty path.
7057
7058         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7059         better approach for some of that patch, but its failing with the
7060         CharSet enumeration.  For now try/catch will do.
7061
7062         * typemanager.cs: Do not crash if a struct does not have fields.
7063         Fixes 56150.
7064
7065 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7066
7067         * expression.cs: cs0213, cant fix a fixed expression.
7068         fixes 50231.
7069
7070 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7071
7072         * cs-parser.jay: detect invalid embeded statements gracefully.
7073         bug #51113.
7074
7075 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7076
7077         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7078         As a regex:
7079         s/
7080         the invocation type may not be a subclass of the tye of the item/
7081         The type of the item must be a subclass of the invocation item.
7082         /g
7083
7084         Fixes bug #50820.
7085
7086 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7087
7088         * attribute.cs: Added methods to get a string and a bool from an
7089         attribute. Required to information from AssemblyKeyFileAttribute,
7090         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7091         * codegen.cs: Modified AssemblyName creation to include support for
7092         strongnames. Catch additional exceptions to report them as CS1548.
7093         * compiler.csproj: Updated include CryptoConvert.cs.
7094         * compiler.csproj.user: Removed file - user specific configuration.
7095         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7096         Mono.Security assembly. The original class is maintained and tested in
7097         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7098         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7099         like CSC 8.0 (C# v2) supports.
7100         * Makefile: Added CryptoConvert.cs to mcs sources.
7101         * rootcontext.cs: Added new options for strongnames.
7102
7103 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7104
7105         * driver.cs: For --expect-error, report error code `2'
7106         if the program compiled with no errors, error code `1' if
7107         it compiled with an error other than the one expected.
7108
7109 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7110
7111         * compiler.csproj: Updated for Visual Studio .NET 2003.
7112         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7113         * compiler.sln: Updated for Visual Studio .NET 2003.
7114
7115 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7116
7117         * expression.cs: Fix bug #47234. We basically need to apply the
7118         rule that we prefer the conversion of null to a reference type
7119         when faced with a conversion to 'object' (csc behaviour).
7120
7121 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7122
7123         * statement.cs: Shorter form for foreach, eliminates
7124         a local variable. r=Martin.
7125
7126 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7127
7128         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7129         checks if we can use brtrue/brfalse to test for 0.
7130         * expression.cs: use the above in the test for using brtrue/brfalse.
7131         cleanup code a bit.
7132
7133 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7134
7135         * expression.cs: Rewrite string concat stuff. Benefits:
7136
7137         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7138         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7139         rather than a concat chain.
7140
7141         * typemanager.cs: Add lookups for more concat overloads.
7142
7143 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7144
7145         * expression.cs: Emit shorter il code for array init.
7146
7147         newarr
7148         dup
7149         // set 1
7150
7151         // set 2
7152
7153         newarr
7154         stloc.x
7155
7156         ldloc.x
7157         // set 1
7158
7159         ldloc.x
7160         // set 2
7161
7162 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7163
7164         * statement.cs: Before, two switch blocks would be merged if the
7165         total size of the blocks (end_item - begin_item + 1) was less than
7166         two times the combined sizes of the blocks.
7167
7168         Now, it will only merge if after the merge at least half of the
7169         slots are filled.
7170
7171         fixes 55885.
7172
7173 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7174
7175         * class.cs : csc build fix for GetMethods(). See bug #52503.
7176
7177 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7178
7179         * expression.cs: Make sure fp comparisons work with NaN.
7180         This fixes bug #54303. Mig approved this patch a long
7181         time ago, but we were not able to test b/c the runtime
7182         had a related bug.
7183
7184 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7185
7186         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7187
7188 2004-03-19  Martin Baulig  <martin@ximian.com>
7189
7190         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7191         error here and not in our caller.
7192
7193 2004-03-19  Martin Baulig  <martin@ximian.com>
7194
7195         * interface.cs: Completely killed this file.
7196         (Interface): We're now a TypeContainer and live in class.cs.
7197
7198         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7199         argument; we're now also called for interfaces.
7200         (TypeContainer.DefineMembers): Allow this method being called
7201         multiple times.
7202         (TypeContainer.GetMethods): New public method; formerly known as
7203         Interface.GetMethod().  This is used by PendingImplementation.
7204         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7205         it's now private and non-static.
7206         (Interface): Moved this here; it's now implemented similar to
7207         Class and Struct.
7208         (Method, Property, Event, Indexer): Added `bool is_interface'
7209         argument to their .ctor's.
7210         (MemberBase.IsInterface): New public field.
7211
7212         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7213         instances instead of InterfaceMethod, InterfaceProperty, etc.
7214         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7215         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7216
7217 2004-03-19  Martin Baulig  <martin@ximian.com>
7218
7219         * class.cs (MethodCore.IsDuplicateImplementation): New private
7220         method which does the CS0111 checking.
7221         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7222         Use IsDuplicateImplementation().
7223
7224 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7225
7226         * decl.cs (FindMemberToOverride): New method to find the correct
7227         method or property to override in the base class.
7228         * class.cs
7229             - Make Method/Property use the above method to find the
7230               version in the base class.
7231             - Remove the InheritableMemberSignatureCompare as it is now
7232               dead code.
7233
7234         This patch makes large code bases much faster to compile, as it is
7235         O(n) rather than O(n^2) to do this validation.
7236
7237         Also, it fixes bug 52458 which is that nested classes are not
7238         taken into account when finding the base class member.
7239
7240         Reviewed/Approved by Martin.
7241
7242 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7243
7244         * interface.cs: In all interface classes removed redundant
7245         member initialization.
7246
7247 2004-03-16  Martin Baulig  <martin@ximian.com>
7248
7249         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7250
7251 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7252
7253         * decl.cs (DefineTypeAndParents): New helper method to define a
7254         type's containers before the type itself is defined;  This is a
7255         bug exposed by the recent changes to Windows.Forms when an
7256         implemented interface was defined inside a class that had not been
7257         built yet.   
7258
7259         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7260
7261         (Check): Loop correctly to report errors modifiers
7262         (UNSAFE was not in the loop, since it was the same as TOP).
7263
7264         * interface.cs: Every interface member now takes a ModFlags,
7265         instead of a "is_new" bool, which we set on the base MemberCore. 
7266
7267         Every place where we called "UnsafeOk" in the interface, now we
7268         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7269         the unsafe settings from the member declaration instead of the
7270         container interface. 
7271
7272         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7273
7274         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7275         `set_indexer_name' to the pending bits (one per type).
7276
7277         We fixed a bug today that was picking the wrong method to
7278         override, since for properties the existing InterfaceMethod code
7279         basically ignored the method name.  Now we make sure that the
7280         method name is one of the valid indexer names.
7281
7282 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7283  
7284         * support.cs (SeekableStreamReader): Keep track of stream byte
7285         positions and don't mix them with character offsets to the buffer.
7286
7287         Patch from Gustavo Giráldez
7288
7289 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7290
7291         * interface.cs (InterfaceSetGetBase): Removed double member
7292         initialization, base class does it as well.
7293
7294 2004-03-13  Martin Baulig  <martin@ximian.com>
7295
7296         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7297         when compiling corlib.
7298
7299 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7300
7301         * convert.cs (ExplicitConversion): We were reporting an error on
7302         certain conversions (object_type source to a value type, when the
7303         expression was `null') before we had a chance to pass it through
7304         the user defined conversions.
7305
7306         * driver.cs: Replace / and \ in resource specifications to dots.
7307         Fixes 50752
7308
7309         * class.cs: Add check for duplicate operators.  Fixes 52477
7310
7311 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7312
7313         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7314         that are in the middle of the statements, not only at the end.
7315         Fixes #54987
7316
7317         * class.cs (TypeContainer.AddField): No longer set the
7318         `HaveStaticConstructor' flag, now we call it
7319         `UserDefineStaticConstructor' to diferentiate the slightly
7320         semantic difference.
7321
7322         The situation is that we were not adding BeforeFieldInit (from
7323         Modifiers.TypeAttr) to classes that could have it.
7324         BeforeFieldInit should be set to classes that have no static
7325         constructor. 
7326
7327         See:
7328
7329         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7330
7331         And most importantly Zoltan's comment:
7332
7333         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7334
7335         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7336          before its static fields are used', i.e. initialization does not need
7337          to be triggered by the first access to the type. Setting this flag
7338          helps the JIT to compile better code, since it can run the static
7339          constructor at JIT time, and does not need to generate code to call it
7340          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7341          this flag for lots of classes like String. 
7342          
7343          csc sets this flag if the type does not have an explicit static 
7344          constructor. The reasoning seems to be that if there are only static
7345          initalizers for a type, and no static constructor, then the programmer
7346          does not care when this initialization happens, so beforefieldinit
7347          can be used.
7348          
7349          This bug prevents the AOT compiler from being usable, since it 
7350          generates so many calls to mono_runtime_class_init that the AOT code
7351          is much slower than the JITted code. The JITted code is faster, 
7352          because it does not generate these calls if the vtable is type is
7353          already initialized, which is true in the majority of cases. But the
7354          AOT compiler can't do this."
7355
7356 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7357
7358         * class.cs (MethodData.Emit): Refactor the code so symbolic
7359         information is generated for destructors;  For some reasons we
7360         were taking a code path that did not generate symbolic information
7361         before. 
7362
7363 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7364
7365         * class.cs: Create a Constructor.CheckBase method that
7366         takes care of all validation type code. The method
7367         contains some code that was moved from Define.
7368
7369         It also includes new code that checks for duplicate ctors.
7370         This fixes bug #55148.
7371
7372 2004-03-09  Joshua Tauberer <tauberer@for.net>
7373
7374         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7375         a { ... }-style array creation invokes EmitStaticInitializers
7376         which is not good for reference-type arrays.  String, decimal
7377         and now null constants (NullCast) are not counted toward
7378         static initializers.
7379
7380 2004-03-05  Martin Baulig  <martin@ximian.com>
7381
7382         * location.cs (SourceFile.HasLineDirective): New public field;
7383         specifies whether the file contains or is referenced by a "#line"
7384         directive.
7385         (Location.DefineSymbolDocuments): Ignore source files which
7386         either contain or are referenced by a "#line" directive.        
7387
7388 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7389
7390         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7391         direct access to our parent, so check the method inline there.
7392
7393 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7394
7395         * expression.cs (Invocation.EmitCall): Miguel's last commit
7396         caused a regression. If you had:
7397
7398             T t = null;
7399             t.Foo ();
7400
7401         In Foo the implict this would be null.
7402
7403 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7404
7405         * expression.cs (Invocation.EmitCall): If the method is not
7406         virtual, do not emit a CallVirt to it, use Call.
7407
7408         * typemanager.cs (GetFullNameSignature): Improve the method to
7409         cope with ".ctor" and replace it with the type name.
7410
7411         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7412         as an argument the ConstructorBuilder where it is being defined,
7413         to catch the recursive constructor invocations.
7414
7415 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7416
7417         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7418         routines to check if a type is an enumerable/enumerator allow
7419         classes that implement the IEnumerable or IEnumerator interfaces.
7420
7421         * class.cs (Property, Operator): Implement IIteratorContainer, and
7422         implement SetYields.
7423
7424         (Property.Define): Do the block swapping for get_methods in the
7425         context of iterators.   We need to check if Properties also
7426         include indexers or not.
7427
7428         (Operator): Assign the Block before invoking the
7429         OperatorMethod.Define, so we can trigger the Iterator code
7430         replacement. 
7431
7432         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7433         Property and Operator classes are not created when we parse the
7434         declarator but until we have the block completed, so we use a
7435         singleton SimpleIteratorContainer.Simple to flag whether the
7436         SetYields has been invoked.
7437
7438         We propagate this setting then to the Property or the Operator to
7439         allow the `yield' to function.
7440
7441 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7442
7443         * codegen.cs: Implemented attribute support for modules.
7444         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7445         Assembly/Module functionality.
7446
7447         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7448         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7449         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7450
7451 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7452
7453         * interface.cs (FindMembers): The operation is performed on all base
7454         interfaces and not only on the first. It is required for future CLS Compliance patch.
7455
7456 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7457
7458         * statement.cs, codegen.cs:
7459         This patch deals with patterns such as:
7460
7461         public class List : IEnumerable {
7462
7463                 public MyEnumerator GetEnumerator () {
7464                         return new MyEnumerator(this);
7465                 }
7466
7467                 IEnumerator IEnumerable.GetEnumerator () {
7468                         ...
7469                 }
7470                 
7471                 public struct MyEnumerator : IEnumerator {
7472                         ...
7473                 }
7474         }
7475
7476         Before, there were a few things we did wrong:
7477         1) we would emit callvirt on a struct, which is illegal
7478         2) we emited ldarg when we needed to emit ldarga
7479         3) we would mistakenly call the interface methods on an enumerator
7480         type that derived from IEnumerator and was in another assembly. For example:
7481
7482         public class MyEnumerator : IEnumerator
7483
7484         Would have the interface methods called, even if there were public impls of the
7485         method. In a struct, this lead to invalid IL code.
7486
7487 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7488
7489         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7490           renamed to Emit.
7491
7492         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7493
7494 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7495
7496         * cs-parser.jay: Fix small regression: we were not testing V2
7497         compiler features correctly.
7498
7499         * interface.cs: If the emit context is null, then create one
7500
7501 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7502
7503         * decl.cs (GetSignatureForError): New virtual method to get full name
7504           for error messages.
7505
7506         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7507           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7508
7509         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7510           Duplicated members and code in these classes has been removed.
7511           Better encapsulation in these classes.
7512
7513 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7514
7515         * assign.cs (Assign.DoResolve): When dealing with compound
7516         assignments, there is a new rule in ECMA C# 2.4 (might have been
7517         there before, but it is documented here) that states that in:
7518
7519         a op= b;
7520
7521         If b is of type int, and the `op' is a shift-operator, then the
7522         above is evaluated as:
7523
7524         a = (int) a op b 
7525
7526         * expression.cs (Binary.ResolveOperator): Instead of testing for
7527         int/uint/long/ulong, try to implicitly convert to any of those
7528         types and use that in pointer arithmetic.
7529
7530         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7531         method to print information for from the type, not from the
7532         null-method we were given.
7533
7534 2004-02-01  Duncan Mak  <duncan@ximian.com>
7535
7536         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7537         parsing for cmd, fixes bug #53694.
7538
7539 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7540
7541         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7542         in the member name duplication tests. Property and operator name duplication
7543         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7544
7545 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7546
7547         * interface.cs (PopulateMethod): Fixed crash when interface method
7548         returns not existing type (error test cs0246-3.cs).
7549
7550 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7551
7552         * cs-parser.jay (interface_accessors): Re-write actions to also
7553         store attributes attached to get and set methods. Fix spelling
7554         while at it.
7555
7556         (inteface_property_declaration): Modify accordingly.
7557
7558         (InterfaceAccessorInfo): New helper class to store information to pass
7559         around between rules that use interface_accessors.
7560
7561         * interface.cs (Emit): Apply attributes on the get and set
7562         accessors of properties and indexers too.
7563
7564         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7565         right MethodBuilder when applying attributes to the get and set accessors.
7566
7567 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7568
7569         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7570
7571 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7572
7573         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7574
7575 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7576
7577         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7578         changes that treat `yield' specially when present before `break'
7579         or `return' tokens.
7580
7581         * cs-tokenizer.cs: yield is no longer a keyword.
7582
7583 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7584
7585         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7586         setting for default constructors.
7587         For default constructors are almost every time set wrong Modifier. The
7588         generated IL code has been alright. But inside mcs this values was
7589         wrong and this was reason why several of my CLS Compliance tests
7590         failed.
7591
7592 2004-01-22  Martin Baulig  <martin@ximian.com>
7593
7594         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7595         not a QualifiedIdentifier.  This is what `type_name_expression'
7596         was previously doing.
7597         (type_name_expression): Removed; the code is now in
7598         `namespace_or_type_name'.
7599         (qualified_identifier): Removed, use `namespace_or_type_name'
7600         instead.
7601         (QualifiedIdentifier): Removed this class.      
7602
7603 2004-01-22  Martin Baulig  <martin@ximian.com>
7604
7605         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7606         not a string as alias name.
7607
7608 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7609
7610         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7611         #52730 bug, and instead compute correctly the need to use a
7612         temporary variable when requesting an address based on the
7613         static/instace modified of the field and the constructor.
7614  
7615 2004-01-21  Martin Baulig  <martin@ximian.com>
7616
7617         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7618         class and namespace before looking up aliases.  Fixes #52517.
7619
7620 2004-01-21  Martin Baulig  <martin@ximian.com>
7621
7622         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7623         assinged in a 'try'; fixes exception4.cs.
7624
7625 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7626         * class.cs : Implemented parameter-less constructor for TypeContainer
7627
7628         * decl.cs: Attributes are now stored here. New property OptAttributes
7629
7630         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7631
7632         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7633
7634 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7635
7636         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7637           (CSharpSignature): New method for indexer and property signature.
7638
7639 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7640
7641         * pending.cs (IsVirtualFilter): Faster implementation.
7642
7643 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7644
7645         * typemanager.cs: Avoid inclusion of same assembly more than once.
7646
7647 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7648
7649         * cs-parser.jay: Fixed problem where the last assembly attribute
7650           has been applied also to following declaration (class, struct, etc.)
7651           
7652 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7653
7654         * class.cs: Added error CS0538, CS0539 reporting.
7655         Fixed crash on Microsoft runtime when field type is void.
7656
7657         * cs-parser.jay: Added error CS0537 reporting.
7658
7659         * pending.cs: Added error CS0535 reporting.
7660         Improved error report for errors CS0536, CS0534.
7661
7662 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7663
7664         Merge a few bits from the Anonymous Method MCS tree.
7665
7666         * statement.cs (ToplevelBlock): New class for toplevel methods,
7667         will hold anonymous methods, lifted variables.
7668
7669         * cs-parser.jay: Create toplevel blocks for delegates and for
7670         regular blocks of code. 
7671
7672 2004-01-20  Martin Baulig  <martin@ximian.com>
7673
7674         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7675         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7676         and `NeedExplicitReturn'; added `IsLastStatement'.
7677         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7678         have a `ReturnLabel' or we're not unreachable.
7679
7680         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7681         child's reachability; don't just override ours with it.  Fixes
7682         #58058 (lluis's example).
7683         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7684         InFinally(), InLoop(), InSwitch() and
7685         BreakCrossesTryCatchBoundary() methods.
7686
7687         * statement.cs (Return): Do all error checking in Resolve().
7688         Unless we are the last statement in a top-level block, always
7689         create a return label and jump to it.
7690         (Break, Continue): Do all error checking in Resolve(); also make
7691         sure we aren't leaving a `finally'.
7692         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7693         statement in a top-level block.
7694         (Block.Flags): Added `IsDestructor'.
7695         (Block.IsDestructor): New public property.
7696
7697 2004-01-20  Martin Baulig  <martin@ximian.com>
7698
7699         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7700
7701 2004-01-20  Martin Baulig  <martin@ximian.com>
7702
7703         * statement.cs (Statement.ResolveUnreachable): New public method.
7704         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7705         (Block.Resolve): Resolve unreachable statements.
7706
7707 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7708
7709         * expression.cs: We need to fix the case where we do
7710         not have a temp variable here.
7711
7712         * assign.cs: Only expression compound assignments need
7713         temporary variables.
7714
7715 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7716
7717         * flowanalysis.cs: Reduce memory allocation in a few ways:
7718           - A block with no variables should not allocate a bit
7719             vector for itself.
7720           - A method with no out parameters does not need any tracking
7721             for assignment of the parameters, so we need not allocate
7722             any data for it.
7723           - The arrays:
7724                 public readonly Type[] VariableTypes;
7725                 public readonly string[] VariableNames;
7726             Are redundant. The data is already stored in the variable
7727             map, so we need not allocate another array for it.
7728           - We need to add alot of checks for if (params | locals) == null
7729             due to the first two changes.
7730
7731 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7732
7733         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7734         implement IMemoryLocation, we store a copy on a local variable and
7735         take the address of it.  Patch from Benjamin Jemlich
7736
7737         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7738         to use a special "type_name_expression" rule which reduces the
7739         number of "QualifiedIdentifier" classes created, and instead
7740         directly creates MemberAccess expressions.
7741
7742 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7743
7744         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7745         that fixes #52853.  Null literal assignment to ValueType
7746
7747         * class.cs (MethodData.Emit): Instead of checking the name of the
7748         method to determine if its a destructor, create a new derived
7749         class from Method called Destructor, and test for that.  
7750
7751         * cs-parser.jay: Create a Destructor object instead of a Method.  
7752
7753         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7754
7755         Fixes: 52933
7756
7757 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7758
7759         * expression.cs (Binary.ResolveOperator): Perform an implicit
7760         conversion from MethodGroups to their delegate types on the
7761         Addition operation.
7762
7763         * delegate.cs: Introduce a new class DelegateCreation that is the
7764         base class for `NewDelegate' and `ImplicitDelegateCreation',
7765         factor some code in here.
7766
7767         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7768         conversion from MethodGroups to compatible delegate types. 
7769
7770         * ecore.cs (Expression.Resolve): Do not flag error 654
7771         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7772         we allow conversions from MethodGroups to delegate types now.
7773
7774         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7775         assignments in v2 either.
7776
7777 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7778
7779         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7780         static read-only fields in ctors.
7781
7782         Applied patch from Benjamin Jemlich 
7783
7784         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7785
7786 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7787
7788         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7789         here to return true, as they can be used like this:
7790
7791                 (XXX) int.MEMBER ()
7792
7793         Fixed 49836 and all the other dups
7794
7795 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7796
7797         * driver.cs: Implement /win32res and /win32icon.
7798
7799 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7800
7801         * cs-parser.jay: Add a rule to improve error handling for the
7802         common mistake of placing modifiers after the type.
7803
7804 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7805
7806         * cs-parser.jay (interface_event_declaration): Catch
7807         initialization of events on interfaces, and report cs0068
7808
7809         * cs-parser.jay (interface_event_declaration): Catch
7810         initialization of events. 
7811
7812         * ecore.cs: Better report missing constructors.
7813
7814         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7815         the error reporting done in the wrong place.  Fix.
7816
7817         * expression.cs (Binary.ResolveOperator): Catch the 
7818         operator + (E x, E y) error earlier, and later allow for implicit
7819         conversions in operator +/- (E e, U x) from U to the underlying
7820         type of E.
7821
7822         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7823         52596, if the container class is abstract, the default constructor
7824         is protected otherwise its public (before, we were always public).
7825
7826         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7827         fixed statement.
7828
7829         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7830         Jemlich that fixes bug #52597, MCS was generating invalid code for
7831         idisposable structs.   Thanks to Ben for following up with this
7832         bug as well.
7833
7834 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7835
7836         * driver.cs: Allow assemblies without code to be generated, fixes
7837         52230.
7838
7839 2004-01-07  Nick Drochak <ndrochak@gol.com>
7840
7841         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7842
7843 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7844
7845         * cs-parser.jay: Add rules to improve error reporting if fields or
7846         methods are declared at the namespace level (error 116)
7847
7848         * Add rules to catch event add/remove
7849
7850 2004-01-04  David Sheldon <dave-mono@earth.li>
7851
7852   * expression.cs: Added matching ")" to error message for 
7853   CS0077
7854
7855 2004-01-03 Todd Berman <tberman@gentoo.org>
7856
7857         * ecore.cs, attribute.cs:
7858         Applying fix from #52429.
7859
7860 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7861
7862         * ecore.cs, expression.cs, statement.cs:
7863         Total rewrite of how we handle branching. We
7864         now handle complex boolean expressions with fewer
7865         jumps. As well if (x == 0) no longer emits a ceq.
7866
7867         if (x is Foo) is much faster now, because we generate
7868         better code.
7869
7870         Overall, we get a pretty big improvement on our benchmark
7871         tests. The code we generate is smaller and more readable.
7872
7873         I did a full two-stage bootstrap. The patch was reviewed
7874         by Martin and Miguel.
7875
7876 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7877
7878         * cs-parser.jay: Make primary_expression not take a QI.
7879         we dont need this because the member_access rule covers
7880         us here. So we replace the rule with just IDENTIFIER.
7881
7882         This has two good effects. First, we remove a s/r conflict.
7883         Second, we allocate many fewer QualifiedIdentifier objects.
7884
7885 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7886
7887         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7888         set the correct information via SRE. This prevents
7889         hanging on the MS runtime. Fixes #29374.
7890
7891 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7892
7893         * convert.cs: correctly handle conversions to value types
7894         from Enum and ValueType as unboxing conversions.
7895
7896         Fixes bug #52569. Patch by Benjamin Jemlich.
7897
7898 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7899
7900         * expression.cs (BetterConversion): Prefer int -> uint
7901         over int -> ulong (csc's behaviour). This fixed bug #52046.
7902
7903 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7904
7905         * decl.cs (MemberCache.FindMembers): now returns a
7906         MemberInfo [].
7907
7908         * typemanager.cs: In general, go with with ^^.
7909         (CopyNewMethods): take an IList.
7910         (RealMemberLookup): Only allocate an arraylist
7911         if we copy from two sets of methods.
7912
7913         This change basically does two things:
7914         1) Fewer array lists allocated due to CopyNewMethods.
7915         2) the explicit cast in MemberList costed ALOT.
7916
7917 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
7918
7919         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
7920         a hashtable to avoid needless string allocations when an identifier is
7921         used more than once (the common case).
7922
7923 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7924
7925         * pending.cs: MS's TypeBuilder.GetInterfaces ()
7926         is broken, it will not return anything. So, we
7927         have to use the information we have in mcs to
7928         do the task.
7929
7930         * typemanager.cs: Add a cache for GetInterfaces,
7931         since this will now be used more often (due to ^^)
7932
7933         (GetExplicitInterfaces) New method that gets the
7934         declared, not effective, interfaces on a type
7935         builder (eg, if you have interface IFoo, interface
7936         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
7937         { IBar }.
7938
7939         This patch makes MCS able to bootstrap itself on
7940         Windows again.
7941
7942 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
7943
7944         * expression.cs: Remove the Nop's that Miguel put
7945         in by mistake.
7946
7947 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7948
7949         * report.cs, codegen.cs: Give the real stack trace to
7950         the error when an exception is thrown.
7951
7952 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7953
7954         * decl.cs: only allocate hashtables for ifaces if 
7955         it is an iface!
7956
7957 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7958
7959         * expression.cs: fix the error from cs0121-2.cs
7960         (a parent interface has two child interfaces that
7961         have a function with the same name and 0 params
7962         and the function is called through the parent).
7963
7964 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7965
7966         * class.cs, rootcontext.cs, typmanager.cs: do not
7967         leak pointers.
7968
7969 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7970
7971         * codegen.cs: remove stack for the ec flow branching.
7972         It is already a linked list, so no need.
7973
7974 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7975
7976         * Makefile: Allow custom profiler here.
7977
7978 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7979
7980         * typemanager.cs (LookupType):
7981           - Use a static char [], because split takes
7982             a param array for args, so it was allocating
7983             every time.
7984           - Do not store true in a hashtable, it boxes.
7985
7986 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7987
7988         * flowanalysis.cs: bytify common enums.
7989
7990 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7991
7992         * modifiers.cs: Add a new set of flags for the
7993         flags allowed on explicit interface impls.
7994         * cs-parser.jay: catch the use of modifiers in
7995         interfaces correctly.
7996         * class.cs: catch private void IFoo.Blah ().
7997
7998         All related to bug #50572.
7999
8000 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8001
8002         * decl.cs: Rewrite the consistant accessability checking.
8003         Accessability is not linear, it must be implemented in
8004         a tableish way. Fixes #49704.
8005
8006 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8007
8008         * expression.cs: Handle negation in a checked context.
8009         We must use subtraction from zero. Fixes #38674.
8010
8011 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8012
8013         * class.cs: Ignore static void main in DLLs.
8014         * rootcontext.cs: Handle the target type here,
8015         since we are have to access it from class.cs
8016         * driver.cs: account for the above.
8017
8018 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8019
8020         * report.cs: Give line numbers and files if available.
8021
8022 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8023
8024         * driver.cs: Implement /addmodule.
8025
8026         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8027         ModuleBuilders.
8028
8029 2003-12-20  Martin Baulig  <martin@ximian.com>
8030
8031         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8032         (FieldBase.IsAssigned): Removed this field.
8033         (FieldBase.SetAssigned): New public method.
8034         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8035
8036 2003-12-20  Martin Baulig  <martin@ximian.com>
8037
8038         * expression.cs (LocalVariableReference.DoResolve): Don't set
8039         `vi.Used' if we're called from DoResolveLValue().
8040
8041         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8042         returns the usage vector it just merged into the current one -
8043         pass this one to UsageWarning().
8044         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8045         of the `EmitContext', don't call this recursively on our children.
8046
8047 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8048
8049         * driver.cs: Implement /target:module.
8050
8051 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8052
8053         * support.cs (CharArrayHashtable): New helper class.
8054
8055         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8056         char arrays, not strings, so we can avoid creating a string in
8057         consume_identifier if the identifier is a keyword.
8058
8059 2003-12-16  Martin Baulig  <martin@ximian.com>
8060
8061         * statement.cs (LocalInfo.Assigned): Removed this property.
8062         (LocalInfo.Flags): Removed `Assigned'.
8063         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8064         and uses flow analysis.
8065         (Block.UsageWarning): Made this method private.
8066         (Block.Resolve): Call UsageWarning() if appropriate.
8067
8068         * expression.cs (LocalVariableReference.DoResolve): Always set
8069         LocalInfo.Used here.
8070
8071 2003-12-13  Martin Baulig  <martin@ximian.com>
8072
8073         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8074         any value here; we're now using flow analysis to figure out
8075         whether a statement/block returns a value.
8076
8077 2003-12-13  Martin Baulig  <martin@ximian.com>
8078
8079         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8080         working again.
8081         (FlowBranching.MergeFinally): Don't call
8082         `branching.CheckOutParameters()' here, this is called in
8083         MergeTopBlock().
8084         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8085         when adding the `finally' vector.       
8086
8087 2003-12-13  Martin Baulig  <martin@ximian.com>
8088
8089         * flowanalysis.cs
8090         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8091         actually work and also fix #48962.
8092
8093 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8094
8095         * decl.cs: Do not check System.Object for nested types,
8096         since we know it does not have any. Big bang for buck:
8097
8098         BEFORE:
8099            Run 1:   8.35 seconds
8100            Run 2:   8.32 seconds
8101            corlib:  17.99 seconds
8102         AFTER:
8103            Run 1:   8.17 seconds
8104            Run 2:   8.17 seconds
8105            corlib:  17.39 seconds
8106
8107 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8108
8109         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8110         time we are returning 0 members, so we save alot here.
8111
8112 2003-12-11  Martin Baulig  <martin@ximian.com>
8113
8114         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8115         `MergeChild()', also just take the `FlowBranching' as argument;
8116         call Merge() on it and return the result.
8117         (FlowBranching.Merge): We don't need to do anything if we just
8118         have one sibling.
8119
8120 2003-12-11  Martin Baulig  <martin@ximian.com>
8121
8122         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8123         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8124         Maurer for this idea.
8125
8126 2003-12-11  Martin Baulig  <martin@ximian.com>
8127
8128         * flowanalysis.cs (MergeResult): This class is now gone; we now
8129         use the `UsageVector' for this.  The reason for this is that if a
8130         branching just has one sibling, we don't need to "merge" them at
8131         all - that's the next step to do.
8132         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8133         `MergeResult'.
8134
8135 2003-12-11  Martin Baulig  <martin@ximian.com>
8136
8137         Reworked flow analyis and made it more precise and bug-free.  The
8138         most important change is that we're now using a special `Reachability'
8139         class instead of having "magic" meanings of `FlowReturns'.  I'll
8140         do some more cleanups and optimizations and also add some more
8141         documentation this week.
8142
8143         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8144         largely reworked this class.
8145         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8146         the new `Reachability' class instead of having "magic" values here.
8147         (FlowBranching): We're now using an instance of `Reachability'
8148         instead of having separate `Returns', `Breaks' etc. fields.
8149
8150         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8151         based on flow analysis; ignore the return value of block.Emit ().
8152
8153 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8154
8155         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8156         if they are private.
8157
8158 2003-12-09  Martin Baulig  <martin@ximian.com>
8159
8160         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8161         call them directly on the UsageVector.
8162
8163 2003-12-09  Martin Baulig  <martin@ximian.com>
8164
8165         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8166         Changed return type from `FlowReturns' to `Reachability'.
8167
8168 2003-12-09  Martin Baulig  <martin@ximian.com>
8169
8170         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8171         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8172         `Reachable' fields with a single `Reachability' one.
8173
8174 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8175
8176         * class.cs (FindMembers): Remove foreach's.
8177
8178         Bootstrap times:
8179
8180         BEFORE
8181                 Run 1:   8.74 seconds
8182                 Run 2:   8.71 seconds
8183
8184         AFTER
8185                 Run 1:   8.64 seconds
8186                 Run 2:   8.58 seconds
8187
8188
8189 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8190
8191         * cs-parser.jay:
8192         * gen-treedump.cs:
8193         * statement.cs:
8194         This patch does a few things:
8195                 1. EmptyStatement is now a singleton, so it is never reallocated.
8196                 2. All blah is EmptyStatement constructs have been changed to
8197                    blah == EmptyStatement.Value, which is much faster and valid
8198                    now that EmptyStatement is a singleton.
8199                 3. When resolving a block, rather than allocating a new array for
8200                    the non-empty statements, empty statements are replaced with
8201                    EmptyStatement.Value
8202                 4. Some recursive functions have been made non-recursive.
8203         Mainly the performance impact is from (3), however (1) and (2) are needed for
8204         this to work. (4) does not make a big difference in normal situations, however
8205         it makes the profile look saner.
8206
8207         Bootstrap times:
8208
8209         BEFORE
8210         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8211         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8212         Total memory allocated: 56397 KB
8213
8214         AFTER
8215         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8216         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8217         Total memory allocated: 55666 KB
8218
8219 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8220
8221         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8222         than the hashtable in a hashtable version
8223
8224         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8225         we always end up concating a string. This results in a huge perf
8226         loss, because many strings have to be tracked by the GC. In this
8227         patch, we first use a hashtable that works with two keys, so that
8228         the strings do not need to be concat'ed.
8229
8230         Bootstrap times:
8231         BEFORE
8232                 Run 1:   8.74 seconds
8233                 Run 2:   8.71 seconds
8234
8235         AFTER
8236                 Run 1:   8.65 seconds
8237                 Run 2:   8.56 seconds
8238
8239 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8240
8241         * Makefile: Add a new target `do-time' that does a quick and simple
8242         profile, leaving easy to parse output.
8243
8244 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8245
8246         * codegen.cs (Init): Create the dynamic assembly with 
8247         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8248
8249 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8250
8251         * support.cs: Make the PtrHashtable use only one
8252         instance of its comparer.
8253
8254 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8255
8256         * typemanager.cs: Fix lookup of GetNamespaces.
8257
8258 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8259
8260         * expression.cs: Removed redundant line.
8261
8262         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8263         ArrayLists, use for loops with bounds.  
8264
8265         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8266         arraylist.
8267
8268         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8269         arraylists, use for loop with bounds.
8270
8271         The above three changes give us a 0.071 second performance
8272         improvement out of 3.294 seconds down to 3.223.  On my machine
8273         the above changes reduced the memory usage by 1,387 KB during
8274         compiler bootstrap.
8275
8276         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8277         QualifiedIdentifiers.  Before we created a new string through
8278         concatenation, and mostly later on, the result would be
8279         manipulated by DecomposeQI through string manipulation.
8280
8281         This reduced the compiler memory usage for bootstrapping from
8282         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8283         compile times in 0.05 seconds.
8284
8285 2003-11-28  Dick Porter  <dick@ximian.com>
8286
8287         * support.cs: Do string compares with the Invariant culture.
8288
8289         * rootcontext.cs: 
8290         * gen-treedump.cs: 
8291         * expression.cs: 
8292         * driver.cs: 
8293         * decl.cs: 
8294         * codegen.cs: 
8295         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8296         the comparison is done with the Invariant culture.
8297
8298 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8299
8300         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8301         GetEnumerator method.
8302
8303         (ProbeCollectionType): Iterate starting at the most specific type
8304         upwards looking for a GetEnumerator
8305
8306         * expression.cs: Shift count can be up to 31 for int/uint and 63
8307         for long/ulong.
8308
8309 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8310
8311         * statement.cs (Block.LookupLabel): Also look for the label on the
8312         children blocks.  Use a hash table to keep track of visited
8313         nodes. 
8314
8315         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8316         we actually did transform the other operand, otherwise fall back
8317         to the common codepath that casts to long.
8318
8319         * cs-tokenizer.cs: Use the same code pattern as the int case.
8320         Maybe I should do the parsing myself, and avoid depending on the
8321         Parse routines to get this done.
8322
8323 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8324
8325         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8326         which fixes bug 51347.  This time test it.
8327
8328         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8329         attributes for example can not tell the difference between these.
8330         The difference was only a syntax feature of the language. 
8331
8332         * attribute.cs: Apply attributes to delegates.
8333
8334         * delegate.cs: Call the apply attributes method.
8335
8336 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8337
8338         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8339         comparing 0 vs Byte.MinValue, not the value
8340
8341         (ImplicitConversionRequired): When reporting a conversion error,
8342         use error 31 to print out the constant error instead of the
8343         simpler 29.
8344
8345         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8346         which fixes bug 51347.
8347
8348 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8349
8350         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8351         which fixes the -warnaserror command line option.
8352
8353 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8354
8355         * cfold.cs (DoNumericPromotions): During constant folding of
8356         additions on UIntConstant, special case intconstants with
8357         IntConstants like we do on the expression binary operator. 
8358
8359 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8360
8361         * convert.cs (ImplicitReferenceConversion): We were missing a case
8362         (System.Enum are not value types or class types, so we need to
8363         classify them separatedly).
8364
8365         * driver.cs: We do not support error 2007.
8366
8367 2003-11-12 Jackson Harper <jackson@ximian.com>
8368
8369         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8370         system directory. Also use the full file name so users can
8371         libraries names mscorlib-o-tron.dll in a non system dir.
8372
8373 2003-11-10  Martin Baulig  <martin@ximian.com>
8374
8375         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8376         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8377         calling `ResolveType()' on them, directly assign their `Type'.
8378
8379 2003-11-08  Martin Baulig  <martin@ximian.com>
8380
8381         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8382         return value and the `out parent' parameter.
8383         (TypeContainer.DefineType): Moved the CS0644 check into
8384         GetClassBases().  Don't pass the interface types to the
8385         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8386         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8387
8388         * ecore.cs (TypeExpr.IsAttribute): New property.
8389         (TypeExpr.GetInterfaces): New method.
8390
8391         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8392         TypeExpr instead of a Type.
8393         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8394         (Interface.DefineType): Don't pass the interface types to the
8395         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8396         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8397
8398         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8399         instead of a `Type[]'.
8400         (TypeManager.RegisterBuilder): Likewise.
8401         (TypeManager.AddUserInterface): Likewise.
8402         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8403         `Type[]' and also return a `TypeExpr[]'.
8404         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8405
8406 2003-11-08  Martin Baulig  <martin@ximian.com>
8407
8408         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8409         Expression.     
8410
8411 2003-11-08  Martin Baulig  <martin@ximian.com>
8412
8413         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8414         TypeManager.ResolveExpressionTypes().
8415
8416         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8417         instead of an Expression.
8418         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8419         (TypeExpression): New public class; formerly known as `TypeExpr'.
8420
8421         * expression.cs (ComposedCast): Derive from TypeExpr.
8422
8423         * typemanager.cs (TypeManager.system_*_expr): These are now
8424         TypExpr's instead of Expression's.
8425         (TypeManager.ResolveExpressionTypes): New public static function;
8426         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8427         of them.        
8428
8429 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8430
8431         * expression.cs (New.DoResolve): Do not dereference value that
8432         might be a null return.
8433
8434         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8435         sure that the constant value has the right type.  Fixes an
8436         unreported bug, similar to 50425.
8437
8438         * const.cs (Const.LookupConstantValue): Call
8439         ImplicitStandardConversionExists before doing a conversion to
8440         avoid havng the TypeManager.ChangeType do conversions.
8441
8442         Reduced the number of casts used
8443
8444         (Const.ChangeType): New routine to enable reuse of the constant
8445         type changing code from statement.
8446
8447         * typemanager.cs (ChangeType): Move common initialization to
8448         static global variables.
8449
8450         Fixes #50425.
8451
8452         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8453         every value type to go through, even if it was void.  Fix that. 
8454
8455         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8456         character of the define, and the is_identifier_part_character for
8457         the rest of the string.
8458
8459 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8460
8461         * expression.cs (UnaryMutator.EmitCode): When I updated
8462         LocalVariableReference.DoResolve, I overdid it, and dropped an
8463         optimization done on local variable references.
8464
8465 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8466
8467         * ecore.cs: Convert the return from Ldlen into an int.
8468
8469 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8472         the accessibility, this is a special case for toplevel non-public
8473         classes (internal for instance).
8474
8475 2003-10-20  Nick Drochak <ndrochak@gol.com>
8476
8477         * ecore.cs: Fix typo and build.  Needed another right paren.
8478
8479 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8480
8481         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8482         `internal' case regular and protected, but not allowing protected
8483         to be evaluated later.  Bug 49840
8484
8485 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8486
8487         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8488         to kb.Nlast, and not the kb.nFirst to isolate the switch
8489         statement.
8490
8491         Extract the underlying type, so enumerations of long/ulong are
8492         treated like long/ulong.
8493
8494 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8495
8496         * expression.cs (New): Overload the meaning of RequestedType to
8497         track the possible creation of the NewDelegate type, since
8498         DoResolve is invoked more than once for new constructors on field
8499         initialization.
8500
8501         See bugs: #48800 and #37014
8502
8503         * cs-parser.jay (declare_local_constants): Take an arraylist
8504         instead of a single constant.
8505
8506         (local_constant_declaration): It should take a
8507         constant_declarators, not a constant_declarator.  Fixes 49487
8508
8509         * convert.cs: Fix error report.
8510
8511 2003-10-13 Jackson Harper <jackson@ximian.com>
8512
8513         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8514         bug #49611
8515
8516 2003-10-09  Martin Baulig  <martin@ximian.com>
8517
8518         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8519         to the .ctor.
8520         (MethodCore.DoDefineParameters): Removed the TypeContainer
8521         argument; use the DeclSpace which was passed to the .ctor instead.
8522         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8523         TypeContainer; we only need a DeclSpace here.
8524
8525 2003-10-09  Martin Baulig  <martin@ximian.com>
8526
8527         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8528         to the .ctor.
8529         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8530         EmitContext's .ctor.    
8531
8532 2003-10-09  Martin Baulig  <martin@ximian.com>
8533
8534         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8535         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8536         AsAccessible(), moved them as well.
8537
8538         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8539
8540 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8541
8542         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8543
8544 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8545
8546         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8547         generation for >=, as spotted by Paolo, bug 48679.  
8548         Patch from David Waite.
8549
8550         * cs-tokenizer.cs: Add handling for #pragma.
8551
8552         * cs-parser.jay: Allow for both yield and yield return in the
8553         syntax.  The anti-cobolization of C# fight will go on!
8554
8555         * class.cs (TypeBuilder.DefineType): Catch error condition here
8556         (Parent.DefineType erroring out and returning null).
8557
8558         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8559         coping with enumerations variables, we were mistakenly processing
8560         them as a regular value type instead of built-in types.  Fixes the
8561         bug #48063
8562
8563         * typemanager.cs (IsBuiltinOrEnum): New method.
8564
8565 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8566
8567         * cs-parser.jay: Upgrade: yield now needs the return clause.
8568
8569 2003-09-19  Martin Baulig  <martin@ximian.com>
8570
8571         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8572         `MemberCache parent' argument.  Normally, an interface doesn't
8573         have a parent type except System.Object, but we use this in gmcs
8574         for generic type parameters.
8575
8576 2003-09-18  Martin Baulig  <martin@ximian.com>
8577
8578         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8579         on `type.IsInterface'; don't check whether the type has a parent
8580         to determine whether it's an interface.
8581
8582 2003-09-15  Martin Baulig  <martin@ximian.com>
8583
8584         * class.cs (TypeContainer.DefineType): Added an error flag to
8585         avoid reporting duplicate CS0146's ("class definition is
8586         circular.").
8587
8588         * driver.cs (Driver.MainDriver): Abort if
8589         RootContext.ResolveTree() reported any errors.
8590
8591 2003-09-07  Martin Baulig  <martin@ximian.com>
8592
8593         * report.cs (Error, Warning): Added overloaded versions which take
8594         a `params object[] args' and call String.Format().
8595
8596 2003-09-07  Martin Baulig  <martin@ximian.com>
8597
8598         * decl.cs (DeclSpace..ctor): Don't call
8599         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8600         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8601         (DeclSpace.RecordDecl): New method.
8602
8603         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8604
8605 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8606
8607         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8608         value attributes to be applied to ParameterBuilders.
8609
8610         * class.cs (MethodCore.LabelParameters): Make static and more
8611         generic so that it can be used from other places - like interface
8612         methods, for instance.
8613
8614         * interface.cs (Interface.Emit): Call LabelParameters before
8615         emitting attributes on the InterfaceMethod.
8616
8617 2003-08-26  Martin Baulig  <martin@ximian.com>
8618
8619         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8620         resolving aliases; fixes #47927.
8621
8622 2003-08-26  Martin Baulig  <martin@ximian.com>
8623
8624         * statement.cs (Using.DoResolve): This is internally emitting a
8625         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8626         do not always return.  Fixes #47681.
8627
8628 2003-08-26  Martin Baulig  <martin@ximian.com>
8629
8630         * decl.cs (MemberCore): Moved WarningNotHiding(),
8631         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8632         into MemberBase.
8633         (AdditionResult): Make this nested in DeclSpace.
8634         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8635         argument; call NamespaceEntry.Define() unless we're nested in a
8636         class or struct.
8637
8638         * namespace.cs (Namespace.DefineName): New public function.  This
8639         is called from DeclSpace's .ctor to add 
8640         (Namespace.Lookup): Include DeclSpaces in the lookup.
8641
8642         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8643
8644         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8645
8646 2003-08-25  Martin Baulig  <martin@ximian.com>
8647
8648         * convert.cs (Convert.ExplicitReferenceConversion): When
8649         converting from an interface type to a class, unbox if the target
8650         type is a struct type.  Fixes #47822.
8651
8652 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8653
8654         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8655         #47854.
8656
8657 2003-08-22  Martin Baulig  <martin@ximian.com>
8658
8659         * class.cs (TypeManager.DefineType): When defining a nested type,
8660         call DefineType() on our parent; fixes #47801.
8661
8662 2003-08-22  Martin Baulig  <martin@ximian.com>
8663
8664         * class.cs (MethodData.Define): While checking if a method is an
8665         interface implementation, improve the test a bit more to fix #47654.
8666
8667 2003-08-22  Martin Baulig  <martin@ximian.com>
8668
8669         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8670         correctly; fixes #47722.
8671
8672 2003-08-22  Martin Baulig  <martin@ximian.com>
8673
8674         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8675         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8676
8677         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8678
8679 2003-08-22  Martin Baulig  <martin@ximian.com>
8680
8681         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8682         can only be assigned in static constructors.  Fixes #47161.
8683
8684 2003-08-22  Martin Baulig  <martin@ximian.com>
8685
8686         Rewrote and improved the flow analysis code.
8687
8688         * flowbranching.cs (FlowBranching): Make this class abstract.
8689         (FlowBranching.CreateBranching): New static function to create a
8690         new flow branching.
8691         (FlowBranchingBlock, FlowBranchingException): New classes.
8692         (FlowBranching.UsageVector.Type): New public readonly field.
8693         (FlowBranching.UsageVector.Breaks): Removed the setter.
8694         (FlowBranching.UsageVector.Returns): Removed the setter.
8695         (FlowBranching.UsageVector): Added Break(), Return(),
8696         NeverReachable() and Throw() methods to modify the reachability.
8697         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8698         done by FlowBranching.Merge().
8699         (FlowBranching.UsageVector.MergeChild): New method; merges the
8700         merge result into the current vector.
8701         (FlowBranching.Merge): New abstract method to merge a branching.
8702
8703 2003-08-12  Martin Baulig  <martin@ximian.com>
8704
8705         * expression.cs (Indirection.CacheTemporaries): Create the
8706         LocalTemporary with the pointer type, not its element type.
8707
8708 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8709
8710         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8711         token was a keyword or not.
8712
8713         Add `error' options where an IDENTIFIER was expected;  Provide
8714         CheckToken and CheckIdentifierToken convenience error reporting
8715         functions. 
8716
8717         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8718
8719         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8720         NameSpaceEntry NameSpaceEntry.
8721
8722         (LookupInterfaceOrClass): Avoid creating a full qualified name
8723         from namespace and name: avoid doing lookups when we know the
8724         namespace is non-existant.   Use new Tree.LookupByNamespace which
8725         looks up DeclSpaces based on their namespace, name pair.
8726
8727         * driver.cs: Provide a new `parser verbose' to display the
8728         exception thrown during parsing.  This is turned off by default
8729         now, so the output of a failure from mcs is more graceful.
8730
8731         * namespace.cs: Track all the namespaces defined in a hashtable
8732         for quick lookup.
8733
8734         (IsNamespace): New method
8735
8736 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8737
8738         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8739         we know that we need to concatenate (full typename can never be
8740         null). 
8741
8742         * class.cs: ditto.
8743
8744         * statement.cs: Use a bitfield;  Do not initialize to null things
8745         which are done by the constructor by default.
8746
8747         * cs-parser.jay: bug fix, parameter was 4, not 3.
8748
8749         * expression.cs: Just use the property;
8750
8751         * statement.cs: No need for GetVariableInfo method.
8752
8753 2003-08-08  Martin Baulig  <martin@ximian.com>
8754
8755         * flowanalysis.cs (FlowReturns): This is now nested in the
8756         `FlowBranching' class.
8757         (MyBitVector): Moved this here from statement.cs.
8758         (FlowBranching.SiblingType): New enum type.
8759         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8760
8761 2003-08-07  Martin Baulig  <martin@ximian.com>
8762
8763         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8764         `FlowBranching' class and called `BranchingType'.
8765
8766 2003-08-07  Martin Baulig  <martin@ximian.com>
8767
8768         * flowanalysis.cs: Moved all the control flow analysis code into
8769         its own file.
8770
8771 2003-08-07  Martin Baulig  <martin@ximian.com>
8772
8773         * assign.cs (Assign.DoResolve): `target' must either be an
8774         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8775         #37319.
8776
8777 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8778
8779         * expression.cs (BinaryMethod): This kind of expression is created by the
8780         Binary class if it determines that the operator has to be handled
8781         by a method.
8782
8783         (BinaryDelegate): This kind of expression is created if we are
8784         dealing with a + or - operator on delegates.
8785
8786         (Binary): remove method, argumetns, and DelegateOperator: when
8787         dealing with methods, 
8788
8789         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8790
8791         * statement.cs (Block): use bitfields for the three extra booleans
8792         we had in use.   Remove unused topblock parameter.
8793
8794         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8795
8796         * assign.cs: Drop extra unneeded tests.
8797
8798 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8799
8800         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8801
8802         * statement.cs (Foreach): Use VariableStorage instead of
8803         LocalBuilders.   
8804
8805         * codegen.cs (VariableStorage): New class used by clients that
8806         require a variable stored: locals or fields for variables that
8807         need to live across yield.
8808
8809         Maybe provide a convenience api for EmitThis+EmitLoad?
8810
8811         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8812         these bad boys.
8813
8814 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8815
8816         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8817         RemapParameterLValue): New methods that are used to turn a
8818         precomputed FieldInfo into an expression like this:
8819
8820                 instance.FieldInfo
8821
8822         The idea is to use this instead of making LocalVariableReference
8823         have more than one meaning.
8824
8825         * cs-parser.jay: Add error production to BASE.
8826
8827         * ecore.cs: Deal with TypeManager.GetField returning null, which
8828         is now a valid return value.
8829
8830         (FieldExprNoAddress): New expression for Fields whose address can
8831         not be taken.
8832
8833         * expression.cs (LocalVariableReference): During the resolve
8834         phases, create new expressions if we are in a remapping context.
8835         Remove code that dealt with remapping here.
8836
8837         (ParameterReference): same.
8838
8839         (ProxyInstance): New expression, like the `This' expression, but
8840         it is born fully resolved.  We know what we are doing, so remove
8841         the errors that are targeted to user-provided uses of `this'.
8842
8843         * statement.cs (Foreach): our variable is now stored as an
8844         Expression;  During resolution, follow the protocol, dont just
8845         assume it will return this.
8846
8847 2003-08-06  Martin Baulig  <martin@ximian.com>
8848
8849         * support.cs (SeekableStreamReader.cs): New public class.
8850
8851         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8852         SeekableStreamReader instead of the normal StreamReader.
8853
8854 2003-08-04  Martin Baulig  <martin@ximian.com>
8855
8856         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8857         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8858         deambiguate casts and delegate invocations.
8859         (parenthesized_expression): Use the new tokens to ensure this is
8860         not a cast of method invocation.
8861
8862         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8863         when reading a `)' and Deambiguate_CloseParens () was previously
8864         called.
8865
8866         * expression.cs (ParenthesizedExpression): New class.  This is
8867         just used for the CS0075 test.
8868         (Binary.DoResolve): Check for CS0075.   
8869
8870 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8871
8872         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8873         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8874         reference comparison.
8875
8876         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8877         examine the ReturnType for equality - this is necessary in the
8878         cases of implicit and explicit operators whose signature also
8879         includes the return type.
8880
8881 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8882
8883         * namespace.cs: Cache the result of the namespace computation,
8884         instead of computing it every time.
8885
8886 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8887
8888         * decl.cs: Use a global arraylist that we reuse over invocations
8889         to avoid excesive memory consumption.  Reduces memory usage on an
8890         mcs compile by one meg (45 average).
8891
8892         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8893         private, work around that.
8894
8895 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8896
8897         * literal.cs (IntLiteral): Define Zero and One static literals. 
8898
8899         * cs-parser.jay (integer_literal): use static literals to reduce
8900         memory usage for the most used literals (0, 1 and -1).  211kb
8901         reduced in memory usage.
8902
8903         Replace all calls to `new ArrayList' with `new
8904         ArrayList(4)' which is a good average number for most allocations,
8905         and also requires only 16 bytes of memory for its buffer by
8906         default. 
8907
8908         This reduced MCS memory usage in seven megabytes for the RSS after
8909         bootstrapping.
8910
8911 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8912
8913         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8914         handle params methods the correct way by forming only one
8915         applicable set with params and normal methods in them. Earlier we
8916         were looking at params methods only if we found no normal methods
8917         which was not the correct thing to do.
8918
8919         (Invocation.BetterFunction): Take separate arguments indicating
8920         when candidate and the best method are params methods in their
8921         expanded form.
8922
8923         This fixes bugs #43367 and #46199.
8924
8925         * attribute.cs: Documentation updates.
8926
8927         (CheckAttribute): Rename to CheckAttributeTarget.
8928         (GetValidPlaces): Rename to GetValidTargets.
8929
8930         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8931         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8932
8933         Fixes bug #44468.
8934
8935 2003-07-28  Martin Baulig  <martin@ximian.com>
8936
8937         * class.cs (TypeContainer.DefineMembers): Use the base type's full
8938         name when looking up the base class of a nested class.  Fixes #46977.
8939
8940 2003-07-26  Martin Baulig  <martin@ximian.com>
8941
8942         * expression.cs (Indexers.Indexer): New nested struct; contains
8943         getter, setter and the indexer's type.
8944         (Indexers.Properties): This is now an ArrayList of
8945         Indexers.Indexer's.
8946         (IndexerAccess.DoResolveLValue): Correctly set the type if the
8947         indexer doesn't have any getters.
8948
8949         * assign.cs (Assign.DoResolve): Also do the implicit conversions
8950         for embedded property and indexer assignments.
8951
8952 2003-07-26  Martin Baulig  <martin@ximian.com>
8953
8954         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
8955         preprocessor directive is not the first non-whitespace character
8956         on a line.
8957
8958 2003-07-26  Martin Baulig  <martin@ximian.com>
8959
8960         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
8961         namespace parsing, follow the spec more closely.
8962
8963         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
8964         NamespaceEntry.Lookup().
8965
8966 2003-07-25  Martin Baulig  <martin@ximian.com>
8967
8968         * MethodCore.cs (OverridesSomething): New public field; it's set
8969         from TypeContainer.DefineMembers if this method overrides
8970         something (which doesn't need to be a method).  Fix #39462.
8971
8972 2003-07-25  Ravi Pratap  <ravi@ximian.com>
8973
8974         * typemanager.cs (GetMembers): Ensure that the list of members is
8975         reversed. This keeps things in sync.
8976
8977         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
8978         find an AttributeUsage attribute.
8979
8980         * expression.cs (Invocation.OverloadResolve): Perform the check
8981         which disallows Invoke to be directly called on a Delegate.
8982
8983         (Error_InvokeOnDelegate): Report error cs1533.
8984
8985 2003-07-25  Martin Baulig  <martin@ximian.com>
8986
8987         * expression.cs (Indexers.GetIndexersForType): Only look in the
8988         interface hierarchy if the requested type is already an
8989         interface.  Fixes #46788 while keeping #46502 fixed.
8990
8991 2003-07-25  Martin Baulig  <martin@ximian.com>
8992
8993         * class.cs (TypeContainer.DefineMembers): Check whether all
8994         readonly fields have been assigned and report warning CS0649 if
8995         not.
8996
8997         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8998         a valuetype.
8999
9000 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9001
9002         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9003         returned from GetMethods to make things consistent with the
9004         assumptions MCS makes about ordering of methods.
9005
9006         This should comprehensively fix bug #45127 and it does :-)
9007
9008         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9009         ordering is actually reverse.
9010
9011         * Clean up some debug messages I left lying around.
9012
9013         * interface.cs (Populate*): Get rid of code which emits attributes
9014         since the stage in which we emit attributes is the 'Emit' stage,
9015         not the define stage.
9016
9017         (Emit): Move attribute emission for interface members here.
9018
9019 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9020
9021         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9022         closely: we eliminate methods in base types when we have an
9023         applicable method in a top-level type.
9024
9025         Please see section 14.5.5.1 for an exact description of what goes
9026         on. 
9027
9028         This fixes bug #45127 and a host of other related to corlib compilation.
9029
9030         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9031         array is the method corresponding to the top-level type (this is
9032         because of the changes made to icall.c) so we change this
9033         accordingly.
9034
9035         (MethodGroupExpr.Name): This too.
9036
9037         * typemanager.cs (GetElementType): New method which does the right
9038         thing when compiling corlib. 
9039
9040         * everywhere: Make use of the above in the relevant places.
9041
9042 2003-07-22  Martin Baulig  <martin@ximian.com>
9043
9044         * cs-parser.jay (invocation_expression): Moved
9045         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9046         `cast_expression', but create a InvocationOrCast which later
9047         resolves to either an Invocation or a Cast.
9048
9049         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9050         method; call this before EmitStatement() to make sure that this
9051         expression can be used as a statement.
9052
9053         * expression.cs (InvocationOrCast): New class; resolves to either
9054         an Invocation or a Cast.
9055
9056         * statement.cs (StatementExpression): Call ResolveStatement() on
9057         the ExpressionStatement before emitting it.
9058
9059 2003-07-21  Martin Baulig  <martin@ximian.com>
9060
9061         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9062         `ref' and `out' attributes match; fixes #46220.
9063         (MemberAccess.ResolveMemberAccess): You can't reference a type
9064         through an expression; fixes #33180.
9065         (Indexers.GetIndexersForType): Don't return the indexers from
9066         interfaces the class implements; fixes #46502.
9067
9068 2003-07-21  Martin Baulig  <martin@ximian.com>
9069
9070         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9071         CS0661 checks; fixes bug #30442.
9072
9073 2003-07-21  Martin Baulig  <martin@ximian.com>
9074
9075         * decl.cs (AdditionResult): Added `Error'.
9076
9077         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9078
9079         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9080         makes cs0031.cs actually work.
9081
9082 2003-07-20  Martin Baulig  <martin@ximian.com>
9083
9084         * namespace.cs: Fixed that bug which caused a crash when compiling
9085         the debugger's GUI.
9086
9087 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9088
9089         * typemanager.cs (LookupTypeReflection): Never expose types which
9090         are NotPublic, NestedPrivate, NestedAssembly, or
9091         NestedFamANDAssem.  We used to return these, and later do a check
9092         that would report a meaningful error, but the problem is that we
9093         would not get the real match, if there was a name override.
9094
9095 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9096
9097         * namespace.cs (Namespace, Name): Do not compute the namespace
9098         name dynamically, compute it in the constructor.  This reduced
9099         memory usage by 1697 KB.
9100
9101         * driver.cs: Use --pause to pause at the end.
9102
9103 2003-07-17  Peter Williams  <peter@newton.cx>
9104
9105         * Makefile: Change the name of the test target so that it doesn't
9106         conflict with the recursive test target.
9107
9108 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9109
9110         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9111         AddressOf): Do not use EmitThis, that was wrong, use the actual
9112         this pointer.
9113
9114 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9115
9116         * class.cs (MethodData.Define): While checking if a method is an
9117         interface implementation, improve the test: If we are not public
9118         (use new test here: use the computed MethodAttributes directly,
9119         instead of the parsed modifier flags) check if the `implementing'
9120         method comes from an interface or not.
9121
9122         * pending.cs (VerifyPendingMethods): Slightly better error
9123         message.
9124
9125         * makefile: add test target that does the mcs bootstrap.
9126
9127 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9128
9129         * interface.cs (Define): Do nothing here since there are no
9130         members to populate etc. Move the attribute emission out of here
9131         since this was just totally the wrong place to put it. Attribute
9132         application happens during the 'Emit' phase, not in the 'Define'
9133         phase.
9134
9135         (Emit): Add this method and move the attribute emission here
9136
9137         * rootcontext.cs (EmitCode): Call the Emit method on interface
9138         types too.
9139
9140 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9141
9142         * expression.cs (OverloadResolve): Report error only if Location
9143         is not 'Null' which means that there was a probe going on.
9144
9145 2003-07-14  Martin Baulig  <martin@ximian.com>
9146
9147         * expression.cs (ConditionalLogicalOperator): New public class to
9148         implement user defined conditional logical operators.
9149         This is section 14.11.2 in the spec and bug #40505.
9150
9151 2003-07-14  Martin Baulig  <martin@ximian.com>
9152
9153         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9154
9155 2003-07-14  Martin Baulig  <martin@ximian.com>
9156
9157         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9158
9159         * ecore.cs (IVariable.VerifyFixed): New interface method.
9160
9161         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9162         operator, check whether the variable is actually fixed.  Fixes bug
9163         #36055.  Set a variable definitely assigned when taking its
9164         address as required by the spec.
9165
9166         * statement.cs (LocalInfo.IsFixed): New field.
9167         (LocalInfo.MakePinned): Set `IsFixed' to true.
9168
9169 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9170
9171         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9172         for .ctors, ensure that we only ask for members declared in the
9173         attribute type (BindingFlags.DeclaredOnly).
9174
9175         Fixes bug #43632.
9176
9177         * expression.cs (Error_WrongNumArguments): Report error 1501
9178         correctly the way CSC does.
9179
9180 2003-07-13  Martin Baulig  <martin@ximian.com>
9181
9182         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9183         lookup on the fully qualified name, to make things like "X.X" work
9184         where "X.X" is a fully qualified type name, but we also have a
9185         namespace "X" in the using list.  Fixes #41975.
9186
9187 2003-07-13  Martin Baulig  <martin@ximian.com>
9188
9189         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9190         function. If we're a CompoundAssign, we need to create an embedded
9191         CompoundAssign, not an embedded Assign.
9192         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9193         Fixes #45854.
9194
9195 2003-07-13  Martin Baulig  <martin@ximian.com>
9196
9197         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9198         work to fix bug #46088.
9199
9200 2003-07-13  Ravi Pratap <ravi@ximian.com>
9201
9202         * class.cs (Operator.Emit): Do not emit attributes here - it is
9203         taken care of by the Method class that we delegate too. This takes
9204         care of bug #45876.
9205
9206 2003-07-10  Martin Baulig  <martin@ximian.com>
9207
9208         * expression.cs (TypeOfVoid): New class.
9209         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9210
9211 2003-07-10  Martin Baulig  <martin@ximian.com>
9212
9213         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9214         bug #35957.
9215
9216 2003-07-10  Martin Baulig  <martin@ximian.com>
9217
9218         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9219         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9220
9221         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9222
9223         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9224
9225 2003-07-10  Martin Baulig  <martin@ximian.com>
9226
9227         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9228         of decimal.  Fixes #42850.
9229
9230         NOTE: I also fixed the created byte blob, but this doesn't work on
9231         the MS runtime and csc never produces any byte blobs for decimal
9232         arrays.
9233
9234 2003-07-10  Martin Baulig  <martin@ximian.com>
9235
9236         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9237         structs; fixes #32068.
9238         (Block.AddChildVariableNames): Fixed #44302.
9239
9240 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9241
9242         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9243
9244 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9245
9246         * attribute.cs: And this test is onger needed.
9247
9248 2003-07-08  Martin Baulig  <martin@ximian.com>
9249
9250         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9251         inaccessible types.  Fixes #36313.
9252
9253         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9254
9255         * namespace.cs (NamespaceEntry): Create implicit entries for all
9256         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9257         implicit entries for N1.N2 and N1.
9258
9259 2003-07-08  Martin Baulig  <martin@ximian.com>
9260
9261         Rewrote the handling of namespaces to fix a lot of the issues
9262         wrt. `using' aliases etc.
9263
9264         * namespace.cs (Namespace): Splitted this class into a
9265         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9266
9267         * typemanager.cs (TypeManager.IsNamespace): Removed.
9268         (TypeManager.ComputeNamespaces): Only compute namespaces from
9269         loaded assemblies here, not the namespaces from the assembly we're
9270         currently compiling.
9271
9272 2003-07-08  Martin Baulig  <martin@ximian.com>
9273
9274         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9275
9276 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9277
9278         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9279         already fixed it.  
9280
9281         I thought about the memory savings here, but LookupTypeReflection
9282         is used under already very constrained scenarios.  Compiling
9283         corlib or mcs only exposes one hit, so it would not really reduce
9284         any memory consumption.
9285
9286 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9287
9288         * typemanager.cs: fixes bug #45889 by only adding public types from
9289         other assemblies to the list of known types.
9290
9291 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9292
9293         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9294         on the type we resolved.
9295
9296 2003-07-05  Martin Baulig  <martin@ximian.com>
9297
9298         * pending.cs (PendingImplementation.ParentImplements): Don't
9299         create the proxy if the parent is abstract.
9300
9301         * class.cs (TypeContainer.DefineIndexers): Process explicit
9302         interface implementations first.  Fixes #37714.
9303
9304 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9305
9306         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9307         defined recursively;  but since we modify the input parameters
9308         (left is set to `this' temporarily), we reset this value if the
9309         left_is_explicit is false, which gives the original semantics to
9310         the code.  
9311
9312         * literal.cs (NullPointer): new class used to represent a null
9313         literal in a pointer context.
9314
9315         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9316         type is a pointer, use a NullPointer object instead of a
9317         NullLiteral.   Closes 43687
9318
9319         (ExplicitConversion): Convert pointer values using
9320         the conv opcode to the proper type.
9321
9322         * ecore.cs (New): change ValueTypeVariable property into a method,
9323         that returns whether the valuetype is suitable for being used.
9324
9325         * expression.cs (Binary.DoNumericPromotions): Only return if we
9326         the int constant was a valid uint, and we can return both left and
9327         right as uints.  If not, we continue processing, to trigger the
9328         type conversion.  This fixes 39018.
9329
9330         * statement.cs (Block.EmitMeta): During constant resolution, set
9331         the CurrentBlock property on the emitcontext, so that we resolve
9332         constants propertly.
9333
9334 2003-07-02  Martin Baulig  <martin@ximian.com>
9335
9336         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9337         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9338
9339         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9340         than emitting it here.
9341
9342         * statement.cs: Fixed some more flow analysis bugs.
9343
9344 2003-07-02  Martin Baulig  <martin@ximian.com>
9345
9346         * class.cs (MethodData.Define): When implementing interface
9347         methods, set Final unless we're Virtual.
9348
9349         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9350         check work for interface methods.
9351
9352 2003-07-01  Martin Baulig  <martin@ximian.com>
9353
9354         * ecore.cs (EmitContext.This): Replaced this property with a
9355         GetThis() method which takes a Location argument.  This ensures
9356         that we get the correct error location for a CS0188.
9357
9358 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9359
9360         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9361         ImplicitStandardConversion.
9362
9363         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9364
9365 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9366
9367         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9368         optimization.
9369
9370 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9371
9372         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9373         constructors.
9374
9375         (MethodData.Define): Turn off initlocals for unsafe methods.
9376
9377 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9378
9379         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9380         complete;  Fixes #37521.
9381
9382         * delegate.cs: Use Modifiers.TypeAttr to compute the
9383         TypeAttributes, instead of rolling our own.  This makes the flags
9384         correct for the delegates.
9385
9386 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9387
9388         * class.cs (Constructor.Define): Set the private flag for static
9389         constructors as well.
9390
9391         * cs-parser.jay (statement_expression): Set the return value to
9392         null, to avoid a crash when we catch an error.
9393
9394 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9395
9396         * cs-parser.jay: Applied patch from Jackson that adds support for
9397         extern and unsafe modifiers to destructor declarations.
9398
9399         * expression.cs: Report error 21 if the user is trying to index a
9400         System.Array.
9401
9402         * driver.cs: Add an error message, suggested by the bug report.
9403
9404         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9405         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9406
9407 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9408
9409         * namespace.cs: Add some information to reduce FAQs.
9410
9411 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9412
9413         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9414         underlying enumeration types.  Fixes #43915.
9415
9416         * expression.cs: Treat ushort/short as legal values to be used in
9417         bitwise operations.
9418
9419 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9420
9421         * delegate.cs: transfer custom attributes for paramenters from
9422         the delegate declaration to Invoke and BeginInvoke.
9423
9424 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9425
9426         * attribute.cs: handle custom marshalers and emit marshal info
9427         for fields, too.
9428
9429 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9430
9431         * makefile.gnu: Added anonymous.cs to the compiler sources.
9432
9433 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9434
9435         * iterators.cs: Change the name of the proxy class to include two
9436         underscores.
9437
9438         * cs-parser.jay: Update grammar to include anonymous methods.
9439
9440         * anonymous.cs: new file.
9441
9442 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9443
9444         * class.cs (Field.Define): Add missing test for pointers and
9445         safety. 
9446
9447 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9448
9449         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9450         we use the stobj opcode.
9451
9452         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9453         since it wasn't the correct fix. 
9454
9455         It still is puzzling that we are required to use stobj for IntPtr
9456         which seems to be a ValueType.
9457
9458 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9459
9460         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9461         during regular simple name resolution.   Now, the trick is that
9462         instead of returning for processing the simplename, we do a
9463         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9464         contextual lookup type).   If a match is found, return that, if
9465         not, return for further composition.
9466
9467         This fixes long-standing 30485.
9468
9469         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9470         using the address to initialize an object, do an Stobj instead of
9471         using the regular Stelem.
9472
9473         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9474         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9475         Because if we are a BaseIndexerAccess that value will be true.
9476         Fixes 43643.
9477
9478         * statement.cs (GotoCase.Resolve): Return after reporting an
9479         error, do not attempt to continue. 
9480
9481         * expression.cs (PointerArithmetic.Emit): If our operand is a
9482         long, convert our constants to match the operand before
9483         multiplying.  Convert to I type before adding.   Fixes 43670.
9484
9485 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9486
9487         * enum.cs (ImplicitConversionExists) : Rename to
9488         ImplicitEnumConversionExists to remove ambiguity. 
9489
9490         * ecore.cs (NullCast): New type of cast expression class which
9491         basically is very similar to EmptyCast with the difference being
9492         it still is a constant since it is used only to cast a null to
9493         something else
9494         (eg. (string) null)
9495
9496         * convert.cs (ImplicitReferenceConversion): When casting a null
9497         literal, we return a NullCast.
9498
9499         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9500         should be around anymore.
9501
9502         The renaming (reported was slightly wrong). Corrections:
9503
9504         ConvertImplicitStandard -> ImplicitConversionStandard
9505         ConvertExplicitStandard -> ExplicitConversionStandard
9506
9507         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9508         before passing them in !
9509
9510         * convert.cs (ImplicitConversionStandard): When comparing for
9511         equal expr and target types, ensure that expr is not a
9512         NullLiteral.
9513
9514         In general, we must not be checking (expr_type ==
9515         target_type) in the top level conversion methods
9516         (ImplicitConversion, ExplicitConversion etc). This checking is
9517         done in the methods that they delegate to.
9518
9519 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9520
9521         * convert.cs: Move Error_CannotConvertType,
9522         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9523         ImplicitNumericConversion, ImplicitConversionExists,
9524         ImplicitUserConversionExists, StandardConversionExists,
9525         FindMostEncompassedType, FindMostSpecificSource,
9526         FindMostSpecificTarget, ImplicitUserConversion,
9527         ExplicitUserConversion, GetConversionOperators,
9528         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9529         TryImplicitIntConversion, Error_CannotConvertImplicit,
9530         ConvertImplicitRequired, ConvertNumericExplicit,
9531         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9532         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9533         its own file.
9534
9535         Perform the following renames:
9536
9537         StandardConversionExists -> ImplicitStandardConversionExists
9538         ConvertImplicit -> ImplicitConversion
9539         ConvertImplicitStandard -> ImplicitStandardConversion
9540         TryImplicitIntConversion -> ImplicitIntConversion
9541         ConvertImplicitRequired -> ImplicitConversionRequired
9542         ConvertNumericExplicit -> ExplicitNumericConversion
9543         ConvertReferenceExplicit -> ExplicitReferenceConversion
9544         ConvertExplicit -> ExplicitConversion
9545         ConvertExplicitStandard -> ExplicitStandardConversion
9546
9547 2003-05-19  Martin Baulig  <martin@ximian.com>
9548
9549         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9550         (TypeInfo): Added support for structs having structs as fields.
9551
9552         * ecore.cs (FieldExpr): Implement IVariable.
9553         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9554         VariableInfo for the field.
9555
9556 2003-05-18  Martin Baulig  <martin@ximian.com>
9557
9558         * expression.cs (This.DoResolve): Report a CS0027 if we're
9559         emitting a field initializer.
9560
9561 2003-05-18  Martin Baulig  <martin@ximian.com>
9562
9563         * expression.cs (This.ResolveBase): New public function.
9564         (This.DoResolve): Check for CS0188.
9565
9566         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9567         This.Resolve().
9568
9569         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9570         `instance_expression' to null if we don't have any non-static
9571         methods.
9572
9573 2003-05-18  Martin Baulig  <martin@ximian.com>
9574
9575         Reworked the way how local variables and parameters are handled by
9576         the flow analysis code.
9577
9578         * statement.cs (TypeInfo, VariableMap): New public classes.
9579         (VariableInfo): New public class.  This is now responsible for
9580         checking whether a variable has been assigned.  It is used for
9581         parameters and local variables.
9582         (Block.EmitMeta): Take the InternalParameters as argument; compute
9583         the layout of the flow vectors here.
9584         (Block.LocalMap, Block.ParameterMap): New public properties.
9585         (FlowBranching): The .ctor doesn't get the InternalParameters
9586         anymore since Block.EmitMeta() now computes the layout of the flow
9587         vector.
9588         (MyStructInfo): This class is now known as `StructInfo' and nested
9589         in `TypeInfo'; we don't access this directly anymore.
9590
9591         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9592         property and removed IsAssigned(), IsFieldAssigned(),
9593         SetAssigned() and SetFieldAssigned(); we now call them on the
9594         VariableInfo so we don't need to duplicate this code everywhere.
9595
9596         * expression.cs (ParameterReference): Added `Block block' argument
9597         to the .ctor.
9598         (LocalVariableReference, ParameterReference, This): The new
9599         VariableInfo class is now responsible for all the definite
9600         assignment stuff.
9601
9602         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9603         IsParameterAssigned, SetParameterAssigned): Removed.
9604
9605 2003-05-18  Martin Baulig  <martin@ximian.com>
9606
9607         * typemanager.cs (InitCoreTypes): Try calling
9608         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9609         the 3-args-version.  Corlib now also needs our `void_type'.
9610         (GetMethod): Added overloaded version which takes an optional
9611         `bool report_errors' to allow lookups of optional methods.
9612
9613 2003-05-12  Martin Baulig  <martin@ximian.com>
9614
9615         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9616         only used for locals and not for parameters.
9617
9618 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9619
9620         * support.cs (InternalParameters.ParameterType): Return the
9621         ExternalType of the parameter.
9622
9623         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9624         they were unused.
9625
9626 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9627
9628         * class.cs (MethodData.Define): Do not set the `newslot' on
9629         interface members, if they are also flagged as "override".
9630
9631         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9632         better code for ++i and i++.  This only works for static fields
9633         and local variables.
9634
9635         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9636         want to pull the DeclSpace out of the builder_to_declspace instead
9637         of the TypeBuilder (like in TypeContainer.FindMembers).
9638
9639         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9640         instead of LookupTypeContainer.  Fixes the crash on .NET for
9641         looking up interface members.
9642
9643         * const.cs: Create our own emit context during the Definition
9644         stage, so that constants are evaluated in the proper context, when
9645         a recursive definition happens.
9646
9647 2003-05-11  Martin Baulig  <martin@ximian.com>
9648
9649         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9650         new block for a switch section.
9651         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9652         the adding/lookup in the switch block.  Fixes #39828.
9653
9654 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9655
9656         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9657         functionality: I needed to convert the data after I had performed
9658         the add/sub operation into the operands type size.
9659
9660         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9661         pass the type for the box operation, otherwise the resulting
9662         object would have been of type object.
9663
9664         (BoxedCast): Add constructor to specify the type to box as.
9665
9666 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9667
9668         * iterators.cs: I was reusing the `count' variable inadvertently,
9669         take steps to not allow this to happen.
9670
9671 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9672
9673         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9674         by creating an array at the point where the params starts and
9675         putting all those arguments there, then adjusting the size of the
9676         array.
9677
9678 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9679
9680         * expression.cs (New.AddressOf): Implement interface
9681         IMemoryLocation.  This is used when the `new' operator is used in
9682         the context of an invocation to a method on a value type.
9683
9684         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9685         example. 
9686
9687         * namespace.cs: Also check the using aliases here.
9688
9689         * driver.cs: Move the test for using validity after the types have
9690         been entered, so we do a single pass that also includes the using
9691         aliases. 
9692
9693         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9694         in the regular case.   CreateSiblingForFinally is doing extra
9695         error checking.
9696
9697         * attribute.cs (GetAttributeArgumentExpression): Store the result
9698         on an out value, and use the return value to indicate failure
9699         instead of using null (which is a valid return for Constant.GetValue).
9700
9701         * statement.cs: Perform the analysis flow for the increment
9702         portion after the statement, because this will be the real flow of
9703         execution.  Fixes #42385
9704
9705         * codegen.cs (EmitContext.EmitArgument,
9706         EmitContext.EmitStoreArgument): New helper functions when the
9707         RemapToProxy flag is set.
9708
9709         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9710         function.
9711
9712         Add support for remapping parameters. 
9713
9714         * iterators.cs: Propagate parameter values;  Store parameter
9715         values in the proxy classes.
9716
9717 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9720         need a proxy reference;  I do not know what I was thinking
9721
9722         * cs-parser.jay (constructor_initializer): catch another error,
9723         and display nice message.
9724
9725         (field_declaration): catch void field declaration
9726         to flag a better error. 
9727
9728         * class.cs (MemberBase.CheckBase): Report an error instead of a
9729         warning if a new protected member is declared in a struct. 
9730         (Field.Define): catch the error of readonly/volatile.
9731
9732         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9733
9734         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9735         volatile variable is taken
9736
9737 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9738
9739         * statement.cs (Fixed.Resolve): Report an error if we are not in
9740         an unsafe context.
9741
9742 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9743
9744         * typemanager.cs: reuse the code that handles type clashes for
9745         delegates and enumerations.
9746
9747         * class.cs (Report28): Always report.
9748
9749         * expression.cs (EncodeAsAttribute): Allow nulls here.
9750
9751 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9752
9753         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9754         the functionality for testing whether an expression is valid for
9755         an attribute here.  Also handle the case of arrays of elements
9756         being stored. 
9757
9758         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9759         encoding a linear array into an array of objects that are suitable
9760         to be passed to an CustomAttributeBuilder.
9761
9762         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9763
9764         * ecore.cs: (FieldExpr): Handle field remapping here.
9765
9766         * iteratators.cs: Pass the instance variable (if the method is an
9767         instance method) to the constructors, so we can access the field
9768         variables on the class.
9769
9770         TODO: Test this with structs.  I think the THIS variable on
9771         structs might have to be a pointer, and not a refenrece
9772
9773 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9774
9775         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9776         local variables to fields in a proxy class.
9777
9778         * iterators.cs (PopulateProxy): Rename our internal fields to
9779         <XXX>.  
9780         Create a <THIS> field if we are an instance method, so we can
9781         reference our parent container variables.
9782         (MapVariable): Called back from the EmitContext code to enter a
9783         new variable to field mapping into the proxy class (we just create
9784         a FieldBuilder).
9785
9786         * expression.cs
9787         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9788         for using the remapped locals to fields.
9789
9790         I placed the code here, because that gives the same semantics to
9791         local variables, and only changes the Emit code.
9792
9793         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9794         statements inside iterators.
9795         (VariableInfo): Add a FieldBuilder for the cases when we are
9796         remapping local variables to fields in a proxy class
9797
9798         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9799         current_block != null.
9800
9801         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9802         not cope with strings, as it has been moved to the
9803         TableSwitchEmit.  Fixed bug in switch generation.
9804
9805         * expression.cs (New.DoResolve): Provide more context for the user
9806         when reporting an error.
9807
9808         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9809         pointers. 
9810
9811         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9812         check the permissions for it.  Note than in a type-resolution
9813         context the check was already present in DeclSpace.ResolveType,
9814         but was missing from the MemberAccess.
9815
9816         (ArrayCreation.CheckIndices): warn if the user has
9817         more nested levels of expressions, but there are no more
9818         dimensions specified.  Avoids crash on bug 41906.
9819
9820 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9821
9822         * statement.cs (Block): replace Implicit bool, for a generic
9823         flags.   
9824         New flag: `Unchecked'.  This is used during the EmitMeta phase
9825         (which is out-of-line with the regular Resolve/Emit process for a
9826         statement, as this is done ahead of time, but still gets a chance
9827         to call constant resolve).
9828
9829         (Block.Flags): new enum for adding a new flag.
9830
9831         (Block.EmitMeta): track the state of unchecked.
9832
9833         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9834         to enable constant resolution to work there as well.
9835
9836 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9837
9838         * typemanager.cs (ienumerable_type): Also look up
9839         System.Collections.IEnumerable. 
9840
9841 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9842
9843         TODO: Test more than one conditional per method.
9844
9845         * class.cs (Indexer.Define): Report the location where the user is
9846         referencing the unsupported feature.
9847
9848         (MethodData): Overload the use of `conditionals' to
9849         minimize the creation of needless ArrayLists.   This saves roughly
9850         212kb on my machine.
9851
9852         (Method): Implement the new IIteratorContainer interface.
9853         (Method.SetYields): Implement the method by setting the ModFlags
9854         to contain METHOD_YIELDS.
9855
9856         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9857         which just got set to null.
9858
9859         * iterators.cs: New file.
9860
9861         (Yield, YieldBreak): New statements.
9862
9863         * statement.cs (Return.Resolve): Flag an error if we are used in
9864         an iterator method.
9865
9866         * codegen.cs (InIterator): New flag set if the code is being
9867         compiled in an iterator method.
9868
9869         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9870         internal modifier, and we just use it to avoid adding extra
9871         fields, as this is seldom used.  
9872
9873         * cs-parser.jay: Add yield_statement (yield and yield break).
9874
9875         * driver.cs: New flag -v2 to turn on version 2 features. 
9876
9877         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9878         hashtable when v2 is enabled.
9879
9880 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9881
9882         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9883         there is already a namespace defined with this name.
9884
9885         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9886         people upgraded their corlibs.
9887
9888         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9889         always use fully qualified types, no need to use the compiler
9890         front end.
9891
9892         (TypeManager.IsNamespace): Use binarysearch.
9893
9894         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9895         AddDelegate): I did not quite use the new IsValid API properly: I
9896         have to pass the short-name and the fullname.  I was passing only
9897         the basename instead of the fullname sometimes. 
9898
9899         (TypeContainer.DefineType): call NamespaceClash.
9900
9901         * interface.cs (Interface.DefineType): use NamespaceClash before
9902         defining the type.
9903
9904         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9905         defining the type.
9906
9907         * enum.cs: (Enum.DefineType): use NamespaceClash before
9908         defining the type.
9909
9910         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9911         speed increase.  First, use the negative_hits cache when we get a
9912         negative.  Second, add the type with its full original name
9913         instead of the new . and + encoded name (reflection uses + to
9914         separate type from a nested type).  Use LookupTypeReflection
9915         directly which bypasses the type->name hashtable (that we already
9916         know does not contain the type.
9917
9918         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9919         location/container type. 
9920
9921         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9922
9923 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9924
9925         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9926
9927         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9928         method is being referenced in the method group from a static
9929         context, and report error 120 if so.
9930
9931         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9932         Error118. 
9933
9934         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9935         is created, we create the A namespace).
9936
9937         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9938         Fixes #41591
9939
9940 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9941
9942         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9943         invocation to ModuleBuilder.GetType with the same values will
9944         return a new type instance, so we need to cache its return
9945         values. 
9946
9947         * expression.cs (Binary.ResolveOperator): Only allow the compare
9948         operators on enums if they are of the same type.
9949
9950         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9951         types of ValueType on their own case.  Before we were giving them
9952         the same treatment as objects.
9953
9954         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9955         fullname.  Short name is used to compare against container name.
9956         Fullname is used to check against defined namespace names.
9957
9958         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9959         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9960
9961         (Method.CheckBase): Call parent.
9962         (MemberBase.CheckBase): Check for protected members on sealed
9963         classes.
9964         (PropertyBase.CheckBase): Call parent.
9965         (Field.Define): Call parent.
9966
9967         * report.cs: Negative error codes are now mapped to 8000 - code,
9968         so that the display is render more nicely.
9969
9970         * typemanager.cs: Do not use try/catch, instead report a regular
9971         error. 
9972
9973         (GetPointerType, GetReferenceType): These methods provide
9974         mechanisms to obtain the T* and T& from a T.  We had the code
9975         previously scattered around the code base, and it also used
9976         TypeManager.LookupType that would go through plenty of caches.
9977         This one goes directly to the type source.
9978
9979         In some places we did the Type.GetType followed by
9980         ModuleBuilder.GetType, but not in others, so this unifies the
9981         processing as well.
9982
9983         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9984         statements now that we have namespace information.
9985
9986         * typemanager.cs (IsNamespace): New method, returns whether the
9987         string presented is a namespace or not.
9988
9989         (ComputeNamespaces): New public entry point, computes the list of
9990         available namespaces, using the GetNamespaces API call in Mono, or
9991         the slower version in MS.NET.   
9992
9993         Now before we start the semantic analysis phase, we have a
9994         complete list of namespaces including everything that the user has
9995         provided.
9996
9997         Deleted old code to cache namespaces in .nsc files.
9998
9999 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10000
10001         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10002         class/struct location definition Location for the implicit
10003         constructor location.
10004
10005         (Operator.Define): Use the location of the operator for the
10006         implicit Method definition.
10007
10008         (Constructor.Emit): use the constructor location for the implicit
10009         base initializer constructor.
10010
10011         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10012         and the Expression class now contains two new methods:
10013
10014         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10015         isolate type lookup from the rest of the resolution process.
10016
10017         Since we use Expressions to hold type definitions due to the way
10018         we parse the input we have historically overloaded Resolve to
10019         perform the Type lookups if a special flag is passed.  Now this is
10020         eliminated and two methods take their place. 
10021
10022         The differences in the two methods between xStep and xTerminal is
10023         that xStep is involved in our current lookup system that uses
10024         SimpleNames to compose a name, while xTerminal is used just to
10025         catch the case where the simplename lookup failed.
10026
10027 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * expression.cs (ResolveMemberAccess): Remove redundant code.
10030         TypeExpr expressions are always born fully resolved.
10031
10032         * interface.cs (PopulateMethod): Do not lookup the types twice.
10033         We were doing it once during SemanticAnalysis and once during
10034         PopulateMethod.
10035
10036         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10037         in local variable type definitions, were being returned as a
10038         SimpleName (we decomposed everything into a string), that is
10039         because primary_expression was being used instead of a type in the
10040         grammar (reduce/reduce conflicts).
10041
10042         The part that was wrong is that we converted the expression into a
10043         string (an oversimplification in one hand, compounded with primary
10044         expressions doing string concatenation).
10045
10046         So things like:
10047
10048         A.B.C [] x;
10049
10050         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10051         using clauses from working on this particular context.  And a type
10052         was being matched directly against "A.B.C[]".
10053
10054         We now use the correct approach, and allow for ComposedCast to be
10055         part of the unary expression.  So the "A.B.C []" become a composed
10056         cast of "A.B.C" (as a nested group of MemberAccess with a
10057         SimpleName at the end) plus the rank composition "[]". 
10058
10059         Also fixes 35567
10060
10061 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10062
10063         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10064         for the access level checking.
10065
10066         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10067         `TypeContainer container', because I kept getting confused when I
10068         was debugging this code.
10069
10070         * expression.cs (Indexers): Instead of tracking getters/setters,
10071         we now track them in parallel.  We create one arraylist less, but
10072         most importantly it is possible now for the LValue code to find a
10073         matching get for a set.
10074
10075         (IndexerAccess.DoResolveLValue): Update the code.
10076         GetIndexersForType has been modified already to extract all the
10077         indexers from a type.  The code assumed it did not.
10078
10079         Also make the code set the correct return type for the indexer.
10080         This was fixed a long time ago for properties, but was missing for
10081         indexers.  It used to be void_type.
10082
10083         (Binary.Emit): Test first for doubles instead of
10084         floats, as they are more common.
10085
10086         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10087         when dealing with floats and the <=, >= operators.  This fixes bug
10088         #39314 
10089
10090         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10091         to load the array value by emitting a load on the foreach variable
10092         type.  This was incorrect.  
10093
10094         We now emit the code to load an element using the the array
10095         variable type, and then we emit the conversion operator.
10096
10097         Fixed #40176
10098
10099 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10100
10101         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10102
10103 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10104
10105         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10106         test for protection before we test for signatures. 
10107
10108         (MethodSignature.ToString): implement.
10109
10110         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10111         to the case where we reduced into a LongConstant.
10112
10113         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10114         depend on whether the information is acurrate, because the
10115         Microsoft runtime will always claim that the array type is public,
10116         regardless of the real state.
10117
10118         If the type is a pointer, another problem happens: the type is
10119         reported as non-public in Microsoft.  
10120
10121         In both cases we have to call CheckAccessLevel recursively with
10122         the underlying type as the argument to be tested.
10123
10124 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10125
10126         * assign.cs (Assign.Emit): If we are dealing with a compound
10127         assignment expression, we should use the code path that stores the
10128         intermediate result in a temporary value.  This fixes #40903.
10129
10130         *expression.cs (Indirection.ToString): Provide ToString method for
10131         debugging. 
10132
10133 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10134
10135         * class.cs: Null out fields holding references to Block objects so
10136         they can be garbage collected.
10137
10138         * expression.cs (OverloadResolve): Remove unused local.
10139
10140 2003-04-07  Martin Baulig  <martin@ximian.com>
10141
10142         * codegen.cs (EmitContext.CurrentFile): New public field.
10143         (EmitContext.Mark): Use the CurrentFile to check whether the
10144         location is in the correct file.
10145         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10146
10147 2003-04-07  Martin Baulig  <martin@ximian.com>
10148
10149         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10150
10151         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10152         location.  [FIXME: The location argument which gets passed to this
10153         method is sometimes wrong!]
10154
10155 2003-04-07  Nick Drochak <ndrochak@gol.com>
10156
10157         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10158
10159 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10160
10161         * expression.cs (Indirection.EmitAssign): We were using the
10162         temporary, but returning immediately instead of continuing the
10163         EmitAssing flow.
10164
10165 2003-04-06  Martin Baulig  <martin@ximian.com>
10166
10167         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10168         if it's a nested child, but also deriving from the outer class.
10169         See test 190.cs.
10170
10171         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10172         nested child, but also deriving from the outer class.  See
10173         test-190.cs.
10174         (FilterWithClosure): We may access private members of the outer
10175         class if we're a nested child and deriving from the outer class.
10176         (RealMemberLookup): Only set `closure_private_ok' if the
10177         `original_bf' contained BindingFlags.NonPublic.
10178
10179 2003-04-05  Martin Baulig  <martin@ximian.com>
10180
10181         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10182
10183 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10184
10185         * class.cs (Event.Define): Do not allow abstract events to have
10186         initializers. 
10187
10188 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10189
10190         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10191         block in event declarations.
10192
10193         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10194         value type, get its address.
10195
10196         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10197         leaving a class on the stack instead of a boolean value (int
10198         0/1).  Change the code so we compare against null, and then the
10199         result against zero.
10200
10201         * class.cs (TypeContainer.GetClassBases): We were checking for the
10202         parent class being sealed too late.
10203
10204         * expression.cs (Binary.Emit): For <= and >= when dealing with
10205         floating point values, use cgt.un and clt.un instead of cgt and
10206         clt alone.
10207
10208 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10209
10210         * statement.cs: Apply the same optimization as MS: skip the 
10211         GetEnumerator returning an IEnumerator, and use the one returning a 
10212         CharEnumerator instead. This allows us to avoid the try-finally block 
10213         and the boxing.
10214
10215 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10216
10217         * cs-parser.jay: Attributes cannot be applied to
10218                          namespaces. Fixes #40473
10219
10220 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10221
10222         * class.cs:
10223         (Add*): check if the name is valid using the full name for constants,
10224         fields, properties and events.
10225
10226 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10227
10228         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10229         char constants to be part of the enumeration.
10230
10231         * expression.cs (Conditional.DoResolve): Add support for operator
10232         true. Implements the missing functionality from 14.12
10233
10234         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10235         operator true/false as required by the spec.
10236
10237         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10238         implicit conversion to boolean.
10239
10240         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10241         also one where the type implements `operator true'. 
10242
10243         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10244         get an expression that will invoke operator true based on an
10245         expression.  
10246
10247         (GetConversionOperators): Removed the hack that called op_True
10248         here.  
10249
10250         (Expression.ResolveBoolean): Move this from Statement.
10251
10252 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10253
10254         * ecore.cs (FieldExpr): do not allow initialization of initonly
10255         fields on derived classes
10256
10257 2003-03-13  Martin Baulig  <martin@ximian.com>
10258
10259         * statement.cs (Block.Emit): Call ig.BeginScope() and
10260         ig.EndScope() when compiling with debugging info; call
10261         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10262
10263 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10264
10265         * expression.cs (Indexers): Do not construct immediately, allow
10266         for new members to be appended as we go.  Fixes 38143
10267
10268 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10269
10270         * expression.cs: save/restore context when resolving an unchecked
10271         expression.
10272
10273 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10274
10275         * cfold.cs: Catch division by zero in modulus operator during
10276         constant folding.
10277
10278 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10279
10280         * interface.cs (Interface.DefineMembers): Avoid defining members
10281         twice. 
10282
10283 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10284
10285         * driver.cs: handle the +/- options for -noconfig
10286
10287         * statement.cs (Unckeched.Resolve): Also track the state of
10288         unchecked in the Resolve phase.
10289
10290 2003-02-27  Martin Baulig  <martin@ximian.com>
10291
10292         * ecore.cs (Expression.MemberLookup): Don't create a
10293         MethodGroupExpr for something which is not a method.  Fixes #38291.
10294
10295 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10296
10297         * class.cs (MemberBase.CheckParameters): Also check that the type
10298         is unmanaged if it is a pointer.
10299
10300         * expression.cs (SizeOf.Resolve): Add location information.
10301
10302         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10303         a managed type is declared.
10304
10305         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10306         parameter modifiers as well.  Fixes bug 38606
10307
10308         * class.cs: Very sad.  Am backing out the speed up changes
10309         introduced by the ArrayList -> Array in the TypeContainer, as they
10310         were not actually that much faster, and introduced a bug (no error
10311         reports on duplicated methods).
10312
10313         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10314         source first, this will guarantee that we have a valid expression
10315         before calling in lower levels functions that will require a
10316         resolved object.  Then use this original_source in the
10317         target.ResolveLValue instead of the original source that was
10318         passed to us.
10319
10320         Another change.  Use target.Resolve instead of LValueResolve.
10321         Although we are resolving for LValues, we will let the Assign code
10322         take care of that (it will be called again from Resolve).  This
10323         basically allows code like this:
10324
10325         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10326         class Y { void A (X x) { x [0] += o; }
10327
10328         The problem was that the indexer was trying to resolve for
10329         set_Item (idx, object o) and never finding one.  The real set_Item
10330         was set_Item (idx, X).  By delaying the process we get the right
10331         semantics. 
10332
10333         Fixes bug 36505
10334
10335 2003-02-23  Martin Baulig  <martin@ximian.com>
10336
10337         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10338         while calling DoEmit ().
10339
10340         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10341         source files; if you use the #line directive inside a method, the
10342         compiler stops emitting line numbers for the debugger until it
10343         reaches the end of the method or another #line directive which
10344         restores the original file.
10345
10346 2003-02-23  Martin Baulig  <martin@ximian.com>
10347
10348         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10349
10350 2003-02-23  Martin Baulig  <martin@ximian.com>
10351
10352         * statement.cs (Block.AddChildVariableNames): We need to call this
10353         recursively, not just for our immediate children.
10354
10355 2003-02-23  Martin Baulig  <martin@ximian.com>
10356
10357         * class.cs (Event.Define): Always make the field private, like csc does.
10358
10359         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10360         actually work, fixes bug #37521.
10361
10362 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10363
10364         * delegate.cs: When creating the various temporary "Parameters"
10365         classes, make sure that we call the ComputeAndDefineParameterTypes
10366         on those new parameters (just like we do with the formal ones), to
10367         allow them to be resolved in the context of the DeclSpace.
10368
10369         This fixes the bug that Dick observed in Bugzilla #38530.
10370
10371 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10372
10373         * expression.cs (ResolveMemberAccess): When resolving a constant,
10374         do not attempt to pull a constant if the value was not able to
10375         generate a valid constant.
10376
10377         * const.cs (LookupConstantValue): Do not report more errors than required.
10378
10379 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10380
10381         * expression.cs: fixes bug #38328.
10382
10383 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10384
10385         * class.cs: Changed all the various members that can be part of a
10386         class from being an ArrayList to be an Array of the right type.
10387         During the DefineType type_list, interface_list, delegate_list and
10388         enum_list are turned into types, interfaces, delegates and enums
10389         arrays.  
10390
10391         And during the member population, indexer_list, event_list,
10392         constant_list, field_list, instance_constructor_list, method_list,
10393         operator_list and property_list are turned into their real arrays.
10394
10395         Although we could probably perform this operation earlier, for
10396         good error reporting we need to keep the lists and remove the
10397         lists for longer than required.
10398
10399         This optimization was triggered by Paolo profiling the compiler
10400         speed on the output of `gen-sample-program.pl' perl script. 
10401
10402         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10403         not crash in methods like MemberLookupFailed that use this field.  
10404
10405         This problem arises when the compiler fails to resolve a type
10406         during interface type definition for example.
10407
10408 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10409
10410         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10411         inherit from System.Object, so we have to stop at null, not only
10412         when reaching System.Object.
10413
10414 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10415
10416         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10417         DeclaredOnly because the parent indexer might have had a different
10418         name, but did not loop until the top of the hierarchy was reached.
10419
10420         The problem this one fixes is 35492: when a class implemented an
10421         indexer from an interface, we were getting the interface method
10422         (which was abstract) and we were flagging an error (can not invoke
10423         abstract method).
10424
10425         This also keeps bug 33089 functioning, and test-148 functioning.
10426
10427         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10428         out if a method is special is to see if it is declared in a
10429         property or event, or whether it is one of the predefined operator
10430         names.   This should fix correctly #36804.
10431
10432 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10433
10434         The goal here is to remove the dependency on EmptyCast.Peel ().
10435         Killing it completely.
10436
10437         The problem is that currently in a number of places where
10438         constants are expected, we have to "probe" for an EmptyCast, and
10439         Peel, which is not the correct thing to do, as this will be
10440         repetitive and will likely lead to errors. 
10441
10442         The idea is to remove any EmptyCasts that are used in casts that
10443         can be reduced to constants, so we only have to cope with
10444         constants. 
10445
10446         This bug hunt was triggered by Bug 37363 and the desire to remove
10447         the duplicate pattern where we were "peeling" emptycasts to check
10448         whether they were constants.  Now constants will always be
10449         constants.
10450
10451         * ecore.cs: Use an enumconstant here instead of wrapping with
10452         EmptyCast.  
10453
10454         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10455         throwing me off.  By handling this we can get rid of a few hacks.
10456
10457         * statement.cs (Switch): Removed Peel() code.
10458
10459 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10460
10461         * class.cs: Location information for error 508
10462
10463         * expression.cs (New.DoResolve): Add a guard against double
10464         resolution of an expression.  
10465
10466         The New DoResolve might be called twice when initializing field
10467         expressions (see EmitFieldInitializers, the call to
10468         GetInitializerExpression will perform a resolve on the expression,
10469         and later the assign will trigger another resolution
10470
10471         This leads to bugs (#37014)
10472
10473         * delegate.cs: The signature for EndInvoke should contain any ref
10474         or out parameters as well.  We were not doing this in the past. 
10475
10476         * class.cs (Field.Define): Do not overwrite the type definition
10477         inside the `volatile' group.  Turns out that volatile enumerations
10478         were changing the type here to perform a validity test, which
10479         broke conversions. 
10480
10481 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10484         and structs, we do not want to load the instance variable
10485
10486         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10487         enum_type has to be handled like an object reference (implicit
10488         conversions exists from this to object), but the regular IsClass
10489         and IsValueType tests will never return true for this one.
10490
10491         Also we use TypeManager.IsValueType instead of type.IsValueType,
10492         just for consistency with the rest of the code (this is only
10493         needed if we ever use the construct exposed by test-180.cs inside
10494         corlib, which we dont today).
10495
10496 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10497
10498         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10499         just InternalCall.
10500
10501 2003-02-09  Martin Baulig  <martin@ximian.com>
10502
10503         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10504         (Namespace.DefineNamespaces): New static public method; this is
10505         called when we're compiling with debugging to add all namespaces
10506         to the symbol file.
10507
10508         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10509         pass it to the Namespace's .ctor.
10510
10511         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10512         and MethodBase arguments; pass the namespace ID to the symwriter;
10513         pass the MethodBase instead of the token to the symwriter.
10514         (SymbolWriter.DefineNamespace): New method to add a namespace to
10515         the symbol file.
10516
10517 2003-02-09  Martin Baulig  <martin@ximian.com>
10518
10519         * symbolwriter.cs: New file.  This is a wrapper around
10520         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10521         methods here in near future.
10522
10523 2003-02-09  Martin Baulig  <martin@ximian.com>
10524
10525         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10526         ILGenerator.MarkSequencePoint() which are actually used by the
10527         symbol writer.
10528
10529 2003-02-09  Martin Baulig  <martin@ximian.com>
10530
10531         * location.cs (SourceFile): New public sealed class.  This
10532         contains the name and an index which is used in the location's token.
10533         (Location): Reserve an appropriate number of bits in the token for
10534         the source file instead of walking over that list, this gives us a
10535         really huge performance improvement when compiling with debugging.
10536
10537         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10538         `SourceFile' argument instead of a string.
10539         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10540         but don't parse/tokenize here, we need to generate the list of all
10541         source files before we do that.
10542         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10543         the files.
10544
10545         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10546         instead of a string.
10547
10548         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10549         of a string.
10550
10551 2003-02-09  Martin Baulig  <martin@ximian.com>
10552
10553         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10554         filename on `#line default'.
10555
10556 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10557
10558         * statement.cs: don't clear the pinned var when the fixed statement
10559         returns from the method (fixes bug#37752).
10560
10561 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10562
10563         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10564         to IsValueType.
10565
10566 2003-02-07  Martin Baulig  <martin@ximian.com>
10567
10568         * driver.cs: Removed the `--debug-args' command line argument.
10569
10570         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10571         automatically by the AsssemblyBuilder.
10572         (CodeGen.InitializeSymbolWriter): We don't need to call any
10573         initialization function on the symbol writer anymore.  This method
10574         doesn't take any arguments.
10575
10576 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10577
10578         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10579         from referenced assemblies as well.
10580
10581 2003-02-02  Martin Baulig  <martin@ximian.com>
10582
10583         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10584
10585 2003-02-02  Martin Baulig  <martin@ximian.com>
10586
10587         * class.cs (Constructor.Emit): Open the symbol writer before
10588         emitting the constructor initializer.
10589         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10590         single-stepping through constructor initializers.
10591
10592 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10593
10594         * class.cs: Handle error 549: do not allow virtual methods in
10595         sealed classes. 
10596
10597 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10598
10599         * decl.cs: Check access levels when resolving types
10600
10601 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10602
10603         * statement.cs: Add parameters and locals set in catch blocks that might 
10604         return to set vector
10605
10606 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10607
10608         * class.cs (Operator): Set the SpecialName flags for operators.
10609
10610         * expression.cs (Invocation.DoResolve): Only block calls to
10611         accessors and operators on SpecialName methods.
10612
10613         (Cast.TryReduce): Handle conversions from char constants.
10614
10615
10616 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10617
10618         * statement.cs: small memory and time optimization in FlowBranching.
10619
10620 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10621
10622         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10623         problem that the last fix but in the other sid (Set).
10624
10625         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10626         access when there is no indexer in the hierarchy.
10627
10628 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10629
10630         * class.cs: Combine some if statements.
10631
10632 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10633
10634         * driver.cs: fixed bug #37187.
10635
10636 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10637
10638         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10639         any indexer, it's needed to build a list with all the indexers in the
10640         hierarchy (AllGetters), else we have problems. Fixes #35653.
10641
10642 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10643
10644         * class.cs (MethodData.Define): It is wrong for an interface
10645         implementation to be static in both cases: explicit and implicit.
10646         We were only handling this in one case.
10647
10648         Improve the if situation there to not have negations.
10649
10650         * class.cs (Field.Define): Turns out that we do not need to check
10651         the unsafe bit on field definition, only on usage.  Remove the test.
10652
10653 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10654
10655         * driver.cs: use assembly.Location instead of Codebase (the latest
10656         patch made mcs fail when using MS assemblies).
10657
10658 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10659
10660         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10661         get the path to *corlib.dll.
10662
10663 2003-01-21  Nick Drochak <ndrochak@gol.com>
10664
10665         * cs-tokenizer.cs:
10666         * pending.cs:
10667         * typemanager.cs: Remove compiler warnings
10668
10669 2003-01-20  Duncan Mak  <duncan@ximian.com>
10670
10671         * AssemblyInfo.cs: Bump the version number to 0.19.
10672
10673 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10674
10675         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10676
10677 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10678
10679         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10680
10681 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10682
10683         * cs-parser.jay: Small fix: we were not comparing the constructor
10684         name correctly.   Thanks to Zoltan for the initial pointer.
10685
10686 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10687
10688         * cs-tokenizer.cs: Set file name when specified with #line
10689
10690 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10691
10692         * cs-parser.jay: Only perform the constructor checks here if we
10693         are named like the class;  This will help provider a better
10694         error.  The constructor path is taken when a type definition is
10695         not found, but most likely the user forgot to add the type, so
10696         report that rather than the constructor error.
10697
10698 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10699
10700         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10701         allocations.
10702
10703 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10704
10705         * cs-parser.jay: Add cleanup call.
10706
10707 2003-01-13  Duncan Mak  <duncan@ximian.com>
10708
10709         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10710         consistent with other methods.
10711
10712 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10713
10714         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10715
10716 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10717
10718         * attribute.cs: only set GuidAttr to true when we have a
10719         GuidAttribute.
10720
10721 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10722
10723         * ecore.cs:
10724         * expression.cs:
10725         * typemanager.cs: fixes to allow mcs compile corlib with the new
10726         Type.IsSubclassOf fix.
10727
10728 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * expression.cs (LocalVariableReference.DoResolve): Classify a
10731         constant as a value, not as a variable.   Also, set the type for
10732         the variable.
10733
10734         * cs-parser.jay (fixed_statement): take a type instead of a
10735         pointer_type, so we can produce a better error message later.
10736
10737         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10738         as an error.  
10739
10740         (For.DoEmit): Make inifinite loops have a
10741         non-conditional branch back.
10742
10743         (Fixed.DoEmit): First populate the pinned variables, then emit the
10744         statement, then clear the variables.  Before I was emitting the
10745         code once for each fixed piece.
10746
10747
10748 2003-01-08  Martin Baulig  <martin@ximian.com>
10749
10750         * statement.cs (FlowBranching.MergeChild): A break in a
10751         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10752
10753 2003-01-08  Martin Baulig  <martin@ximian.com>
10754
10755         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10756         lives in the same number space than `param_map'.  Fixes #36154.
10757
10758 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10759
10760         * cs-parser.jay (constructor_declaration): Set the
10761         Constructor.ModFlags before probing for it.  This makes the
10762         compiler report 514, 515 and 132 (the code was there, but got
10763         broken). 
10764
10765         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10766         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10767         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10768
10769 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10770
10771         * enum.cs: create the enum static fields using the enum type.
10772
10773 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10774
10775         * class.cs: don't try to create the ParamBuilder for the return
10776         type if it's not needed (and handle it breaking for the ms runtime
10777         anyway).
10778
10779 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10780
10781         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10782
10783 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10784
10785         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10786         the command.   This showed up while compiling the JANET source
10787         code, which used \r as its only newline separator.
10788
10789 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10790
10791         * class.cs (Method.Define): If we are an operator (because it
10792         reuses our code), then set the SpecialName and HideBySig.  #36128
10793
10794 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10795
10796         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10797         exception, report error 120 `object reference required'.
10798
10799         * driver.cs: Add --pause option, used during to measure the size
10800         of the process as it goes with --timestamp.
10801
10802         * expression.cs (Invocation.DoResolve): Do not allow methods with
10803         SpecialName to be invoked.
10804
10805 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10806
10807         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10808         number before adding it.
10809
10810 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10811
10812         * ecore.cs (StandardImplicitConversion): When in an unsafe
10813         context, we allow conversion between void * to any other pointer
10814         type. This fixes bug #35973.
10815
10816 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10817
10818         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10819         is not thrown when extensionless outputs are used 
10820
10821 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10822
10823         * rootcontext.cs: fixed compilation of corlib.
10824
10825 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10826
10827         * attribute.cs (Attributes.Contains): Add new method.
10828
10829         * class.cs (MethodCore.LabelParameters): if the parameter is an
10830         `out' parameter, check that no attribute `[In]' has been passed.
10831
10832         * enum.cs: Handle the `value__' name in an enumeration.
10833
10834 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10835
10836         * decl.cs: Added special case to allow overrides on "protected
10837         internal" methods
10838
10839 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10840
10841         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10842         since it makes much more sense.
10843
10844         (Attributes.ctor): Don't require a Location parameter.
10845
10846         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10847
10848         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10849         since we already have that information per attribute.
10850
10851         * everywhere : make appropriate changes.
10852
10853         * class.cs (LabelParameters): Write the code which actually
10854         applies attributes to the return type. We can't do this on the MS
10855         .NET runtime so we flag a warning in the case an exception is
10856         thrown.
10857
10858 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10859
10860         * const.cs: Handle implicit null conversions here too.
10861
10862 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10863
10864         * class.cs (MethodCore.LabelParameters): Remove the extra
10865         Type [] parameter since it is completely unnecessary. Instead
10866         pass in the method's attributes so that we can extract
10867         the "return" attribute.
10868
10869 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10870
10871         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10872         of ignoring it and letting the compile continue.
10873
10874         * typemanager.cs (ChangeType): use an extra argument to return an
10875         error condition instead of throwing an exception.
10876
10877 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10878
10879         * expression.cs (Unary.TryReduce): mimic the code for the regular
10880         code path.  Perform an implicit cast in the cases where we can
10881         implicitly convert to one of the integral types, and then reduce
10882         based on that constant.   This fixes bug #35483.
10883
10884 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10885
10886         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10887
10888 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10889
10890         * namespace.cs: fixed bug #35489.
10891
10892 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10893
10894         * class.cs: Remove some dead code.
10895
10896         * cs-parser.jay: Estimate the number of methods needed
10897         (RootContext.MethodCount);
10898
10899         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10900         numbers instead of StringBuilders.
10901
10902         * support.cs (PtrHashtable): Add constructor with initial size;
10903         We can now reduce reallocations of the method table.
10904
10905 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10906
10907         * attribute.cs (ApplyAttributes): Keep track of the emitted
10908         attributes on a per-target basis. This fixes bug #35413.
10909
10910 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10911
10912         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10913         default to the Windows 1252 encoding.
10914
10915         (UnixParseOption): Support version, thanks to Alp for the missing
10916         pointer. 
10917
10918         * AssemblyInfo.cs: Add nice assembly information.
10919
10920         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10921         (bug 35169).
10922
10923         * cs-parser.jay: Allow a trailing comma before the close bracked
10924         in the attribute_section production.
10925
10926         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10927         address of the instance was being taken, I will take this out,
10928         because we take the address of the object immediately here.
10929
10930 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10931
10932         * typemanager.cs (AreMultipleAllowed): Take care of the most
10933         obvious case where attribute type is not in the current assembly -
10934         stupid me ;-)
10935
10936 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10937
10938         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10939         definitions, instead of doing that afterwards.  
10940
10941         Also we use a nice little hack, depending on the constructor, we
10942         know if we are a "composed" name or a simple name.  Hence, we
10943         avoid the IndexOf test, and we avoid 
10944
10945         * codegen.cs: Add code to assist in a bug reporter to track down
10946         the source of a compiler crash. 
10947
10948 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10949
10950         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10951         types have been emitted for a given element and flag an error
10952         if something which does not have AllowMultiple set is used more
10953         than once.
10954
10955         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10956         attribute types and their corresponding AllowMultiple properties
10957
10958         (AreMultipleAllowed): Check the property for a given type.
10959
10960         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10961         property in the case we have a TypeContainer.
10962
10963         (Attributes.AddAttribute): Detect duplicates and just skip on
10964         adding them. This trivial fix catches a pretty gross error in our
10965         attribute emission - global attributes were being emitted twice!
10966
10967         Bugzilla bug #33187 is now fixed.
10968
10969 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10970
10971         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10972         instead of pp_and).
10973
10974         * expression.cs (Binary.ResolveOperator): I can only use the
10975         Concat (string, string, string) and Concat (string, string,
10976         string, string) if the child is actually a concatenation of
10977         strings. 
10978
10979 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10980
10981         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10982         context where we need a 2-character lookahead.
10983
10984         * pending.cs (PendingImplementation): Rework so we can keep track
10985         of interface types all the time, and flag those which were
10986         implemented by parents as optional.
10987
10988 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10989
10990         * expression.cs (Binary.ResolveOperator): Use
10991         String.Concat(string,string,string) or
10992         String.Concat(string,string,string,string) when possible. 
10993
10994         * typemanager: More helper methods.
10995
10996
10997 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10998
10999         * pending.cs: remove the bogus return from GetMissingInterfaces()
11000         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11001
11002 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11003
11004         * namespace.cs: avoid duplicated 'using xxx' being added to
11005         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11006         when we get more than one 'using' statement for the same namespace.
11007         Report a CS0105 warning for it.
11008
11009 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11010
11011         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11012         of calling getChar/putback, uses internal knowledge of it.    
11013
11014         (xtoken): Reorder tokenizer so most common patterns are checked
11015         first.  This reduces the compilation time in another 5% (from 8.11s
11016         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11017
11018         The parsing time is 22% of the compilation in mcs, and from that
11019         64% is spent on the tokenization process.  
11020
11021         I tried using a binary search for keywords, but this is slower
11022         than the hashtable.  Another option would be to do a couple of
11023         things:
11024
11025                 * Not use a StringBuilder, instead use an array of chars,
11026                   with a set value.  Notice that this way we could catch
11027                   the 645 error without having to do it *afterwards*.
11028
11029                 * We could write a hand-parser to avoid the hashtable
11030                   compares altogether.
11031
11032         The identifier consumption process takes 37% of the tokenization
11033         time.  Another 15% is spent on is_number.  56% of the time spent
11034         on is_number is spent on Int64.Parse:
11035
11036                 * We could probably choose based on the string length to
11037                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11038                   computations. 
11039
11040         Another 3% is spend on wrapping `xtoken' in the `token' function.
11041
11042         Handle 0xa0 as whitespace (#34752)
11043
11044 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11045
11046         * typemanager.cs (IsCLRType): New routine to tell whether a type
11047         is one of the builtin types.  
11048
11049         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11050         typecode in more places instead of doing pointer comparissions.
11051         We could leverage some knowledge about the way the typecodes are
11052         laid out.
11053
11054         New code to cache namespaces in assemblies, it is currently not
11055         invoked, to be used soon.
11056
11057         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11058
11059         * expression.cs (Binary.ResolveOperator): specially handle
11060         strings, and do not perform user-defined operator overloading for
11061         built-in types.
11062
11063 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11064
11065         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11066         internalcall as it is a pretty simple operation;  Avoid whenever
11067         possible to call Char.IsLetter.
11068
11069         (consume_identifier): Cut by half the number of
11070         hashtable calls by merging the is_keyword and GetKeyword behavior.
11071
11072         Do not short-circuit, because if we do, we
11073         report errors (ie, #if false && true would produce an invalid
11074         directive error);
11075
11076
11077 2002-11-24  Martin Baulig  <martin@ximian.com>
11078
11079         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11080         check constant ranges and report a CS0221.  Fixes #33186.
11081
11082 2002-11-24  Martin Baulig  <martin@ximian.com>
11083
11084         * cs-parser.jay: Make this work for uninitialized variable
11085         declarations in the `for' initializer.  Fixes #32416.
11086
11087 2002-11-24  Martin Baulig  <martin@ximian.com>
11088
11089         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11090         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11091
11092 2002-11-24  Martin Baulig  <martin@ximian.com>
11093
11094         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11095         argument; if true, we also check for user-defined conversions.
11096         This is only needed if both arguments are of a user-defined type.
11097         Fixes #30443, added test-175.cs.
11098         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11099
11100         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11101
11102 2002-11-24  Martin Baulig  <martin@ximian.com>
11103
11104         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11105         function to get the store opcode.
11106         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11107         only emit the Ldelema if the store opcode is Stobj.  You must run
11108         both test-34 and test-167 to test this.  Fixes #34529.
11109
11110 2002-11-23  Martin Baulig  <martin@ximian.com>
11111
11112         * ecore.cs (Expression.MemberLookup): Added additional
11113         `qualifier_type' argument which is used when we're being called
11114         from MemberAccess.DoResolve() and null if we're called from a
11115         SimpleName lookup.
11116         (Expression.MemberLookupFailed): New method to report errors; this
11117         does the CS1540 check and reports the correct error message.
11118
11119         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11120         argument for the CS1540 check and redone the way how we're dealing
11121         with private members.  See the comment in the source code for details.
11122         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11123         `closure_start_type' to `closure_qualifier_type' and check whether
11124         it's not null.  It was not this filter being broken, it was just
11125         being called with the wrong arguments.
11126
11127         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11128         and pass it the correct `qualifier_type'; this also does the error
11129         handling for us.
11130
11131 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11132
11133         * expression.cs (Invocation.EmitParams): If the we are dealing
11134         with a non-built-in value type, load its address as well.
11135
11136         (ArrayCreation): Use a a pretty constant instead
11137         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11138         static initializers.  
11139
11140         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11141         because they are not really value types, just glorified integers. 
11142
11143         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11144
11145         * ecore.cs: Remove redundant code for enumerations, make them use
11146         the same code path as everything else, fixes the casting issue
11147         with enumerations in Windows.Forms.
11148
11149         * attribute.cs: Do only cast to string if it is a string, the
11150         validation happens later.
11151
11152         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11153         people upgrade their corlibs.
11154
11155         * ecore.cs: Oops, enumerations were not following the entire code path
11156
11157 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11158
11159         * typemanager.cs (FilterWithClosure): Commented out the test for
11160         1540 in typemanager.cs, as it has problems when accessing
11161         protected methods from a parent class (see test-174.cs). 
11162
11163         * attribute.cs (Attribute.ValidateGuid): new method.
11164         (Attribute.Resolve): Use above.
11165
11166 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11167
11168         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11169
11170         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11171         handling for enumerations, as we only needed the TypeContainer
11172         functionality to begin with (this is required for the fix below to
11173         work for enums that reference constants in a container class for
11174         example). 
11175
11176         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11177
11178         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11179         a valid TypeBuilder to perform lookups on.o
11180
11181         * class.cs (InheritableMemberSignatureCompare): Use true in the
11182         call to GetGetMethod and GetSetMethod, because we are comparing
11183         the signature, and we need to get the methods *even* if they are
11184         private. 
11185
11186         (PropertyBase.CheckBase): ditto.
11187
11188         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11189         GotoCase.Resolve): Use Peel on EmpytCasts.
11190
11191         * ecore.cs (EmptyCast): drop child, add Peel method.
11192
11193 2002-11-17  Martin Baulig  <martin@ximian.com>
11194
11195         * ecore.cs (EmptyCast.Child): New public property.
11196
11197         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11198         label resolved to an EmptyCast.  Fixes #34162.
11199         (GotoCase.Resolve): Likewise.
11200         (Block.EmitMeta): Likewise.
11201
11202 2002-11-17  Martin Baulig  <martin@ximian.com>
11203
11204         * expression.cs (Invocation.BetterConversion): Prefer int over
11205         uint; short over ushort; long over ulong for integer literals.
11206         Use ImplicitConversionExists instead of StandardConversionExists
11207         since we also need to check for user-defined implicit conversions.
11208         Fixes #34165.  Added test-173.cs.
11209
11210 2002-11-16  Martin Baulig  <martin@ximian.com>
11211
11212         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11213         with the `true' and `false' literals.  Fixes #33151.
11214
11215 2002-11-16  Martin Baulig  <martin@ximian.com>
11216
11217         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11218         October 22nd; don't do the cs1540 check for static members.
11219
11220         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11221         now using our own filter here and doing the cs1540 check again.
11222
11223 2002-11-16  Martin Baulig  <martin@ximian.com>
11224
11225         * support.cs (InternalParameters): Don't crash if we don't have
11226         any fixed parameters.  Fixes #33532.
11227
11228 2002-11-16  Martin Baulig  <martin@ximian.com>
11229
11230         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11231         when looking up static methods to make this work on Windows.
11232         Fixes #33773.
11233
11234 2002-11-16  Martin Baulig  <martin@ximian.com>
11235
11236         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11237         a setter rather than using PropertyInfo.CanWrite.
11238
11239 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11240
11241         * class.cs: Allow acces to block member by subclasses. Fixes build
11242         breaker.
11243
11244 2002-11-14  Martin Baulig  <martin@ximian.com>
11245
11246         * class.cs (Constructor.Emit): Added the extern/block check.
11247         Fixes bug #33678.
11248
11249 2002-11-14  Martin Baulig  <martin@ximian.com>
11250
11251         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11252         iteration while looking for indexers, this is needed because the
11253         indexer may have a different name in our base classes.  Fixed the
11254         error reporting (no indexers at all, not get accessor, no
11255         overloaded match).  Fixes bug #33089.
11256         (IndexerAccess.DoResolveLValue): Likewise.
11257
11258 2002-11-14  Martin Baulig  <martin@ximian.com>
11259
11260         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11261         indexers.  Fixes the first part of bug #33089.
11262         (MethodSignature.InheritableMemberSignatureCompare): Added support
11263         for properties.
11264
11265 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11266
11267         * attribute.cs (Attribute.Resolve): Catch the
11268         NullReferenceException and report it since it isn't supposed to
11269         happen. 
11270
11271 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11272
11273         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11274         LogicalOr and LogicalAnd that can benefit from recursively
11275         handling EmitBranchable.  The code now should be nice for Paolo.
11276
11277 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11278
11279         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11280         the Type lookups, as we perform quite a number of lookups on
11281         non-Types.  This can be removed once we can deterministically tell
11282         whether we have a type or a namespace in advance.
11283
11284         But this might require special hacks from our corlib.
11285
11286         * TODO: updated.
11287
11288         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11289         and double which avoids a conversion from an integer to a double.
11290
11291         * expression.cs: tiny optimization, avoid calling IsConstant,
11292         because it effectively performs the lookup twice.
11293
11294 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11295
11296         But a bogus return here to keep the semantics of the old code
11297         until the Mono runtime is fixed.
11298
11299         * pending.cs (GetMissingInterfaces): New method used to remove all
11300         the interfaces that are already implemented by our parent
11301         classes from the list of pending methods. 
11302
11303         * interface.cs: Add checks for calls after ResolveTypeExpr.
11304
11305 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11306
11307         * class.cs (Class.Emit): Report warning 67: event not used if the
11308         warning level is beyond 3.
11309
11310         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11311         being a NullLiteral.
11312
11313         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11314         specifiers. 
11315
11316         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11317         path that might fail if a type can not be resolved.
11318
11319         * expression.cs (Binary.Emit): Emit unsigned versions of the
11320         operators. 
11321
11322         * driver.cs: use error 5.
11323
11324 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11325
11326         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11327
11328 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11329
11330         * cs-parser.jay (switch_section): A beautiful patch from Martin
11331         Baulig that fixed 33094.
11332
11333 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11334
11335         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11336         Check whether the base is abstract and report an error if so.
11337
11338         * expression.cs (IndexerAccess.DoResolveLValue,
11339         IndexerAccess.DoResolve): ditto. 
11340
11341         (Invocation.DoResolve): ditto.
11342
11343         (Invocation.FullMethodDesc): Improve the report string.
11344
11345         * statement.cs (Block): Eliminate IsVariableDefined as it is
11346         basically just a wrapper for GetVariableInfo.
11347
11348         * ecore.cs (SimpleName): Use new 
11349
11350         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11351         type, as we return the actual parameter ref/unref state on a
11352         different call.
11353
11354 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11355
11356         * support.cs: Return proper flags REF/OUT fixing the previous
11357         commit.  
11358
11359         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11360         not used to mean `ref' but `ref or out' in ParameterReference
11361
11362         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11363         full type signature instead of calling TypeManger.CSharpName
11364         ourselves. 
11365
11366         * support.cs (InternalParameters.ParameterDesc): Do not compare
11367         directly to the modflags, because REF/OUT will actually be bitsets
11368         if set. 
11369
11370         * delegate.cs (VerifyMethod): Check also the modifiers.
11371
11372         * cs-tokenizer.cs: Fix bug where floating point values with an
11373         exponent where a sign was missing was ignored.
11374
11375         * driver.cs: Allow multiple assemblies to be specified in a single
11376         /r: argument
11377
11378 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11379
11380         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11381         because identifiers after a parenthesis would end up in this kind
11382         of production, and we needed to desamiguate it for having casts
11383         like:
11384
11385                 (UserDefinedType *) xxx
11386
11387 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11388
11389         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11390         we should set on the Bindingflags.NonPublic, but not turn on
11391         private_ok.  private_ok controls whether a Private member is
11392         returned (this is chekced on the filter routine), while the
11393         BindingFlags.NonPublic just controls whether private/protected
11394         will be allowed.   This fixes the problem part of the problem of
11395         private properties being allowed to be used in derived classes.
11396
11397         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11398         so we can call the children DoResolveLValue method (this will
11399         properly signal errors on lvalue assignments to base properties)
11400
11401         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11402         getter are null, and we have a property info, we know that this
11403         happened because the lookup failed, so we report an error 122 for
11404         protection level violation.
11405
11406         We also silently return if setter and getter are null in the
11407         resolve functions, this condition only happens if we have flagged
11408         the error before.  This is the other half of the problem. 
11409
11410         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11411         not have accessibility information, that is why we were returning
11412         true in the filter function in typemanager.cs.
11413
11414         To properly report 122 (property is inaccessible because of its
11415         protection level) correctly, we report this error in ResolveAccess
11416         by failing if both the setter and the getter are lacking (ie, the
11417         lookup failed). 
11418
11419         DoResolve and DoLResolve have been modified to check for both
11420         setter/getter being null and returning silently, the reason being
11421         that I did not want to put the knowledge about this error in upper
11422         layers, like:
11423
11424         int old = Report.Errors;
11425         x = new PropertyExpr (...);
11426         if (old != Report.Errors)
11427                 return null;
11428         else
11429                 return x;
11430
11431         So the property expr is returned, but it is invalid, so the error
11432         will be flagged during the resolve process. 
11433
11434         * class.cs: Remove InheritablePropertySignatureCompare from the
11435         class, as we no longer depend on the property signature to compute
11436         whether it is possible to implement a method or not.
11437
11438         The reason is that calling PropertyInfo.GetGetMethod will return
11439         null (in .NET, in Mono it works, and we should change this), in
11440         cases where the Get Method does not exist in that particular
11441         class.
11442
11443         So this code:
11444
11445         class X { public virtual int A { get { return 1; } } }
11446         class Y : X { }
11447         class Z : Y { public override int A { get { return 2; } } }
11448
11449         Would fail in Z because the parent (Y) would not have the property
11450         defined.  So we avoid this completely now (because the alternative
11451         fix was ugly and slow), and we now depend exclusively on the
11452         method names.
11453
11454         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11455         reference method, instead of using the property.
11456
11457         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11458         routines are gone now.
11459
11460         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11461         names, they were incorrectly named.
11462
11463         * cs-tokenizer.cs: Return are more gentle token on failure. 
11464
11465         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11466         had an out-of-sync index variable, which caused it to remove from
11467         the list of pending methods the wrong method sometimes.
11468
11469 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11470
11471         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11472         CanWrite, because those refer to this particular instance of the
11473         property, and do not take into account the fact that we can
11474         override single members of a property.
11475
11476         Constructor requires an EmitContext.  The resolution process does
11477         not happen here, but we need to compute the accessors before,
11478         because the resolution does not always happen for properties.
11479
11480         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11481         subclass, before we did not update this flag, but we did update
11482         bindingflags. 
11483
11484         (GetAccessors): Drop this routine, as it did not work in the
11485         presence of partially overwritten set/get methods. 
11486
11487         Notice that this broke the cs1540 detection, but that will require
11488         more thinking. 
11489
11490 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11491
11492         * class.cs:
11493         * codegen.cs:
11494         * driver.cs: issue a warning instead of an error if we don't support
11495         debugging for the platform. Also ignore a couple of errors that may
11496         arise when trying to write the symbols. Undo my previous patch.
11497
11498 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11499
11500         * driver.cs: ignore /debug switch except for Unix platforms.
11501
11502 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11503
11504         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11505
11506 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11507
11508         * driver.cs: Do not make mcs-debug conditional, so we do not break
11509         builds that use it.
11510
11511         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11512         review this patch.  But basically after all the children variables
11513         have been merged, the value of "Breaks" was not being set to
11514         new_breaks for Switch blocks.  I think that it should be set after
11515         it has executed.  Currently I set this to the value of new_breaks,
11516         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11517         conservative, but I do not understand this code very well.
11518
11519         I did not break anything in the build, so that is good ;-)
11520
11521         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11522
11523 2002-10-20  Mark Crichton  <crichton@gimp.org>
11524
11525         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11526
11527 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11528
11529         * cfold.cs: Fixed compile blocker.
11530
11531 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11532
11533         * driver.cs: I was chekcing the key, not the file.
11534
11535 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11536
11537         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11538         message that we were generating - we just need to silently return
11539         a null.
11540
11541 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11542
11543         * class.cs (Event.Define): Change my previous commit, as this
11544         breaks the debugger.  This is a temporary hack, as it seems like
11545         the compiler is generating events incorrectly to begin with.
11546
11547         * expression.cs (Binary.ResolveOperator): Added support for 
11548         "U operator - (E x, E y)"
11549
11550         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11551         y)".
11552
11553         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11554         init-only variables, but this path did not take into account that
11555         there might be also instance readonly variables.  Correct this
11556         problem. 
11557
11558         This fixes bug 32253
11559
11560         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11561         delegates as well.
11562
11563         * driver.cs: Change the extension for modules to `netmodule'
11564
11565         * cs-parser.jay: Improved slightly the location tracking for
11566         the debugger symbols.
11567
11568         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11569         modifiers that were specified instead of the hardcoded value
11570         (FamAndAssem).  This was basically ignoring the static modifier,
11571         and others.  Fixes 32429.
11572
11573         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11574         fixed a bug in the process (32476)
11575
11576         * expression.cs (ArrayAccess.EmitAssign): Patch from
11577         hwang_rob@yahoo.ca that fixes bug 31834.3
11578
11579 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11580
11581         * driver.cs: Make the module extension .netmodule.
11582
11583 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11584
11585         * driver.cs: Report an error if the resource file is not found
11586         instead of crashing.
11587
11588         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11589         false, like Emit does.
11590
11591 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11592
11593         * typemanager.cs: Remove unused private member.  Also reported mcs
11594         bug to report this as a warning like csc.
11595
11596 2002-10-15  Martin Baulig  <martin@gnome.org>
11597
11598         * statement.cs (Statement.Emit): Made this a virtual method; emits
11599         the line number info and calls DoEmit().
11600         (Statement.DoEmit): New protected abstract method, formerly knows
11601         as Statement.Emit().
11602
11603         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11604
11605 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11606
11607         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11608         have fixed a remaining problem: not every AddXXXX was adding a
11609         fully qualified name.  
11610
11611         Now everyone registers a fully qualified name in the DeclSpace as
11612         being defined instead of the partial name.  
11613
11614         Downsides: we are slower than we need to be due to the excess
11615         copies and the names being registered this way.  
11616
11617         The reason for this is that we currently depend (on the corlib
11618         bootstrap for instance) that types are fully qualified, because
11619         we dump all the types in the namespace, and we should really have
11620         types inserted into the proper namespace, so we can only store the
11621         basenames in the defined_names array.
11622
11623 2002-10-10  Martin Baulig  <martin@gnome.org>
11624
11625         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11626         from bug #31834, see the bug report for a testcase which is
11627         miscompiled.
11628
11629 2002-10-10  Martin Baulig  <martin@gnome.org>
11630
11631         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11632         flow analysis code for this.
11633
11634         * statement.cs (Do, While, For): Tell the flow analysis code about
11635         infinite loops.
11636         (FlowBranching.UsageVector): Added support for infinite loops.
11637         (Block.Resolve): Moved the dead code elimination here and use flow
11638         analysis to do it.
11639
11640 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * class.cs (Field.Define): Catch cycles on struct type
11643         definitions. 
11644
11645         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11646         fields if the fields are static.  We only need to check instance
11647         fields. 
11648
11649         * expression.cs (As.DoResolve): Test for reference type.
11650
11651         * statement.cs (Using.ResolveExpression): Use
11652         ConvertImplicitRequired, not ConvertImplicit which reports an
11653         error on failture
11654         (Using.ResolveLocalVariableDecls): ditto.
11655
11656         * expression.cs (Binary.ResolveOperator): Report errors in a few
11657         places where we had to.
11658
11659         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11660
11661 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11662
11663         * expression.cs: Use StoreFromPtr instead of extracting the type
11664         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11665
11666         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11667         an enumeration value to a System.Enum, but System.Enum is not a
11668         value type, but an class type, so we need to box.
11669
11670         (Expression.ConvertExplicit): One codepath could return
11671         errors but not flag them.  Fix this.  Fixes #31853
11672
11673         * parameter.cs (Resolve): Do not allow void as a parameter type.
11674
11675 2002-10-06  Martin Baulig  <martin@gnome.org>
11676
11677         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11678         if it's a class type and not a struct.  Fixes #31815.
11679
11680 2002-10-06  Martin Baulig  <martin@gnome.org>
11681
11682         * statement.cs: Reworked the flow analysis code a bit to make it
11683         usable for dead code elimination.
11684
11685 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11686
11687         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11688
11689 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11690
11691         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11692         to fix the test 165, will investigate deeper.
11693
11694 2002-10-04  Martin Baulig  <martin@gnome.org>
11695
11696         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11697         finally blocks actually work.
11698         (Try.Resolve): We don't need to create a sibling for `finally' if
11699         there is no finally block.
11700
11701 2002-10-04  Martin Baulig  <martin@gnome.org>
11702
11703         * class.cs (Constructor.Define): The default accessibility for a
11704         non-default constructor is private, not public.
11705
11706 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11707
11708         * class.cs (Constructor): Make AllowedModifiers public, add
11709         EXTERN.
11710
11711         * cs-parser.jay: Perform the modifiers test here, as the
11712         constructor for the Constructor class usually receives a zero
11713         because of the way we create it (first we create, later we
11714         customize, and we were never checking the modifiers).
11715
11716         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11717         is a version of LookupTypeReflection that includes the type-name
11718         cache.  This can be used as a fast path for functions that know
11719         the fully qualified name and are only calling into *.GetType() to
11720         obtain a composed type.
11721
11722         This is also used by TypeManager.LookupType during its type
11723         composition.
11724
11725         (LookupType): We now also track the real type name, as sometimes
11726         we can get a quey for the real type name from things like
11727         ComposedCast.  This fixes bug 31422.
11728
11729         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11730         complete type fullname, it does not have to go through the type
11731         resolution system to obtain the composed version of the type (for
11732         obtaining arrays or pointers).
11733
11734         (Conditional.Emit): Use the EmitBoolExpression to
11735         generate nicer code, as requested by Paolo.
11736
11737         (ArrayCreation.CheckIndices): Use the patch from
11738         hwang_rob@yahoo.ca to validate the array initializers. 
11739
11740 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11741
11742         * class.cs (ConstructorInitializer.Emit): simplify code by using
11743         Invocation.EmitCall, and at the same time, fix the bugs in calling
11744         parent constructors that took variable arguments. 
11745
11746         * ecore.cs (Expression.ConvertNumericExplicit,
11747         Expression.ImplicitNumericConversion): Remove the code that
11748         manually wrapped decimal (InternalTypeConstructor call is now gone
11749         as well).
11750
11751         * expression.cs (Cast.TryReduce): Also handle decimal types when
11752         trying to perform a constant fold on the type.
11753
11754         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11755
11756         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11757         that only turned off an error report, and did nothing else. 
11758
11759 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11760
11761         * driver.cs: Handle and ignore /fullpaths
11762
11763 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11764
11765         * expression.cs (Binary.ResolveOperator): Catch the case where
11766         DoNumericPromotions returns true, 
11767
11768         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11769
11770 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11771
11772         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11773         report error 70.
11774
11775 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11776
11777         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11778         conversion exists, but it is also required that the conversion be
11779         performed.  This manifested in "(Type64Enum) 2".  
11780
11781         * class.cs (TypeManager.AddMethod): The fix is not to change
11782         AddEnum, because that one was using a fully qualified name (every
11783         DeclSpace derivative does), but to change the AddMethod routine
11784         that was using an un-namespaced name.  This now correctly reports
11785         the duplicated name.
11786
11787         Revert patch until I can properly fix it.  The issue
11788         is that we have a shared Type space across all namespaces
11789         currently, which is wrong.
11790
11791         Options include making the Namespace a DeclSpace, and merge
11792         current_namespace/current_container in the parser.
11793
11794 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11795
11796         * cs-parser.jay: Improve error reporting when we get a different
11797         kind of expression in local_variable_type and
11798         local_variable_pointer_type. 
11799
11800         Propagate this to avoid missleading errors being reported.
11801
11802         * ecore.cs (ImplicitReferenceConversion): treat
11803         TypeManager.value_type as a target just like object_type.   As
11804         code like this:
11805
11806         ValueType v = 1;
11807
11808         Is valid, and needs to result in the int 1 being boxed before it
11809         is assigned to the value type v.
11810
11811         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11812         to validate the enumeration name.
11813
11814         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11815         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11816         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11817
11818         * ecore.cs (TryImplicitIntConversion): When doing an
11819         implicit-enumeration-conversion, check if the type is 64-bits and
11820         perform a conversion before passing to EnumConstant.
11821
11822 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11823
11824         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11825         report ambiguous type references.  Unlike the MS version, we
11826         report what the ambiguity is.   Innovation at work ;-)
11827
11828         (DeclSpace.FindType): Require a location argument to
11829         display when we display an ambiguous error.
11830
11831         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11832
11833         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11834
11835         * expression.cs (EmitDynamicInitializers): Apply patch from
11836         hwang_rob@yahoo.ca that fixes the order in which we emit our
11837         initializers. 
11838
11839 2002-09-21  Martin Baulig  <martin@gnome.org>
11840
11841         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11842         delegate takes no arguments.
11843
11844 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11845
11846         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11847         from integers.
11848
11849         * expression.cs: Extract the underlying type.
11850
11851         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11852
11853         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11854
11855 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11856
11857         * class.cs (TypeContainer.DefineType): We can not use the nice
11858         PackingSize with the size set to 1 DefineType method, because it
11859         will not allow us to define the interfaces that the struct
11860         implements.
11861
11862         This completes the fixing of bug 27287
11863
11864         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11865         means also structs.  This fixes part of the problem. 
11866         (Expresion.ImplicitReferenceConversionExists): ditto.
11867
11868         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11869         error if there were no errors reported during the type lookup
11870         process, to avoid duplicates or redundant errors.  Without this
11871         you would get an ambiguous errors plus a type not found.  We have
11872         beaten the user enough with the first error.  
11873
11874         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11875         reference. 
11876
11877         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11878         during the resolution process, stop the lookup, this avoids
11879         repeated error reports (same error twice).
11880
11881         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11882
11883         * typemanager.cs (LookupType): Redo the type lookup code to match
11884         the needs of System.Reflection.  
11885
11886         The issue is that System.Reflection requires references to nested
11887         types to begin with a "+" sign instead of a dot.  So toplevel
11888         types look like: "NameSpace.TopLevelClass", and nested ones look
11889         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11890         levels. 
11891
11892 2002-09-19  Martin Baulig  <martin@gnome.org>
11893
11894         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11895         says that a method always returns or always throws an exception,
11896         don't report the CS0161.
11897
11898         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11899         set `Returns = new_returns'.
11900
11901 2002-09-19  Martin Baulig  <martin@gnome.org>
11902
11903         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11904         to an enum constant, check for a CS0176.
11905
11906 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11907
11908         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11909         for operators that must be in pairs and report errors.
11910
11911         * ecore.cs (SimpleName.DoResolveType): During the initial type
11912         resolution process, when we define types recursively, we must
11913         check first for types in our current scope before we perform
11914         lookups in the enclosing scopes.
11915
11916         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11917
11918         (Invocation.VerifyArgumentsCompat): Call
11919         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11920         I thought we were supposed to always call this, but there are a
11921         few places in the code where we dont do it.
11922
11923 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11924
11925         * driver.cs: Add support in -linkres and -resource to specify the
11926         name of the identifier.
11927
11928 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * ecore.cs (StandardConversionExists): Sync with the conversion
11931         code: allow anything-* to void* conversions.
11932
11933         (FindMostSpecificSource): Use an Expression argument
11934         instead of a Type, because we might be handed over a Literal which
11935         gets a few more implicit conversions that plain types do not.  So
11936         this information was being lost.
11937
11938         Also, we drop the temporary type-holder expression when not
11939         required.
11940
11941 2002-09-17  Martin Baulig  <martin@gnome.org>
11942
11943         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11944         this is an explicit interface implementation.
11945
11946 2002-09-17  Martin Baulig  <martin@gnome.org>
11947
11948         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11949         different `IndexerName' attributes.
11950
11951         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11952         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11953         virtual CommonResolve().
11954
11955 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11956
11957         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11958         and convert that to the UnderlyingType.
11959
11960         * statement.cs (Foreach.Resolve): Indexers are just like variables
11961         or PropertyAccesses.
11962
11963         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11964         inside quoted strings, we were not doing this before.
11965
11966 2002-09-16  Martin Baulig  <martin@gnome.org>
11967
11968         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11969         resolve it.  This is needed for the definite assignment check of the
11970         instance expression, fixes bug #29846.
11971         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11972
11973 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11974
11975         * parameter.cs: Fix compile error.  Cannot reference static member
11976         from an instance object.  Is this an mcs bug?
11977
11978 2002-09-14  Martin Baulig  <martin@gnome.org>
11979
11980         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11981         multiple times.  Fixes bug #30295, added test-166.cs.
11982
11983 2002-09-14  Martin Baulig  <martin@gnome.org>
11984
11985         * statement.cs (Block.Emit): Don't emit unreachable code.
11986         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11987         `break' statements.
11988         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11989
11990 2002-09-14  Martin Baulig  <martin@gnome.org>
11991
11992         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11993         is set.
11994
11995 2002-09-14  Martin Baulig  <martin@gnome.org>
11996
11997         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11998         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11999         be false on the ms runtime.
12000
12001 2002-09-13  Martin Baulig  <martin@gnome.org>
12002
12003         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12004         the CS0038 error message.
12005
12006 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12007
12008         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12009         constant inside, return it.
12010
12011 2002-09-12  Martin Baulig  <martin@gnome.org>
12012
12013         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12014         implicit conversion can be done between enum types.
12015
12016         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12017         check whether an implicit conversion to the current enum's UnderlyingType
12018         exists and report an error if not.
12019
12020         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12021         without debugging support.
12022
12023         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12024         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12025
12026 2002-09-12  Martin Baulig  <martin@gnome.org>
12027
12028         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12029
12030         * ecore.cs (IMemberExpr.DeclaringType): New property.
12031         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12032         nonstatic member of an outer type (CS0038).
12033
12034 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12035
12036         * driver.cs: Activate the using-error detector at warning level
12037         4 (at least for MS-compatible APIs).
12038
12039         * namespace.cs (VerifyUsing): Small buglett fix.
12040
12041         * pending.cs (PendingImplementation): pass the container pointer. 
12042
12043         * interface.cs (GetMethods): Allow for recursive definition.  Long
12044         term, I would like to move every type to support recursive
12045         definitions, not the current ordering mechanism that we have right
12046         now.
12047
12048         The situation is this: Attributes are handled before interfaces,
12049         so we can apply attributes to interfaces.  But some attributes
12050         implement interfaces, we will now handle the simple cases
12051         (recursive definitions will just get an error).  
12052
12053         * parameter.cs: Only invalidate types at the end if we fail to
12054         lookup all types.  
12055
12056 2002-09-09  Martin Baulig  <martin@gnome.org>
12057
12058         * ecore.cs (PropertyExpr.Emit): Also check for
12059         TypeManager.system_int_array_get_length so this'll also work when
12060         compiling corlib.  Fixes #30003.
12061
12062 2002-09-09  Martin Baulig  <martin@gnome.org>
12063
12064         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12065         and throw an exception if we can't get the type's size.  Fixed #30040,
12066         added test-165.cs.
12067
12068 2002-09-09  Martin Baulig  <martin@gnome.org>
12069
12070         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12071
12072         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12073         context.  Fixes bug #30027.
12074
12075         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12076         virtual functions.  Fixes bug #30043, added test-164.cs.
12077
12078 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12079
12080         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12081
12082 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12083
12084         * driver.cs: Use an object to get the windows codepage since it's not a
12085         static property.
12086
12087 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12088
12089         * statement.cs (For.Emit): for infinite loops (test == null)
12090         return whether there is a break inside, not always "true".
12091
12092         * namespace.cs (UsingEntry): New struct to hold the name of the
12093         using definition, the location where it is defined, and whether it
12094         has been used in a successful type lookup.
12095
12096         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12097         strings.
12098
12099         * decl.cs: ditto.
12100
12101 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12102
12103         * attribute.cs : Fix incorrect code which relied on catching
12104         a NullReferenceException to detect a null being passed in
12105         where an object was expected.
12106
12107 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12108
12109         * statement.cs (Try): flag the catch variable as assigned
12110
12111         * expression.cs (Cast): Simplified by using ResolveType instead of
12112         manually resolving.
12113
12114         * statement.cs (Catch): Fix bug by using ResolveType.
12115
12116 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12117
12118         * expression.cs (BetterConversion): Special case for when we have
12119         a NullLiteral as the argument and we have to choose between string
12120         and object types - we choose string the way csc does.
12121
12122         * attribute.cs (Attribute.Resolve): Catch the
12123         NullReferenceException and report error #182 since the Mono
12124         runtime no more has the bug and having this exception raised means
12125         we tried to select a constructor which takes an object and is
12126         passed a null.
12127
12128 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12129
12130         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12131         message (1502, 1503) when we can't locate a method after overload
12132         resolution. This is much more informative and closes the bug
12133         Miguel reported.
12134
12135         * interface.cs (PopulateMethod): Return if there are no argument
12136         types. Fixes a NullReferenceException bug.
12137
12138         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12139         expressions too. Previously we were checking only in one place for
12140         positional arguments leaving out named arguments.
12141
12142         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12143         type to the enum type is not allowed. Remove code corresponding to
12144         that.
12145
12146         (ConvertNumericExplicit): Allow explicit conversions from
12147         the underlying type to enum type. This precisely follows the spec
12148         and closes a bug filed by Gonzalo.
12149
12150 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12151
12152         * compiler.csproj:
12153         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12154
12155 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12156
12157         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12158         it was important that we stored the right value after the
12159         reduction in `converted'.
12160
12161 2002-09-04  Martin Baulig  <martin@gnome.org>
12162
12163         * location.cs (Location.SymbolDocument): Use full pathnames for the
12164         source files.
12165
12166 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12169         of the expression resolve mechanism, because that will catch the
12170         SimpleName error failures.
12171
12172         (Conditional): If we can not resolve the
12173         expression, return, do not crash.
12174
12175 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12176
12177         * cs-tokenizer.cs:
12178         (location): display token name instead of its number.
12179
12180 2002-08-28  Martin Baulig  <martin@gnome.org>
12181
12182         * expression.cs (Binary.ResolveOperator): Don't silently return
12183         but return an error if an operator cannot be applied between two
12184         enum types.
12185
12186 2002-08-28  Martin Baulig  <martin@gnome.org>
12187
12188         * class.cs (Constructor.Define): Set the permission attributes
12189         correctly instead of making all constructors public.
12190
12191 2002-08-28  Martin Baulig  <martin@gnome.org>
12192
12193         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12194         for private members before reporting a CS0103; if we find anything,
12195         it's a CS0122.
12196
12197 2002-08-28  Martin Baulig  <martin@gnome.org>
12198
12199         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12200         to check whether `closure_start_type == closure_invocation_type',
12201         we also need to check whether `m.DeclaringType == closure_invocation_type'
12202         before bypassing the permission checks.  We might be accessing
12203         protected/private members from the base class.
12204         (TypeManager.RealMemberLookup): Only set private_ok if private
12205         members were requested via BindingFlags.NonPublic.
12206
12207         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12208
12209         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12210         MethodGroupExpr.IsExplicitImpl if appropriate.
12211         (Invocation.DoResolve): Don't report the CS0120 for explicit
12212         interface implementations.
12213
12214 2002-08-27  Martin Baulig  <martin@gnome.org>
12215
12216         * expression.cs (Invocation.DoResolve): If this is a static
12217         method and we don't have an InstanceExpression, we must report
12218         a CS0120.
12219
12220 2002-08-25  Martin Baulig  <martin@gnome.org>
12221
12222         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12223         `==' between a valuetype and an object.
12224
12225 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12226
12227         * ecore.cs (TypeExpr): Provide a ToString method.
12228
12229 2002-08-24  Martin Baulig  <martin@gnome.org>
12230
12231         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12232         now called proggie.dbg and it's a binary file.
12233
12234 2002-08-23  Martin Baulig  <martin@gnome.org>
12235
12236         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12237
12238 2002-08-23  Martin Baulig  <martin@gnome.org>
12239
12240         * struct.cs (MyStructInfo.ctor): Make this work with empty
12241         structs; it's not allowed to use foreach() on null.
12242
12243 2002-08-23  Martin Baulig  <martin@gnome.org>
12244
12245         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12246         writer the full pathname of the generated assembly.
12247
12248 2002-08-23  Martin Baulig  <martin@gnome.org>
12249
12250         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12251         A `finally' block never returns or breaks; improved handling of
12252         unreachable code.
12253
12254 2002-08-23  Martin Baulig  <martin@gnome.org>
12255
12256         * statement.cs (Throw.Resolve): Allow `throw null'.
12257
12258 2002-08-23  Martin Baulig  <martin@gnome.org>
12259
12260         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12261         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12262         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12263         MemberLookup would return a wrong event if this is an explicit
12264         interface implementation and the class has an event with the same
12265         name.
12266
12267 2002-08-23  Martin Baulig  <martin@gnome.org>
12268
12269         * statement.cs (Block.AddChildVariableNames): New public method.
12270         (Block.AddChildVariableName): Likewise.
12271         (Block.IsVariableNameUsedInChildBlock): Likewise.
12272         (Block.AddVariable): Check whether a variable name has already
12273         been used in a child block.
12274
12275         * cs-parser.jay (declare_local_variables): Mark all variable names
12276         from the current block as being used in a child block in the
12277         implicit block.
12278
12279 2002-08-23  Martin Baulig  <martin@gnome.org>
12280
12281         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12282         find the symbol writer.
12283
12284         * driver.cs: csc also allows the arguments to /define being
12285         separated by commas, not only by semicolons.
12286
12287 2002-08-23  Martin Baulig  <martin@gnome.org>
12288
12289         * interface.cs (Interface.GetMembers): Added static check for events.
12290
12291 2002-08-15  Martin Baulig  <martin@gnome.org>
12292
12293         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12294         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12295
12296         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12297         why the MethodData.EmitDestructor() change was necessary.
12298
12299 2002-08-20  Martin Baulig  <martin@gnome.org>
12300
12301         * class.cs (TypeContainer.FindMembers): Added static check for events.
12302
12303         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12304
12305         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12306         use Type.GetEvents(), not Type.FindMembers().
12307
12308 2002-08-20  Martin Baulig  <martin@gnome.org>
12309
12310         * decl.cs (MemberCache): Added a special method cache which will
12311         be used for method-only searched.  This ensures that a method
12312         search will return a MethodInfo with the correct ReflectedType for
12313         inherited methods.      
12314
12315 2002-08-20  Martin Baulig  <martin@gnome.org>
12316
12317         * decl.cs (DeclSpace.FindMembers): Made this public.
12318
12319 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12320
12321         * delegate.cs: fixed build on windows.
12322         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12323
12324 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12325
12326         * ecore.cs (StandardConversionExists): Return a false
12327         if we are trying to convert the void type to anything else
12328         since that is not allowed.
12329
12330         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12331         we flag error 70 in the event an event is trying to be accessed
12332         directly from outside the declaring type.
12333
12334 2002-08-20  Martin Baulig  <martin@gnome.org>
12335
12336         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12337         MemberCache from typemanager.cs to decl.cs.
12338
12339 2002-08-19  Martin Baulig  <martin@gnome.org>
12340
12341         * class.cs (TypeContainer): Implement IMemberContainer.
12342         (TypeContainer.DefineMembers): Create the MemberCache.
12343         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12344         return public members if BindingFlags.Public was given, check
12345         whether members are static.
12346
12347 2002-08-16  Martin Baulig  <martin@gnome.org>
12348
12349         * decl.cs (DeclSpace.Define): Splitted this in Define and
12350         DefineMembers.  DefineMembers is called first and initializes the
12351         MemberCache.
12352
12353         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12354         DefineMembers() on all our DeclSpaces.
12355
12356         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12357         but call DefineMembers() on all nested interfaces.  We call their
12358         Define() in our new Define() function.
12359
12360         * interface.cs (Interface): Implement IMemberContainer.
12361         (Interface.Define): Moved all code except the attribute stuf to
12362         DefineMembers().
12363         (Interface.DefineMembers): Initialize the member cache.
12364
12365         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12366         need this anymore since we can use MemberCache.FindMembers directly.
12367
12368 2002-08-19  Martin Baulig  <martin@gnome.org>
12369
12370         * typemanager.cs (MemberCache): When creating the cache for an
12371         interface type, add all inherited members.
12372         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12373         to `out bool used_cache' and documented it.
12374         (TypeManager.MemberLookup): If we already used the cache in the first
12375         iteration, we don't need to do the interfaces check.
12376
12377 2002-08-19  Martin Baulig  <martin@gnome.org>
12378
12379         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12380         here from IMemberFinder and don't implement this interface anymore.
12381         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12382
12383         * typemanager.cs (IMemberFinder): This interface is now only used by
12384         classes which actually support the member cache.
12385         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12386         since we only put DeclSpaces into this Hashtable.
12387         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12388         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12389
12390 2002-08-16  Martin Baulig  <martin@gnome.org>
12391
12392         * typemanager.cs (ICachingMemberFinder): Removed.
12393         (IMemberFinder.MemberCache): New property.
12394         (TypeManager.FindMembers): Merged this with RealFindMembers().
12395         This function will never be called from TypeManager.MemberLookup()
12396         so we can't use the cache here, just the IMemberFinder.
12397         (TypeManager.MemberLookup_FindMembers): Check whether the
12398         IMemberFinder has a MemberCache and call the cache's FindMembers
12399         function.
12400         (MemberCache): Rewrote larger parts of this yet another time and
12401         cleaned it up a bit.
12402
12403 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * driver.cs (LoadArgs): Support quoting.
12406
12407         (Usage): Show the CSC-like command line arguments.
12408
12409         Improved a few error messages.
12410
12411 2002-08-15  Martin Baulig  <martin@gnome.org>
12412
12413         * typemanager.cs (IMemberContainer.Type): New property.
12414         (IMemberContainer.IsInterface): New property.
12415
12416         The following changes are conditional to BROKEN_RUNTIME, which is
12417         defined at the top of the file.
12418
12419         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12420         class'es members, but add all members from TypeHandle.ObjectType
12421         if we're an interface.
12422         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12423         is the current type.
12424         (MemberCache.CacheEntry.Container): Removed this field.
12425         (TypeHandle.GetMembers): Include inherited members.
12426
12427 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12428
12429         * typemanager.cs: fixed compilation and added a comment on a field that
12430         is never used.
12431
12432 2002-08-15  Martin Baulig  <martin@gnome.org>
12433
12434         * class.cs (ConstructorInitializer.Resolve): In the
12435         Expression.MemberLookup call, use the queried_type as
12436         invocation_type.
12437
12438         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12439         declared' attribute, it's always true.
12440         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12441         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12442         temporary wrapper for FindMembers which tells MemberLookup whether
12443         members from the base classes are included in the return value.
12444         This will go away soon.
12445         (TypeManager.MemberLookup): Use this temporary hack here; once the
12446         new MemberCache is completed, we don't need to do the DeclaredOnly
12447         looping here anymore since the MemberCache will take care of this.
12448         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12449         (MemberCache): When creating the MemberCache for a class, get
12450         members from the current class and all its base classes.
12451         (MemberCache.CacheEntry.Container): New field.  This is a
12452         temporary hack until the Mono runtime is fixed to distinguish
12453         between ReflectedType and DeclaringType.  It allows us to use MCS
12454         with both the MS runtime and the unfixed Mono runtime without
12455         problems and without accecting performance.
12456         (MemberCache.SearchMembers): The DeclaredOnly looping from
12457         TypeManager.MemberLookup is now done here.      
12458
12459 2002-08-14  Martin Baulig  <martin@gnome.org>
12460
12461         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12462         Type.GetFields on dynamic types but get the fields from the
12463         corresponding TypeContainer.
12464         (MyStructInfo.GetStructInfo): Added check for enum types.
12465
12466         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12467         (MemberList.SyncRoot): Implemented.
12468         (TypeManager.FilterWithClosure): No need to check permissions if
12469         closure_start_type == closure_invocation_type, don't crash if
12470         closure_invocation_type is null.
12471
12472 2002-08-13  Martin Baulig  <martin@gnome.org>
12473
12474         Rewrote TypeContainer.FindMembers to use a member cache.  This
12475         gives us a speed increase of about 35% for the self-hosting MCS
12476         build and of about 15-20% for the class libs (both on GNU/Linux).
12477
12478         * report.cs (Timer): New class to get enhanced profiling.  This
12479         whole class is "TIMER" conditional since it remarkably slows down
12480         compilation speed.
12481
12482         * class.cs (MemberList): New class.  This is an IList wrapper
12483         which we're now using instead of passing MemberInfo[]'s around to
12484         avoid copying this array unnecessarily.
12485         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12486         (ICachingMemberFinder, IMemberContainer): New interface.
12487         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12488         has already been checked, otherwise use it for the name comparision.
12489         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12490         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12491         if possible.  Returns a MemberList, not a MemberInfo [].
12492         (TypeHandle): New class, implements IMemberContainer.  We create
12493         one instance of this class per type, it contains a MemberCache
12494         which is used to do the member lookups.
12495         (MemberCache): New class.  Each instance of this class contains
12496         all members of a type and a name-based hash table.
12497         (MemberCache.FindMembers): This is our new member lookup
12498         function.  First, it looks up all members of the requested name in
12499         the hash table.  Then, it walks this list and sorts out all
12500         applicable members and returns them.
12501
12502 2002-08-13  Martin Baulig  <martin@gnome.org>
12503
12504         In addition to a nice code cleanup, this gives us a performance
12505         increase of about 1.4% on GNU/Linux - not much, but it's already
12506         half a second for the self-hosting MCS compilation.
12507
12508         * typemanager.cs (IMemberFinder): New interface.  It is used by
12509         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12510         Enum, Delegate or Interface.
12511         (TypeManager.finder_to_member_finder): New PtrHashtable.
12512         (TypeManager.finder_to_container): Removed.
12513         (TypeManager.finder_to_delegate): Removed.
12514         (TypeManager.finder_to_interface): Removed.
12515         (TypeManager.finder_to_enum): Removed.
12516
12517         * interface.cs (Interface): Implement IMemberFinder.
12518
12519         * delegate.cs (Delegate): Implement IMemberFinder.
12520
12521         * enum.cs (Enum): Implement IMemberFinder.
12522
12523         * class.cs (TypeContainer): Implement IMemberFinder.
12524
12525 2002-08-12  Martin Baulig  <martin@gnome.org>
12526
12527         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12528
12529 2002-08-12  Martin Baulig  <martin@gnome.org>
12530
12531         * ecore.cs (ITypeExpression): New interface for expressions which
12532         resolve to a type.
12533         (TypeExpression): Renamed to TypeLookupExpression.
12534         (Expression.DoResolve): If we're doing a types-only lookup, the
12535         expression must implement the ITypeExpression interface and we
12536         call DoResolveType() on it.
12537         (SimpleName): Implement the new ITypeExpression interface.
12538         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12539         hack, the situation that we're only looking up types can't happen
12540         anymore when this method is called.  Moved the type lookup code to
12541         DoResolveType() and call it.
12542         (SimpleName.DoResolveType): This ITypeExpression interface method
12543         is now doing the types-only lookup.
12544         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12545         (ResolveFlags): Added MaskExprClass.
12546
12547         * expression.cs (MemberAccess): Implement the ITypeExpression
12548         interface.
12549         (MemberAccess.DoResolve): Added support for a types-only lookup
12550         when we're called via ITypeExpression.DoResolveType().
12551         (ComposedCast): Implement the ITypeExpression interface.
12552
12553         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12554         Expression.Resolve() with ResolveFlags.Type instead.
12555
12556 2002-08-12  Martin Baulig  <martin@gnome.org>
12557
12558         * interface.cs (Interface.Define): Apply attributes.
12559
12560         * attribute.cs (Attribute.ApplyAttributes): Added support for
12561         interface attributes.
12562
12563 2002-08-11  Martin Baulig  <martin@gnome.org>
12564
12565         * statement.cs (Block.Emit): Only check the "this" variable if we
12566         do not always throw an exception.
12567
12568         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12569         whether the property has a set accessor.
12570
12571 2002-08-11  Martin Baulig  <martin@gnome.org>
12572
12573         Added control flow analysis support for structs.
12574
12575         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12576         with control flow analysis turned off.
12577         (IVariable): New interface.
12578         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12579         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12580         (FieldExpr.DoResolve): Resolve the instance expression with flow
12581         analysis turned off and do the definite assignment check after the
12582         resolving when we know what the expression will resolve to.
12583
12584         * expression.cs (LocalVariableReference, ParameterReference):
12585         Implement the new IVariable interface, only call the flow analysis
12586         code if ec.DoFlowAnalysis is true.
12587         (This): Added constructor which takes a Block argument.  Implement
12588         the new IVariable interface.
12589         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12590         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12591         This does the definite assignment checks for struct members.
12592
12593         * class.cs (Constructor.Emit): If this is a non-static `struct'
12594         constructor which doesn't have any initializer, call
12595         Block.AddThisVariable() to tell the flow analysis code that all
12596         struct elements must be initialized before control returns from
12597         the constructor.
12598
12599         * statement.cs (MyStructInfo): New public class.
12600         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12601         argument to this indexer.  If non-zero, check an individual struct
12602         member, not the whole struct.
12603         (FlowBranching.CheckOutParameters): Check struct members.
12604         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12605         overloaded versions of these methods which take an additional
12606         `int field_idx' argument to check struct members.
12607         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12608         overloaded versions of these methods which take an additional
12609         `string field_name' argument to check struct member.s
12610         (VariableInfo): Implement the IVariable interface.
12611         (VariableInfo.StructInfo): New public property.  Returns the
12612         MyStructInfo instance of the variable if it's a struct or null.
12613         (Block.AddThisVariable): New public method.  This is called from
12614         Constructor.Emit() for non-static `struct' constructor which do
12615         not have any initializer.  It creates a special variable for the
12616         "this" instance variable which will be checked by the flow
12617         analysis code to ensure that all of the struct's fields are
12618         initialized before control returns from the constructor.
12619         (UsageVector): Added support for struct members.  If a
12620         variable/parameter is a struct with N members, we reserve a slot
12621         in the usage vector for each member.  A struct is considered fully
12622         initialized if either the struct itself (slot 0) or all its
12623         members are initialized.
12624
12625 2002-08-08  Martin Baulig  <martin@gnome.org>
12626
12627         * driver.cs (Driver.MainDriver): Only report an error CS5001
12628         if there were no compilation errors.
12629
12630         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12631         `UnsafeContext' property to determine whether the parent is in
12632         unsafe context rather than checking the parent's ModFlags:
12633         classes nested in an unsafe class are unsafe as well.
12634
12635 2002-08-08  Martin Baulig  <martin@gnome.org>
12636
12637         * statement.cs (UsageVector.MergeChildren): Distinguish between
12638         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12639         we return.  Added test17() and test18() to test-154.cs.
12640
12641 2002-08-08  Martin Baulig  <martin@gnome.org>
12642
12643         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12644         Family access, make sure the invoking type isn't a subclass of the
12645         queried type (that'd be a CS1540).
12646
12647         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12648         this method which takes an additional `Type invocation_type'.
12649
12650         * expression.cs (BaseAccess.DoResolve): Use the base type as
12651         invocation and query type.
12652         (MemberAccess.DoResolve): If the lookup failed and we're about to
12653         report a CS0122, try a lookup with the ec.ContainerType - if this
12654         succeeds, we must report a CS1540.
12655
12656 2002-08-08  Martin Baulig  <martin@gnome.org>
12657
12658         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12659         (MethodGroupExpr): Implement the IMemberExpr interface.
12660
12661         * expression (MemberAccess.ResolveMemberAccess): No need to have
12662         any special code for MethodGroupExprs anymore, they're now
12663         IMemberExprs.   
12664
12665 2002-08-08  Martin Baulig  <martin@gnome.org>
12666
12667         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12668         Family, FamANDAssem and FamORAssem permissions.
12669         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12670
12671 2002-08-08  Martin Baulig  <martin@gnome.org>
12672
12673         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12674         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12675         or loop block.
12676
12677 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12678
12679         * driver.cs: implemented /resource option to embed managed resources.
12680
12681 2002-08-07  Martin Baulig  <martin@gnome.org>
12682
12683         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12684         (FieldBase.HasFieldInitializer): New public property.
12685         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12686         returns the field initializer and makes sure it is only resolved once.
12687         (TypeContainer.EmitFieldInitializers): Call
12688         FieldBase.GetInitializerExpression to get the initializer, this ensures
12689         that it isn't resolved multiple times.
12690
12691         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12692         the resolving process (SimpleName/MemberLookup) that we're currently
12693         emitting a field initializer (which must not access any instance members,
12694         this is an error CS0236).
12695
12696         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12697         argument, if the `IsFieldInitializer' flag is set, we must report and
12698         error CS0236 and not an error CS0120.   
12699
12700 2002-08-07  Martin Baulig  <martin@gnome.org>
12701
12702         * ecore.cs (IMemberExpr): New public interface.
12703         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12704         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12705         if the expression is an IMemberExpr.
12706
12707         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12708         to be null, implicitly default to `this' if we're non-static in
12709         this case.  Simplified the code a lot by using the new IMemberExpr
12710         interface.  Also fixed bug #28176 here.
12711
12712 2002-08-06  Martin Baulig  <martin@gnome.org>
12713
12714         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12715         ParameterReferences during semantic analysis so that we can do a
12716         type-only search when resolving Cast, TypeOf and SizeOf.
12717         (block): Pass the `current_local_parameters' to the Block's
12718         constructor.
12719
12720         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12721         argument to the constructor.
12722         (ConstructorInitializer.Resolve): Create a temporary implicit
12723         block with the parameters.
12724
12725         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12726         references here if we aren't doing a type-only search.
12727
12728         * statement.cs (Block): Added constructor which takes a
12729         `Parameters parameters' argument.
12730         (Block.Parameters): New public property.
12731
12732         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12733         to `Parameters' and made it public readonly.
12734
12735 2002-08-06  Martin Baulig  <martin@gnome.org>
12736
12737         * ecore.cs (Expression.Warning): Made this public as well.
12738
12739         * report.cs (Report.Debug): Print the contents of collections.
12740
12741 2002-08-06  Martin Baulig  <martin@gnome.org>
12742
12743         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12744         used to tell Resolve() which kinds of expressions it may return.
12745         (Expression.Resolve): Added overloaded version of this method which
12746         takes a `ResolveFlags flags' argument.  This can be used to tell
12747         Resolve() which kinds of expressions it may return.  Reports a
12748         CS0118 on error.
12749         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12750         ResolveFlags.SimpleName.
12751         (Expression.Error118): Added overloaded version of this method which
12752         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12753         which kinds of expressions are allowed.
12754
12755         * expression.cs (Argument.ResolveMethodGroup): New public method.
12756         Resolves an argument, but allows a MethodGroup to be returned.
12757         This is used when invoking a delegate.
12758
12759         * TODO: Updated a bit.
12760
12761 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12762
12763         Fixed compilation with csc.
12764
12765         * ecore.cs: Expression.Error made public. Is this correct? Should
12766         Warning be made public too?
12767
12768         * expression.cs: use ea.Location instead of ea.loc.
12769         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12770
12771 2002-08-06  Martin Baulig  <martin@gnome.org>
12772
12773         * ecore.cs (Expression.loc): Moved the location here instead of
12774         duplicating it in all derived classes.
12775         (Expression.Location): New public property.
12776         (Expression.Error, Expression.Warning): Made them non-static and
12777         removed the location argument.
12778         (Expression.Warning): Added overloaded version which takes an
12779         `int level' argument.
12780         (Expression.Error118): Make this non-static and removed the
12781         expression and location arguments.
12782         (TypeExpr): Added location argument to the constructor.
12783
12784         * expression.cs (StaticCallExpr): Added location argument to
12785         the constructor.
12786         (Indirection, PointerArithmetic): Likewise.
12787         (CheckedExpr, UnCheckedExpr): Likewise.
12788         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12789         (StringPtr): Likewise.
12790
12791
12792 2002-08-05  Martin Baulig  <martin@gnome.org>
12793
12794         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12795
12796         * assign.cs (Assign.DoResolve): Check whether the source
12797         expression is a value or variable.
12798
12799         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12800         while resolving the corresponding blocks.
12801
12802         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12803         an error, don't silently return null.
12804
12805         * statement.cs (Block.AddVariable): Do the error reporting here
12806         and distinguish between CS0128 and CS0136.
12807         (Block.DoResolve): Report all unused labels (warning CS0164).
12808         (LabeledStatement): Pass the location to the constructor.
12809         (LabeledStatement.HasBeenReferenced): New property.
12810         (LabeledStatement.Resolve): Set it to true here.
12811
12812         * statement.cs (Return.Emit): Return success even after reporting
12813         a type mismatch error (CS0126 or CS0127), this is what csc does and
12814         it avoids confusing the users with any consecutive errors.
12815
12816 2002-08-05  Martin Baulig  <martin@gnome.org>
12817
12818         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12819
12820         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12821
12822         * expression.cs (MemberAccess.DoResolve): Silently return if an
12823         error has already been reported.
12824
12825         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12826         error has already been reported.
12827
12828 2002-08-05  Martin Baulig  <martin@gnome.org>
12829
12830         * statement.cs (UsageVector): Only initialize the `parameters'
12831         vector if we actually have any "out" parameters.
12832
12833 2002-08-05  Martin Baulig  <martin@gnome.org>
12834
12835         * expression.cs (Binary.ResolveOperator): When combining delegates,
12836         they must have the same type.
12837
12838 2002-08-05  Martin Baulig  <martin@gnome.org>
12839
12840         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12841         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12842         work with the ms runtime and we also don't need it: if we're a
12843         PropertyBuilder and not in the `indexer_arguments' hash, then we
12844         are a property and not an indexer.
12845
12846         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12847         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12848         since the latter one doesn't work with the ms runtime.
12849
12850 2002-08-03  Martin Baulig  <martin@gnome.org>
12851
12852         Fixed bugs #27998 and #22735.
12853
12854         * class.cs (Method.IsOperator): New public field.
12855         (Method.CheckBase): Report CS0111 if there's already a method
12856         with the same parameters in the current class.  Report CS0508 when
12857         attempting to change the return type of an inherited method.
12858         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12859         and it's not marked abstract or extern.
12860         (PropertyBase): New abstract base class for Property and Indexer.
12861         (PropertyBase.CheckBase): Moved here from Property and made it work
12862         for indexers.
12863         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12864         the same so we can reuse it there.
12865         (Property, Indexer): Derive from PropertyBase.
12866         (MethodSignature.inheritable_property_signature_filter): New delegate
12867         to find properties and indexers.
12868
12869         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12870         argument and improved error reporting.
12871
12872         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12873         EmptyReadOnlyParameters and made it a property.
12874
12875         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12876         version of this method which takes a `PropertyInfo indexer'.
12877         (TypeManager.RegisterIndexer): New method.
12878
12879         * class.cs: Added myself as author of this file :-)
12880
12881 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12882
12883         * class.cs: fixed compilation on windoze.
12884
12885 2002-08-03  Martin Baulig  <martin@gnome.org>
12886
12887         * interface.cs (Interface.GetInterfaceBases): Check whether all
12888         base interfaces are at least as accessible than the current one.
12889
12890         * class.cs (TypeContainer.GetClassBases): Check whether base types
12891         are at least as accessible than the current type.
12892         (TypeContainer.AsAccessible): Implemented and made non-static.
12893         (MemberBase.CheckParameters): Report errors if the accessibility
12894         checks fail.
12895
12896         * delegate.cs (Delegate.Delegate): The default visibility is
12897         internal for top-level types and private for nested types.
12898         (Delegate.Define): Report errors if the accessibility checks fail.
12899
12900         * enum.cs (Enum.Enum): The default visibility is internal for
12901         top-level types and private for nested types.
12902         (Enum.DefineType): Compute the correct visibility.
12903
12904         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12905         function which takes a `bool is_toplevel' instead of a TypeContainer.
12906
12907         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12908         builtin type.
12909
12910 2002-08-02  Martin Baulig  <martin@gnome.org>
12911
12912         * expression.cs (LocalVariableReferenc): Added constructor which
12913         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12914         (LocalVariableReference.IsReadOnly): New property.
12915         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12916         variable is readonly, use our own readonly flag to do this; you can
12917         use the new constructor to get a writable reference to a read-only
12918         variable.
12919
12920         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12921         reference to the local variable.
12922
12923 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12924
12925         * rootcontext.cs (ResolveCore): Also include System.Exception
12926
12927         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12928         we reach an EmptyStatement.
12929
12930         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12931         is also fine.
12932
12933         * expression.cs (Binary.ResolveOperator): Check error result in
12934         two places.
12935
12936         use brtrue/brfalse directly and avoid compares to null.
12937
12938 2002-08-02  Martin Baulig  <martin@gnome.org>
12939
12940         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12941         Fixes bug #28407, added test-155.cs.
12942
12943 2002-08-01  Martin Baulig  <martin@gnome.org>
12944
12945         * class.cs (Event.EmitDefaultMethod): Make this work with static
12946         events.  Fixes #28311, added verify-3.cs.
12947
12948 2002-08-01  Martin Baulig  <martin@gnome.org>
12949
12950         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12951         `is_disposable' fields.
12952         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12953         `hm.is_disposable' if we're using the collection pattern.
12954         (Foreach.EmitCollectionForeach): Use the correct type for the
12955         enumerator's local variable, only emit the try/finally block if
12956         necessary (fixes #27713).
12957
12958 2002-08-01  Martin Baulig  <martin@gnome.org>
12959
12960         * ecore.cs (Expression.report118): Renamed to Error118 and made
12961         it public static.
12962
12963         * statement.cs (Throw.Resolve): Check whether the expression is of
12964         the correct type (CS0118) and whether the type derives from
12965         System.Exception (CS0155).
12966         (Catch.Resolve): New method.  Do the type lookup here and check
12967         whether it derives from System.Exception (CS0155).
12968         (Catch.CatchType, Catch.IsGeneral): New public properties.
12969
12970         * typemanager.cs (TypeManager.exception_type): Added.
12971
12972 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12973
12974         * driver.cs: Updated About function.
12975
12976 2002-07-31  Martin Baulig  <martin@gnome.org>
12977
12978         Implemented Control Flow Analysis.
12979
12980         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12981         (EmitContext.CurrentBranching): Added.
12982         (EmitContext.StartFlowBranching): Added.
12983         (EmitContext.EndFlowBranching): Added.
12984         (EmitContext.KillFlowBranching): Added.
12985         (EmitContext.IsVariableAssigned): Added.
12986         (EmitContext.SetVariableAssigned): Added.
12987         (EmitContext.IsParameterAssigned): Added.
12988         (EmitContext.SetParameterAssigned): Added.
12989         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12990         Added control flow analysis stuff here.
12991
12992         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12993         resolve the expression as lvalue.
12994         (LocalVariableReference.DoResolve): Check whether the variable has
12995         already been assigned.
12996         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12997         the parameter as assigned here.
12998         (ParameterReference.DoResolve): Check whether the parameter has already
12999         been assigned.
13000         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13001         expression as lvalue.
13002
13003         * statement.cs (FlowBranching): New class for the flow analysis code.
13004         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13005         (LabeledStatement.IsDefined): New public property.
13006         (LabeledStatement.AddUsageVector): New public method to tell flow
13007         analyis that the label may be reached via a forward jump.
13008         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13009         flow analysis.
13010         (VariableInfo.Number): New public field.  This is used by flow analysis
13011         to number all locals of a block.
13012         (Block.CountVariables): New public property.  This is the number of
13013         local variables in this block (including the locals from all parent
13014         blocks).
13015         (Block.EmitMeta): Number all the variables.
13016
13017         * statement.cs: Added flow analysis support to all classes.
13018
13019 2002-07-31  Martin Baulig  <martin@gnome.org>
13020
13021         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13022         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13023         then use this argument.
13024
13025         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13026
13027         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13028         use this to specify /define options.
13029
13030 2002-07-29  Martin Baulig  <martin@gnome.org>
13031
13032         * statement.cs (Fixed): Moved all code that does variable lookups
13033         and resolvings from Emit to Resolve.
13034
13035         * statement.cs (For): Moved all code that does variable lookups
13036         and resolvings from Emit to Resolve.
13037
13038         * statement.cs (Using): Moved all code that does variable lookups
13039         and resolvings from Emit to Resolve.
13040
13041 2002-07-29  Martin Baulig  <martin@gnome.org>
13042
13043         * attribute.cs (Attribute.Resolve): Explicitly catch a
13044         System.NullReferenceException when creating the
13045         CustromAttributeBuilder and report a different warning message.
13046
13047 2002-07-29  Martin Baulig  <martin@gnome.org>
13048
13049         * support.cs (ParameterData.ParameterName): Added method to
13050         get the name of a parameter.
13051
13052         * typemanager.cs (TypeManager.IsValueType): New public method.
13053
13054 2002-07-29  Martin Baulig  <martin@gnome.org>
13055
13056         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13057         is a flag which specifies that it's either ref or out.
13058         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13059         the out parameter to `out Parameter.Modifier mod', also set the
13060         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13061
13062         * support.cs (InternalParameters.ParameterModifier): Distinguish
13063         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13064         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13065
13066         * expression.cs (Argument.GetParameterModifier): Distinguish
13067         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13068         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13069
13070 2002-07-29  Martin Baulig  <martin@gnome.org>
13071
13072         * expression.cs (ParameterReference.ParameterReference): Added
13073         `Location loc' argument to the constructor.
13074
13075         * cs-parser.jay: Pass location to ParameterReference.
13076
13077 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13078
13079         * statement.cs (Try): Initialize the location.
13080
13081         * cs-parser.jay: pass location to Try.
13082
13083         * expression.cs (Unary.Reduce): Change the prototype to return
13084         whether a constant fold could be performed or not.  The result is
13085         returned in an out parameters.  In the case of Indirection and
13086         AddressOf, we want to perform the full tests.
13087
13088 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13089
13090         * statement.cs (Statement.Emit): Flag dead code.
13091
13092 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13093
13094         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13095
13096 2002-07-27  Martin Baulig  <martin@gnome.org>
13097
13098         * class.cs (MethodData.Define): Put back call to
13099         TypeManager.AddMethod(), accidentally commented this out.
13100
13101         * report.cs (Debug): New public method to print debugging information,
13102         this is `[Conditional ("DEBUG")]'.
13103
13104 2002-07-26  Martin Baulig  <martin@gnome.org>
13105
13106         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13107         (switch_statement): Push the current_block to the switch_stack and
13108         pop it again when we're done with the switch.
13109         (switch_section): The new block is a child of the current_block.
13110         Fixes bug #24007, added test-152.cs.
13111
13112 2002-07-27  Martin Baulig  <martin@gnome.org>
13113
13114         * expression.cs (Invocation.EmitArguments): When calling a varargs
13115         function with only its fixed arguments, we need to pass an empty
13116         array.
13117
13118 2002-07-27  Martin Baulig  <martin@gnome.org>
13119
13120         Mono 0.13 has been released.
13121
13122 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13123
13124         * driver.cs: Rename --resource to --linkres, because that is what
13125         we do currently, we dont support --resource yet.
13126
13127         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13128
13129 2002-07-25  Martin Baulig  <martin@gnome.org>
13130
13131         * class.cs (MethodData): New public class.  This is a `method builder'
13132         class for a method or one accessor of a Property/Indexer/Event.
13133         (MethodData.GetMethodFlags): Moved here from MemberBase.
13134         (MethodData.ApplyAttributes): Likewise.
13135         (MethodData.ApplyObsoleteAttribute): Likewise.
13136         (MethodData.ApplyConditionalAttribute): Likewise.
13137         (MethodData.ApplyDllImportAttribute): Likewise.
13138         (MethodData.CheckAbstractAndExternal): Likewise.
13139         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13140         (MethodData.Emit): Formerly known as Method.Emit().
13141         (MemberBase): Moved everything which was specific to a single
13142         accessor/method to MethodData.
13143         (Method): Create a new MethodData and call Define() and Emit() on it.
13144         (Property, Indexer, Event): Create a new MethodData objects for each
13145         accessor and call Define() and Emit() on them.
13146
13147 2002-07-25  Martin Baulig  <martin@gnome.org>
13148
13149         Made MethodCore derive from MemberBase to reuse the code from there.
13150         MemberBase now also checks for attributes.
13151
13152         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13153         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13154         as virtual.
13155         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13156         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13157         (MemberBase.ApplyAttributes): New virtual method; applies the
13158         attributes to a method or accessor.
13159         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13160         (MemberBase.ApplyConditionalAttribute): Likewise.
13161         (MemberBase.ApplyDllImportAttribute): Likewise.
13162         (MemberBase.CheckAbstractAndExternal): Likewise.
13163         (MethodCore.ParameterTypes): This is now a property instead of a
13164         method, it's initialized from DoDefineParameters().
13165         (MethodCore.ParameterInfo): Removed the set accessor.
13166         (MethodCore.DoDefineParameters): New protected virtual method to
13167         initialize ParameterTypes and ParameterInfo.
13168         (Method.GetReturnType): We can now simply return the MemberType.
13169         (Method.GetMethodFlags): Override the MemberBase version and add
13170         the conditional flags.
13171         (Method.CheckBase): Moved some code from Define() here, call
13172         DoDefineParameters() here.
13173         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13174         here to avoid some larger code duplication.
13175         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13176         ensure that abstract and external accessors don't declare a body.
13177
13178         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13179         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13180         lookup in the attribute's parent classes, so we need to abort as soon
13181         as we found the first match.
13182         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13183         the attribute has no arguments.
13184
13185         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13186         of a Method.
13187
13188 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13189
13190         * cs-parser.jay: reverted previous patch.
13191
13192 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13193
13194         * cs-parser.jay: fixed bug #22119.
13195
13196 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13197
13198         * attribute.cs: fixed compilation. The error was:
13199         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13200         be assigned to before control leaves the current method."
13201         [FIXME:  Filed as bug #28186: MCS must report this error.]
13202
13203 2002-07-25  Martin Baulig  <martin@gnome.org>
13204
13205         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13206         method to pull the condition name ouf of a Conditional attribute.
13207         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13208         the obsolete message and error flag out of an Obsolete attribute.
13209
13210         * class.cs (Method.GetMethodFlags): New public method to get the
13211         TypeManager.MethodFlags for this method.
13212         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13213         private methods.
13214         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13215         if we're overriding a virtual function, set the new private variable
13216         `parent_method'; call the new TypeManager.AddMethod().
13217
13218         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13219         the MethodBuilder and the Method in a PtrHashtable.
13220         (TypeManager.builder_to_method): Added for this purpose.
13221         (TypeManager.MethodFlags): Added IsObsoleteError.
13222         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13223         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13224         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13225         the message from the attribute.
13226
13227 2002-07-24  Martin Baulig  <martin@gnome.org>
13228
13229         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13230         preprocessor directives, ensure that the argument to #define/#undef is
13231         exactly one identifier and that it's actually an identifier.
13232
13233         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13234         did not work ....
13235
13236 2002-07-24  Martin Baulig  <martin@gnome.org>
13237
13238         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13239         initialize it to TypeManager.object_type in the constructor.
13240         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13241         of the `hm.get_current' method if we're using the collection pattern.
13242         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13243         for the explicit conversion to make it work when we're using the collection
13244         pattern and the `Current' property has a different return type than `object'.
13245         Fixes #27713.
13246
13247 2002-07-24  Martin Baulig  <martin@gnome.org>
13248
13249         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13250         does not match, but don't report any errors.  This method is called in
13251         order for all methods in a MethodGroupExpr until a matching method is
13252         found, so we don't want to bail out if the first method doesn't match.
13253         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13254         matches, report the 123.  Fixes #28070.
13255
13256 2002-07-24  Martin Baulig  <martin@gnome.org>
13257
13258         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13259         TypeManager.TypeToCoreType() to the top of the method so the
13260         following equality checks will work.  Fixes #28107.
13261
13262 2002-07-24  Martin Baulig  <martin@gnome.org>
13263
13264         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13265         operand is of type uint, and the other operand is of type sbyte,
13266         short or int, the operands are converted to type long." -
13267         Actually do what this comment already told us.  Fixes bug #28106,
13268         added test-150.cs.
13269
13270 2002-07-24  Martin Baulig  <martin@gnome.org>
13271
13272         * class.cs (MethodBase): New abstract class.  This is now a base
13273         class for Property, Indexer and Event to avoid some code duplication
13274         in their Define() and DefineMethods() methods.
13275         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13276         generic methods for Define() and DefineMethods().
13277         (FieldBase): Derive from MemberBase, not MemberCore.
13278         (Property): Derive from MemberBase, not MemberCore.
13279         (Property.DefineMethod): Moved all the code from this method to the
13280         new MethodBase.DefineAccessor(), just call it with appropriate
13281         argumetnts.
13282         (Property.Define): Call the new Property.DoDefine(), this does some
13283         sanity checks and we don't need to duplicate the code everywhere.
13284         (Event): Derive from MemberBase, not MemberCore.
13285         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13286         accessors, this will also make them work with interface events.
13287         (Indexer): Derive from MemberBase, not MemberCore.
13288         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13289         (Indexer.Define): Use the new MethodBase functions.
13290
13291         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13292         argument to the constructor.
13293         (Interface.FindMembers): Added support for interface events.
13294         (Interface.PopluateEvent): Implemented.
13295
13296         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13297
13298 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13299
13300         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13301         but this is required to check for a method name being the same as
13302         the containing class.  
13303
13304         Handle this now.
13305
13306 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13307
13308         * interface.cs: initialize variable.
13309
13310 2002-07-23  Martin Baulig  <martin@gnome.org>
13311
13312         Implemented the IndexerName attribute in interfaces.
13313
13314         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13315         name if this is an explicit interface implementation.
13316         (Indexer.InterfaceIndexerName): New public variable.  If we're
13317         implementing an interface indexer, this is the IndexerName in that
13318         interface.  Otherwise, it's the IndexerName.
13319         (Indexer.DefineMethod): If we're implementing interface indexer,
13320         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13321         and Pending.ImplementIndexer methods.
13322         (Indexer.Define): Also define the PropertyBuilder if we're
13323         implementing an interface indexer and this is neither an explicit
13324         interface implementation nor do the IndexerName match the one in
13325         the interface.
13326
13327         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13328         If a method is defined here, then we always need to create a proxy
13329         for it.  This is used when implementing interface indexers.
13330         (Pending.IsInterfaceIndexer): New public method.
13331         (Pending.ImplementIndexer): New public method.
13332         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13333         This is used when implementing interface indexers to define a proxy
13334         if necessary.
13335         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13336         define a proxy if necessary.
13337
13338         * interface.cs (Interface.IndexerName): New public variable.
13339         (Interface.PopulateIndexer): Set the IndexerName.
13340         (Interface.DefineIndexers): New private method.  Populate all the
13341         indexers and make sure their IndexerNames match.
13342
13343         * typemanager.cs (IndexerPropertyName): Added support for interface
13344         indexers.
13345
13346 2002-07-22  Martin Baulig  <martin@gnome.org>
13347
13348         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13349         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13350         ret if HasReturnLabel.
13351         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13352         variables.
13353
13354         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13355         and set the ec.LoopBeginTryCatchLevel.
13356         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13357         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13358         the current ec.TryCatchLevel, the branch goes out of an exception
13359         block.  In this case, we need to use Leave and not Br.
13360
13361 2002-07-22  Martin Baulig  <martin@gnome.org>
13362
13363         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13364         block unless the block does not always return or it is contained in
13365         another try { ... } catch { ... } block.  Fixes bug #26506.
13366         Added verify-1.cs to the test suite.
13367
13368 2002-07-22  Martin Baulig  <martin@gnome.org>
13369
13370         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13371         then we do not always return.  Fixes bug #24985.
13372
13373 2002-07-22  Martin Baulig  <martin@gnome.org>
13374
13375         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13376         lookup on a per-class level; ie. walk up the class hierarchy until we
13377         found at least one applicable method, then choose the best among them.
13378         Fixes bug #24463 and test-29.cs.
13379
13380 2002-07-22  Martin Baulig  <martin@gnome.org>
13381
13382         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13383         return types of the methods.  The return type is not part of the
13384         signature and we must not check it to make the `new' modifier work.
13385         Fixes bug #27999, also added test-147.cs.
13386         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13387
13388         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13389         on the method's return type.
13390
13391 2002-07-21  Martin Baulig  <martin@gnome.org>
13392
13393         * assign.cs: Make this work if the rightmost source is a constant and
13394         we need to do an implicit type conversion.  Also adding a few more tests
13395         to test-38.cs which should have caught this.
13396
13397         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13398         target in the makefile for this.  The makefile.gnu is primarily intended
13399         for end-users who don't want to debug the compiler.
13400
13401 2002-07-21  Martin Baulig  <martin@gnome.org>
13402
13403         * assign.cs: Improved the Assign class so it can now handle embedded
13404         assignments (X = Y = Z = something).  As a side-effect this'll now also
13405         consume less local variables.  test-38.cs now passes with MCS, added
13406         a few new test cases to that test.
13407
13408 2002-07-20  Martin Baulig  <martin@gnome.org>
13409
13410         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13411         instructions.  Fixes bug #27977, also added test-146.cs.
13412
13413 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13414
13415         * cs-tokenizer.cs: fixed getHex ().
13416
13417 2002-07-19  Martin Baulig  <martin@gnome.org>
13418
13419         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13420         not Type.GetType() to lookup the array type.  This is needed when
13421         we're constructing an array of a user-defined type.
13422         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13423         single-dimensional arrays, but also for single-dimensial arrays of
13424         type decimal.
13425
13426 2002-07-19  Martin Baulig  <martin@gnome.org>
13427
13428         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13429         this function is called, it's not allowed to share LocalBuilders
13430         among ILGenerators.
13431
13432 2002-07-19  Martin Baulig  <martin@gnome.org>
13433
13434         * expression.cs (Argument.Resolve): Report an error 118 when trying
13435         to pass a type as argument.
13436
13437 2002-07-18  Martin Baulig  <martin@gnome.org>
13438
13439         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13440         Conv_R_Un for the signed `long' type.
13441
13442 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13443
13444         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13445         `expr' for the temporary result, as that will fail if we do
13446         multiple resolves on the same expression.
13447
13448 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13449
13450         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13451         ec.TypeContainer for looking up aliases. 
13452
13453         * class.cs (TypeContainer): Remove LookupAlias from here.
13454
13455         * decl.cs (DeclSpace); Move here.
13456
13457 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13458
13459         * class.cs (FindMembers): Only call filter if the constructor
13460         bulider is not null.
13461
13462         Also handle delegates in `NestedTypes' now.  Now we will perform
13463         type lookups using the standard resolution process.  This also
13464         fixes a bug.
13465
13466         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13467         This uses Expressions (the limited kind that can be parsed by the
13468         tree) instead of strings.
13469
13470         * expression.cs (ComposedCast.ToString): Implement, used to flag
13471         errors since now we have to render expressions.
13472
13473         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13474         FormArrayType. 
13475
13476         * ecore.cs (SimpleName.ToString): ditto.
13477
13478         * cs-parser.jay: Instead of using strings to assemble types, use
13479         Expressions to assemble the type (using SimpleName, ComposedCast,
13480         MemberAccess).  This should fix the type lookups in declarations,
13481         because we were using a different code path for this.
13482
13483         * statement.cs (Block.Resolve): Continue processing statements
13484         even when there is an error.
13485
13486 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13487
13488         * class.cs (Event.Define): Also remove the `remove' method from
13489         the list of pending items.
13490
13491         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13492         generate more compact code. 
13493
13494 2002-07-17  Martin Baulig  <martin@gnome.org>
13495
13496         * const.cs (Const.LookupConstantValue): Add support for constant
13497         `unchecked' and `checked' expressions.
13498         Also adding test case test-140.cs for this.
13499
13500 2002-07-17  Martin Baulig  <martin@gnome.org>
13501
13502         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13503         check whether mi.ReturnType implements the IEnumerator interface; the
13504         `==' and the IsAssignableFrom() will fail in this situation.
13505
13506 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13507
13508         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13509         here too.
13510
13511 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13512
13513         * expression.cs: fixed bug #27811.
13514
13515 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13516
13517         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13518         Molaro: when we are a ref, the value already contains a pointer
13519         value, do not take the address of it.
13520
13521 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13522         * removed mb-parser.jay and mb-tokenizer.cs
13523
13524 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13525
13526         * expression.cs: check against the building corlib void type.
13527
13528 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13529
13530         * ecore.cs: fix for valuetype static readonly fields: when 
13531         initializing them, we need their address, not the address of a copy.
13532
13533 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13534
13535         * typemanager.cs: register also enum_type in corlib.
13536
13537 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13538
13539         * class.cs: allow calling this (but not base) initializers in structs.
13540
13541 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13542
13543         * ecore.cs: make sure we compare against the building base types
13544         in GetTypeSize ().
13545
13546 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13547
13548         * typemanager.cs: fix TypeToCoreType() to handle void and object
13549         (corlib gets no more typerefs after this change).
13550
13551 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * expression.cs (ArrayCreation.EmitArrayArguments): use
13554         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13555
13556         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13557         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13558         array indexes, the runtime actually forbids them.
13559
13560         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13561         for array arguments here.
13562
13563         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13564         instead of the default for ValueTypes.
13565
13566         (New.DoEmit): Use IsValueType instead of
13567         IsSubclassOf (value_type)
13568         (New.DoResolve): ditto.
13569         (Invocation.EmitCall): ditto.
13570
13571         * assign.cs (Assign): ditto.
13572
13573         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13574         Statements *are* currently doing part of their resolution during
13575         Emit.  
13576
13577         Expressions do always resolve during resolve, but statements are
13578         only required to propagate resolution to their children.
13579
13580 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13581
13582         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13583
13584         (LoadAssembly): Do not add the dll if it is already specified
13585
13586         (MainDriver): Add the System directory to the link path at the end,
13587         after all the other -L arguments. 
13588
13589         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13590         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13591         ldelem.u1) and using the opposite for sbytes.
13592
13593         This fixes Digger, and we can finally run it.
13594
13595         * driver.cs (UnixParseOption): Move the option parsing here.  
13596         (CSCParseOption): Implement CSC-like parsing of options.
13597
13598         We now support both modes of operation, the old Unix way, and the
13599         new CSC-like way.  This should help those who wanted to make cross
13600         platform makefiles.
13601
13602         The only thing broken is that /r:, /reference: and /lib: are not
13603         implemented, because I want to make those have the same semantics
13604         as the CSC compiler has, and kill once and for all the confussion
13605         around this.   Will be doing this tomorrow.
13606
13607         * statement.cs (Unsafe.Resolve): The state is checked during
13608         resolve, not emit, so we have to set the flags for IsUnsfe here.
13609
13610 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13611
13612         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13613         not catch the Error_ObjectRefRequired in SimpleName (as it is
13614         possible to have a class/instance variable name that later gets
13615         deambiguated), we have to check this here.      
13616
13617 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13618
13619         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13620         make static and put into Expression.
13621
13622         (Event.Define): Register the private field of the event with the 
13623         TypeManager so that GetFieldFromEvent can get at it.
13624
13625         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13626         keep track of the private field associated with an event which
13627         has no accessors.
13628
13629         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13630         private field.
13631
13632         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13633
13634 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13635
13636         * expression.cs (Binary.EmitBranchable): this routine emits the
13637         Binary expression in a branchable context.  This basically means:
13638         we need to branch somewhere, not just get the value on the stack.
13639
13640         This works together with Statement.EmitBoolExpression.
13641
13642         * statement.cs (Statement.EmitBoolExpression): Use
13643         EmitBranchable. 
13644
13645 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * statement.cs (For): Reduce the number of jumps in loops.
13648
13649         (For): Implement loop inversion for the For statement.
13650
13651         (Break): We can be breaking out of a Try/Catch controlled section
13652         (foreach might have an implicit try/catch clause), so we need to
13653         use Leave instead of Br.
13654
13655         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13656         now).  If the instace expression supports IMemoryLocation, we use
13657         the AddressOf method from the IMemoryLocation to extract the
13658         address instead of emitting the instance.
13659
13660         This showed up with `This', as we were emitting the instance
13661         always (Emit) instead of the Address of This.  Particularly
13662         interesting when This is a value type, as we dont want the Emit
13663         effect (which was to load the object).
13664
13665 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13666
13667         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13668
13669         * statement.cs (Checked): Set the CheckedState during the resolve
13670         process too, as the ConvCast operations track the checked state on
13671         the resolve process, and not emit.
13672
13673         * cs-parser.jay (namespace_member_declaration): Flag that we have
13674         found a declaration when we do.  This is used to flag error 1529
13675
13676         * driver.cs: Report ok when we display the help only.
13677
13678 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13679
13680         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13681
13682 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13683
13684         * cs-tokenizer.cs (define): We also have to track locally the
13685         defines.  AllDefines is just used for the Conditional Attribute,
13686         but we also need the local defines for the current source code. 
13687
13688 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13689
13690         * statement.cs (While, For, Do): These loops can exit through a
13691         Break statement, use this information to tell whether the
13692         statement is the last piece of code.
13693
13694         (Break): Flag that we break.
13695
13696         * codegen.cs (EmitContexts): New `Breaks' state variable.
13697
13698 2002-07-03  Martin Baulig  <martin@gnome.org>
13699
13700         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13701         modifiers in method declarations in structs.  Otherwise, you won't
13702         be able to override things like Object.Equals().
13703
13704 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13705
13706         * class.cs (Method, Property, Indexer): Do not allow the public
13707         modifier to be used in explicit interface implementations.
13708
13709         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13710         override modifiers in method declarations in structs
13711
13712 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13713
13714         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13715         integer or real overflow, report an error
13716
13717 2002-07-02  Martin Baulig  <martin@gnome.org>
13718
13719         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13720         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13721         to tell the runtime about our newly created System.Object and
13722         System.ValueType types.
13723
13724 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13725
13726         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13727         struct instead of Ldarg/Starg.
13728
13729 2002-07-02  Martin Baulig  <martin@gnome.org>
13730
13731         * expression.cs (Indirection.Indirection): Call
13732         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13733
13734 2002-07-02  Martin Baulig  <martin@gnome.org>
13735
13736         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13737         ValueType, call TypeManager.TypeToCoreType() on it.
13738         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13739         the OpCodes.Newarr argument.
13740
13741 2002-07-02  Martin Baulig  <martin@gnome.org>
13742
13743         * expression.cs (Invocation.EmitCall): When compiling corlib,
13744         replace all calls to the system's System.Array type to calls to
13745         the newly created one.
13746
13747         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13748         System.Array methods.
13749         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13750         from the system's System.Array type which must be replaced.
13751
13752 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13753
13754         * typemanager.cs: load unverifiable_code_ctor so we can build
13755         corlib using the correct type. Avoid using GetTypeCode() with
13756         TypeBuilders.
13757         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13758         TypeManager.object_type to allow building corlib.
13759
13760 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13761
13762         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13763
13764 2002-07-01  Martin Baulig  <martin@gnome.org>
13765
13766         * class.cs: Make the last change actually work, we need to check
13767         whether `ifaces != null' to avoid a crash.
13768
13769 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13770
13771         * class.cs: when we build structs without fields that implement
13772         interfaces, we need to add the interfaces separately, since there is
13773         no API to both set the size and add the interfaces at type creation
13774         time.
13775
13776 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13777
13778         * expression.cs: the dimension arguments to the array constructors
13779         need to be converted if they are a long.
13780
13781 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13782
13783         * class.cs: don't emit ldarg.0 if there is no parent constructor
13784         (fixes showstopper for corlib).
13785
13786 2002-06-29  Martin Baulig  <martin@gnome.org>
13787
13788         MCS now compiles corlib on GNU/Linux :-)
13789
13790         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13791         ie. check for MethodImplOptions.InternalCall.
13792
13793         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13794         and TypeManager.attribute_type are null, so we must explicitly check
13795         whether parent is not null to find out whether it's an attribute type.
13796         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13797         and SetBuilder, not only if the property is neither abstract nor external.
13798         This is necessary to set the MethodImplOptions on the accessor methods.
13799         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13800         SetBuilder, see Property.Emit().
13801
13802         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13803         populate "System.Object", "System.ValueType" and "System.Attribute" since
13804         they've already been populated from BootCorlib_PopulateCoreTypes().
13805
13806 2002-06-29  Martin Baulig  <martin@gnome.org>
13807
13808         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13809         is the NullLiteral, we also need to make sure that target_type is not
13810         an enum type.   
13811
13812 2002-06-29  Martin Baulig  <martin@gnome.org>
13813
13814         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13815         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13816         before calling BootstrapCorlib_ResolveDelegate ().
13817
13818 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13819
13820         * statement.cs: fixed build-breaker. All tests passed ok.
13821
13822 2002-06-27  Martin Baulig  <martin@gnome.org>
13823
13824         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13825         for System.Decimal when compiling corlib.
13826
13827 2002-06-27  Martin Baulig  <martin@gnome.org>
13828
13829         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13830         switch blocks which contain nothing but a default clause.
13831
13832 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13833
13834        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13835
13836 2002-06-27  Martin Baulig  <martin@gnome.org>
13837
13838         * ecore.cs (PropertyExpr.PropertyExpr): Call
13839         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13840
13841         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13842         is already a TypeBuilder.
13843
13844 2002-06-27  Martin Baulig  <martin@gnome.org>
13845
13846         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13847         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13848         the "from an array-type to System.Array" case.  This makes it work
13849         when compiling corlib.
13850
13851 2002-06-27  Martin Baulig  <martin@gnome.org>
13852
13853         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13854         non-static PropertyExpr, set its InstanceExpression.  This makes
13855         the `ICollection.Count' property work in System/Array.cs.
13856
13857 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13858
13859         * driver.cs: Made error handling more consistent.  Errors now
13860         tracked by Report class, so many methods which used to return int
13861         now return void.  Main() now prints success/failure and 
13862         errors/warnings message.
13863
13864         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13865         the magic number return values (123 and 124).  Now, if the
13866         expected error occurs, the compiler exits with success (exit value
13867         0).  If the compilation completes without seeing that particular
13868         error, the compiler exits with failure (exit value 1).  The
13869         makefile in mcs/errors has been changed to handle the new behaviour.
13870
13871         * report.cs: Made 'expected error' number a property and renamed
13872         it from 'Probe' to 'ExpectedError'.
13873
13874         * genericparser.cs: Removed error handling support, since it is
13875         now all done by Report class.
13876
13877         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13878         class, so parse() no longer returns an int.
13879
13880         * namespace.cs: Use Report.Error instead of GenericParser.error
13881
13882 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13883
13884         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13885         TypeContainer.AddOperator): At the front of the list put the
13886         explicit implementations, so they get resolved/defined first. 
13887
13888 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13889
13890         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13891         interface type is implemented by this TypeContainer.  Used during
13892         explicit interface implementation.
13893
13894         (Property.Define, Indexer.Define, Method.Define): Validate that
13895         the given interface in the explicit implementation is one of the
13896         base classes for the containing type.
13897
13898         Also if we are explicitly implementing an interface, but there is
13899         no match in the pending implementation table, report an error.
13900
13901         (Property.Define): Only define the property if we are
13902         not explicitly implementing a property from an interface.  Use the
13903         correct name also for those properties (the same CSC uses,
13904         although that is really not needed).
13905
13906         (Property.Emit): Do not emit attributes for explicitly implemented
13907         properties, as there is no TypeBuilder.
13908
13909         (Indexer.Emit): ditto.
13910
13911         Hiding then means that we do not really *implement* a pending
13912         implementation, which makes code fail.
13913
13914 2002-06-22  Martin Baulig  <martin@gnome.org>
13915
13916         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13917         the return value of Object.GetType().  [FIXME: we need to do this whenever
13918         we get a type back from the reflection library].
13919
13920 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13921
13922         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13923
13924 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * attribute.cs: Return null if we can not look up the type.
13927
13928         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13929         the interface types found.
13930
13931         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13932         interface types found.
13933
13934         * typemanager.cs (GetInterfaces): Make this routine returns alll
13935         the interfaces and work around the lame differences between
13936         System.Type and System.Reflection.Emit.TypeBuilder in the results
13937         result for GetInterfaces.
13938
13939         (ExpandInterfaces): Given an array of interface types, expand and
13940         eliminate repeated ocurrences of an interface.  This expands in
13941         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13942         be IA, IB, IC.
13943
13944 2002-06-21  Martin Baulig  <martin@gnome.org>
13945
13946         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13947         on System.Enum.
13948
13949 2002-06-21  Martin Baulig  <martin@gnome.org>
13950
13951         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13952         and called with one of the core types, return the corresponding typebuilder for
13953         that type.
13954
13955         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13956         element type.
13957
13958 2002-06-21  Martin Baulig  <martin@gnome.org>
13959
13960         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13961         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13962         (Expression.ConvertReferenceExplicit): Likewise.
13963
13964         * expression.cs (ElementAccess.DoResolve): Likewise.
13965         (ElementAccess.DoResolveLValue): Likewise.
13966
13967 2002-06-10  Martin Baulig  <martin@gnome.org>
13968
13969         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13970         add the "value" parameter to the parameter list.
13971
13972         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13973         to our caller.
13974
13975 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13976
13977         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13978         the argument to an int, uint, long or ulong, per the spec.  Also
13979         catch negative constants in array creation.
13980
13981 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13982
13983         * class.cs: do not allow the same interface to appear twice in
13984         the definition list.
13985
13986 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13987
13988         * ecore.cs: don't use ldlen with System.Array.
13989
13990 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13991
13992         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13993
13994 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13995
13996         * modifiers.cs: produce correct field attributes for protected
13997         internal. Easy fix so miguel can work on ther harder stuff:-)
13998
13999 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14000
14001         * pending.cs: New file.  Move the code from class.cs here.
14002         Support clearning the pending flag for all methods (when not doing
14003         explicit interface implementation).
14004
14005 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14006
14007         * rootcontext.cs: added a couple more types needed to bootstrap.
14008
14009 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14010
14011         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14012         constructor in the type, instead of any constructor in the type
14013         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14014         a bug in the Mono runtime when applying the params attribute). 
14015
14016 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14017         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14018
14019 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14020
14021         * expression.cs (Unary.ResolveOperator): Use TypeManager
14022         to resolve the type.
14023
14024 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14025
14026         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14027         attached.
14028
14029         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14030         with each member too.
14031
14032         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14033         field builders too - this takes care of the enum member case.
14034
14035 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14036
14037         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14038         address-of operator on both value types and pointers.
14039
14040 2002-06-10  Martin Baulig  <martin@gnome.org>
14041
14042         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14043         PropertyBuilder to the `property_builders' list.
14044
14045         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14046         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14047         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14048         find any indexers which are inherited from an interface.
14049
14050 2002-06-09  Martin Baulig  <martin@gnome.org>
14051
14052         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14053         the same type as the constant if necessary.  There's also a test-130.cs
14054         for this.
14055
14056         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14057
14058         * typemanager.cs (TypeManager.ChangeType): Previously known as
14059         Enum.ChangeEnumType().
14060
14061 2002-06-09  Martin Baulig  <martin@gnome.org>
14062
14063         * expression.cs (Cast.TryReduce): Added support for consts.
14064
14065 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14066
14067         * class.cs (Accessor): Hold attributes information so we can pass
14068         it along.
14069
14070         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14071         Modify to pass in attributes attached to the methods.
14072
14073         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14074
14075         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14076         to handle the Accessor kind :-)
14077
14078         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14079
14080 2002-06-08  Martin Baulig  <martin@gnome.org>
14081
14082         * expression.cs (Unary.TryReduceNegative): Added support for
14083         ULongConstants.
14084
14085 2002-06-08  Martin Baulig  <martin@gnome.org>
14086
14087         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14088         name can't be found in the `defined_names' - the caller will do a
14089         MemberLookup in this case and thus find methods in System.Enum
14090         such as Enum.IsDefined().
14091
14092 2002-06-08  Martin Baulig  <martin@gnome.org>
14093
14094         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14095         Convert.ChangeType() which works with TypeBuilder created types.
14096         (Enum.LookupEnumValue, Enum.Define): Use it here.
14097
14098         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14099         `TypeBuilder.BaseType != null' check.
14100         (TypeContainer.FindMembers): Only lookup parent members if we
14101         actually have a parent.
14102         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14103         (ConstructorInitializer.Resolve): Likewise.
14104
14105         * interface.cs (Interface.FindMembers): Added
14106         `TypeBuilder.BaseType != null' check.
14107
14108         * rootcontext.cs (RootContext.ResolveCore): Added
14109         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14110         classes_second_stage.
14111
14112         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14113         debug_type and trace_type when compiling with --nostdlib.       
14114
14115 2002-06-07  Martin Baulig  <martin@gnome.org>
14116
14117         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14118         (AddField): Set it to true when adding a non-static field.
14119         (DefineType): Use `have_nonstatic_fields' to find out whether we
14120         have non-static fields, not `Fields != null'.
14121
14122 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14123
14124         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14125         dereferencing a null on the static-field code path)
14126
14127 2002-05-30  Martin Baulig  <martin@gnome.org>
14128
14129         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14130         to take command line arguments.  Use reflection to call the new
14131         custom `Initialize' function on the symbol writer and pass it the
14132         command line arguments.
14133
14134         * driver.cs (--debug-args): New command line argument to pass command
14135         line arguments to the symbol writer.
14136
14137 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14138
14139         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14140         the target type for indexers and properties.  Thanks to Joe for
14141         catching this.
14142
14143 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14144
14145         * typemanager.cs (MethodFlags): returns the method flags
14146         (Obsolete/ShouldIgnore) that control warning emission and whether
14147         the invocation should be made, or ignored. 
14148
14149         * expression.cs (Invocation.Emit): Remove previous hack, we should
14150         not do this on matching a base type, we should do this based on an attribute
14151
14152         Only emit calls to System.Diagnostics.Debug and
14153         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14154         on the command line.
14155
14156         * rootcontext.cs: Global settings for tracing and debugging.
14157
14158         * cs-tokenizer.cs (define): New utility function to track
14159         defines.   Set the global settings for TRACE and DEBUG if found.
14160
14161 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14162
14163         * interface.cs (Populate*): Pass in the TypeContainer as well as
14164         the DeclSpace as parameters so that we can create EmitContexts and
14165         then use that to apply attributes etc.
14166
14167         (PopulateMethod, PopulateEvent, PopulateProperty)
14168         (PopulateIndexer): Apply attributes everywhere.
14169
14170         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14171         etc.
14172
14173         (ApplyAttributes): Update accordingly.
14174
14175         We now apply interface attributes for all members too.
14176
14177 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14178
14179         * class.cs (Indexer.Define); Correctly check if we are explicit
14180         implementation (instead of checking the Name for a ".", we
14181         directly look up if the InterfaceType was specified).
14182
14183         Delay the creation of the PropertyBuilder.
14184
14185         Only create the PropertyBuilder if we are not an explicit
14186         interface implementation.   This means that explicit interface
14187         implementation members do not participate in regular function
14188         lookups, and hence fixes another major ambiguity problem in
14189         overload resolution (that was the visible effect).
14190
14191         (DefineMethod): Return whether we are doing an interface
14192         implementation. 
14193
14194         * typemanager.cs: Temporary hack until we get attributes in
14195         interfaces (Ravi is working on that) and we get IndexerName
14196         support in interfaces.
14197
14198         * interface.cs: Register the indexers as properties.
14199
14200         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14201         warning, I have verified that this is a bug in the .NET runtime
14202         (JavaScript suffers of the same problem).
14203
14204         * typemanager.cs (MemberLookup): When looking up members for
14205         interfaces, the parent of an interface is the implicit
14206         System.Object (so we succeed in searches of Object methods in an
14207         interface method invocation.  Example:  IEnumerable x;  x.ToString
14208         ()) 
14209
14210 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14211
14212         * class.cs (Event): Events should also register if they do
14213         implement the methods that an interface requires.
14214
14215         * typemanager.cs (MemberLookup); use the new GetInterfaces
14216         method. 
14217
14218         (GetInterfaces): The code used to lookup interfaces for a type is
14219         used in more than one place, factor it here. 
14220
14221         * driver.cs: Track the errors at the bottom of the file, we kept
14222         on going.
14223
14224         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14225         instance if the method we are calling is static!
14226
14227 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14228
14229         * attribute.cs (ApplyAttributes): Make this function filter out
14230         the IndexerName attribute (as that attribute in reality is never
14231         applied) and return the string constant for the IndexerName
14232         attribute. 
14233
14234         * class.cs (TypeContainer.Emit): Validate that all the indexers
14235         have the same IndexerName attribute, and if so, set the
14236         DefaultName attribute on the class. 
14237
14238         * typemanager.cs: The return value might contain other stuff (not
14239         only methods).  For instance, consider a method with an "Item"
14240         property and an Item method.
14241
14242         * class.cs: If there is a problem with the parameter types,
14243         return. 
14244
14245 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14246
14247         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14248         looks at user defined conversion after making a call to 
14249         StandardConversionExists - we need this for overload resolution.
14250
14251         * expression.cs : Update accordingly the various method calls.
14252
14253         This fixes 2 bugs filed against implicit user defined conversions 
14254
14255 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * statement.cs: Track the result of the assignment.
14258
14259 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14260
14261         * expression.cs (MemberAccess): Improved error reporting for
14262         inaccessible members.
14263
14264 2002-05-22  Martin Baulig  <martin@gnome.org>
14265
14266         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14267         itself with debugging support.
14268
14269 2002-05-22  Martin Baulig  <martin@gnome.org>
14270
14271         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14272         Removed, this isn't needed anymore.
14273
14274 2002-05-20  Martin Baulig  <martin@gnome.org>
14275
14276         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14277         be underlying type for an enum.
14278
14279 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14280
14281         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14282         that splits out the loading of just the core types.
14283
14284         * rootcontext.cs (ResolveCore): Split the struct resolution in
14285         two, so we can load the enumeration underlying types before any
14286         enums are used.
14287
14288         * expression.cs (Is): Bandaid until we fix properly Switch (see
14289         bug #24985 for details).
14290
14291         * typemanager.cs (ImplementsInterface): The hashtable will contain
14292         a null if there are no interfaces implemented.
14293
14294 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14295
14296         * cs-parser.jay (indexer_declarator): It is fine to have array
14297         parameters
14298
14299 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14300
14301         * typemanager.cs: (RegisterBuilder): New function used to register
14302         TypeBuilders that implement interfaces.  Since
14303         TypeBuilder.GetInterfaces (as usual) does not work with lame
14304         Reflection.Emit. 
14305         (AddUserType): register interfaces.
14306
14307         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14308         dealing with TypeBuilder.  Also, arrays are showing up as
14309         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14310         methods can not be invoked on them!
14311
14312         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14313         (ImplicitReferenceConversionExists): Split out from
14314         StandardConversionExists. 
14315
14316         * expression.cs (As): We were only implementing one of the three
14317         cases for the as operator.  We now implement them all.
14318         (Is): Implement the various other cases for Is as well.
14319
14320         * typemanager.cs (CACHE): New define used to control if we want or
14321         not the FindMembers cache.  Seems to have a negative impact on
14322         performance currently
14323
14324         (MemberLookup): Nested types have full acess to
14325         enclosing type members
14326
14327         Remove code that coped with instance/static returns for events, we
14328         now catch this in RealFindMembers.
14329
14330         (RealFindMembers): only perform static lookup if the instance
14331         lookup did not return a type or an event.  
14332
14333 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14334
14335         * assign.cs (CompoundAssign): We pass more semantic information
14336         now to Compound Assignments than we did before: now we have all
14337         the information at hand, and now we resolve the target *before* we
14338         do the expression expansion, which allows the "CacheValue" method
14339         to have the effect we intended (before, a [x] += 1 would generate
14340         two differen ArrayAccess expressions from the ElementAccess,
14341         during the resolution process).
14342
14343         (CompoundAssign.DoResolve): Resolve target and original_source here.
14344
14345 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * expression.cs (ArrayAccess): dropped debugging information. 
14348
14349         * typemanager.cs: Small bug fix: I was always returning i_members,
14350         instead of one of i_members or s_members (depending on which had
14351         the content).
14352
14353         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14354         method is invoked before any code generation takes place, and it
14355         is a mechanism to inform that the expression will be invoked more
14356         than once, and that the method should use temporary values to
14357         avoid having side effects
14358
14359         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14360
14361         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14362         implementation.
14363
14364         * expression.cs (Indirection, ArrayAccess): Add support for
14365         CacheTemporaries in these two bad boys. 
14366
14367         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14368         ldobj or ldind_ref.  
14369         (StoreFromPtr): Handle stobj as well.
14370
14371         * expression.cs (UnaryMutator): Share more code.
14372
14373         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14374         down: I was not tracking the Filter function as well, which
14375         was affecting the results of the cache.
14376
14377 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14378
14379         * attribute.cs: Remove the hack to handle the CharSet property on
14380         StructLayouts. 
14381
14382 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14383
14384         * attribute.cs (DoResolve): More uglyness, we now only try to
14385         resolve the attribute partially, to extract the CharSet
14386         information (only if we are a StructLayout attribute).  Otherwise 
14387
14388         (GetExtraTypeInfo): Add some code to conditionally kill in the
14389         future this.   I am more and more convinced that the .NET
14390         framework has special code to handle the attribute setting on
14391         certain elements.
14392
14393         * expression.cs (IsParamsMethodApplicable): Revert my previous
14394         foreach change here, it was wrong.
14395
14396 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14397
14398         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14399         (pp_expr): do not abort on unknown input, just return.
14400         (eval): abort if there are pending chars.
14401
14402         * attribute.cs (Attribute.Resolve): Positional parameters are
14403         optional.  Deal with that case.
14404
14405         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14406         the Ansi/Unicode/Auto information for the type.
14407
14408         (TypeContainer.DefineType): instantiate the EmitContext here, as
14409         we will be using it during the type definition (to resolve
14410         attributes) and during the emit phase.
14411
14412         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14413         to pull type information out of the attributes
14414
14415         (Attribute.Resolve): track the constructor builder, and allow for
14416         multiple invocations (structs and classes will use this).
14417
14418         * ecore.cs (MemberLookupFinal): new version with all the
14419         parameters customizable.
14420
14421         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14422         constructors.  Return if the result value is null (as the error
14423         would have been flagged already by MemberLookupFinal)
14424
14425         Do not allow instances of abstract classes or interfaces to be
14426         created.
14427
14428         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14429         We have to compare the assembly property here when dealing with
14430         FamANDAssem and Assembly access modifiers, because we might be
14431         creating an assembly from *modules* (that means that we are not
14432         getting TypeBuilders for types defined in other modules that are
14433         part of this assembly).
14434
14435         (Method.Emit): If the method is marked abstract and has a body,
14436         emit an error. 
14437
14438         (TypeContainer.DefineMembers): If both the defined member and the
14439         parent name match are methods, then do not emit any warnings: let
14440         the Method.Define routine take care of flagging warnings.  But if
14441         there is a mismatch (method overrides something else, or method is
14442         overriwritten by something, then emit warning).
14443
14444         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14445         set to null, this means `do not check for the return type on the
14446         signature'. 
14447
14448         (Method.Define): set the return type for the method signature to
14449         null, so that we get methods with the same name and parameters and
14450         different return types.  This is used to flag warning 114 (you are
14451         hiding a method, and you probably want to use the new/override
14452         keywords instead).
14453
14454         * typemanager.cs (MemberLookup): Implemented proper access
14455         control, closing a long standing set of bug reports.  The problem
14456         was that the Framework only has two bits: Public and NonPublic,
14457         and NonPublic includes private and protected methods, but we need
14458         to enforce the FamANDAssem, FamOrAssem and Family. 
14459
14460 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14461
14462         * statement.cs (GotoCase): Return true: Ammounts to giving up
14463         knowledge on whether we return or not, and letting the other case
14464         be responsible for it.
14465
14466 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14467
14468         * driver.cs: Do not load directories for each file processed, only
14469         do it if there is a pattern.
14470
14471         * ecore.cs: Report readonly assigns here as well, as we might have
14472         been resolved only by MemberAccess.
14473
14474         (SimpleName.SimpleNameResolve): Also be useful for LValue
14475         resolution.   We need this to propagate assign to local readonly variables
14476
14477         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14478         do not want to reuse potential criteria memory.
14479
14480         * class.cs (MyEventBuilder): Set reflected_type;
14481
14482         * ecore.cs (Constantify): Added support for constifying bools.
14483
14484         (RootContext.LookupType): Added a cache for values looked up in
14485         the declaration space.
14486
14487         * typemanager.cs (FindMembers): Now is a front-end to
14488         RealFindMembers, and provides a two-level hashtable-based cache to
14489         the request.  
14490
14491         15% performance improvement: from 22.5 to 19.2 seconds.
14492
14493         * expression.cs (IsParamsMethodApplicable): use foreach.
14494         (Invocation.DoResolve): ditto.
14495         (New.DoResolve): ditto.
14496         (ArrayCreation.DoResolve): ditto.
14497
14498         * ecore.cs (FindMostEncompassingType): use foreach.
14499
14500         * delegate.cs (NewDelegate.DoResolve): Use foreach
14501
14502         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14503         (RemoveMethods): use foreach.
14504
14505         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14506         nested foreach statements instead of for, and also break out of
14507         the inner loop once a match is found.
14508
14509         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14510
14511 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14512
14513         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14514         we actually unwrap the expression to allow for extra information
14515         to be extracted. 
14516
14517         * expression.cs: Use Shr_Un on unsigned operations. 
14518
14519 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14520
14521         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14522         applicable operators was not being considered correctly. This closes
14523         the bug Miguel reported.
14524
14525 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14526
14527         * attribute.cs: check that the type derives from System.Attribute
14528         and report the correct error in that case (moved the duplicate code to
14529         its own method, too).
14530
14531 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14532
14533         * attribute.cs: lookup attribute type name as the spec says: first the
14534         bare attribute name and then name + "Attribute" (nant compiles with
14535         mcs after this fix).
14536
14537 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14538
14539         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14540         Because of the way we parse things, we should try to see if a
14541         UIntConstant can fit in an integer.
14542
14543 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14544
14545         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14546         when we are in an explicit context.
14547
14548         (ConvertReferenceExplicit): When converting from Iface type S to Class
14549         T make sure the rules are implemented as an OR.
14550
14551         * parameter.cs (ParameterType): Make it a property for now although the
14552         purpose really isn't anything immediate.
14553
14554         * expression.cs (Is*Applicable): Do better checking on the parameter type
14555         of a ref/out parameter. The ones from the system assemblies are already 
14556         marked with the correct type so we don't need to do any correction.
14557
14558         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14559         the object type is standard too so include that.
14560
14561 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14562
14563         * ecore.cs (StandardConversionExists): Augment with missing code:
14564         deal with IntConstant, LongConstants and Enumerations.
14565
14566         * assign.cs: Report the error, instead of failing silently
14567
14568         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14569         typecontainer that they are declared, because the
14570         typecontainer/namespace will have the list of using clauses that
14571         need to be applied.
14572
14573         Assembly Attributes were escaping the normal registration
14574         mechanism. 
14575
14576         (EmitCode): Apply attributes within an EmitContext that represents
14577         the container they were declared on.
14578
14579         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14580
14581 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14582
14583         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14584         Revamp completely - make much cleaner as we now operate only
14585         on a set of Types.
14586
14587         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14588         to implement the logic detailed in the spec more correctly.
14589
14590         (UserDefinedConversion): Update accordingly.
14591
14592 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14593
14594         * statement.cs: Return flow analysis information up.
14595
14596         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14597         and the default.
14598
14599         (token): Do not consume an extra character before calling
14600         decimal_digits.
14601
14602 2002-05-06  Piers Haken <piersh@friskit.com>
14603
14604         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14605
14606 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14607
14608         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14609         EmitContext during the instance constructor initializer
14610         resolution, to stop access to instance variables.
14611
14612         This is mandated by the spec, last paragraph of the `constructor
14613         initializers' section. 
14614
14615 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14616
14617         * cs-parser.jay, class.cs (Accessor): new class used to represent
14618         an accessor (get or set).  In the past we used `null' to represent
14619         a missing accessor.  But this is ambiguous because there was no
14620         way to tell in abstract indexers/properties if one of them was
14621         specified.
14622
14623         Now there is a way of addressing that.
14624
14625         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14626         instead of FindMembers.
14627
14628         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14629         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14630
14631         * attribute.cs: Treat indexers and properties as the same in terms
14632         of applying attributes
14633
14634         * ecore.cs (FindMostEncompassedType): Use statically initialized
14635         EmptyExpressions()s like we do elsewhere to avoid creating useless
14636         objects (and we take this out of the tight loop).
14637
14638         (GetConversionOperators): Move the code to extract the actual
14639         operators to a separate routine to clean things up.
14640
14641 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14644         events are always registered FieldBuilders.
14645
14646         * class.cs (FieldBase): New class shared by Fields 
14647
14648         * delegate.cs: If we are a toplevel delegate, use our full name.
14649         If we are a nested delegate, then only use our tail name.
14650
14651 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14652
14653         * expression.cs (IsApplicable): Ensure that we add the "&" to
14654         ref/out types before comparing it with the type of the argument.
14655
14656         (IsParamsMethodApplicable): Ditto.
14657
14658         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14659         silly me ;-)
14660
14661         * delegate.cs : Handle the case when we have more than one applicable
14662         method. Flag an error only when we finish checking all.
14663
14664 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14665
14666         * expression.cs: Add support for boolean static initializers.
14667
14668 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14669
14670         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14671
14672         * parameter.cs (ComputeParameterTypes,
14673         ComputeAndDefineParameterTypes): Better error handling: now we
14674         clear the `types' cache if we fail during any of the type lookups.
14675         We also return the status code correctly to our caller
14676
14677         * delegate.cs: If we fail to define a delegate, abort the extra
14678         steps. 
14679
14680         * expression.cs (Binary.ResolveOperator): for
14681         operator==(object,object) and operator !=(object, object) we also
14682         have to verify that there is an implicit conversion from one to
14683         the other.
14684
14685         (ArrayAccess.DoResolve): Array Access can operate on
14686         non-variables. 
14687
14688 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14689
14690         * assign.cs (CompoundAssign): A new class used as a "flag" that
14691         the assignment actually is happening as part of a compound
14692         assignment operator.
14693
14694         During compound assignment, a few new rules exist to enable things
14695         like:
14696
14697         byte b |= 1 + 2
14698
14699         From the spec:
14700
14701         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14702         to the type of x) if y is implicitly convertible to the type of x,
14703         and the operator is a builtin operator and the return type of the
14704         operator is explicitly convertible to the type of x. 
14705
14706         * rootcontext.cs: Reset warning level to 2.  4 catches various
14707         "interesting" features in mcs, we must clean this up at some
14708         point, but currently am trying to kill other bugs ;-)
14709
14710         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14711         in container classes as well.  
14712
14713         * expression.cs (Binary.ResolveOperator): Handle string case
14714         before anything else (as operator overloading does emit an error
14715         before doing anything else).
14716
14717         This code could go away when we move to a table driven model, but
14718         i could not come up with a good plan last night.
14719
14720 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14721
14722         * typemanager.cs (CSharpName): reimplementation using regex.
14723         * class.cs: added null check for fields in Emit
14724         * rootcontext.cs: set warninglevel to 4
14725
14726 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14727
14728         * typemanager.cs (CSharpName): reimplemented with Lupus
14729         suggestion.
14730
14731 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14732
14733         * statement.cs (If): correclty implement Resolve, because we were
14734         not catching sem errors in there.  The same process is needed
14735         everywhere else. 
14736         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14737
14738
14739         (Statement.Warning_DeadCodeFound): Factorize code.
14740         (While): Report dead code here too.
14741
14742         (Statement): Added Resolve virtual method to allow
14743         for resolution split from the emit code.
14744
14745 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14746
14747         * statement.cs (EmitBoolExpression): No longer try to resolve the
14748         expression here.    
14749         (MakeBoolean): New utility function that resolve, implicitly
14750         converts to boolean and tags the expression. 
14751
14752
14753         (If, Do): Implement dead code elimination.
14754         (While): Implement loop inversion
14755
14756         (Do, While, For, If): Resolve the expression prior to calling our
14757         code generation.
14758
14759 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14760
14761         * class.cs:
14762           - added method Report28 (warning: program has more than one entry point)
14763           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14764           - modified method Method.Define, the part at the end of the method
14765
14766         * rootcontext.cs: added static public Location EntryPointLocation;
14767           
14768         * ../errors/cs0028.cs : Add test case for the above warning.              
14769
14770         * typemanager.cs:
14771           - modified method CSharpName to allow arrays of primitive type to
14772             be printed nicely (e.g. instead of System.Int32[][] it now prints
14773             int[][])
14774           - added method CSharpSignature: returns the signature of a method
14775             in string format to be used in reporting errors, warnings, etc.
14776
14777         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14778         with String.Empty.
14779
14780 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14781
14782         * delegate.cs (Define): Fix extremely silly bug where I was
14783         setting the type of the 'object' parameter of the BeginInvoke
14784         method to System.IAsyncResult instead of System.Object ;-)
14785
14786 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14787
14788         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14789         here. 
14790
14791         (Constructor.Emit): return if we fail to initialize the
14792         constructor.  Another door closed!  
14793
14794         * expression.cs (New.DoResolve): Improve error message (from -6 to
14795         1501).  Use DeclaredOnly lookup to find the exact constructor.
14796
14797         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14798         loop.  This is useful.
14799
14800         * cs-parser.jay: Adjust the default parameters so that destructors
14801         have the proper signature.
14802
14803 2002-04-26  Martin Baulig  <martin@gnome.org>
14804
14805         * driver.cs (LoadAssembly): If `assembly' contains any characters
14806         which are only valid in path names and not in assembly names
14807         (currently slash, backslash and point), use Assembly.LoadFrom ()
14808         instead of Assembly.Load () on the `assembly' (before iteration
14809         over the link_paths).
14810
14811 2002-04-26  Martin Baulig  <martin@gnome.org>
14812
14813         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14814
14815 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14816
14817         * class.cs (Property): use the new typemanager.MemberLookup
14818
14819         (TypeContainer.MemberLookup): Implement using the
14820         TypeManager.MemberLookup now. 
14821
14822         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14823         and return MemberInfos, so that these can be used without an
14824         EmitContext (what we had before).
14825
14826 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14827
14828         * expression.cs: Fix the case where the argument to params if the
14829         type of the params.  I omitted handling this before.   Fixed
14830
14831 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14832
14833         * driver.cs: Call BootCorlib_PopulateCoreType
14834
14835         * class.cs (Property.CheckBase): Check for properties only, not
14836         for all members. 
14837
14838         * interface.cs: Temporary hack: try/catch around the
14839         CustomAttributeBuilder, because I am getting an exception that I
14840         do not understand.
14841
14842         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14843         types whose definitions are required to be there (attributes are
14844         defined before standard types).
14845
14846         Compute definitions as we boot the various types, as they are used
14847         immediately (value_type class will need object_type, but if we do
14848         not initialize object_type, we will pass a null, which will let
14849         the runtime pick the System.Object from the existing corlib, which
14850         is not what we want).
14851
14852 2002-04-22  Patrik Torstensson <totte@labs2.com>
14853
14854         * cs-tokenizer.cs: fixed a number of trim() issues.
14855
14856 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14857
14858         * expression.cs (Argument.Type): Ensure that we return the correct
14859         type when we have out or ref parameters [in which case we 
14860         append a "&"].
14861
14862 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14863
14864         * class.cs (Property, Indexer): Allow extern modifier in there. 
14865
14866         * typemanager.cs (InitBaseTypes): Initializes object_type and
14867         value_type, since those will be used early on during the bootstrap
14868         process to compile corlib.
14869
14870         (InitCoreTypes): Move code from here to InitBaseTypes.
14871
14872 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14873
14874         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14875         single-dimension arrays as using the ldlen opcode.  
14876
14877         Daniel Lewis discovered this optimization.  
14878
14879         * typemanager.cs: Add signature for System.Array::get_Length
14880
14881 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14882
14883         * statement.cs: report the error when the foreach does not apply to an
14884         array nor a collection.
14885
14886 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14887
14888         * expression.cs: Add implicit conversions to the operator ~.
14889
14890         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14891
14892         * typemanager.cs: Locate the decimal constructor.
14893
14894 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14895
14896         * attribute.cs: use the new property of TypeOf.
14897         * expression.cs: added 'get' property around typearg.
14898
14899         These changes fix a build breaker reported by NickD. Is this the
14900         correct way to fix?  If not, please, revert my changes and make it
14901         work :-).
14902
14903 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * attribute.cs: Add support for typeof in attribute invocations.
14906         I am not sure that this is right though.
14907
14908 2002-04-14  Duncan Mak  <duncan@ximian.com>
14909
14910         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14911         Binary.Operator.Division case.
14912
14913 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14914
14915         * class.cs (DefineType): Ensure that we do a proper check on
14916         attribute types and also register it with the TypeManager.
14917
14918         (TypeContainer.Targets): The default for attribute types is
14919         AttributeTargets.All.
14920
14921         * attribute.cs (ApplyAttributes): Registering the attribute type
14922         is done elsewhere, not when we discover we have a Usage attribute.
14923
14924 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14925
14926         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14927         and get rid of is_delegate parameter.
14928
14929         * everywhere : update.
14930
14931 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14932
14933         * cs-parser.jay (compilation_unit): Revamp completely to use
14934         some new ideas that I got from Rhys' grammar to solve the problems
14935         with assembly level attributes.
14936
14937         (outer_declaration): New grammar production.
14938
14939         (attribute_sections): Add.
14940
14941         (opt_attributes): Base on attribute_sections
14942
14943         (namespace_declaration): Allow opt_attributes to tackle the case
14944         when we have assembly level attributes - we are clever in this
14945         regard now ;-)
14946
14947         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14948         attributes in the non-global context.
14949
14950         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14951         instead of SetGlobalAttributes.
14952
14953         * class.cs, rootcontext.cs : Ensure we define and generate 
14954         attribute types before anything else.
14955
14956         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14957         and flag the new error -20 for the case when the attribute type
14958         does not have valid targets specified. csc does not catch this.
14959
14960         * ../errors/errors.txt : update for error # -20
14961
14962 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14963
14964         * support.cs (InternalParameters.ParameterModifier): Do some null
14965         checking and return sane values.
14966
14967         * class.cs (Method.Define): If we are a PInvoke method, ensure
14968         that we are static and extern. Report error # 601
14969
14970         * ../errors/cs0601.cs : Add test case for the above error.
14971
14972 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14973
14974         * rootcontext.cs (attribute_types): We need to keep type of
14975         all attribute types separately and emit code for them first.
14976
14977         (RegisterAttribute) : Implement.
14978
14979         * class.cs (DefineType): Check if the current Type is a custom
14980         attribute type and register it accordingly.
14981
14982         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14983         adding the first attribute twice and rename to
14984
14985         (SetGlobalAttributes): this.
14986
14987         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14988         lookups.
14989
14990         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14991         if we are processing global arguments. Hmm, I am unsure of this.
14992
14993 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14994
14995         * expression.cs: added static array of strings to avoid calling
14996         Enum.ToString () for Operator in Binary. Significant recover of
14997         performance.
14998
14999 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15000
15001         * class.cs (FindMembers): Allow the Builders of the various
15002         members to be null.  If they are skip them.  This only happens
15003         during the PInvoke declaration.
15004
15005 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15008         failure, so we do not keep going afterwards.
15009
15010         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15011         wanted to pass `false' as the `is_delegate' argument.  If this is
15012         the case, why not use delegate_type == null to mean `is_delegate =
15013         false' and anything else as is_delegate = true.
15014
15015 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15016
15017         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15018         code for the section, not the beginning of the tests.
15019
15020 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15021
15022         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15023
15024         * expression.cs (Binary): same.  Warn about errors where we have
15025         Enum/Enum in operator + as well.
15026
15027 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15028
15029         * statement.cs:
15030                 - added support for switch(bool)
15031                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15032                 - add TableSwitchEmit() to handle table-based switch statements
15033
15034 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15035
15036         * expression.cs (Invocation.OverloadResolve): Factor out code which
15037         does parameter compatibility checking with arguments so that we can 
15038         re-use the code even from Delegate.VerifyApplicability
15039
15040         (VerifyArgumentsCompat): Move above code here.
15041
15042         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15043         and instead make a call to the above method.
15044
15045 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15046
15047         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15048         We use it to keep track of classes which are attribute types.
15049
15050 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15051
15052         * delegate.cs (Delegate.Define): Correctly define the types in the
15053         presence of fixed and array parameters.
15054
15055         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15056         doing FindMembers.
15057
15058         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15059         include NonPublic after the first iteration.
15060
15061         * class.cs (Indexer.CheckBase): Only check if both parents are
15062         non-null. 
15063
15064         * cs-parser.jay (accessor_body): If empty, set to null.
15065
15066         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15067         same code path here to resolve constants names that we did have in
15068         MemberAccess.DoResolve.  There is too much code duplicated here.
15069
15070 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15071
15072         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15073
15074         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15075         to MakeUnionSet.
15076
15077         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15078         tokens, numbers and strings.
15079
15080         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15081         parenthesis.
15082
15083         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15084         asyncronous parameters and the regular parameters.  
15085
15086         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15087         specify the target directory.
15088
15089         * expression.cs: (This.DoResolve): Simplify
15090         (As.Emit): Optimize, do not generate IsInst if the expression is
15091         always of the given type.
15092
15093         (Is.DoResolve): Bug fix, we were reporting both always/never for
15094         the is expression.
15095
15096         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15097         creating too many unnecessary arrays.
15098
15099 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15100
15101         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15102         fields instead of rolling our own initializer.   Takes care of all
15103         implicit conversions, and drops unnecessary static checks/argument.
15104
15105 2002-03-31  Dick Porter  <dick@ximian.com>
15106
15107         * driver.cs: use the GetDirectories() return values properly, and
15108         use "/" as path separator.
15109
15110 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15111
15112         * expression.cs (Unary): Optimize - - expr into expr.
15113         (Binary): Optimize a + (-b) into a -b.
15114
15115         * codegen.cs (CodeGen): Made all methods static.
15116
15117 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15118
15119         * rootcontext.cs: 
15120
15121         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15122         TypeBuilder property.
15123
15124         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15125         instead. 
15126
15127         * tree.cs: Removed the various RecordXXXX, and replaced with a
15128         single RecordDecl.  Removed all the accessor methods, and just
15129         left a single access point Type 
15130
15131         * enum.cs: Rename DefineEnum to DefineType.
15132
15133         * decl.cs: New abstract method `DefineType' used to unify the
15134         Defines for Enumerations, Interfaces, TypeContainers and
15135         Delegates.
15136
15137         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15138         LookupBaseClasses method that used to live in class.cs and
15139         interface.cs here, and renamed to FindType.
15140
15141         * delegate.cs: Implement DefineType.  Take advantage of the
15142         refactored pattern for locating the parent builder without taking
15143         the parent_builder argument (which we know does not work if we are
15144         nested, and triggering a toplevel definition).
15145
15146 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15149         accessibility of a member has changed during override and report
15150         an error if so.
15151
15152         * class.cs (Method.Define, Property.Define): Only complain on
15153         overrides if the method is private, any other accessibility is
15154         fine (and since we just checked the permission is the same, we are
15155         good to go).
15156
15157         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15158         and elif are processed always.  The other pre-processing
15159         directives are only processed if we are "taking" the path
15160
15161 2002-03-29  Martin Baulig  <martin@gnome.org>
15162
15163         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15164         current location is not Null.
15165
15166         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15167         a separate method so we can profile it.
15168
15169         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15170         `span.Seconds' are just seconds, but no minutes or hours.
15171         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15172
15173 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15176         Remove the gratuitous set of Final:
15177
15178                                 // If an interface implementation, then we can set Final.
15179                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15180                                     implementing.DeclaringType.IsInterface)
15181                                         flags |= MethodAttributes.Final;
15182
15183         I do not know what I was smoking when I used that.
15184
15185
15186         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15187         step into fixing the name resolution issues for delegates and
15188         unifying the toplevel name resolution.
15189
15190 2002-03-28  Martin Baulig  <martin@gnome.org>
15191
15192         * class.cs (Method.Emit): If we have a symbol writer, call its
15193         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15194         tell it about the current method.
15195
15196         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15197         writer that we're going to emit the first byte of IL code for a new
15198         statement (a new source line).
15199         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15200         EmitContext.Mark() before emitting any code.
15201
15202         * location.cs (SymbolDocument): Return null when we're Null.
15203
15204         * statement.cs (Statement): Moved the `Location loc' variable here.
15205         (Statement.EmitBoolExpression): If we have a symbol writer, call
15206         ec.Mark() before emitting any code to tell it that we're at the
15207         beginning of a new statement.
15208         (StatementExpression): Added `Location' argument to the constructor.
15209         (Block): Added public readonly variable `StartLocation' and public
15210         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15211         (Block): Added constructor which takes a start and end location.
15212         (Block.SetEndLocation): New method. This sets the end location.
15213         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15214         local variables we create.
15215         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15216         each statement and do also mark the begin and end of the block.
15217
15218         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15219         tell it the current lexer.Location, use Location.Null for the end of the
15220         block.
15221         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15222         current block, set its end location using SetEndLocation().
15223         (statement_expression): StatementExpression constructor now takes the
15224         lexer.Location as additional argument.
15225         (for_statement, declare_local_variables): Likewise.
15226         (declare_local_variables): When creating a new implicit block, use the
15227         new Block constructor and pass it the lexer.Location.
15228
15229 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15230
15231         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15232         members also on the parent interfaces recursively.
15233
15234 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15235
15236         * report.cs: Use new formats, since Gonzalo finished the missing
15237         bits. 
15238
15239         * expression.cs (Binary.ResolveOperator): added missing operator|
15240         operator& and operator^ for bool/bool.
15241
15242         * cs-parser.jay: CheckDef now takes a Location argument that is
15243         used to report errors more precisly (instead of reporting the end
15244         of a definition, we try to track something which is a lot closer
15245         to the source of the problem).
15246
15247         * cs-tokenizer.cs: Track global token use, so we can properly flag
15248         the use of #define/#undef after the first token has been seen.
15249
15250         Also, rename the reportXXXX to Error_DescriptiveName
15251
15252         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15253         TypeContainer, so that Enum and Interface can use this too.
15254
15255         * class.cs (TypeContainer.LookupInterfaceOrClass,
15256         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15257         `builder' argument.  Typically this was used to pass the parent
15258         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15259         the definition).  
15260
15261         The problem is that a nested class could trigger the definition of
15262         a toplevel class, and the builder would be obviously wrong in that
15263         case. 
15264
15265         So we drop this argument, and we compute dynamically the
15266         TypeBuilder/ModuleBuilder (the correct information was available
15267         to us anyways from DeclSpace.Parent)
15268
15269         * interface.cs (Interface.DefineInterface): Drop builder
15270         parameter cleanup like class.cs
15271
15272         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15273         like class.cs
15274
15275         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15276         values. 
15277
15278         (Try.Emit): Propagate the returns value from the statement.
15279
15280         (Return.Emit): Even if we are leavning 
15281
15282         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15283
15284         * modifiers.cs: Fix the computation of MethodAttributes flags.
15285
15286 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15287
15288         * driver.cs: allow compilation of files that start with '/'.
15289         Add a default case when checking the argument of --target.
15290
15291 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15292
15293         * interface.cs: Implement the same search algorithm for types in
15294         the interface code.
15295
15296         * delegate.cs: Do not allow multiple definition.
15297
15298         * Recovered ChangeLog that got accidentally amputated
15299
15300         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15301
15302         * rootcontext.cs: Load manually enum to allow core classes to
15303         contain enumerations.
15304
15305         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15306         Update to new static methods in TypeManager.
15307
15308         * typemanager.cs (GetMethod, GetConstructor): Use our
15309         implementation of FindMembers to find the members, since during
15310         corlib compilation, the types are TypeBuilders and GetMethod and
15311         GetConstructor do not work.
15312
15313         Make all methods in TypeManager static.
15314
15315         (InitCodeHelpers): Split the functionality from
15316         the InitCodeTypes function.
15317
15318         * driver.cs: Call InitCodeHelpers after we have populated the
15319         types. 
15320
15321         * cs-parser.jay (delegate_declaration): we did not used to compute
15322         the delegate name correctly for void delegates.
15323
15324 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15325
15326         * rootcontext.cs (RootContext): Init the interface_resolve_order
15327         and type_container_resolve_order always.
15328
15329         (ResolveCore, BootstrapCorlib_ResolveClass,
15330         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15331         compiler when compiling with --nostdlib
15332
15333         * class.cs (TypeContainer.DefineType): Check that our parent is
15334         not null.  This test is most important when we are bootstraping
15335         the core types.
15336
15337         * codegen.cs: Split out the symbol writing code.
15338
15339 2002-03-25  Martin Baulig  <martin@gnome.org>
15340
15341         * driver.cs (-g): Made -g an alias for --debug.
15342
15343 2002-03-24  Martin Baulig  <martin@gnome.org>
15344
15345         * codegen.cs (SymbolWriter): New public variable. Returns the
15346         current symbol writer.
15347         (CodeGen): Added `bool want_debugging_support' argument to the
15348          constructor. If true, tell the ModuleBuild that we want debugging
15349         support and ask it for the ISymbolWriter.
15350         (Save): If we have a symbol writer, call it's Close() method after
15351         saving the assembly.
15352
15353         * driver.c (--debug): New command line argument to create a
15354         debugger information file.
15355
15356         * location.cs (SymbolDocument): New public property. Returns an
15357         ISymbolDocumentWriter object for the current source file or null
15358         if we don't have a symbol writer.
15359
15360 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * driver.cs (LoadAssembly): Correctly return when all the paths
15363         have been tried and not before.
15364
15365         * statement.cs (Switch.Emit): return the actual coverage for this
15366         statement (returns/not-returns)
15367
15368         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15369         switch of the statement if we are the last switch section.  That
15370         kills two problems: try/catch problems (we used to emit an empty
15371         nop at the end) and switch statements where all branches would
15372         return. 
15373
15374 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15375
15376         * driver.cs: Add default assemblies (the equivalent to the
15377         Microsoft CSC.RSP file)
15378
15379         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15380         also update tokens_seen and set it to false.
15381
15382         * driver.cs: Implement --recurse for Mike.
15383
15384         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15385         correctly splitting out the paths.
15386
15387 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15388
15389         * interface.cs (Interface.PopulateProperty): Instead of using
15390         `parent' as the declaration space for the set parameters, use
15391         `this' 
15392
15393         * support.cs (InternalParameters): InternalParameters constructor
15394         takes a DeclSpace instead of a TypeContainer.
15395
15396         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15397         types are being initialized, load the address of it before calling
15398         the function.  
15399
15400         (New): Provide a mechanism to disable the generation of local
15401         value type temporaries when the caller will be providing us with
15402         an address to store it.
15403
15404         (ArrayCreation.EmitDynamicInitializers): Use it.
15405
15406 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15407
15408         * expression.cs (Invocation.EmitArguments): Only probe for array
15409         property if there is more than one argument.  Sorry about that.
15410
15411         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15412         empty param arrays.
15413
15414         * class.cs (Method.LabelParameters): Fix incorrect code path that
15415         prevented the `ParamArrayAttribute' from being applied to the
15416         params attribute.
15417
15418 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * support.cs (ReflectionParameters): Correctly compute whether the
15421         last argument is a params array.  Fixes the problem with
15422         string.Split ('a')
15423
15424         * typemanager.cs: Make the assemblies array always be non-null
15425         (empty, but non-null)
15426
15427         * tree.cs (RecordDecl): New function that abstracts the recording
15428         of names.  This reports error 101, and provides a pointer to the
15429         previous declaration.  Fixes a crash in the compiler.
15430
15431         * cs-parser.jay (constructor_declaration): Update to new grammar,
15432         and provide a constructor_body that can be empty.
15433
15434 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15435
15436         * driver.cs: Add support for --resources.
15437
15438         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15439         Make all types for the various array helper methods be integer.
15440
15441         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15442         CheckState to ConvCast.
15443
15444         (ConvCast): Now it takes a `checked' state argument, to avoid
15445         depending on the emit context for the conversion, and just using
15446         the resolve time setting.
15447
15448         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15449         instead of Invocation.EmitArguments.  We do not emit the original
15450         arguments, instead we emit those which have been converted to
15451         unsigned int expressions.
15452
15453         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15454
15455         * codegen.cs: ditto.
15456
15457         * expression.cs (LocalVariableReference): Drop the use of the
15458         Store function that depended on the variable index.
15459
15460         * statement.cs (VariableInfo): Drop the `Idx' property from this
15461         class, as this is not taking into account the indexes for
15462         temporaries tat we generate during the execution, getting the
15463         indexes wrong.
15464
15465         * class.cs: First emit class initializers, then call the parent
15466         constructor. 
15467
15468         * expression.cs (Binary): Fix opcode emision.
15469         (UnaryMutator.EmitCode): Support checked code generation
15470
15471         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15472         matches for events for both the Static and Instance scans,
15473         pointing to the same element.   Fix that.
15474
15475 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15476
15477         * rootcontext.cs (ResolveTree): Always set the
15478         interface_resolve_order, because nested interfaces will be calling
15479         into us.
15480
15481         * class.cs (GetInterfaceOrClass): Track the same resolution
15482         process used by TypeManager.LookupType.  This fixes the nested
15483         type lookups in class declarations (separate path from
15484         LookupType). 
15485
15486         (TypeContainer.DefineType): Also define nested interfaces.
15487         (TypeContainer.RegisterOrder): New public function used to
15488         register the order in which child interfaces need to be closed.
15489
15490         Nested interfaces need to be closed after their parents have been
15491         created. 
15492
15493         * interface.cs (InterfaceAttr): Put all the logic for computing
15494         the interface attribute here. 
15495
15496         (DefineInterface): Register our interface order with the
15497         RootContext or with the TypeContainer depending on the case.
15498
15499 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * cs-parser.jay: rework foreach statement to work with the new
15502         changes to the policy on SimpleNames.
15503
15504         * report.cs: support Stacktrace on warnings as well.
15505
15506         * makefile: drop --unsafe and /unsafe from the compile.
15507
15508 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15509
15510         * ecore.cs (StandardConversionExists): Modify to take an Expression
15511         as the first parameter. Ensure we do null -> reference type conversion
15512         checking.
15513
15514         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15515         temporary Expression objects.
15516
15517 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15518
15519         * interface.cs: workaround bug in method overloading resolution
15520         (there is already a bugzilla bug for it).
15521
15522 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15523
15524         We could also solve this problem by having a separate path for
15525         performing type lookups, instead of DoResolve, we could have a
15526         ResolveType entry point, and only participating pieces of the
15527         production (simplename, deref, array) would implement this. 
15528
15529         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15530         signal SimpleName to only resolve type names and not attempt to
15531         resolve anything else.
15532
15533         * expression.cs (Cast): Set the flag.
15534
15535         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15536
15537         * class.cs: Only report 108 if there is no `new' modifier.
15538
15539         * cs-parser.jay: rework foreach statement to work with the new
15540         changes to the policy on SimpleNames.
15541
15542         * report.cs: support Stacktrace on warnings as well.
15543
15544         * makefile: drop --unsafe and /unsafe from the compile.
15545
15546 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15547
15548         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15549         lookups here, instead of doing that at parse time.  This means
15550         that our grammar will not introduce `LocalVariableReferences' as
15551         expressions at this point.  That solves the problem of code like
15552         this:
15553
15554         class X {
15555            static void Main ()
15556            { int X = 1;
15557             { X x = null }}}
15558
15559         This is only half the fix.  The full fix requires parameters to
15560         also be handled in this way.
15561
15562         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15563         makes the use more obvious of the DeclSpace.  The
15564         ec.TypeContainer.TypeBuilder is now only used to pull the
15565         TypeBuilder for it.
15566
15567         My theory is that I can get rid of the TypeBuilder completely from
15568         the EmitContext, and have typecasts where it is used (from
15569         DeclSpace to where it matters).  
15570
15571         The only pending problem is that the code that implements Aliases
15572         is on TypeContainer, and probably should go in DeclSpace.
15573
15574         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15575         lookups here, instead of doing that at parse time.  This means
15576         that our grammar will not introduce `LocalVariableReferences' as
15577         expressions at this point.  That solves the problem of code like
15578         this:
15579
15580         class X {
15581            static void Main ()
15582            { int X = 1;
15583             { X x = null }}}
15584
15585         This is only half the fix.  The full fix requires parameters to
15586         also be handled in this way.
15587
15588         * class.cs (Property.DefineMethod): When implementing an interface
15589         method, set newslot, when implementing an abstract method, do not
15590         set the flag (before we tried never setting it, or always setting
15591         it, which is the difference).
15592         (Indexer.DefineMethod): same.
15593         (Method.DefineMethod): same.
15594
15595         * ecore.cs: Only set the status used flag if we get back a Field.
15596
15597         * attribute.cs: Temporary hack, so Paolo can keep working.
15598
15599 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15600
15601         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15602         the unmanaged type in the case we have a MarshalAs attribute.
15603
15604         (Resolve): Handle the case when we are parsing the special MarshalAs
15605         attribute [we need to store the unmanaged type to use later]
15606
15607         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15608         MarshalAs Attribute.
15609
15610         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15611         on parameters and accordingly set the marshalling info.
15612
15613 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15614
15615         * class.cs: Optimizing slightly by removing redundant code after
15616         we switched to the `NoTypes' return value.
15617         (Property.DefineMethod): use NoTypes here too.
15618
15619         This fixes the bug I introduced in my last batch of changes.
15620
15621 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15622
15623         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15624
15625         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15626         Enums since those are types too. 
15627
15628         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15629
15630         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15631         thanks to a call during the lookup process.
15632
15633 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15634
15635         * statement.cs (Foreach): Lots of work to accomodate a particular
15636         kind of foreach statement that I had not kept in mind.  It is
15637         possible to have foreachs on classes that provide a GetEnumerator
15638         method that return objects that implement the "pattern" for using
15639         a foreach, there is no need to support GetEnumerator
15640         specifically. 
15641
15642         This is needed to compile nant.
15643
15644         * decl.cs: Only report 114 if the member is not `Finalize' and if
15645         the warning level is at least 2.
15646
15647         * class.cs: Moved the compare function from Method to
15648         MethodSignature. 
15649
15650         (MethodSignature.InheritableMemberSignatureCompare): Add new
15651         filter function that is used to extract inheritable methods from a
15652         class. 
15653
15654         (Method.Define): Use the new `inheritable_method_signature_filter'
15655         delegate
15656
15657         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15658         command. 
15659
15660 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15661
15662         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15663
15664         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15665
15666         * expression.cs: Pass location information to
15667         ConvertImplicitStandard. 
15668
15669         * class.cs: Added debugging code to track return values from
15670         interfaces. 
15671
15672 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15673
15674         * expression.cs (Is.DoResolve): If either side of the `is' is an
15675         interface, do not flag the warning.
15676
15677         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15678         for interfaces
15679
15680         * report.cs: Allow for --fatal to be used with --probe.
15681
15682         * typemanager.cs (NoTypes): Move the definition for the empty Type
15683         array here. 
15684
15685         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15686         properties. 
15687         (TypeContainer.DefineProxy): New function used to proxy to parent
15688         implementations when implementing interfaces.
15689         (TypeContainer.ParentImplements): used to lookup if our parent
15690         implements a public function that is required by an interface.
15691         (TypeContainer.VerifyPendingMethods): Hook this up.
15692
15693         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15694         `modules' and `assemblies' arraylists into arrays.  We only grow
15695         these are the very early start up of the program, so this improves
15696         the speedof LookupType (nicely measured).
15697
15698         * expression.cs (MakeByteBlob): Replaced unsafe code with
15699         BitConverter, as suggested by Paolo.
15700
15701         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15702         folding of string concatenation, but if either side is a string,
15703         and the other is not, then return null, and let the runtime use
15704         the concatenation on the string plus the object (using
15705         `Object.ToString'). 
15706
15707 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15708
15709         Constant Folding has been implemented now.
15710
15711         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15712         the error instead on types that are not supported in one's
15713         complement. 
15714
15715         * constant.cs (Constant and all children): New set of functions to
15716         perform implict and explicit conversions.
15717
15718         * ecore.cs (EnumConstant): Implement the new functions to perform
15719         conversion by proxying to the child expression.
15720
15721         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15722         own separate setting that can not be turned off from the command
15723         line using --unchecked or --checked and is only controlled using
15724         the checked/unchecked statements and expressions.  This setting is
15725         used by the constant folder to flag errors.
15726
15727         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15728         ConstantCheckState as well.   
15729
15730         During Resolve, they also have to flag the state, because the
15731         constant folder runs completely in the Resolve phase.
15732
15733         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15734         well.
15735
15736 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15737
15738         * cfold.cs: New file, this file contains the constant folder.
15739
15740         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15741         argument to track whether we are using the resulting address to
15742         load or store a value and provide better error messages. 
15743
15744         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15745         new AddressOf arguments.
15746
15747         * statement.cs (Foreach.EmitCollectionForeach): Update
15748
15749         * expression.cs (Argument.Emit): Call AddressOf with proper
15750         arguments to track usage.
15751
15752         (New.DoEmit): Call AddressOf with new arguments.
15753
15754         (Unary.Emit): Adjust AddressOf call.
15755
15756 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15757
15758         * cs-parser.jay (member_access): Change the case for pre-defined types
15759         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15760         this suggestion.
15761
15762         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15763         a method body.
15764
15765         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15766         essentially like methods and apply attributes like MethodImplOptions to them too.
15767
15768         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15769         not being null.
15770
15771         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15772         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15773         is the DeclSpace.
15774
15775         * Update code everywhere accordingly.
15776
15777         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15778
15779         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15780
15781 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15782
15783         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15784         try performing lookups against those instead of jumping straight into using
15785         the 'using' clauses.
15786
15787         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15788
15789         (LookupType): Perform lookups in implicit parents too.
15790
15791         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15792         sequence as RootContext.LookupType. 
15793
15794         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15795         the various cases of namespace lookups into this method.
15796
15797 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15798
15799         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15800         in positional arguments)
15801
15802         * class.cs (Operator): Update the AllowedModifiers to contain
15803         extern. 
15804
15805         * cs-parser.jay: Update operator declaration to allow for the
15806         operator body to be empty.
15807
15808         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15809         values. 
15810
15811 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15812
15813         * class.cs (Method.Emit): Label parameters.
15814
15815         * driver.cs: Return 1 or 0 as the program exit code.
15816
15817 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15818
15819         * expression.cs: Special case the `null' object when trying to
15820         auto-compute the type, as anything can be explicitly converted to
15821         that. 
15822
15823         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15824         spotting this Paolo.
15825
15826         (Expression.ImplicitNumericConversion): Perform comparissions of
15827         the type using the underlying type in the case of an enumeration
15828         rather than using the enumeration type for the compare.
15829
15830         Cope with the underlying == type case, which is not possible to
15831         catch before. 
15832
15833         (Expression.ConvertNumericExplicit): Perform comparissions of
15834         the type using the underlying type in the case of an enumeration
15835         rather than using the enumeration type for the compare.
15836
15837         * driver.cs: If the user does not supply an extension, assume .exe
15838
15839         * cs-parser.jay (if_statement): Rewrote so that we can track the
15840         location for the if statement.
15841
15842         * expression.cs (Binary.ConstantFold): Only concat strings when
15843         the operation is "+", not everything ;-)
15844
15845         * statement.cs (Statement.EmitBoolExpression): Take a location
15846         argument. 
15847         (If, While, Do): Track location.
15848
15849         * expression.cs (Binary.ResolveOperator): In the object + string
15850         case, I was missing a call to ConvertImplicit
15851
15852 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15853
15854         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15855         Location arguments. Ensure we use RootContext.LookupType to do our work
15856         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15857
15858         * interface.cs (PopulateMethod): Handle the type of the parameter being
15859         null gracefully.
15860
15861         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15862         have a params method with no fixed arguments and a call is made with no
15863         arguments.
15864
15865 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15866
15867         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15868         the verbatim-string-literal
15869
15870         * support.cs (InternalParameters.ParameterModifier): handle null
15871         fixed parameters.
15872         (InternalParameters.ParameterType): ditto.
15873
15874         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15875         duplicating the name of the variable parameter.
15876         (GetParameterByName): Fix bug where we were not looking up array
15877         paramters if they were the only present (thanks Paolo!).
15878         (GetParameterInfo): We only have an empty set of types if both
15879         fixed and array are set to null.
15880         (GetParameterInfo-idx): Handle FixedParameter == null
15881
15882         * cs-parser.jay: Handle the case where there is no catch
15883         statements (missing null test).
15884
15885 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15886
15887         * driver.cs (MainDriver): Be conservative on our command line
15888         handling.
15889
15890         Catch DirectoryNotFoundException when calling GetFiles.
15891
15892         (SplitPathAndPattern): Used to split the input specification into
15893         a path and a pattern that we can feed to Directory.GetFiles.
15894
15895 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15896
15897         * statement.cs (Fixed): Implement the last case of the Fixed
15898         statement (string handling).
15899
15900         * expression.cs (StringPtr): New class used to return a char * to
15901         a string;  Used by the Fixed statement.
15902
15903         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15904
15905         * expression.cs (Binary.ResolveOperator): Remove redundant
15906         MemberLookup pn parent type.
15907         Optimize union call, we do not need a union if the types are the same.
15908         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15909         type.
15910
15911         Specialize the use of MemberLookup everywhere, instead of using
15912         the default settings. 
15913
15914         (StackAlloc): Implement stackalloc keyword.
15915
15916         * cs-parser.jay: Add rule to parse stackalloc.
15917
15918         * driver.cs: Handle /h, /help, /?
15919
15920         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15921         before we supported unsafe code.
15922
15923         * makefile: add --unsafe to the self compilation of mcs.
15924
15925 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15926
15927         * expression.cs (PointerArithmetic): New class that is used to
15928         perform pointer arithmetic.
15929         (Binary.Resolve): Handle pointer arithmetic
15930         Handle pointer comparission.
15931         (ArrayPtr): Utility expression class that is used to take the
15932         address of an array.
15933
15934         (ElementAccess): Implement array access for pointers
15935
15936         * statement.cs (Fixed): Implement fixed statement for arrays, we
15937         are missing one more case before we are done.
15938
15939         * expression.cs (Indirection): Implement EmitAssign and set the
15940         ExprClass to Variable.  This allows pointer dereferences to be
15941         treated as variables, and to have values assigned to them.
15942
15943         * ecore.cs (Expression.StoreFromPtr): New utility function to
15944         store values dereferencing.
15945
15946 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15947
15948         * expression.cs (Binary.ResolveOperator): Ensure that we are
15949         not trying to operate on a void type - this fixes the reported
15950         bug.
15951
15952         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15953         the parent implementation is sealed.
15954
15955         * ../errors/cs0239.cs : Add.
15956
15957         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15958
15959         * typemanager.cs (unverifiable_code_type): Corresponds to 
15960         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15961         which have unsafe code in them.
15962
15963         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15964         unsafe context.
15965
15966 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * cs-tokenizer.cs: Add support for @"litreal strings"
15969
15970         Make tokenizer accept pre-processor directives
15971         on any column (remove the old C-like limitation). 
15972
15973         * rootcontext.cs (EmitCode): Emit any global attributes.
15974         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15975
15976         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15977
15978         * cs-parser.jay: Add support for global attributes.  
15979
15980 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15981
15982         * expression.cs (Indirection): New helper class.  Unary will
15983         create Indirection classes to be able to implement the
15984         IMemoryLocation interface on it.
15985
15986 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * cs-parser.jay (fixed_statement): reference the right statement.
15989
15990         * statement.cs (Fixed.Emit): Finish implementing the fixed
15991         statement for the &x case.
15992
15993 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15994
15995         * class.cs (Property.Define, Method.Define): Remove newslot when
15996         `implementing'.  
15997
15998         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15999         wrong.  NewSlot should only be used if the `new' keyword is present.
16000
16001         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16002         locating our system dir.  Sorry about this.
16003
16004 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16005
16006         * driver.cs (GetSystemDir): Compute correctly the location of our
16007         system assemblies.  I was using the compiler directory instead of
16008         the library directory.
16009
16010 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16011
16012         * expression.cs (BetterFunction): Put back in what Miguel commented out
16013         since it is the correct fix. The problem is elsewhere ;-)
16014
16015         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16016         parameters of the parms method are themselves compatible or not !
16017
16018         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16019         to check that a class implements an interface before saying that an implicit
16020         conversion was allowed. Use ImplementsInterface to do the checking.
16021
16022 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16023
16024         * class.cs (Method.Define): Track whether we are an explicit
16025         implementation or not.  And only call DefineMethodOverride if we
16026         are an explicit implementation.
16027
16028         (Property.DefineMethod): Ditto.
16029
16030 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16031
16032         * expression.cs (BetterFunction): Catch hideous bug which was
16033          preventing us from detecting ambiguous calls due to implicit casts i.e
16034         cs0121.
16035
16036 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16037
16038         * support.cs (Pair): Remove un-needed method.  I figured why I was
16039         getting the error in cs-parser.jay, the variable in a foreach loop
16040         is readonly, and the compiler does not really treat this as a variable.
16041
16042         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16043         instead of EQUALS in grammar.  
16044
16045         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16046
16047         * expression.cs (Unary.DoResolve): Check whether the argument is
16048         managed or not.
16049
16050 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16051
16052         * support.cs: Api for Pair to set a value.  Despite the fact that
16053         the variables are public the MS C# compiler refuses to compile
16054         code that accesses the field if the variable is part of a foreach
16055         statement. 
16056
16057         * statement.cs (Fixed): Begin implementation of the fixed
16058         statement.
16059
16060         (Block.AddVariable): Return the VariableInfo on success and null
16061         on failure instead of true/false. 
16062
16063         * cs-parser.jay (foreach): Catch errors on variables already
16064         defined (we were ignoring this value before) and properly unwind
16065         the block hierarchy
16066
16067         (fixed_statement): grammar for the fixed statement.
16068
16069 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16070
16071         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16072         pointer types to be incretemented.
16073
16074         (SizeOf): Implement.
16075
16076         * cs-parser.jay (pointer_member_access): Implement
16077         expr->IDENTIFIER production.
16078
16079         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16080         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16081         on safe contexts.
16082
16083         (Unary): Implement indirection.
16084
16085         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16086         use in non-unsafe context).
16087
16088         (SimpleName.DoResolve): Check for pointers in field access on safe
16089         contexts. 
16090
16091         (Expression.LoadFromPtr): Factor the load-indirect code in this
16092         function.  This was duplicated in UnboxCast and ParameterReference
16093
16094 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16095
16096         * expression.cs (ComposedCast): report an error if a pointer cast
16097         is used in a safe region.
16098
16099         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16100         pointer type casts in unsafe context.
16101
16102         * codegen.cs (EmitContext): Set up IsUnsafe.
16103
16104         * cs-parser.jay (non_expression_type): Add productions for pointer
16105         casts. 
16106
16107         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16108         code.  We should not use force into static mode if the method is
16109         not virtual.  Fixes bug in MIS
16110
16111         * statement.cs (Do.Emit, While.Emit, For.Emit,
16112         Statement.EmitBoolExpression): Add support to Do and While to
16113         propagate infinite loop as `I do return' semantics.
16114
16115         Improve the For case to also test for boolean constants.
16116
16117         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16118         to the list of attributes we can add.
16119
16120         Remove `EmitContext' argument.
16121
16122         * class.cs (Method.Define): Apply parameter attributes.
16123         (Constructor.Define): Apply parameter attributes.
16124         (MethodCore.LabelParameters): Move here the core of labeling
16125         parameters. 
16126
16127         * support.cs (ReflectionParameters.ParameterModifier,
16128         InternalParameters.ParameterModifier): Use IsByRef on the type and
16129         only return the OUT bit for these parameters instead of in/out/ref
16130         flags.
16131
16132         This is because I miss-understood things.  The ParameterInfo.IsIn
16133         and IsOut represent whether the parameter has the [In] and [Out]
16134         attributes set.  
16135
16136 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16137
16138         * ecore.cs (FieldExpr.Emit): Release temporaries.
16139
16140         * assign.cs (LocalTemporary.Release): new function.
16141
16142         * codegen.cs (EmitContext.GetTemporaryStorage,
16143         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16144         temporary storage.  Now we can "put back" localbuilders when we
16145         are done with them
16146
16147 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16150         need to make a copy of the variable to generate verifiable code.
16151
16152 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16153
16154         * driver.cs: Compute dynamically the system directory.
16155
16156         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16157         Slower, but more generally useful.  Used by the abstract
16158         registering implementation. 
16159
16160         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16161         the rules for the special rule on Type/instances.  First check if
16162         we have the same name, and if so, try that special static path
16163         rather than the instance path.
16164
16165 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16166
16167         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16168         for, while and if.
16169
16170         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16171         Enum, ValueType, Delegate or Array for non-corlib compiles.
16172
16173         * cs-tokenizer.cs: Catch long identifiers (645)
16174
16175         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16176         piece of code.
16177
16178         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16179         fix, we were returning too early, so we were not registering
16180         pending methods from abstract classes.
16181
16182         Do not register pending methods if the class is abstract.
16183
16184         * expression.cs (Conditional.DoResolve): Report circular implicit
16185         conversions when we neecd to compute it for conditional
16186         expressions. 
16187
16188         (Is.DoResolve): If the expression is always of the provided type,
16189         flag warning 183.  If the expression can not ever be of the
16190         provided type flag warning 184.
16191
16192         * class.cs: Catch 169 as well.
16193
16194         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16195         read. 
16196
16197 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16198
16199         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16200
16201 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16202
16203         * interface.cs: (PopulateMethod): Check for pointers being defined
16204         only if the unsafe context is active.
16205         (PopulateProperty): ditto.
16206         (PopulateIndexer): ditto.
16207
16208         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16209         specified.  If pointers are present, make sure that they are
16210         present in an unsafe context.
16211         (Constructor, Constructor.Define): ditto.
16212         (Field, Field.Define): ditto.
16213         (Property, Property.Define): ditto.
16214         (Event, Event.Define): ditto.
16215
16216         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16217         hashtable if there are classes or structs defined.
16218
16219         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16220         code, as the constant resolution moved.
16221
16222         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16223         the metadata, so we can flag error 133. 
16224
16225         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16226         pointer is being declared in an unsafe context.
16227
16228 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * modifiers.cs (Modifiers.Check): Require a Location argument.
16231         Report error 227 for Unsafe use.
16232
16233         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16234
16235         * statement.cs (For.Emit): If the test is null, then report that
16236         we do `return', as we wont reach anything afterwards.
16237
16238         (Switch.SwitchGoverningType): Track the expression that matched
16239         the conversion.
16240
16241         * driver.cs: Allow negative numbers as an error code to flag.
16242
16243         * cs-parser.jay: Handle 1551.
16244
16245         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16246
16247 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16248
16249         * cs-parser.jay: Report 1518 (type declaration can only contain
16250         class, struct, interface, enum or delegate)
16251
16252         (switch_label): Report 1523 (keywords `case' or `default' must
16253         preced code)
16254
16255         (opt_switch_sections): Report 1522 (empty switch)
16256
16257         * driver.cs: Report 1515 (response file specified multiple times)
16258         Report 1516 (Source file specified multiple times).
16259
16260         * expression.cs (Argument.Resolve): Signal 1510
16261
16262         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16263         access not allowed in static code)
16264
16265 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16266
16267         * typemanager.cs (IsPointerType): Utility method which we are going
16268         to need a lot.
16269
16270         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16271         the object type, so we take care of that.
16272
16273         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16274
16275         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16276         added to non-params parameters :-)
16277
16278         * typemanager.cs (CSharpName): Include 'void' type too. 
16279
16280         (void_ptr_type): Include in the set of core types.
16281
16282         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16283         duplicating code.
16284
16285         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16286         an unsafe context.
16287
16288         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16289         completely forgotten about it.
16290
16291 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16292
16293         * cs-parser.jay (pointer_type): Add. This begins our implementation
16294         of parsing rules for unsafe code.
16295
16296         (unsafe_statement): Implement.
16297
16298         (embedded_statement): Modify to include the above.
16299
16300         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16301
16302         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16303         if the current context is an unsafe one.
16304
16305         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16306         are handled differently, we need separate rules for them.
16307
16308         (local_variable_declaration): Update to use local_variable_pointer_type
16309         to allow variable declarations of unmanaged pointer types.
16310
16311         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16312         in unsafe contexts.
16313
16314         * ../errors/cs0214.cs : Add.
16315
16316 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16317
16318         * makefile: remove 'response' file when cleaning.
16319
16320 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16321
16322         * cs-parser.jay: Report 1524.
16323
16324 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16325
16326         * typemanager.cs (RegisterMethod): drop checking if we have
16327         registered this from here
16328
16329 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16330
16331         * class.cs (Method.EmitDestructor): Implement calling our base
16332         destructor. 
16333
16334         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16335         value of InFinally.
16336
16337         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16338         this routine and will wrap the call in a try/catch block.  Deal
16339         with the case.
16340
16341 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * ecore.cs (Expression.MemberLookup): instead of taking a
16344         parameter `same_type' that was used to tell whether we could
16345         access private members we compute our containing type from the
16346         EmitContext.
16347
16348         (FieldExpr): Added partial support for volatile fields.  This does
16349         not work for volatile fields exposed from assemblies, as I can not
16350         figure out how to extract the modreq from it.
16351
16352         Updated all the source files to use this.
16353
16354         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16355         because it is referenced by MemberLookup very often. 
16356
16357 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16358
16359         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16360         TypeBuilder.GetCustomAttributes to retrieve what we need.
16361
16362         Get rid of redundant default_member_attr_type as this is the same as
16363         default_member_type which already exists.
16364
16365         * interface.cs, attribute.cs : Update accordingly.
16366
16367 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16368
16369         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16370         work for TYpeBuilders though.  Ravi, can you please fix this?
16371
16372         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16373
16374         * expression.cs (Argument.Emit): Handle the case of ref objects
16375         being passed to ref functions;  
16376
16377         (ParameterReference.EmitLoad): Loads the content of the pointer
16378         without dereferencing.
16379
16380 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16383
16384 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16385
16386         * class.cs (Indexer.DefineMethod): Incorporate the interface
16387         type in the name of the method if we are doing explicit interface
16388         implementation.
16389
16390         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16391
16392         (BetterConversion): Fix extremely trivial bug where we were referring to
16393         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16394         again !
16395
16396         * ../errors/bug16.cs : Add although we have fixed it.
16397
16398 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16399
16400         * expression.cs (BaseIndexer): Begin implementation.
16401
16402         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16403
16404         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16405         production directly to remove a shift/reduce, and implement
16406         explicit interface implementation.
16407
16408         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16409         after a floating point suffix.
16410
16411         * expression.cs (DoNumericPromotions): Improved the conversion for
16412         uint/uint.  If we have a constant, we avoid doing a typecast to a
16413         larger type.
16414
16415         * class.cs (Indexer): Implement explicit interface implementation
16416         for indexers.
16417
16418 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16419
16420         * class.cs: make the default instance constructor public and hidebysig.
16421
16422 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16423
16424         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16425         so we can call it from elsewhere.
16426
16427         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16428         we emit it internally if the class has a defined indexer; otherwise the user
16429         emits it by decorating the class definition with the DefaultMemberAttribute.
16430
16431         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16432         attribute is not used on a type which defines an indexer.
16433
16434         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16435         character when we skip whitespace.
16436
16437         * ../errors/cs0646.cs : Add.
16438
16439 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16440
16441         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16442         again. 
16443
16444         * makefile: Add practical target `mcs3.exe' which builds the third
16445         generation compiler. 
16446
16447         * expression.cs (New): Fix structures constructor calling.
16448
16449         * class.cs (Property, Method, Indexer): Emit Final flag on the
16450         method if we are an interface implementation and we are not
16451         abstract. 
16452
16453         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16454         whether this property is referencing a `base' method.
16455
16456         * expression.cs (Invocation.EmitCall): take an extra argument:
16457         is_base, this is used to determine whether the `call' or
16458         `callvirt' opcode should be used.
16459
16460
16461         * delegate.cs: update EmitCall.
16462
16463         * class.cs (Method.Define): Set NewSlot for the cases where we are
16464         not implementing an interface method.
16465
16466         (Property.Define): ditto.
16467
16468 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16469
16470         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16471         'r'.  Allows mcs to parse itself fully.
16472
16473 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16474
16475         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16476         of the number of initializers that require the InitializeArray method.
16477
16478         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16479         update the above field where necessary.
16480
16481         (MakeByteBlob): Update accordingly.
16482
16483         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16484         greater than 2.
16485
16486         (EmitDynamicInitializers): Update in accordance with the new optimization.
16487
16488         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16489         same OpCode applies.
16490
16491         * cs-parser.jay : Fix some glaring errors I introduced.
16492
16493 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16494
16495         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16496         so that we can check for name clashes there too.
16497
16498         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16499         for interface indexers.
16500
16501         * interfaces.cs (Define): Emit the default member attribute.
16502
16503         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16504         variable was being referred to while setting the value ;-)
16505
16506 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16507
16508         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16509         byte-by-byte information when we know the data is zero.
16510
16511         Make the block always a multiple of 4, because
16512         DefineInitializedData has a bug.
16513
16514         * assign.cs: Fix, we should assign from the temporary, not from
16515         the source. 
16516
16517         * expression.cs (MakeByteBlob): Fix my incorrect code.
16518
16519 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16520
16521         * typemanager.cs (EnumToUnderlying): This function is used to get
16522         the underlying type from an enumeration, because it does not
16523         always work. 
16524
16525         * constant.cs: Use the I4_S form for values between -128 and 127.
16526
16527         * statement.cs (Block.LookupLabel): Looks up a label.
16528         (Block): Drop support for labeled blocks.
16529
16530         (LabeledStatement): New kind of statement that represents a label
16531         only.
16532
16533         (Goto): Finally implement this bad boy.
16534
16535         * cs-parser.jay: Update to reflect new mechanism to implement
16536         labels.
16537
16538 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16539
16540         * codegen.cs (EmitContext.This): a codegen property that keeps the
16541         a single instance of this instead of creating many different this
16542         instances. 
16543
16544         * delegate.cs (Delegate.DoResolve): Update to use the property;
16545
16546         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16547
16548         * expression.cs (BaseAccess.DoResolve): Ditto.
16549
16550 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16551
16552         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16553         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16554
16555         (InitCoreTypes): Update accordingly.
16556
16557         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16558         so we can quickly store the state.
16559
16560         (ApplyAttributes): Set the correct implementation flags
16561         for InternalCall methods.
16562
16563 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16564
16565         * expression.cs (EmitCall): if a method is not virtual, then do
16566         not use callvirt on it.
16567
16568         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16569         user defined stuff) requires the use of stobj, which takes an
16570         address on the stack instead of an array and an index.  So emit
16571         the Ldelema operation for it.
16572
16573         (EmitStoreOpcode): Use stobj for valuetypes.
16574
16575         (UnaryMutator.EmitCode): Use the right 1 value depending on
16576         whether we are dealing with int64/uint64, float or doubles.
16577
16578         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16579         constructors that I implemented last night.
16580
16581         (Constructor.IsDefault): Fix to work properly for static
16582         constructors.
16583
16584         * cs-parser.jay (CheckDef): report method signature errors.
16585         Update error number 103 to be 132.
16586
16587         * decl.cs: New AdditionResult enumeration value: MethodExists.
16588         Although we do this check for methods later on in the semantic
16589         analysis, catching repeated default constructors is so easy that
16590         we catch these here. 
16591
16592         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16593         promotions code.
16594
16595         (ParameterReference.EmitAssign, Emit): handle
16596         bools as bytes.
16597
16598         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16599         (ArrayAccess.EmitStoreOpcode): ditto.
16600
16601         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16602
16603         * expression.cs (MakeByteBlob): Complete all the missing types
16604         (uint, short, ushort, byte, sbyte)
16605
16606         * class.cs: Only init instance field initializers on instance
16607         constructors. 
16608
16609         Rename `constructors' to instance_constructors. 
16610
16611         (TypeContainer.AddConstructor): Only add constructors to the list
16612         if it is not static.
16613
16614         Make sure that we handle default_static_constructor independently
16615         everywhere where we handle instance_constructors
16616
16617 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16618
16619         * class.cs: Do not lookup or create a base initializer for a
16620         static constructor.
16621
16622         (ConstructorInitializer.Resolve): use the proper type to lookup
16623         for constructors.
16624
16625         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16626
16627         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16628         in DeclSpace. 
16629
16630         * decl.cs: CloseType is now an virtual method, the default
16631         implementation just closes this type.
16632
16633 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16634
16635         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16636         to PreserveSig by default. Also emit HideBySig on such methods.
16637
16638         Basically, set the defaults to standard values.
16639
16640         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16641         argument, if candidate is better, it can't be worse than the best !
16642
16643         (Invocation): Re-write bits to differentiate between methods being
16644         applicable in their expanded form and their normal form - for params
16645         methods of course.
16646
16647         Get rid of use_standard everywhere as only standard conversions are allowed
16648         in overload resolution. 
16649
16650         More spec conformance.
16651
16652 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16653
16654         * driver.cs: Add --timestamp, to see where the compiler spends
16655         most of its time.
16656
16657         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16658         `this' in static code.
16659
16660         (SimpleName.DoResolve): Implement in terms of a helper function
16661         that allows static-references to be passed upstream to
16662         MemberAccess.
16663
16664         (Expression.ResolveWithSimpleName): Resolve specially simple
16665         names when called by MemberAccess to implement the special
16666         semantics. 
16667
16668         (Expression.ImplicitReferenceConversion): Handle conversions from
16669         Null to reference types before others, as Null's type is
16670         System.Object. 
16671
16672         * expression.cs (Invocation.EmitCall): Handle the special case of
16673         calling methods declared on a reference type from a ValueType
16674         (Base classes System.Object and System.Enum)
16675
16676         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16677         the left hand side is a TypeExpr, not on every enumeration. 
16678
16679         (Binary.Resolve): If types are reference types, then do a cast to
16680         object on operators != and == of both arguments.
16681
16682         * typemanager.cs (FindMembers): Extract instance and static
16683         members if requested.
16684
16685         * interface.cs (PopulateProperty): Use void_type instead of null
16686         as the return type for the setter method.
16687
16688         (PopulateIndexer): ditto.
16689
16690 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16691
16692         * support.cs (ReflectionParameters): Fix minor bug where we
16693         were examining the wrong parameter for the ParamArray attribute.
16694
16695         Cope with requests for the type of the parameter at position
16696         greater than the params parameter's. We now return the element
16697         type of the params array as that makes more sense.
16698
16699         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16700         accordingly as we no longer have to extract the element type
16701         ourselves.
16702
16703         (Invocation.OverloadResolve): Update.
16704
16705 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16706
16707         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16708         against IEnumerator, test whether the return value is a descendant
16709         of the IEnumerator interface.
16710
16711         * class.cs (Indexer.Define): Use an auxiliary method to implement
16712         the other bits of the method definition.  Begin support for
16713         explicit interface implementation.
16714
16715         (Property.DefineMethod): Use TypeManager.void_type instead of null
16716         for an empty return value.
16717
16718 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16719
16720         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16721         dealing with a FieldExpr which is composed of a FieldBuilder, in
16722         the code path we did extract the constant, but we should have
16723         obtained the underlying value to be able to cast it (otherwise we
16724         end up in an infinite loop, this is what Ravi was running into).
16725
16726         (ArrayCreation.UpdateIndices): Arrays might be empty.
16727
16728         (MemberAccess.ResolveMemberAccess): Add support for section
16729         14.5.4.1 that deals with the special case of E.I when E is a type
16730         and something else, that I can be a reference to a static member.
16731
16732         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16733         handle a particular array type to create byte blobs, it is just
16734         something we dont generate byteblobs for.
16735
16736         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16737         arguments. 
16738
16739         * location.cs (Push): remove the key from the hashtable that we
16740         are about to add.   This happens for empty files.
16741
16742         * driver.cs: Dispose files after we have parsed them.
16743
16744         (tokenize): new function that only runs the tokenizer on its
16745         input, for speed testing.
16746
16747 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16748
16749         * class.cs (Event.Define): Define the private field only if there
16750         are no accessors defined.
16751
16752         * expression.cs (ResolveMemberAccess): If there is no associated
16753         field with the event, that means we have an event defined with its
16754         own accessors and we should flag error cs0070 since transforming
16755         ourselves into a field is not valid in that case.
16756
16757         * ecore.cs (SimpleName.DoResolve): Same as above.
16758
16759         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16760         and charset to sane values.
16761
16762 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16763
16764         * assign.cs (DoResolve): Perform check on events only if they 
16765         are being accessed outside the declaring type.
16766
16767         * cs-parser.jay (event_declarations): Update rules to correctly
16768         set the type of the implicit parameter etc.
16769
16770         (add_accessor, remove_accessor): Set current local parameters.
16771
16772         * expression.cs (Binary): For delegate addition and subtraction,
16773         cast the return value from the method into the appropriate delegate
16774         type.
16775
16776 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16777
16778         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16779         of these as the workaround is unnecessary.
16780
16781         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16782         delegate data - none of that is needed at all.
16783
16784         Re-write bits to extract the instance expression and the delegate method
16785         correctly.
16786
16787         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16788         on delegates too.
16789
16790         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16791         of attaching attributes instead of duplicating code everywhere.
16792
16793         * everywhere : Update code to do attribute emission using the above method.
16794
16795 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16796
16797         * expression.cs (IsParamsMethodApplicable): if there are not
16798         parameters, return immediately.
16799
16800         * ecore.cs: The 0 literal can be implicity converted to an enum
16801         type. 
16802
16803         (SimpleName.DoResolve): First lookup the type, then lookup the
16804         members. 
16805
16806         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16807         want to get its address.  If the InstanceExpression is not
16808         addressable, store the result in a temporary variable, then get
16809         the address of it.
16810
16811         * codegen.cs: Only display 219 errors on warning level or above. 
16812
16813         * expression.cs (ArrayAccess): Make it implement the
16814         IMemoryLocation interface.
16815
16816         (Binary.DoResolve): handle the operator == (object a, object b)
16817         and operator != (object a, object b) without incurring into a
16818         BoxedCast (because 5 != o should never be performed).
16819
16820         Handle binary enumerator operators.
16821
16822         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16823         value type, otherwise use Ldelem_ref.
16824
16825         Use precomputed names;
16826
16827         (AddressOf): Implement address of
16828
16829         * cs-parser.jay (labeled_statement): Fix recursive block
16830         addition by reworking the production.
16831
16832         * expression.cs (New.DoEmit): New has a special case:
16833                 
16834                  If we are dealing with a ValueType, we have a few
16835                  situations to deal with:
16836                 
16837                     * The target of New is a ValueType variable, that is
16838                       easy, we just pass this as the variable reference
16839                 
16840                     * The target of New is being passed as an argument,
16841                       to a boxing operation or a function that takes a
16842                       ValueType.
16843                 
16844                       In this case, we need to create a temporary variable
16845                       that is the argument of New.
16846
16847
16848 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16849
16850         * rootcontext.cs (LookupType): Check that current_type is not null before
16851         going about looking at nested types.
16852
16853         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16854         not implement the IAssignMethod interface any more.
16855
16856         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16857         where we tranform them into FieldExprs if they are being resolved from within
16858         the declaring type.
16859
16860         * ecore.cs (SimpleName.DoResolve): Do the same here.
16861
16862         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16863
16864         * ../errors/bug10.cs : Add.
16865
16866         * ../errors/cs0070.cs : Add.
16867
16868         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16869
16870         * assign.cs : Get rid of EventIsLocal everywhere.
16871
16872 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * ecore.cs (ConvertIntLiteral): finished the implementation.
16875
16876         * statement.cs (SwitchLabel): Convert the value we are using as a
16877         key before looking up the table.
16878
16879 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16880
16881         * codegen.cs (EmitTopBlock): Require a Location argument now.
16882
16883         * cs-parser.jay (constructor_declarator): We need to setup
16884         current_local_parameters before we parse the
16885         opt_constructor_initializer, to allow the variables to be bound
16886         to the constructor arguments.
16887
16888         * rootcontext.cs (LookupType): First lookup nested classes in our
16889         class and our parents before we go looking outside our class.
16890
16891         * expression.cs (ConstantFold): Extract/debox the values at the
16892         beginnning. 
16893
16894         * rootcontext.cs (EmitCode): Resolve the constants first before we
16895         resolve the types.  This is not really needed, but it helps debugging.
16896
16897         * statement.cs: report location.
16898
16899         * cs-parser.jay: pass location to throw statement.
16900
16901         * driver.cs: Small bug fix.
16902
16903         * report.cs: Updated format to be 4-zero filled digits.
16904
16905 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16906
16907         * expression.cs (CheckIndices): Fix minor bug where the wrong
16908         variable was being referred to ;-)
16909
16910         (DoEmit): Do not call EmitStaticInitializers when the 
16911         underlying type is System.Object.
16912
16913 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16914
16915         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16916         and do the usual workaround for SRE.
16917
16918         * class.cs (MyEventBuilder.EventType): New member to get at the type
16919         of the event, quickly.
16920
16921         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16922
16923         * assign.cs (Assign.DoResolve): Handle the case when the target
16924         is an EventExpr and perform the necessary checks.
16925
16926         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16927         interface.
16928
16929         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16930
16931         (EventExpr): Set the type in the constructor itself since we 
16932         are meant to be born fully resolved.
16933
16934         (EventExpr.Define): Revert code I wrote earlier.
16935                 
16936         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16937         instance expression is null. The instance expression is a This in that case
16938         or a null, depending on whether it is a static method or not.
16939
16940         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16941         refers to more than one method.
16942
16943         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16944         and accordingly flag errors.
16945
16946 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16947
16948         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16949
16950 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * location.cs (ToString): Provide useful rutine.
16953
16954 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16955
16956         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16957         objects, return the actual integral boxed.
16958
16959         * statement.cs (SwitchLabel): define an ILLabel for each
16960         SwitchLabel. 
16961
16962         (Switch.CheckSwitch): If the value is a Literal, extract
16963         the underlying literal.
16964
16965         Also in the unused hashtable we had, add the SwitchLabel so we can
16966         quickly look this value up.
16967
16968         * constant.cs: Implement a bunch of new constants.  Rewrite
16969         Literal based on this.  Made changes everywhere to adapt to this.
16970
16971         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16972         dereferencing array only once, and also copes with enumrations.
16973
16974         bytes are two bytes wide, not one.
16975
16976         (Cast): Perform constant conversions.
16977
16978         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16979         wrappers to the literals here.
16980
16981         * expression.cs (DoNumericPromotions): long literals can converted
16982         to ulong implicity (this is taken care of elsewhere, but I was
16983         missing this spot).
16984
16985         * ecore.cs (Expression.Literalize): Make the return type Literal,
16986         to improve type checking.
16987
16988         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16989
16990 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16991
16992         * literal.cs: Revert code from ravi that checked the bounds.  The
16993         bounds are sane by the definition of the type itself. 
16994
16995         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16996         need to actually look up in our parent hierarchy for interfaces
16997         implemented. 
16998
16999         * const.cs: Use the underlying type for enumerations
17000
17001         * delegate.cs: Compute the basename for the delegate creation,
17002         that should fix the delegate test case, and restore the correct
17003         Type Lookup semantics in rootcontext
17004
17005         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17006         referencing a nested type with the Reflection API is using the "+"
17007         sign. 
17008
17009         * cs-parser.jay: Do not require EOF token at the end.
17010
17011 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17012
17013         * rootcontext.cs (LookupType): Concatenate type names with
17014         a '.' instead of a '+' The test suite passes again.
17015
17016         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17017         field of the enumeration.
17018
17019         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17020         the case when the member is an EventExpr.
17021
17022         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17023         static has an associated instance expression.
17024
17025         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17026
17027         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17028
17029         * class.cs (Event.Define): Register event and perform appropriate checks
17030         for error #111.
17031
17032         We define the Add and Remove methods even if the use provides none because
17033         in that case, we provide default implementations ourselves.
17034
17035         Define a private field of the type of the event. This is done by the CSC compiler
17036         and we should be doing it too ;-)
17037
17038         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17039         More methods we use in code we generate.
17040
17041         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17042         is important.
17043
17044         (InitCoreTypes): Update accordingly for the above.
17045
17046         * class.cs (Event.Emit): Generate code for default accessors that we provide
17047
17048         (EmitDefaultMethod): Do the job in the above.
17049
17050         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17051         appropriate place.
17052
17053 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17054
17055         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17056         builders even if we were missing one.
17057
17058         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17059         pass the Basename as our class name instead of the Name.  The
17060         basename will be correctly composed for us.
17061
17062         * parameter.cs (Paramters): Now takes a Location argument.
17063
17064         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17065         make all the code call directly LookupType in RootContext and take
17066         this chance to pass the Location information everywhere.
17067
17068         * Everywhere: pass Location information.
17069
17070 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17071
17072         * class.cs (Constructor.Define): Updated way of detecting the
17073         length of the parameters.
17074
17075         (TypeContainer.DefineType): Use basename as the type name for
17076         nested types.
17077
17078         (TypeContainer.Define): Do not recursively define types here, as
17079         definition is taken care in order by the RootContext.
17080
17081         * tree.cs: Keep track of namespaces in a per-file basis.
17082
17083         * parameter.cs (Parameter.ComputeSignature): Update to use
17084         DeclSpace. 
17085
17086         (Parameters.GetSignature): ditto.
17087
17088         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17089         instead of a TypeContainer.
17090
17091         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17092         resolve names.  Because we need to be resolve in our context, not
17093         our parents.
17094
17095         * driver.cs: Implement response files.
17096
17097         * class.cs (TypeContainer.DefineType): If we are defined, do not
17098         redefine ourselves.
17099
17100         (Event.Emit): Emit the code for add/remove handlers.
17101         (Event.Define): Save the MethodBuilders for add/remove.
17102
17103         * typemanager.cs: Use pair here too.
17104
17105         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17106         DictionaryEntry requires the first argument to be non-null.  
17107
17108         (enum_declaration): Compute full name for registering the
17109         enumeration.
17110
17111         (delegate_declaration): Instead of using
17112         formal_parameter_list, use opt_formal_parameter_list as the list
17113         can be empty.
17114
17115         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17116         (EventParsing): New property that controls whether `add' and
17117         `remove' are returned as tokens or identifiers (for events);
17118
17119 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17120
17121         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17122         use MyEventBuilder only and let it wrap the real builder for us.
17123
17124         (MyEventBuilder): Revamp constructor etc.
17125
17126         Implement all operations that we perform on EventBuilder in precisely the same
17127         way here too.
17128
17129         (FindMembers): Update to use the EventBuilder member.
17130
17131         (Event.Emit): Update accordingly.
17132
17133 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17134
17135         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17136         by calling the appropriate methods.
17137
17138         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17139         useful.
17140
17141         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17142
17143 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17144
17145         * delegate.cs (Delegate.Populate): Check that the return type
17146         and various parameters types are indeed accessible.
17147
17148         * class.cs (Constructor.Define): Same here.
17149
17150         (Field.Define): Ditto.
17151
17152         (Event.Define): Ditto.
17153
17154         (Operator.Define): Check that the underlying Method defined itself
17155         correctly - so it's MethodBuilder should not be null.
17156
17157         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17158         expression happens to be null.
17159
17160         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17161         members but as of now we don't seem to be able to do anything really useful with it.
17162
17163         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17164         not the EventBuilder.
17165
17166 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17167
17168         * cs-tokenizer.cs: Add support for defines.
17169         Add support for #if, #elif, #else, #endif
17170
17171         (eval_var): evaluates a variable.
17172         (eval): stubbed for evaluating functions.
17173
17174         * cs-parser.jay: Pass the defines information
17175
17176         * driver.cs: Add --define command line option.
17177
17178         * decl.cs: Move MemberCore here.
17179
17180         Make it the base class for DeclSpace.  This allows us to catch and
17181         report 108 and 109 for everything now.
17182
17183         * class.cs (TypeContainer.Define): Extract all the members
17184         before populating and emit the warning 108 (new keyword required
17185         to override) instead of having each member implement this.
17186
17187         (MemberCore.Define): New abstract method, we will be using this in
17188         the warning reporting engine in Populate.
17189
17190         (Operator.Define): Adjust to new MemberCore protocol. 
17191
17192         * const.cs (Const): This does not derive from Expression, it is a
17193         temporary object we use to create fields, it is a MemberCore. 
17194
17195         * class.cs (Method.Define): Allow the entry point to be in a
17196         specific class.
17197
17198         * driver.cs: Rewrite the argument handler to clean it up a bit.
17199
17200         * rootcontext.cs: Made it just an auxiliary namespace feature by
17201         making everything static.
17202
17203         * driver.cs: Adapt code to use RootContext type name instead of
17204         instance variable.
17205
17206         * delegate.cs: Remove RootContext argument.
17207
17208         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17209         argument. 
17210
17211         * class.cs (Event.Define): The lookup can fail.
17212
17213         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17214
17215         * expression.cs: Resolve the this instance before invoking the code.
17216
17217 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17218
17219         * cs-parser.jay: Add a production in element_access that allows
17220         the thing to become a "type" reference.  This way we can parse
17221         things like "(string [])" as a type.
17222
17223         Note that this still does not handle the more complex rules of
17224         casts. 
17225
17226
17227         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17228
17229         * ecore.cs: (CopyNewMethods): new utility function used to
17230         assemble the list of methods from running FindMembers.
17231
17232         (MemberLookup): Rework FindMembers so that 
17233
17234 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17235
17236         * class.cs (TypeContainer): Remove Delegates who fail to be
17237         defined.
17238
17239         * delegate.cs (Populate): Verify that we dont get null return
17240         values.   TODO: Check for AsAccessible.
17241
17242         * cs-parser.jay: Use basename to emit error 574 (destructor should
17243         have the same name as container class), not the full name.
17244
17245         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17246         possible representation.  
17247
17248         Also implements integer type suffixes U and L.
17249
17250 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17251
17252         * expression.cs (ArrayCreation.DoResolve): We need to do the
17253         argument resolution *always*.
17254
17255         * decl.cs: Make this hold the namespace.  Hold the root context as
17256         well.
17257         (LookupType): Move here.
17258
17259         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17260
17261         * location.cs (Row, Name): Fixed the code, it was always returning
17262         references to the first file.
17263
17264         * interface.cs: Register properties defined through interfaces.
17265
17266         * driver.cs: Add support for globbing on the command line
17267
17268         * class.cs (Field): Make it derive from MemberCore as well.
17269         (Event): ditto.
17270
17271 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17272
17273         * class.cs (Event::Define): Check that the type of the event is a delegate
17274         type else flag error #66.
17275
17276         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17277         same.
17278
17279         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17280         values of EntryPoint, CharSet etc etc.
17281
17282         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17283
17284         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17285         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17286         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17287         which needs this to do its work.
17288
17289         * ../errors/cs0066.cs : Add.
17290
17291 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17292
17293         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17294         helper functions.
17295
17296         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17297         clears out the parameters field.
17298         (MemberSignatureCompare): Cleanup
17299
17300         (MemberCore): New base class used to share code between MethodCore
17301         and Property.
17302
17303         (RegisterRequiredImplementations) BindingFlags.Public requires
17304         either BindingFlags.Instace or Static.  Use instance here.
17305
17306         (Property): Refactored code to cope better with the full spec.
17307
17308         * parameter.cs (GetParameterInfo): Return an empty array instead
17309         of null on error.
17310
17311         * class.cs (Property): Abstract or extern properties have no bodies.
17312
17313         * parameter.cs (GetParameterInfo): return a zero-sized array.
17314
17315         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17316         method modifier validation to the typecontainer so we can reuse
17317         this on properties.
17318
17319         (MethodCore.ParameterTypes): return an empty sized array of types.
17320
17321         (Property.Define): Test property modifier validity.
17322
17323         Add tests for sealed/override too.
17324
17325         (Method.Emit): abstract or extern methods have no bodies.
17326
17327 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17328
17329         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17330         thing.
17331
17332         (Method::Define, ::Emit): Modify accordingly.
17333
17334         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17335
17336         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17337
17338         * makefile: Pass in /unsafe.
17339
17340 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17341
17342         * class.cs (MakeKey): Kill routine.
17343
17344         * class.cs (TypeContainer.Define): Correctly define explicit
17345         method implementations (they require the full interface name plus
17346         the method name).
17347
17348         * typemanager.cs: Deply the PtrHashtable here and stop using the
17349         lame keys.  Things work so much better.
17350
17351         This of course broke everyone who depended on `RegisterMethod' to
17352         do the `test for existance' test.  This has to be done elsewhere.
17353
17354         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17355         the object stupid Equals method (because, that like fails all over
17356         the place).  We still do not use it.
17357
17358         * class.cs (TypeContainer.SetRequiredInterface,
17359         TypeContainer.RequireMethods): Killed these two routines and moved
17360         all the functionality to RegisterRequiredImplementations.
17361
17362         (TypeContainer.RegisterRequiredImplementations): This routine now
17363         registers all the implementations required in an array for the
17364         interfaces and abstract methods.  We use an array of structures
17365         which can be computed ahead of time to reduce memory usage and we
17366         also assume that lookups are cheap as most classes will not
17367         implement too many interfaces.
17368
17369         We also avoid creating too many MethodSignatures.
17370
17371         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17372         clear the "pending" bit if we find that there are problems with
17373         the declaration.
17374
17375         (TypeContainer.VerifyPendingMethods): Update to report errors of
17376         methods that look like implementations but are not.
17377
17378         (TypeContainer.Define): Add support for explicit interface method
17379         implementation. 
17380
17381 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17382
17383         * typemanager.cs: Keep track of the parameters here instead of
17384         being a feature of the TypeContainer.
17385
17386         * class.cs: Drop the registration of parameters here, as
17387         InterfaceMethods are also interface declarations.
17388
17389         * delegate.cs: Register methods with the TypeManager not only with
17390         the TypeContainer.  This code was buggy.
17391
17392         * interface.cs: Full registation here.
17393
17394 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17395
17396         * expression.cs: Remove reducer for binary expressions, it can not
17397         be done this way.
17398
17399         * const.cs: Put here the code that used to go into constant.cs
17400
17401         * constant.cs: Put here the code for constants, this is a new base
17402         class for Literals.
17403
17404         * literal.cs: Make Literal derive from Constant.
17405
17406 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17407
17408         * statement.cs (Return.Emit): Report error 157 if the user
17409         attempts to return from a finally block.
17410
17411         (Return.Emit): Instead of emitting a return, jump to the end of
17412         the function.
17413
17414         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17415         LocalBuilder to store the result of the function.  ReturnLabel is
17416         the target where we jump.
17417
17418
17419 2001-12-09  Radek Doulik  <rodo@ximian.com>
17420
17421         * cs-parser.jay: remember alias in current namespace
17422
17423         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17424         namespaces
17425
17426         * class.cs (LookupAlias): lookup alias in my_namespace
17427
17428         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17429         aliases hashtable
17430         (LookupAlias): lookup alias in this and if needed in parent
17431         namespaces
17432
17433 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17434
17435         * support.cs: 
17436
17437         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17438         making things static.  I need this to avoid passing the
17439         TypeContainer when calling ParameterType.
17440
17441         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17442         that did string manipulation to compute the type and then call
17443         GetType.  Use Parameter.ParameterType instead.
17444
17445         * cs-tokenizer.cs: Consume the suffix for floating values.
17446
17447         * expression.cs (ParameterReference): figure out whether this is a
17448         reference parameter or not.  Kill an extra variable by computing
17449         the arg_idx during emission.
17450
17451         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17452         function that returns whether a parameter is an out/ref value or not.
17453
17454         (Parameter.ParameterType): The type of the parameter (base,
17455         without ref/out applied).
17456
17457         (Parameter.Resolve): Perform resolution here.
17458         (Parameter.ExternalType): The full type (with ref/out applied).
17459
17460         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17461         support for expressions on the using statement.
17462
17463 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17464
17465         * statement.cs (Using.EmitLocalVariableDecls): Split the
17466         localvariable handling of the using statement.
17467
17468         (Block.EmitMeta): Keep track of variable count across blocks.  We
17469         were reusing slots on separate branches of blocks.
17470
17471         (Try.Emit): Emit the general code block, we were not emitting it. 
17472
17473         Check the type of the declaration to be an IDisposable or
17474         something that can be implicity converted to it. 
17475
17476         Emit conversions if required.
17477
17478         * ecore.cs (EmptyExpression): New utility class.
17479         (Expression.ImplicitConversionExists): New utility function.
17480
17481 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17482
17483         * statement.cs (Using): Implement.
17484
17485         * expression.cs (LocalVariableReference): Support read only variables.
17486
17487         * statement.cs: Remove the explicit emit for the Leave opcode.
17488         (VariableInfo): Add a readonly field.
17489
17490 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17491
17492         * ecore.cs (ConvCast): new class used to encapsulate the various
17493         explicit integer conversions that works in both checked and
17494         unchecked contexts.
17495
17496         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17497         properly generate the overflow opcodes.
17498
17499 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17500
17501         * statement.cs: The correct type for the EmptyExpression is the
17502         element_type, not the variable type.  Ravi pointed this out.
17503
17504 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17505
17506         * class.cs (Method::Define): Handle PInvoke methods specially
17507         by using DefinePInvokeMethod instead of the usual one.
17508
17509         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17510         above to do the task of extracting information and defining the method.
17511
17512 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17513
17514         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17515         of the condition for string type.
17516
17517         (Emit): Move that here. 
17518
17519         (ArrayCreation::CheckIndices): Keep string literals in their expression
17520         form.
17521
17522         (EmitDynamicInitializers): Handle strings appropriately.
17523
17524 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17525
17526         * codegen.cs (EmitContext): Replace multiple variables with a
17527         single pointer to the current Switch statement.
17528
17529         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17530         EmitContext.
17531
17532 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17533
17534         * statement.cs 
17535
17536         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17537         default'.
17538
17539         (Foreach.Emit): Foreach on arrays was not setting
17540         up the loop variables (for break/continue).
17541
17542         (GotoCase): Semi-implented.
17543
17544 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17545
17546         * attribute.cs (CheckAttribute): Handle system attributes by using
17547         Attribute.GetAttributes to examine information we need.
17548
17549         (GetValidPlaces): Same here.
17550
17551         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17552
17553         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17554
17555         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17556
17557         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17558
17559         (Method::Emit): Handle the case when we are a PInvoke method.
17560
17561 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17562
17563         * expression.cs: Use ResolveWithSimpleName on compound names.
17564
17565 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17566
17567         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17568         before trying to reduce it.
17569
17570         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17571
17572         * constant.cs (LookupConstantValue): Implement.
17573
17574         (EmitConstant): Use the above in emitting the constant.
17575
17576         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17577         that are user-defined by doing a LookupConstantValue on them.
17578
17579         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17580         too, like above.
17581
17582 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17583
17584         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17585
17586         (BaseAccess.DoResolve): Implement.
17587
17588         (MemberAccess.DoResolve): Split this routine into a
17589         ResolveMemberAccess routine that can be used independently
17590
17591 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17592
17593         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17594         As that share bits of the implementation.  Is returns a boolean,
17595         while As returns the Type that is being probed.
17596
17597 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17598
17599         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17600         instead of a Literal - much easier.
17601
17602         (EnumInTransit): Remove - utterly useless :-)
17603
17604         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17605
17606         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17607
17608         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17609         chain when we have no associated expression.
17610
17611 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17612
17613         * constant.cs (Define): Use Location while reporting the errror.
17614
17615         Also emit a warning when 'new' is used and there is no inherited
17616         member to hide.
17617
17618         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17619         populated.
17620
17621         (LookupEnumValue): Implement to lookup an enum member's value and define it
17622         if necessary.
17623
17624         (Populate): Re-write accordingly to use the above routine.
17625
17626 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * expression.cs (This): Fix prototype for DoResolveLValue to
17629         override the base class DoResolveLValue.
17630
17631         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17632         declarations) 
17633
17634         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17635         (we need to load the address of the field here).  This fixes
17636         test-22. 
17637
17638         (FieldExpr.DoResolveLValue): Call the DoResolve
17639         function to initialize the Instance expression.
17640
17641         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17642         correctly the GetEnumerator operation on a value type.
17643
17644         * cs-parser.jay: Add more simple parsing error catches.
17645
17646         * statement.cs (Switch): Add support for string switches.
17647         Handle null specially.
17648
17649         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17650
17651 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17652
17653         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17654
17655         (declare_local_constant): New helper function.
17656
17657         * statement.cs (AddConstant): Keep a separate record of constants
17658
17659         (IsConstant): Implement to determine if a variable is a constant.
17660
17661         (GetConstantExpression): Implement.
17662
17663         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17664
17665         * statement.cs (IsVariableDefined): Re-write.
17666
17667 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17668
17669         * class.cs (TypeContainer::FindMembers): Look for constants
17670         in the case when we are looking for MemberTypes.Field
17671
17672         * expression.cs (MemberAccess::DoResolve): Check that in the
17673         case we are a FieldExpr and a Literal, we are not being accessed
17674         by an instance reference.
17675
17676         * cs-parser.jay (local_constant_declaration): Implement.
17677
17678         (declaration_statement): Implement for constant declarations.
17679
17680 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17681
17682         * statement.cs (Switch): Catch double defaults.
17683
17684         (Switch): More work on the switch() statement
17685         implementation.  It works for integral values now, need to finish
17686         string support.
17687
17688
17689 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17690
17691         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17692         integer literals into other integer literals.  To be used by
17693         switch. 
17694
17695 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17696
17697         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17698         some memory.
17699
17700         (EmitDynamicInitializers): Cope with the above since we extract data
17701         directly from ArrayData now.
17702
17703         (ExpectInitializers): Keep track of whether initializers are mandatory
17704         or not.
17705
17706         (Bounds): Make it a hashtable to prevent the same dimension being 
17707         recorded for every element in that dimension.
17708
17709         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17710         from being found.
17711
17712         Also fix bug which was causing the indices to be emitted in the reverse
17713         order.
17714
17715 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17716
17717         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17718         unfinished.  They do not work, because the underlying code is
17719         sloppy.
17720
17721 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17722
17723         * cs-parser.jay: Remove bogus fixme.
17724
17725         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17726         on Switch statement.
17727
17728 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17729
17730         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17731         the same. 
17732
17733         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17734         parameter. Apparently, any expression is allowed. 
17735
17736         (ValidateInitializers): Update accordingly.
17737
17738         (CheckIndices): Fix some tricky bugs thanks to recursion.
17739
17740         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17741         I was being completely brain-dead.
17742
17743         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17744         and re-write acordingly.
17745
17746         (DelegateInvocation): Re-write accordingly.
17747
17748         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17749
17750         (MakeByteBlob): Handle types more correctly.
17751
17752         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17753         initialization from expressions but it is incomplete because I am a complete
17754         Dodo :-|
17755
17756 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17757
17758         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17759         on If.  Basically, we have to return `true' (ie, we do return to
17760         our caller) only if both branches of the if return.
17761
17762         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17763         short-circuit operators, handle them as short circuit operators. 
17764
17765         (Cast.DoResolve): Resolve type.
17766         (Cast.Cast): Take an expression as the target type.
17767
17768         * cs-parser.jay (cast_expression): Remove old hack that only
17769         allowed a limited set of types to be handled.  Now we take a
17770         unary_expression and we resolve to a type during semantic
17771         analysis.
17772
17773         Use the grammar productions from Rhys to handle casts (this is
17774         not complete like Rhys syntax yet, we fail to handle that corner
17775         case that C# has regarding (-x), but we will get there.
17776
17777 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17778
17779         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17780         field which is an array type.
17781
17782         * cs-parser.jay (declare_local_variables): Support array initialization too.
17783
17784         * typemanager.cs (MakeKey): Implement.
17785
17786         (everywhere): Use the above appropriately.
17787
17788         * cs-parser.jay (for_statement): Update for array initialization while
17789         declaring variables.
17790
17791         * ecore.cs : The error message was correct, it's the variable's names that
17792         were misleading ;-) Make the code more readable.
17793
17794         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17795         the correct type etc.
17796
17797         (ConvertExplicit): Handle Enum types by examining the underlying type.
17798
17799 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17800
17801         * parameter.cs (GetCallingConvention): Always return
17802         CallingConventions.Standard for now.
17803
17804 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17805
17806         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17807         and `r' after calling DoNumericPromotions.
17808
17809         * ecore.cs: Fix error message (the types were in the wrong order).
17810
17811         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17812         BindingFlags.Instance as well 
17813
17814         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17815         implicit int literal conversion in an empty cast so that we
17816         propagate the right type upstream.
17817
17818         (UnboxCast): new class used to unbox value types.
17819         (Expression.ConvertExplicit): Add explicit type conversions done
17820         by unboxing.
17821
17822         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17823         the target type before applying the implicit LongLiterals to ULong
17824         literal cast.
17825
17826 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17827
17828         * cs-parser.jay (for_statement): Reworked the way For works: now
17829         we declare manually any variables that are introduced in
17830         for_initializer to solve the problem of having out-of-band code
17831         emition (that is what got for broken).
17832
17833         (declaration_statement): Perform the actual variable declaration
17834         that used to be done in local_variable_declaration here.
17835
17836         (local_variable_declaration): Do not declare anything, just pass
17837         the information on a DictionaryEntry
17838
17839 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17840
17841         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17842         re-write of the logic to now make it recursive.
17843
17844         (UpdateIndices): Re-write accordingly.
17845
17846         Store element data in a separate ArrayData list in the above methods.
17847
17848         (MakeByteBlob): Implement to dump the array data into a byte array.
17849
17850 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17851
17852         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17853         into CheckIndices.
17854
17855         * constant.cs (Define): Implement.
17856
17857         (EmitConstant): Re-write fully.
17858
17859         Pass in location info.
17860
17861         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17862         respectively.
17863
17864         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17865         DictionaryEntry since we need location info too.
17866
17867         (constant_declaration): Update accordingly.
17868
17869         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17870         code into another method : UpdateIndices.
17871
17872 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17873
17874         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17875         some type checking etc.
17876
17877 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17878
17879         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17880         bits to provide dimension info if the user skips doing that.
17881
17882         Update second constructor to store the rank correctly.
17883
17884 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17885
17886         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17887         and try to implement.
17888
17889         * ../errors/cs0150.cs : Add.
17890
17891         * ../errors/cs0178.cs : Add.
17892
17893 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17894
17895         * statement.cs: Implement foreach on multi-dimensional arrays. 
17896
17897         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17898         name of the params argument.
17899
17900         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17901         initializing the array.
17902
17903         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17904         we can use this elsewhere.
17905
17906         * statement.cs: Finish implementation of foreach for single
17907         dimension arrays.
17908
17909         * cs-parser.jay: Use an out-of-band stack to pass information
17910         around, I wonder why I need this.
17911
17912         foreach_block: Make the new foreach_block the current_block.
17913
17914         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17915         function used to return a static Parameters structure.  Used for
17916         empty parameters, as those are created very frequently.
17917
17918         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17919
17920 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17921
17922         * interface.cs : Default modifier is private, not public. The
17923         make verify test passes again.
17924
17925 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17926
17927         * support.cs (ReflectionParameters): Fix logic to determine
17928         whether the last parameter is a params one. Test 9 passes again.
17929
17930         * delegate.cs (Populate): Register the builders we define with
17931         RegisterParameterForBuilder. Test 19 passes again.
17932
17933         * cs-parser.jay (property_declaration): Reference $6 instead
17934         of $$ to get at the location.
17935
17936         (indexer_declaration): Similar stuff.
17937
17938         (attribute): Ditto.
17939
17940         * class.cs (Property): Register parameters for the Get and Set methods
17941         if they exist. Test 23 passes again.
17942
17943         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17944         call to EmitArguments as we are sure there aren't any params arguments. 
17945         Test 32 passes again.
17946
17947         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17948         IndexOutOfRangeException. 
17949
17950         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17951         Test 33 now passes again.
17952
17953 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17954
17955         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17956         broke a bunch of things.  Will have to come up with a better way
17957         of tracking locations.
17958
17959         * statement.cs: Implemented foreach for single dimension arrays.
17960
17961 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17964         an error.  This removes the lookup from the critical path.
17965
17966         * cs-parser.jay: Removed use of temporary_loc, which is completely
17967         broken. 
17968
17969 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * support.cs (ReflectionParameters.ParameterModifier): Report
17972         whether the argument is a PARAMS argument or not.
17973
17974         * class.cs: Set the attribute `ParamArrayAttribute' on the
17975         parameter argument.
17976
17977         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17978         and cons_param_array_attribute (ConstructorInfo for
17979         ParamArrayAttribute)., 
17980
17981         * codegen.cs: Emit the return using the `Return' statement, that
17982         way we can report the error correctly for missing return values. 
17983
17984         * class.cs (Method.Emit): Clean up.
17985
17986         * expression.cs (Argument.Resolve): Take another argument: the
17987         location where this argument is used.  Notice that this is not
17988         part of the "Argument" class as to reduce the size of the
17989         structure (we know the approximate location anyways).
17990
17991         Test if the argument is a variable-reference, if not, then
17992         complain with a 206.
17993
17994         (Argument.Emit): Emit addresses of variables.
17995
17996         (Argument.FullDesc): Simplify.
17997
17998         (Invocation.DoResolve): Update for Argument.Resolve.
17999
18000         (ElementAccess.DoResolve): ditto.
18001
18002         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18003         method should be virtual, as this method is always virtual.
18004
18005         (NewDelegate.DoResolve): Update for Argument.Resolve.
18006
18007         * class.cs (ConstructorInitializer.DoResolve): ditto.
18008
18009         * attribute.cs (Attribute.Resolve): ditto.
18010
18011 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18012
18013         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18014
18015         * expression.cs (ParameterReference): Drop IStackStorage and implement
18016         IAssignMethod instead. 
18017
18018         (LocalVariableReference): ditto.
18019
18020         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18021         IAssignMethod instead. 
18022
18023 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18024
18025         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18026         enumerations that are used in heavily used structures derive from
18027         byte in a laughable and pathetic attempt to reduce memory usage.
18028         This is the kind of pre-optimzations that you should not do at
18029         home without adult supervision.
18030
18031         * expression.cs (UnaryMutator): New class, used to handle ++ and
18032         -- separatedly from the other unary operators.  Cleans up the
18033         code, and kills the ExpressionStatement dependency in Unary.
18034
18035         (Unary): Removed `method' and `Arguments' from this class, making
18036         it smaller, and moving it all to SimpleCall, so I can reuse this
18037         code in other locations and avoid creating a lot of transient data
18038         strucutres when not required.
18039
18040         * cs-parser.jay: Adjust for new changes.
18041
18042 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18043
18044         * enum.cs (Enum.Populate): If there is a failure during
18045         definition, return
18046
18047         * cs-parser.jay (opt_enum_base): we used to catch type errors
18048         here, but this is really incorrect.  The type error should be
18049         catched during semantic analysis.
18050
18051 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18052
18053         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18054         current_local_parameters as expected since I, in my stupidity, had forgotten
18055         to do this :-)
18056
18057         * attribute.cs (GetValidPlaces): Fix stupid bug.
18058
18059         * class.cs (Method::Emit): Perform check on applicability of attributes.
18060
18061         (Constructor::Emit): Ditto.
18062
18063         (Field::Emit): Ditto.
18064
18065         (Field.Location): Store location information.
18066
18067         (Property, Event, Indexer, Operator): Ditto.
18068
18069         * cs-parser.jay (field_declaration): Pass in location for each field.
18070
18071         * ../errors/cs0592.cs : Add.
18072
18073 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18074
18075         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18076
18077         (InitCoreTypes): Update accordingly.
18078
18079         (RegisterAttrType, LookupAttr): Implement.
18080
18081         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18082         info about the same.
18083
18084         (Resolve): Update to populate the above as necessary.
18085
18086         (Error592): Helper.
18087
18088         (GetValidPlaces): Helper to the above.
18089
18090         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18091
18092         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18093
18094 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18095
18096         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18097
18098         * ../errors/cs0617.cs : Add.
18099
18100 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18101
18102         * enum.cs (Emit): Rename to Populate to be more consistent with what
18103         we expect it to do and when exactly it is called.
18104
18105         * class.cs, rootcontext.cs : Update accordingly.
18106
18107         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18108         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18109
18110         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18111
18112         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18113         of a fieldinfo using the above, when dealing with a FieldBuilder.
18114
18115 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18116
18117         * ../errors/cs0031.cs : Add.
18118
18119         * ../errors/cs1008.cs : Add.
18120
18121         * ../errrors/cs0543.cs : Add.
18122
18123         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18124         enum type.
18125
18126         (FindMembers): Implement.
18127
18128         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18129         enums and delegates too.
18130
18131         (enum_types): Rename to builder_to_enum.
18132
18133         (delegate_types): Rename to builder_to_delegate.
18134
18135         * delegate.cs (FindMembers): Implement.
18136
18137 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18138
18139         * typemanager.cs (IsEnumType): Implement.
18140
18141         * enum.cs (Emit): Re-write parts to account for the underlying type
18142         better and perform checking etc.
18143
18144         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18145         of the underlying type.
18146
18147         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18148         value
18149
18150         * enum.cs (error31): Helper to report error #31.
18151
18152         * cs-parser.jay (enum_declaration): Store location of each member too.
18153
18154         * enum.cs (member_to_location): New hashtable. 
18155
18156         (AddEnumMember): Update location hashtable.
18157
18158         (Emit): Use the location of each member while reporting errors.
18159
18160 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18161
18162         * cs-parser.jay: A for_initializer if is a
18163         local_variable_declaration really ammount to have an implicit
18164         block with the variable declaration and no initializer for for.
18165
18166         * statement.cs (For.Emit): Cope with null initializers.
18167
18168         This fixes the infinite loop on for initializers.
18169
18170 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18171
18172         * enum.cs: More cleanup.
18173
18174         * ecore.cs: Remove dead code.
18175
18176         * class.cs (Property.Emit): More simplification.
18177         (Event.Emit): ditto.
18178
18179         Reworked to have less levels of indentation.
18180
18181 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18182
18183         * class.cs (Property): Emit attributes.
18184
18185         (Field): Ditto.
18186
18187         (Event): Ditto.
18188
18189         (Indexer): Ditto.
18190
18191         (Operator): Ditto.
18192
18193         * enum.cs (Emit): Ditto.
18194
18195         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18196         Enums too.
18197
18198         * class.cs (Field, Event, etc.): Move attribute generation into the
18199         Emit method everywhere.
18200
18201         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18202         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18203         as we had no way of defining nested enums !
18204
18205         * rootcontext.cs : Adjust code accordingly.
18206
18207         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18208
18209 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18210
18211         * expression.cs (EvalConstantExpression): Move into ecore.cs
18212
18213         * enum.cs (Enum): Rename some members and make them public and readonly
18214         according to our convention.
18215
18216         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18217         nothing else.
18218
18219         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18220
18221         (Enum::Emit): Write a simple version for now which doesn't try to compute
18222         expressions. I shall modify this to be more robust in just a while.
18223
18224         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18225
18226         (TypeContainer::CloseType): Create the Enum types too.
18227
18228         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18229
18230         * expression.cs (EvalConstantExpression): Get rid of completely.
18231
18232         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18233         user-defined values and other cases.
18234
18235         (IsValidEnumLiteral): Helper function.
18236
18237         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18238         out there in the case we had a literal FieldExpr.
18239
18240         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18241
18242         (Literalize): Revamp a bit to take two arguments.
18243
18244         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18245
18246 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18247
18248         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18249
18250         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18251
18252         (Resolve): Use the above to ensure we have proper initializers.
18253
18254 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18255
18256         * expression.cs (Expression::EvalConstantExpression): New method to 
18257         evaluate constant expressions.
18258
18259         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18260
18261 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18262
18263         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18264         in an array.
18265
18266         (Binary.ResolveOperator): Handle operator != (object a, object b)
18267         and operator == (object a, object b);
18268
18269         (Binary.DoNumericPromotions): Indicate whether the numeric
18270         promotion was possible.
18271
18272         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18273         Implement.  
18274
18275         Made the ArrayAccess implement interface IAssignMethod instead of
18276         IStackStore as the order in which arguments are passed reflects
18277         this.
18278
18279         * assign.cs: Instead of using expr.ExprClass to select the way of
18280         assinging, probe for the IStackStore/IAssignMethod interfaces.
18281
18282         * typemanager.cs: Load InitializeArray definition.
18283
18284         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18285         static data that can be used to initialize arrays. 
18286
18287 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * expression.cs: Handle operator== and operator!= for booleans.
18290
18291         (Conditioal.Reduce): Implement reducer for the ?: operator.
18292
18293         (Conditional.Resolve): Implement dead code elimination.
18294
18295         (Binary.Resolve): Catch string literals and return a new
18296         concatenated string.
18297
18298         (Unary.Reduce): Implement reduction of unary expressions.
18299
18300         * ecore.cs: Split out the expression core handling here.
18301
18302         (Expression.Reduce): New method used to perform constant folding
18303         and CSE.  This is needed to support constant-expressions. 
18304
18305         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18306         targets, and optimize for !x.
18307
18308 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18309
18310         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18311         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18312         set custom atttributes.
18313
18314         * literal.cs (Literal::GetValue): New abstract method to return the actual
18315         value of the literal, cast as an object.
18316
18317         (*Literal): Implement GetValue method.
18318
18319         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18320         expressions to the arraylist but objects of type Argument.
18321
18322         * class.cs (TypeContainer::Emit): Emit our attributes too.
18323
18324         (Method::Emit, Constructor::Emit): Ditto.
18325
18326         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18327         to be ignoring earlier.
18328
18329 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18330
18331         * attribute.cs (AttributeSection::Define): Implement to do the business
18332         of constructing a CustomAttributeBuilder.
18333
18334         (Attribute): New trivial class. Increases readability of code.  
18335
18336         * cs-parser.jay : Update accordingly.
18337
18338         (positional_argument_list, named_argument_list, named_argument): New rules
18339
18340         (attribute_arguments): Use the above so that we are more correct.
18341
18342 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18343
18344         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18345         to perform all checks for a method with a params parameter.
18346
18347         (Invocation::OverloadResolve): Update to use the above method and therefore
18348         cope correctly with params method invocations.
18349
18350         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18351         params too.
18352
18353         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18354         constructors in our parent too because we can't afford to miss out on 
18355         protected ones ;-)
18356
18357         * attribute.cs (AttributeSection): New name for the class Attribute
18358
18359         Other trivial changes to improve readability.
18360
18361         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18362         use the new class names.
18363
18364 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18365
18366         * class.cs (Method::Define): Complete definition for params types too
18367
18368         (Indexer::Define): Ditto.
18369
18370         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18371         Cope everywhere with a request for info about the array parameter.
18372
18373 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18374
18375         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18376
18377         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18378         local_variable_type to extract the string corresponding to the type.
18379
18380         (local_variable_type): Fixup the action to use the new helper method.
18381
18382         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18383         go.
18384
18385         * expression.cs : Clean out code which uses the above.
18386
18387 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18388
18389         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18390         and bale out if necessary by returning a false.
18391
18392         (RegisterProperty): Ditto.
18393
18394         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18395         and print out appropriate error messages.
18396
18397         * interface.cs (everywhere): Ditto.
18398
18399         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18400         location to constructor.
18401
18402         * class.cs (Property, Event, Indexer): Update accordingly.
18403
18404         * ../errors/cs111.cs : Added.
18405
18406         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18407         of a method, as laid down by the spec.
18408
18409         (Invocation::OverloadResolve): Use the above method.
18410
18411 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18412
18413         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18414         now take a TypeContainer and a Parameters object.
18415
18416         (ParameterData): Modify return type of ParameterModifier method to be 
18417         Parameter.Modifier and not a string.
18418
18419         (ReflectionParameters, InternalParameters): Update accordingly.
18420
18421         * expression.cs (Argument::GetParameterModifier): Same here.
18422
18423         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18424         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18425         symbol in it at all so maybe this is only for now.
18426
18427 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18428
18429         * support.cs (InternalParameters): Constructor now takes an extra argument 
18430         which is the actual Parameters class.
18431
18432         (ParameterDesc): Update to provide info on ref/out modifiers.
18433
18434         * class.cs (everywhere): Update call to InternalParameters to pass in
18435         the second argument too.
18436
18437         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18438         to return the modifier info [ref/out etc]
18439
18440         (InternalParameters, ReflectionParameters): Implement the above.
18441
18442         * expression.cs (Argument::ParameterModifier): Similar function to return
18443         info about the argument's modifiers.
18444
18445         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18446         too.
18447
18448         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18449         a new SetFormalParameters object which we pass to InternalParameters.
18450
18451 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18452
18453         * expression.cs (NewArray): Merge into the ArrayCreation class.
18454
18455 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18456
18457         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18458         NewUserdefinedArray into one as there wasn't much of a use in having
18459         two separate ones.
18460
18461         * expression.cs (Argument): Change field's name to ArgType from Type.
18462
18463         (Type): New readonly property which returns the proper type, taking into 
18464         account ref/out modifiers.
18465
18466         (everywhere): Adjust code accordingly for the above.
18467
18468         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18469         whether we are emitting for a ref or out parameter.
18470
18471         * expression.cs (Argument::Emit): Use the above field to set the state.
18472
18473         (LocalVariableReference::Emit): Update to honour the flag and emit the
18474         right stuff.
18475
18476         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18477
18478         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18479
18480         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18481
18482         (ReflectionParameters, InternalParameters): Implement the above method.
18483
18484         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18485         reporting errors.
18486
18487         (Invocation::FullMethodDesc): Ditto. 
18488
18489 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18490
18491         * cs-parser.jay: Add extra production for the second form of array
18492         creation. 
18493
18494         * expression.cs (ArrayCreation): Update to reflect the above
18495         change. 
18496
18497         * Small changes to prepare for Array initialization.
18498
18499 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18500
18501         * typemanager.cs (ImplementsInterface): interface might be null;
18502         Deal with this problem;
18503
18504         Also, we do store negative hits on the cache (null values), so use
18505         this instead of calling t.GetInterfaces on the type everytime.
18506
18507 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18508
18509         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18510
18511         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18512         split functionality out into different classes.
18513
18514         (New::FormArrayType): Move into NewBuiltinArray.
18515
18516         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18517         quite useless.
18518
18519         (NewBuiltinArray): New class to handle creation of built-in arrays.
18520
18521         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18522         account creation of one-dimensional arrays.
18523
18524         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18525
18526         (NewUserdefinedArray::DoResolve): Implement.
18527
18528         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18529
18530         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18531         we maintain inside the TypeManager. This is necessary to perform lookups on the
18532         module builder.
18533
18534         (LookupType): Update to perform GetType on the module builders too.     
18535
18536         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18537
18538         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18539
18540 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18541
18542         * expression.cs (New::DoResolve): Implement guts of array creation.
18543
18544         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18545
18546 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18547
18548         * expression.cs: Fix bug I introduced lsat night that broke
18549         Delegates. 
18550
18551         (Expression.Resolve): Report a 246 error (can not resolve name)
18552         if we find a SimpleName in the stream.
18553
18554         (Expression.ResolveLValue): Ditto.
18555
18556         (Expression.ResolveWithSimpleName): This function is a variant of
18557         ResolveName, this one allows SimpleNames to be returned without a
18558         warning.  The only consumer of SimpleNames is MemberAccess
18559
18560 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18561
18562         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18563         might arrive here.  I have my doubts that this is correct.
18564
18565         * statement.cs (Lock): Implement lock statement.
18566
18567         * cs-parser.jay: Small fixes to support `lock' and `using'
18568
18569         * cs-tokenizer.cs: Remove extra space
18570
18571         * driver.cs: New flag --checked, allows to turn on integer math
18572         checking. 
18573
18574         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18575         Threading.Monitor.Exit 
18576
18577 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18578
18579         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18580         Expression Class to be IndexerAccess.
18581
18582         Notice that Indexer::DoResolve sets the eclass to Value.
18583
18584 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18585
18586         * class.cs (TypeContainer::Emit): Emit code for indexers.
18587
18588         * assign.cs (IAssignMethod): New interface implemented by Indexers
18589         and Properties for handling assignment.
18590
18591         (Assign::Emit): Simplify and reuse code. 
18592
18593         * expression.cs (IndexerAccess, PropertyExpr): Implement
18594         IAssignMethod, clean up old code. 
18595
18596 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18597
18598         * typemanager.cs (ImplementsInterface): New method to determine if a type
18599         implements a given interface. Provides a nice cache too.
18600
18601         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18602         method.
18603
18604         (ConvertReferenceExplicit): Ditto.
18605
18606         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18607         various methods, with correct names etc.
18608
18609         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18610         Operator.UnaryNegation.
18611
18612         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18613         we have a unary plus or minus operator.
18614
18615         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18616         UnaryMinus.
18617
18618         * everywhere : update accordingly.
18619
18620         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18621         respectively.
18622
18623         * class.cs (Method::Define): For the case where we are implementing a method
18624         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18625         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18626
18627 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18628
18629         * interface.cs (FindMembers): Implement to work around S.R.E
18630         lameness.
18631
18632         * typemanager.cs (IsInterfaceType): Implement.
18633
18634         (FindMembers): Update to handle interface types too.
18635
18636         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18637         use IsAssignableFrom as that is not correct - it doesn't work.
18638
18639         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18640         and accordingly override EmitStatement.
18641
18642         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18643         using the correct logic :-)
18644
18645 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18646
18647         * ../errors/cs-11.cs : Add to demonstrate error -11 
18648
18649 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18650
18651         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18652         then pass this as a hint to ResolveLValue.
18653
18654         * expression.cs (FieldExpr): Add Location information
18655
18656         (FieldExpr::LValueResolve): Report assignment to readonly
18657         variable. 
18658
18659         (Expression::ExprClassFromMemberInfo): Pass location information.
18660
18661         (Expression::ResolveLValue): Add new method that resolves an
18662         LValue. 
18663
18664         (Expression::DoResolveLValue): Default invocation calls
18665         DoResolve. 
18666
18667         (Indexers): New class used to keep track of indexers in a given
18668         Type. 
18669
18670         (IStackStore): Renamed from LValue, as it did not really describe
18671         what this did.  Also ResolveLValue is gone from this interface and
18672         now is part of Expression.
18673
18674         (ElementAccess): Depending on the element access type
18675
18676         * typemanager.cs: Add `indexer_name_type' as a Core type
18677         (System.Runtime.CompilerServices.IndexerNameAttribute)
18678
18679         * statement.cs (Goto): Take a location.
18680
18681 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18682
18683         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18684         if two delegates are compatible.
18685
18686         (NewDelegate::DoResolve): Update to take care of the case when
18687         we instantiate a delegate from another delegate.
18688
18689         * typemanager.cs (FindMembers): Don't even try to look up members
18690         of Delegate types for now.
18691
18692 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18693
18694         * delegate.cs (NewDelegate): New class to take care of delegate
18695         instantiation.
18696
18697         * expression.cs (New): Split the delegate related code out into 
18698         the NewDelegate class.
18699
18700         * delegate.cs (DelegateInvocation): New class to handle delegate 
18701         invocation.
18702
18703         * expression.cs (Invocation): Split out delegate related code into
18704         the DelegateInvocation class.
18705
18706 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18707
18708         * expression.cs (New::DoResolve): Implement delegate creation fully
18709         and according to the spec.
18710
18711         (New::DoEmit): Update to handle delegates differently.
18712
18713         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18714         because of which we were printing out arguments in reverse order !
18715
18716         * delegate.cs (VerifyMethod): Implement to check if the given method
18717         matches the delegate.
18718
18719         (FullDelegateDesc): Implement.
18720
18721         (VerifyApplicability): Implement.
18722
18723         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18724         delegate invocations too.
18725
18726         (Invocation::Emit): Ditto.
18727
18728         * ../errors/cs1593.cs : Added.
18729
18730         * ../errors/cs1594.cs : Added.
18731
18732         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18733
18734 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18735
18736         * typemanager.cs (intptr_type): Core type for System.IntPtr
18737
18738         (InitCoreTypes): Update for the same.
18739
18740         (iasyncresult_type, asynccallback_type): Ditto.
18741
18742         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18743         correct.
18744
18745         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18746         too.
18747
18748         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18749         the builders for the 4 members of a delegate type :-)
18750
18751         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18752         type.
18753
18754         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18755
18756         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18757
18758 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18759
18760         * statement.cs (Break::Emit): Implement.   
18761         (Continue::Emit): Implement.
18762
18763         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18764         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18765         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18766         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18767         end loop
18768
18769         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18770         properties that track the label for the current loop (begin of the
18771         loop and end of the loop).
18772
18773 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18774
18775         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18776         use of emitting anything at all.
18777
18778         * class.cs, rootcontext.cs : Get rid of calls to the same.
18779
18780         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18781
18782         (Populate): Define the constructor correctly and set the implementation
18783         attributes.
18784
18785         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18786         have been defined.
18787
18788         (AddDelegateType): Implement.
18789
18790         (IsDelegateType): Implement helper method.
18791
18792         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18793
18794         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18795         and accordingly handle it.
18796
18797         * delegate.cs (Populate): Take TypeContainer argument.
18798         Implement bits to define the Invoke method. However, I still haven't figured out
18799         how to take care of the native int bit :-(
18800
18801         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18802         Qualify the name of the delegate, not its return type !
18803
18804         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18805         conversion.
18806
18807         (StandardConversionExists): Checking for array types turns out to be recursive.
18808
18809         (ConvertReferenceExplicit): Implement array conversion.
18810
18811         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18812
18813 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18814
18815         * cs-parser.jay (delegate_declaration): Store the fully qualified
18816         name as it is a type declaration.
18817
18818         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18819         readonly.
18820
18821         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18822         as TypeContainer::DefineType.
18823
18824         (Populate): Method in which all the definition of the various methods (Invoke)
18825         etc is done.
18826
18827         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18828         see.
18829
18830         (CloseDelegate): Finally creates the delegate.
18831
18832         * class.cs (TypeContainer::DefineType): Update to define delegates.
18833         (Populate, Emit and CloseType): Do the same thing here too.
18834
18835         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18836         delegates in all these operations.
18837
18838 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18839
18840         * expression.cs: LocalTemporary: a new expression used to
18841         reference a temporary that has been created.
18842
18843         * assign.cs: Handle PropertyAccess back here, so that we can
18844         provide the proper semantic access to properties.
18845
18846         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18847         a few more explicit conversions. 
18848
18849         * modifiers.cs: `NEW' modifier maps to HideBySig.
18850
18851         * expression.cs (PropertyExpr): Make this into an
18852         ExpressionStatement, and support the EmitStatement code path. 
18853
18854         Perform get/set error checking, clean up the interface.
18855
18856         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18857         them into toplevel access objects.
18858
18859 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18860
18861         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18862         SRE.
18863
18864         * typemanager.cs: Keep track here of our PropertyBuilders again to
18865         work around lameness in SRE.
18866
18867 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18868
18869         * expression.cs (LValue::LValueResolve): New method in the
18870         interface, used to perform a second resolution pass for LValues. 
18871
18872         (This::DoResolve): Catch the use of this in static methods.
18873
18874         (This::LValueResolve): Implement.
18875
18876         (This::Store): Remove warning, assigning to `this' in structures
18877         is 
18878
18879         (Invocation::Emit): Deal with invocation of
18880         methods on value types.  We need to pass the address to structure
18881         methods rather than the object itself.  (The equivalent code to
18882         emit "this" for structures leaves the entire structure on the
18883         stack instead of a pointer to it). 
18884
18885         (ParameterReference::DoResolve): Compute the real index for the
18886         argument based on whether the method takes or not a `this' pointer
18887         (ie, the method is static).
18888
18889         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18890         value types returned from functions when we need to invoke a
18891         method on the sturcture.
18892
18893
18894 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18895
18896         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18897         defining the type in the Modulebuilder or Typebuilder. This is to take
18898         care of nested types which need to be defined on the TypeBuilder using
18899         DefineNestedMethod.
18900
18901         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18902         methods in RootContext, only ported to be part of TypeContainer.
18903
18904         (TypeContainer::GetInterfaceOrClass): Ditto.
18905
18906         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18907
18908         * interface.cs (Interface::DefineInterface): New method. Does exactly
18909         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18910         too.
18911
18912         (Interface::GetInterfaces): Move from RootContext here and port.
18913
18914         (Interface::GetInterfaceByName): Same here.
18915
18916         * rootcontext.cs (ResolveTree): Re-write.
18917
18918         (PopulateTypes): Re-write.
18919
18920         * class.cs (TypeContainer::Populate): Populate nested types too.
18921         (TypeContainer::Emit): Emit nested members too.
18922
18923         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18924         instead just use the name argument passed in as it is already fully
18925         qualified.
18926
18927         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18928         to TypeContainer mapping to see if a type is user-defined.
18929
18930         * class.cs (TypeContainer::CloseType): Implement. 
18931
18932         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18933         the default constructor.
18934
18935         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18936         twice.
18937
18938         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18939
18940         * interface.cs (CloseType): Create the type here.
18941
18942         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18943         the hierarchy.
18944
18945         Remove all the methods which are now in TypeContainer.
18946
18947 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18948
18949         * delegate.cs (Define): Re-write bits to define the delegate
18950         correctly.
18951
18952 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18953
18954         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18955
18956         * expression.cs (ImplicitReferenceConversion): handle null as well
18957         as a source to convert to any reference type.
18958
18959         * statement.cs (Return): Perform any implicit conversions to
18960         expected return type.  
18961
18962         Validate use of return statement.  
18963
18964         * codegen.cs (EmitContext): Pass the expected return type here.
18965
18966         * class.cs (Method, Constructor, Property): Pass expected return
18967         type to EmitContext.
18968
18969 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18970
18971         * expression.cs: Make DoResolve take an EmitContext instead of a
18972         TypeContainer.
18973
18974         Replaced `l' and `location' for `loc', for consistency.
18975
18976         (Error, Warning): Remove unneeded Tc argument.
18977
18978         * assign.cs, literal.cs, constant.cs: Update to new calling
18979         convention. 
18980
18981         * codegen.cs: EmitContext now contains a flag indicating whether
18982         code is being generated in a static method or not.
18983
18984         * cs-parser.jay: DecomposeQI, new function that replaces the old
18985         QualifiedIdentifier.  Now we always decompose the assembled
18986         strings from qualified_identifier productions into a group of
18987         memberaccesses.
18988
18989 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18990
18991         * rootcontext.cs: Deal with field-less struct types correctly now
18992         by passing the size option to Define Type.
18993
18994         * class.cs: Removed hack that created one static field. 
18995
18996 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18997
18998         * statement.cs: Moved most of the code generation here. 
18999
19000 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19001
19002         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19003         seem very right.
19004
19005         (ElementAccess): Remove useless bits for now - keep checks as the spec
19006         says.
19007
19008 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19009
19010         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19011         and start performing checks according to the spec.
19012
19013 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19014
19015         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19016         rank_specifiers instead.
19017
19018         (rank_specifiers): Change the order in which the rank specifiers are stored
19019
19020         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19021
19022         * expression.cs (ElementAccess): Implement the LValue interface too.
19023
19024 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19025
19026         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19027         except that user defined conversions are not included.
19028
19029         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19030         perform the conversion of the return type, if necessary.
19031
19032         (New::DoResolve): Check whether we are creating an array or an object
19033         and accordingly do the needful.
19034
19035         (New::Emit): Same here.
19036
19037         (New::DoResolve): Implement guts of array creation.
19038
19039         (New::FormLookupType): Helper function.
19040
19041 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19042
19043         * codegen.cs: Removed most of the code generation here, and move the
19044         corresponding code generation bits to the statement classes. 
19045
19046         Added support for try/catch/finalize and throw.
19047
19048         * cs-parser.jay: Added support for try/catch/finalize.
19049
19050         * class.cs: Catch static methods having the flags override,
19051         virtual or abstract.
19052
19053         * expression.cs (UserCast): This user cast was not really doing
19054         what it was supposed to do.  Which is to be born in fully resolved
19055         state.  Parts of the resolution were being performed at Emit time! 
19056
19057         Fixed this code.
19058
19059 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * expression.cs: Implicity convert the result from UserCast.
19062
19063 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19064
19065         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19066         prevented it from working correctly. 
19067
19068         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19069         merely ConvertImplicit.
19070
19071 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19072
19073         * typemanager.cs: Make the LookupTypeContainer function static,
19074         and not per-instance.  
19075
19076         * class.cs: Make static FindMembers (the one that takes a Type
19077         argument). 
19078
19079         * codegen.cs: Add EmitForeach here.
19080
19081         * cs-parser.jay: Make foreach a toplevel object instead of the
19082         inline expansion, as we need to perform semantic analysis on it. 
19083
19084 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19085
19086         * expression.cs (Expression::ImplicitUserConversion): Rename to
19087         UserDefinedConversion.
19088
19089         (Expression::UserDefinedConversion): Take an extra argument specifying 
19090         whether we look for explicit user conversions too.
19091
19092         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19093
19094         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19095
19096         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19097         with the appropriate arguments.
19098
19099         * cs-parser.jay (cast_expression): Record location too.
19100
19101         * expression.cs (Cast): Record location info.
19102
19103         (Expression::ConvertExplicit): Take location argument.
19104
19105         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19106         to determine if we are doing explicit conversions.
19107
19108         (UserCast::Emit): Update accordingly.
19109
19110         (Expression::ConvertExplicit): Report an error if everything fails.
19111
19112         * ../errors/cs0030.cs : Add.
19113
19114 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19117         virtual and newslot bits. 
19118
19119         * class.cs (TypeContainer::RegisterRequiredImplementations):
19120         Record methods we need.
19121
19122         (TypeContainer::MakeKey): Helper function to make keys for
19123         MethodBases, since the Methodbase key is useless.
19124
19125         (TypeContainer::Populate): Call RegisterRequiredImplementations
19126         before defining the methods.   
19127
19128         Create a mapping for method_builders_to_methods ahead of time
19129         instead of inside a tight loop.
19130
19131         (::RequireMethods):  Accept an object as the data to set into the
19132         hashtable so we can report interface vs abstract method mismatch.
19133
19134 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19135
19136         * report.cs: Make all of it static.
19137
19138         * rootcontext.cs: Drop object_type and value_type computations, as
19139         we have those in the TypeManager anyways.
19140
19141         Drop report instance variable too, now it is a global.
19142
19143         * driver.cs: Use try/catch on command line handling.
19144
19145         Add --probe option to debug the error reporting system with a test
19146         suite. 
19147
19148         * report.cs: Add support for exiting program when a probe
19149         condition is reached.
19150
19151 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19152
19153         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19154         we do a forcible conversion regardless of type, to check if 
19155         ForceConversion returns a null.
19156
19157         (Binary::error19): Use location to report error.
19158
19159         (Unary::error23): Use location here too.
19160
19161         * ../errors/cs0019.cs : Check in.
19162
19163         * ../errors/cs0023.cs : Check in.
19164
19165         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19166         case of a non-null MethodInfo object with a length of 0 !
19167
19168         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19169         an applicable member - according to the spec :-)
19170         Also fix logic to find members in base types.
19171
19172         (Unary::ResolveOperator): Same here.
19173
19174         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19175         as I was getting thoroughly confused between this and error19 :-)
19176
19177         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19178         (::FindMostEncompassedType): Implement.
19179         (::FindMostEncompassingType): Implement.
19180         (::StandardConversionExists): Implement.
19181
19182         (UserImplicitCast): Re-vamp. We now need info about most specific
19183         source and target types so that we can do the necessary conversions.
19184
19185         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19186         mathematical union with no duplicates.
19187
19188 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19191         in order from base classes to child classes, so that we can in
19192         child classes look up in our parent for method names and
19193         attributes (required for handling abstract, virtual, new, override
19194         constructs: we need to instrospect our base class, and if we dont
19195         populate the classes in order, the introspection might be
19196         incorrect.  For example, a method could query its parent before
19197         the parent has any methods and would determine that the parent has
19198         no abstract methods (while it could have had them)).
19199
19200         (RootContext::CreateType): Record the order in which we define the
19201         classes.
19202
19203 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19204
19205         * class.cs (TypeContainer::Populate): Also method definitions can
19206         fail now, keep track of this.
19207
19208         (TypeContainer::FindMembers): Implement support for
19209         DeclaredOnly/noDeclaredOnly flag.
19210
19211         (Constructor::Emit) Return the ConstructorBuilder.
19212
19213         (Method::Emit) Return the MethodBuilder. 
19214         Check for abstract or virtual methods to be public.
19215
19216         * rootcontext.cs (RootContext::CreateType): Register all the
19217         abstract methods required for the class to be complete and the
19218         interface methods that must be implemented. 
19219
19220         * cs-parser.jay: Report error 501 (method requires body if it is
19221         not marked abstract or extern).
19222
19223         * expression.cs (TypeOf::Emit): Implement.
19224
19225         * typemanager.cs: runtime_handle_type, new global type.
19226
19227         * class.cs (Property::Emit): Generate code for properties.
19228
19229 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19230
19231         * expression.cs (Unary::ResolveOperator): Find operators on base type
19232         too - we now conform exactly to the spec.
19233
19234         (Binary::ResolveOperator): Same here.
19235
19236         * class.cs (Operator::Define): Fix minor quirk in the tests.
19237
19238         * ../errors/cs0215.cs : Added.
19239
19240         * ../errors/cs0556.cs : Added.
19241
19242         * ../errors/cs0555.cs : Added.
19243
19244 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19245
19246         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19247         single integer which is really efficient
19248
19249 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19250
19251         *  expression.cs (Expression::ImplicitUserConversion): Use location
19252         even in the case when we are examining True operators.
19253  
19254         * class.cs (Operator::Define): Perform extensive checks to conform
19255         with the rules for operator overloading in the spec.
19256
19257         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19258         some of the other conversions mentioned in the spec.
19259
19260         * typemanager.cs (array_type): New static member for the System.Array built-in
19261         type.
19262
19263         (cloneable_interface): For System.ICloneable interface.
19264
19265         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19266         we start resolving the tree and populating types.
19267
19268         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19269  
19270 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19271
19272         * expression.cs (Expression::ExprClassFromMemberInfo,
19273         Expression::Literalize): Create literal expressions from
19274         FieldInfos which are literals.
19275
19276         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19277         type casts, because they were wrong.  The test suite in tests
19278         caught these ones.
19279
19280         (ImplicitNumericConversion): ushort to ulong requires a widening
19281         cast. 
19282
19283         Int32 constant to long requires widening cast as well.
19284
19285         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19286         for integers because the type on the stack is not i4.
19287
19288 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19289
19290         * expression.cs (report118): require location argument. 
19291
19292         * parameter.cs: Do not dereference potential null value.
19293
19294         * class.cs: Catch methods that lack the `new' keyword when
19295         overriding a name.  Report warnings when `new' is used without
19296         anything being there to override.
19297
19298         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19299
19300         * class.cs: Only add constructor to hashtable if it is non-null
19301         (as now constructors can fail on define).
19302
19303         (TypeManager, Class, Struct): Take location arguments.
19304
19305         Catch field instance initialization in structs as errors.
19306
19307         accepting_filter: a new filter for FindMembers that is static so
19308         that we dont create an instance per invocation.
19309
19310         (Constructor::Define): Catch errors where a struct constructor is
19311         parameterless 
19312
19313         * cs-parser.jay: Pass location information for various new
19314         constructs. 
19315
19316         * delegate.cs (Delegate): take a location argument.
19317
19318         * driver.cs: Do not call EmitCode if there were problesm in the
19319         Definition of the types, as many Builders wont be there. 
19320
19321         * decl.cs (Decl::Decl): Require a location argument.
19322
19323         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19324         into integers, and find the most appropiate integer for it.
19325
19326         * literal.cs: Implement ULongLiteral.
19327
19328         * rootcontext.cs: Provide better information about the location of
19329         failure when CreateType fails.
19330
19331 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19334         as well.
19335
19336         * expression.cs (Binary::CheckShiftArguments): Add missing type
19337         computation.
19338         (Binary::ResolveOperator): Add type to the logical and and logical
19339         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19340         before.
19341
19342         (Binary::DoNumericPromotions): In the case where either argument
19343         is ulong (and most signed types combined with ulong cause an
19344         error) perform implicit integer constant conversions as well.
19345
19346 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * expression.cs (UserImplicitCast): Method should always be
19349         non-null. 
19350         (Invocation::BetterConversion): Simplified test for IntLiteral.
19351
19352         (Expression::ImplicitNumericConversion): Split this routine out.
19353         Put the code that performs implicit constant integer conversions
19354         here. 
19355
19356         (Expression::Resolve): Become a wrapper around DoResolve so we can
19357         check eclass and type being set after resolve.
19358
19359         (Invocation::Badness): Remove this dead function
19360
19361         (Binary::ResolveOperator): Do not compute the expensive argumnets
19362         unless we have a union for it.
19363
19364         (Probe::Emit): Is needs to do an isinst and then
19365         compare against null.
19366
19367         (::CanConvert): Added Location argument.  If the Location argument
19368         is null (Location.Null), then we do not report errors.  This is
19369         used by the `probe' mechanism of the Explicit conversion.  We do
19370         not want to generate an error for something that the user
19371         explicitly requested to be casted.  But the pipeline for an
19372         explicit cast first tests for potential implicit casts.
19373
19374         So for now, if the Location is null, it means `Probe only' to
19375         avoid adding another argument.   Might have to revise this
19376         strategy later.
19377
19378         (ClassCast): New class used to type cast objects into arbitrary
19379         classes (used in Explicit Reference Conversions).
19380
19381         Implement `as' as well.
19382
19383         Reverted all the patches from Ravi below: they were broken:
19384
19385                 * The use of `level' as a mechanism to stop recursive
19386                   invocations is wrong.  That was there just to catch the
19387                   bug with a strack trace but not as a way of addressing
19388                   the problem.
19389
19390                   To fix the problem we have to *understand* what is going
19391                   on and the interactions and come up with a plan, not
19392                   just get things going.
19393
19394                 * The use of the type conversion cache that I proposed
19395                   last night had an open topic: How does this work across
19396                   protection domains.  A user defined conversion might not
19397                   be public in the location where we are applying the
19398                   conversion, a different conversion might be selected
19399                   (ie, private A->B (better) but public B->A (worse),
19400                   inside A, A->B applies, but outside it, B->A will
19401                   apply).
19402
19403                 * On top of that (ie, even if the above is solved),
19404                   conversions in a cache need to be abstract.  Ie, `To
19405                   convert from an Int to a Short use an OpcodeCast', not
19406                   `To convert from an Int to a Short use the OpcodeCast on
19407                   the variable 5' (which is what this patch was doing).
19408
19409 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19410
19411         * expression.cs (Invocation::ConversionExists): Re-write to use
19412         the conversion cache
19413
19414         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19415         cache all conversions done, not just user-defined ones.
19416
19417         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19418         to determine if a conversion exists instead of acutually trying to 
19419         perform the conversion. It's faster too.
19420
19421         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19422         and only then attempt the implicit conversion.
19423
19424 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19425
19426         * expression.cs (ConvertImplicit): Use a cache for conversions
19427         already found. Check level of recursion and bail out if necessary.
19428
19429 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19430
19431         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19432         Export standard methods that we expect for string operations.
19433
19434         * statement.cs (Block::UsageWarning): Track usage of variables and
19435         report the errors for not used variables.
19436
19437         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19438         operator. 
19439
19440 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19441
19442         * codegen.cs: remove unnneded code 
19443
19444         * expression.cs: Removed BuiltinTypeAccess class
19445
19446         Fix the order in which implicit conversions are
19447         done.  
19448
19449         The previous fixed dropped support for boxed conversions (adding a
19450         test to the test suite now)
19451
19452         (UserImplicitCast::CanConvert): Remove test for source being null,
19453         that code is broken.  We should not feed a null to begin with, if
19454         we do, then we should track the bug where the problem originates
19455         and not try to cover it up here.
19456
19457         Return a resolved expression of type UserImplicitCast on success
19458         rather than true/false.  Ravi: this is what I was talking about,
19459         the pattern is to use a static method as a "constructor" for
19460         objects. 
19461
19462         Also, do not create arguments until the very last minute,
19463         otherwise we always create the arguments even for lookups that
19464         will never be performed. 
19465
19466         (UserImplicitCast::Resolve): Eliminate, objects of type
19467         UserImplicitCast are born in a fully resolved state. 
19468
19469         * typemanager.cs (InitCoreTypes): Init also value_type
19470         (System.ValueType). 
19471
19472         * expression.cs (Cast::Resolve): First resolve the child expression.
19473
19474         (LValue): Add new method AddressOf to be used by
19475         the `&' operator.  
19476
19477         Change the argument of Store to take an EmitContext instead of an
19478         ILGenerator, because things like FieldExpr need to be able to call
19479         their children expression to generate the instance code. 
19480
19481         (Expression::Error, Expression::Warning): Sugar functions for
19482         reporting errors.
19483
19484         (Expression::MemberLookup): Accept a TypeContainer instead of a
19485         Report as the first argument.
19486
19487         (Expression::ResolvePrimary): Killed.  I still want to improve
19488         this as currently the code is just not right.
19489
19490         (Expression::ResolveMemberAccess): Simplify, but it is still
19491         wrong. 
19492
19493         (Unary::Resolve): Catch errors in AddressOf operators.
19494
19495         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19496         index to a byte for the short-version, or the compiler will choose
19497         the wrong Emit call, which generates the wrong data.
19498
19499         (ParameterReference::Emit, ::Store): same.
19500
19501         (FieldExpr::AddressOf): Implement.
19502
19503         * typemanager.cs: TypeManager: made public variable instead of
19504         property.
19505
19506         * driver.cs: document --fatal.
19507
19508         * report.cs (ErrorMessage, WarningMessage): new names for the old
19509         Error and Warning classes.
19510
19511         * cs-parser.jay (member_access): Turn built-in access to types
19512         into a normal simplename
19513
19514 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19515
19516         * expression.cs (Invocation::BetterConversion): Fix to cope
19517         with q being null, since this was introducing a bug.
19518
19519         * expression.cs (ConvertImplicit): Do built-in conversions first.
19520
19521 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19522
19523         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19524
19525 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19526
19527         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19528         I had introduced long ago (what's new ?).
19529
19530         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19531         the work of all the checking. 
19532         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19533         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19534
19535         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19536         that is the right way. 
19537
19538         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19539         overloading resolution. Use everywhere instead of cutting and pasting code.
19540
19541         (Binary::ResolveOperator): Use MakeUnionSet.
19542
19543         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19544         we have to convert to bool types. Not complete yet.
19545
19546 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19547
19548         * typemanager.cs (TypeManager::CSharpName): support ushort.
19549
19550         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19551         to provide an expression that performsn an implicit constant int
19552         conversion (section 6.1.6).
19553         (Expression::ConvertImplicitRequired): Reworked to include
19554         implicit constant expression conversions.
19555
19556         (Expression::ConvertNumericExplicit): Finished.
19557
19558         (Invocation::Emit): If InstanceExpression is null, then it means
19559         that we perform a call on this.
19560
19561 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19562
19563         * expression.cs (Unary::Emit): Remove some dead code.
19564         (Probe): Implement Resolve and Emit for `is'.
19565         (Expression::ConvertImplicitRequired): Attempt to do constant
19566         expression conversions here.  Maybe should be moved to
19567         ConvertImplicit, but I am not sure.
19568         (Expression::ImplicitLongConstantConversionPossible,
19569         Expression::ImplicitIntConstantConversionPossible): New functions
19570         that tell whether is it possible to apply an implicit constant
19571         expression conversion.
19572
19573         (ConvertNumericExplicit): Started work on explicit numeric
19574         conversions.
19575
19576         * cs-parser.jay: Update operator constants.
19577
19578         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19579         (Parameters::GetSignature): Hook up VerifyArgs here.
19580         (Parameters::VerifyArgs): Verifies that no two arguments have the
19581         same name. 
19582
19583         * class.cs (Operator): Update the operator names to reflect the
19584         ones that the spec expects (as we are just stringizing the
19585         operator names).
19586
19587         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19588         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19589         previous usage did only work for our methods.
19590         (Expression::ConvertImplicit): Handle decimal implicit numeric
19591         conversions as well.
19592         (Expression::InternalTypeConstructor): Used to invoke constructors
19593         on internal types for default promotions.
19594
19595         (Unary::Emit): Implement special handling for the pre/post
19596         increment/decrement for overloaded operators, as they need to have
19597         the same semantics as the other operators.
19598
19599         (Binary::ResolveOperator): ditto.
19600         (Invocation::ConversionExists): ditto.
19601         (UserImplicitCast::Resolve): ditto.
19602
19603 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19604
19605         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19606         operator, return after emitting body. Regression tests pass again !
19607
19608         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19609         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19610         (Invocation::OverloadResolve): Ditto.
19611         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19612
19613         * everywhere : update calls to the above methods accordingly.
19614
19615 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19616
19617         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19618
19619         * expression.cs (ExpressionStatement): New base class used for
19620         expressions that can appear in statements, so that we can provide
19621         an alternate path to generate expression that do not leave a value
19622         on the stack.
19623
19624         (Expression::Emit, and all the derivatives): We no longer return
19625         whether a value is left on the stack or not.  Every expression
19626         after being emitted leaves a single value on the stack.
19627
19628         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19629         facilties of ExpressionStatement if possible.
19630
19631         * cs-parser.jay: Update statement_expression.
19632
19633 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19634
19635         * driver.cs: Change the wording of message
19636
19637 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19638
19639         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19640         the type of the expression to the return type of the method if
19641         we have an overloaded operator match ! The regression tests pass again !
19642         (Unary::ResolveOperator): Ditto.
19643
19644         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19645         to find "op_Implicit", not "implicit" ;-)
19646         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19647         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19648
19649         * everywhere : Correct calls to the above accordingly.
19650
19651         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19652         (ConvertImplicit): Do user-defined conversion if it exists.
19653
19654 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19655
19656         * assign.cs: track location.
19657         (Resolve): Use implicit conversions on assignment.
19658
19659         * literal.cs: Oops.  Not good, Emit of short access values should
19660         pass (Bytes) or the wrong argument will be selected.
19661
19662         * expression.cs (Unary::Emit): Emit code for -expr.
19663
19664         (Unary::ResolveOperator): Handle `Substract' for non-constants
19665         (substract from zero from the non-constants).
19666         Deal with Doubles as well. 
19667
19668         (Expression::ConvertImplicitRequired): New routine that reports an
19669         error if no implicit conversion exists. 
19670
19671         (Invocation::OverloadResolve): Store the converted implicit
19672         expressions if we make them
19673
19674 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19675
19676         * class.cs (ConstructorInitializer): Take a Location argument.
19677         (ConstructorBaseInitializer): Same here.
19678         (ConstructorThisInitializer): Same here.
19679
19680         * cs-parser.jay : Update all calls accordingly.
19681
19682         * expression.cs (Unary, Binary, New): Take location argument.
19683         Update accordingly everywhere.
19684
19685         * cs-parser.jay : Update all calls to the above to take a location
19686         argument.
19687
19688         * class.cs : Ditto.
19689
19690 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19691
19692         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19693         (Invocation::BetterConversion): Same here
19694         (Invocation::ConversionExists): Ditto.
19695
19696         (Invocation::ConversionExists): Implement.
19697
19698 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19699
19700         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19701         Also take an additional TypeContainer argument.
19702
19703         * All over : Pass in TypeContainer as argument to OverloadResolve.
19704
19705         * typemanager.cs (CSharpName): Update to check for the string type and return
19706         that too.
19707
19708         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19709         a given method.
19710
19711 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19712
19713         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19714         (Invocation::BetterFunction): Implement.
19715         (Invocation::BetterConversion): Implement.
19716         (Invocation::ConversionExists): Skeleton, no implementation yet.
19717
19718         Okay, things work fine !
19719
19720 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19721
19722         * typemanager.cs: declare and load enum_type, delegate_type and
19723         void_type. 
19724
19725         * expression.cs (Expression::Emit): Now emit returns a value that
19726         tells whether a value is left on the stack or not.  This strategy
19727         might be reveted tomorrow with a mechanism that would address
19728         multiple assignments.
19729         (Expression::report118): Utility routine to report mismatches on
19730         the ExprClass.
19731
19732         (Unary::Report23): Report impossible type/operator combination
19733         utility function.
19734
19735         (Unary::IsIncrementableNumber): Whether the type can be
19736         incremented or decremented with add.
19737         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19738         complemented. 
19739         (Unary::ResolveOperator): Implement ++, !, ~,
19740
19741         (Invocation::Emit): Deal with new Emit convetion.
19742
19743         * All Expression derivatives: Updated their Emit method to return
19744         whether they leave values on the stack or not.
19745
19746         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19747         stack for expressions that are statements. 
19748
19749 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * expression.cs (LValue): New interface.  Must be implemented by
19752         LValue objects.
19753         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19754         LValue interface.
19755
19756         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19757         interface for generating code, simplifies the code.
19758
19759 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19760
19761         * expression.cs (everywhere): Comment out return statements in ::Resolve
19762         methods to avoid the warnings.
19763
19764 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19765
19766         * driver.cs (parse): Report error 2001 if we can not open the
19767         source file.
19768
19769         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19770         not resolve it.
19771
19772         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19773         object. 
19774
19775         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19776         otherwise nested blocks end up with the same index.
19777
19778         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19779
19780         * expression.cs:  Instead of having FIXMEs in the Resolve
19781         functions, throw exceptions so it is obvious that we are facing a
19782         bug. 
19783
19784         * cs-parser.jay (invocation_expression): Pass Location information.
19785
19786         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19787         Use a basename for those routines because .NET does not like paths
19788         on them. 
19789
19790         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19791         already defined.
19792
19793 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19796         are loading the correct data types (throws an exception if not).
19797         (TypeManager::InitCoreTypes): Use CoreLookupType
19798
19799         * expression.cs (Unary::ResolveOperator): return the child
19800         expression for expressions which are just +expr.
19801         (Unary::ResolveOperator): Return negative literals for -LITERAL
19802         expressions (otherwise they are Unary {Literal}).
19803         (Invocation::Badness): Take into account `Implicit constant
19804         expression conversions'.
19805
19806         * literal.cs (LongLiteral): Implement long literal class.
19807         (IntLiteral): export the `Value' of the intliteral. 
19808
19809 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19810
19811         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19812
19813         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19814         instead of 'Operator'
19815
19816         * expression.cs (Binary::ResolveOperator): Update accordingly.
19817         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19818         and 'Minus'
19819
19820         * cs-parser.jay (unary_expression): Update to use the new names.
19821
19822         * gen-treedump.cs (GetUnary): Same here.
19823
19824         * expression.cs (Unary::Resolve): Implement.
19825         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19826         operators are found instead of making noise ;-)
19827         (Unary::ResolveOperator): New method to do precisely the same thing which
19828         Binary::ResolveOperator does for Binary expressions.
19829         (Unary.method, .Arguments): Add.
19830         (Unary::OperName): Implement.   
19831         (Unary::ForceConversion): Copy and Paste !
19832
19833         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19834         a unary operator.
19835
19836         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19837         for the inbuilt operators. Only overloading works for now ;-)
19838
19839 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19840
19841         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19842         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19843
19844         * expression.cs (This::Emit): Implement. 
19845         (This::Resolve): Implement.
19846         (TypeOf:Resolve): Implement.
19847         (Expression::ResolveSimpleName): Add an implicit this to instance
19848         field references. 
19849         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19850         Bind instance variable to Field expressions.
19851         (FieldExpr::Instance): New field used to track the expression that
19852         represents the object instance.
19853         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19854         binding 
19855         (FieldExpr::Emit): Implement.
19856
19857         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19858         the last instruction contains a return opcode to avoid generating
19859         the last `ret' instruction (this generates correct code, and it is
19860         nice to pass the peverify output).
19861
19862         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19863         initializer for static and instance variables.
19864         (Constructor::Emit): Allow initializer to be null in the case of
19865         static constructors.  Only emit initializer for instance
19866         constructors. 
19867
19868         (TypeContainer::FindMembers): Return a null array if there are no
19869         matches.
19870
19871         Also fix the code for the MemberTypes.Method branch, as it was not
19872         scanning that for operators (or tried to access null variables before).
19873
19874         * assign.cs (Assign::Emit): Handle instance and static fields. 
19875
19876         * TODO: Updated.
19877
19878         * driver.cs: Stop compilation if there are parse errors.
19879
19880         * cs-parser.jay (constructor_declaration): Provide default base
19881         initializer for non-static constructors.
19882         (constructor_declarator): Do not provide a default base
19883         initializers if none was specified.
19884         Catch the fact that constructors should not have parameters.
19885
19886         * class.cs: Do not emit parent class initializers for static
19887         constructors, that should be flagged as an error.
19888
19889 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19890
19891         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19892         Move back code into TypeContainer::Populate.
19893
19894 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19895
19896         * class.cs (TypeContainer::AddConstructor): Fix the check to
19897         compare against Name, not Basename. 
19898         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19899
19900         * cs-parser.jay : Update accordingly.
19901
19902         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19903         for methods, don't forget to look into the operators too.
19904         (RegisterMethodBuilder): Helper method to take care of this for
19905         methods, constructors and operators.
19906         (Operator::Define): Completely revamp.
19907         (Operator.OperatorMethod, MethodName): New fields.
19908         (TypeContainer::Populate): Move the registering of builders into
19909         RegisterMethodBuilder.
19910         (Operator::Emit): Re-write.
19911
19912         * expression.cs (Binary::Emit): Comment out code path to emit method
19913         invocation stuff for the case when we have a user defined operator. I am
19914         just not able to get it right !
19915
19916 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19917
19918         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19919         argument. 
19920
19921         (Expression::MemberLookup): Provide a version that allows to
19922         specify the MemberTypes and BindingFlags. 
19923
19924         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19925         so it was not fetching variable information from outer blocks.
19926
19927         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19928         Beforefieldinit as it was buggy.
19929
19930         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19931         that Ravi put here.  
19932
19933         * class.cs (Constructor::Emit): Only emit if block is not null.
19934         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19935         deal with this by semantically definining it as if the user had
19936         done it.
19937
19938         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19939         constructors as we now "emit" them at a higher level.
19940
19941         (TypeContainer::DefineDefaultConstructor): Used to define the
19942         default constructors if none was provided.
19943
19944         (ConstructorInitializer): Add methods Resolve and Emit. 
19945
19946         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19947
19948 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19949
19950         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19951         the default constructor builder with our hashtable for methodbuilders
19952         to methodcores.
19953
19954         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19955         and argument_count is 0 in which case we have a match.
19956         (Binary::ResolveOperator): More null checking and miscellaneous coding
19957         style cleanup.
19958
19959 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19960
19961         * rootcontext.cs (IsNameSpace): Compare against null.
19962
19963         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19964
19965         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19966         and Unary::Operator.
19967
19968         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19969         accordingly.
19970
19971         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19972         we have overloaded operators.
19973         (Binary::ResolveOperator): Implement the part which does the operator overload
19974         resolution.
19975
19976         * class.cs (Operator::Emit): Implement.
19977         (TypeContainer::Emit): Emit the operators we have too.
19978
19979         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19980         the case when we have a user-defined operator.
19981
19982 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19983
19984         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19985
19986 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19987
19988         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19989         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19990         (Constructor::Emit): Implement.
19991         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19992         if we have no work to do. 
19993         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19994         Emit method.
19995
19996         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19997         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19998
19999         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20000         of parent.parent.
20001
20002 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20003
20004         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20005         in the source.
20006         (Tree::RecordNamespace): Method to do what the name says ;-)
20007         (Tree::Namespaces): Property to get at the namespaces hashtable.
20008
20009         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20010         keep track.
20011
20012         * rootcontext.cs (IsNamespace): Fixed it :-)
20013
20014 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20015
20016         * class.cs (TypeContainer::FindMembers): Add support for
20017         constructors. 
20018         (MethodCore): New class that encapsulates both the shared aspects
20019         of a Constructor and a Method.  
20020         (Method, Constructor): Factored pieces into MethodCore.
20021
20022         * driver.cs: Added --fatal which makes errors throw exceptions.
20023         Load System assembly as well as part of the standard library.
20024
20025         * report.cs: Allow throwing exceptions on errors for debugging.
20026
20027         * modifiers.cs: Do not use `parent', instead use the real type
20028         container to evaluate permission settings.
20029
20030         * class.cs: Put Ravi's patch back in.  He is right, and we will
20031         have to cope with the
20032
20033 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20034
20035         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20036         FamORAssem, not FamANDAssem.
20037
20038 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20039
20040         * driver.cs: Added --parse option that only parses its input files
20041         and terminates.
20042
20043         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20044         incorrect.  IsTopLevel is not used to tell whether an object is
20045         root_types or not (that can be achieved by testing this ==
20046         root_types).  But to see if this is a top-level *class* (not
20047         necessarly our "toplevel" container). 
20048
20049 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20050
20051         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20052         parent instead of a direct call to GetType.
20053
20054 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20055
20056         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20057         Modifiers.TypeAttr. This should just be a call to that method.
20058
20059         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20060         object so that we can determine if we are top-level or not.
20061
20062         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20063         TypeContainer too.
20064
20065         * enum.cs (Enum::Define): Ditto.
20066
20067         * modifiers.cs (FieldAttr): Re-write.
20068
20069         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20070         (TypeContainer::HaveStaticConstructor): New property to provide access
20071         to precisely that info.
20072
20073         * modifiers.cs (MethodAttr): Re-write.
20074         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20075
20076         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20077         of top-level types as claimed.
20078
20079 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20080
20081         * expression.cs (MemberLookup): Fruitless attempt to lookup
20082         constructors.  Maybe I need to emit default constructors?  That
20083         might be it (currently .NET emits this for me automatically).
20084         (Invocation::OverloadResolve): Cope with Arguments == null.
20085         (Invocation::EmitArguments): new function, shared by the new
20086         constructor and us.
20087         (Invocation::Emit): Handle static and instance methods.  Emit
20088         proper call instruction for virtual or non-virtual invocations.
20089         (New::Emit): Implement.
20090         (New::Resolve): Implement.
20091         (MemberAccess:Resolve): Implement.
20092         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20093         to track instances.
20094         (FieldExpr::Resolve): Set type.
20095
20096         * support.cs: Handle empty arguments.
20097                 
20098         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20099         SimpleLookup): Auxiliary routines to help parse a qualifier
20100         identifier.  
20101
20102         Update qualifier_identifier rule.
20103
20104         * codegen.cs: Removed debugging messages.
20105
20106         * class.cs: Make this a global thing, this acts just as a "key" to
20107         objects that we might have around.
20108
20109         (Populate): Only initialize method_builders_to_methods once.
20110
20111         * expression.cs (PropertyExpr): Initialize type from the
20112         PropertyType. 
20113
20114         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20115         Resolve pattern.  Attempt to implicitly convert value to boolean.
20116         Emit code.
20117
20118         * expression.cs: Set the type for the int32/int32 argument case.
20119         (Binary::ResolveOperator): Set the return type to boolean for
20120         comparission operators
20121
20122         * typemanager.cs: Remove debugging print code.
20123
20124         (Invocation::Resolve): resolve type.
20125
20126         * class.cs: Allocate a MemberInfo of the correct size, as the code
20127         elsewhere depends on the test to reflect the correct contents.
20128
20129         (Method::) Keep track of parameters, due to System.Reflection holes
20130
20131         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20132         mapping here.
20133
20134         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20135         of the exact size and return that.
20136
20137         (Class::LookupMethodByBuilder): New function that maps
20138         MethodBuilders to its methods.  Required to locate the information
20139         on methods because System.Reflection bit us again.
20140
20141         * support.cs: New file, contains an interface ParameterData and
20142         two implementations: ReflectionParameters and InternalParameters
20143         used to access Parameter information.  We will need to grow this
20144         as required.
20145
20146         * expression.cs (Invocation::GetParameterData): implement a cache
20147         and a wrapper around the ParameterData creation for methods. 
20148         (Invocation::OverloadResolve): Use new code.
20149
20150 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20151
20152         * class.cs (TypeContainer::EmitField): Remove and move into 
20153         (Field::Define): here and modify accordingly.
20154         (Field.FieldBuilder): New member.
20155         (TypeContainer::Populate): Update accordingly.
20156         (TypeContainer::FindMembers): Implement.
20157
20158 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * statement.cs: (VariableInfo::VariableType): New field to be
20161         initialized with the full type once it is resolved. 
20162
20163 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20164
20165         * parameter.cs (GetParameterInfo): Use a type cache to compute
20166         things only once, and to reuse this information
20167
20168         * expression.cs (LocalVariableReference::Emit): Implement.
20169         (OpcodeCast::Emit): fix.
20170
20171         (ParameterReference::Resolve): Implement.
20172         (ParameterReference::Emit): Implement.
20173
20174         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20175         that are expressions need to stay as Expressions.
20176
20177         * typemanager.cs (CSharpName): Returns the C# name of a type if
20178         possible. 
20179
20180         * expression.cs (Expression::ConvertImplicit): New function that
20181         implements implicit type conversions.
20182
20183         (Expression::ImplicitReferenceConversion): Implements implicit
20184         reference conversions.
20185
20186         (EmptyCast): New type for transparent casts.
20187
20188         (OpcodeCast): New type for casts of types that are performed with
20189         a sequence of bytecodes.
20190
20191         (BoxedCast): New type used for casting value types into reference
20192         types.  Emits a box opcode.
20193
20194         (Binary::DoNumericPromotions): Implements numeric promotions of
20195         and computation of the Binary::Type.
20196
20197         (Binary::EmitBranchable): Optimization.
20198
20199         (Binary::Emit): Implement code emission for expressions.
20200
20201         * typemanager.cs (TypeManager): Added two new core types: sbyte
20202         and byte.
20203
20204 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20205
20206         * class.cs (TypeContainer::FindMembers): Method which does exactly
20207         what Type.FindMembers does, only we don't have to use reflection. No
20208         implementation yet.
20209
20210         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20211         typecontainer objects as we need to get at them.
20212         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20213
20214         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20215         typecontainer object.
20216
20217         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20218         of just a Report object.
20219
20220 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20221
20222         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20223         "remove_"
20224         (TypeContainer::Populate): Now define the delegates of the type too.
20225         (TypeContainer.Delegates): Property to access the list of delegates defined
20226         in the type.
20227
20228         * delegates.cs (Delegate::Define): Implement partially.
20229
20230         * modifiers.cs (TypeAttr): Handle more flags.
20231
20232 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20233
20234         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20235         and not <=
20236         (Operator::Define): Re-write logic to get types by using the LookupType method
20237         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20238         (Indexer::Define): Ditto.
20239         (Event::Define): Ditto.
20240         (Property::Define): Ditto.
20241
20242 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20243
20244         * class.cs (TypeContainer::Populate): Now define operators too. 
20245         (TypeContainer.Operators): New property to access the list of operators
20246         in a type.
20247         (Operator.OperatorMethodBuilder): New member to hold the method builder
20248         for the operator we are defining.
20249         (Operator::Define): Implement.
20250
20251 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20252
20253         * class.cs (Event::Define): Make the prefixes of the accessor methods
20254         addOn_ and removeOn_ 
20255
20256         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20257         of the location being passed in too. Ideally, this should go later since all
20258         error reporting should be done through the Report object.
20259
20260         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20261         (Populate): Iterate thru the indexers we have and define them too.
20262         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20263         for the get and set accessors.
20264         (Indexer::Define): Implement.
20265
20266 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20267
20268         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20269         my previous implementation, did not work.
20270
20271         * typemanager.cs: Add a couple of missing types (the longs).
20272
20273         * literal.cs: Use TypeManager.bool_type instead of getting it.
20274
20275         * expression.cs (EventExpr): New kind of expressions.
20276         (Expressio::ExprClassFromMemberInfo): finish
20277
20278 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20279
20280         * assign.cs: Emit stores to static fields differently.
20281
20282 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20283
20284         * Merge in changes and adjust code to tackle conflicts. Backed out my
20285         code in Assign::Resolve ;-) 
20286
20287 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20288
20289         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20290         instead Report.Error and also pass in the location.
20291         (CSharpParser::Lexer): New readonly property to return the reference
20292         to the Tokenizer object.
20293         (declare_local_variables): Use Report.Error with location instead of plain 
20294         old error.
20295         (CheckDef): Ditto.
20296
20297         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20298         (Operator.CheckBinaryOperator): Ditto.
20299
20300         * cs-parser.jay (operator_declarator): Update accordingly.
20301
20302         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20303         (CheckBinaryOperator): Same here.
20304
20305         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20306         on the name without any prefixes of namespace names etc. This is because we
20307         already might have something already fully qualified like 
20308         'System.Console.WriteLine'
20309
20310         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20311
20312 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20313
20314         * cs-tokenizer.cs (location): Return a string which also contains
20315         the file name.
20316
20317         * expression.cs (ElementAccess): New class for expressions of the
20318         type 'element access.'
20319         (BaseAccess): New class for expressions of the type 'base access.'
20320         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20321         respectively.
20322
20323         * cs-parser.jay (element_access): Implement action.
20324         (base_access): Implement actions.
20325         (checked_expression, unchecked_expression): Implement.
20326
20327         * cs-parser.jay (local_variable_type): Correct and implement.
20328         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20329
20330         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20331
20332         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20333         name and the specifiers.
20334
20335         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20336
20337         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20338         making them all public ;-)
20339
20340         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20341         class anyways.
20342
20343 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20344
20345         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20346         PropertyExprs.
20347         (FieldExpr, PropertyExprs): New resolved expressions.
20348         (SimpleName::MemberStaticCheck): Perform static checks for access
20349         to non-static fields on static methods. Maybe this should be
20350         generalized for MemberAccesses. 
20351         (SimpleName::ResolveSimpleName): More work on simple name
20352         resolution. 
20353
20354         * cs-parser.jay (primary_expression/qualified_identifier): track
20355         the parameter index.
20356
20357         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20358         (EmitContext::EmitBoolExpression): Chain to expression generation
20359         instead of temporary hack.
20360         (::EmitStatementExpression): Put generic expression code generation.
20361
20362         * assign.cs (Assign::Emit): Implement variable assignments to
20363         local variables, parameters and fields.
20364
20365 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * statement.cs (Block::GetVariableInfo): New method, returns the
20368         VariableInfo for a variable name in a block.
20369         (Block::GetVariableType): Implement in terms of GetVariableInfo
20370
20371         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20372         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20373
20374 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20375
20376         * cs-parser.jay (operator_declaration): Continue on my quest : update
20377         to take attributes argument.
20378         (event_declaration): Ditto.
20379         (enum_declaration): Ditto.
20380         (indexer_declaration): Ditto.
20381
20382         * class.cs (Operator::Operator): Update constructor accordingly.
20383         (Event::Event): Ditto.
20384
20385         * delegate.cs (Delegate::Delegate): Same here.
20386
20387         * enum.cs (Enum::Enum): Same here.
20388
20389 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20390
20391         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20392
20393         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20394
20395         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20396         being passed around as an arraylist.
20397         (Attributes::AddAttribute): Method to add attribute sections.
20398
20399         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20400         (struct_declaration): Update accordingly.
20401         (constant_declaration): Update.
20402         (field_declaration): Update.
20403         (method_header): Update.
20404         (fixed_parameter): Update.
20405         (parameter_array): Ditto.
20406         (property_declaration): Ditto.
20407         (destructor_declaration): Ditto.
20408
20409         * class.cs (Struct::Struct): Update constructors accordingly.
20410         (Class::Class): Ditto.
20411         (Field::Field): Ditto.
20412         (Method::Method): Ditto.
20413         (Property::Property): Ditto.
20414         (TypeContainer::OptAttribute): update property's return type.
20415
20416         * interface.cs (Interface.opt_attributes): New member.
20417         (Interface::Interface): Update to take the extra Attributes argument.
20418
20419         * parameter.cs (Parameter::Parameter): Ditto.
20420
20421         * constant.cs (Constant::Constant): Ditto.
20422
20423         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20424         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20425         the attributes as a parameter.
20426         (InterfaceProperty): Update constructor call.
20427         (InterfaceEvent): Ditto.
20428         (InterfaceMethod): Ditto.
20429         (InterfaceIndexer): Ditto.
20430
20431         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20432         pass the attributes too.
20433         (interface_event_declaration): Ditto.
20434         (interface_property_declaration): Ditto.
20435         (interface_method_declaration): Ditto.
20436         (interface_declaration): Ditto.
20437
20438 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * class.cs (Method::Define): Track the "static Main" definition to
20441         create an entry point. 
20442
20443         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20444         EntryPoint if we find it. 
20445
20446         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20447         (EmitContext::ig): Make this variable public.
20448
20449         * driver.cs: Make the default output file be the first file name
20450         with the .exe extension.  
20451
20452         Detect empty compilations
20453
20454         Handle various kinds of output targets.  Handle --target and
20455         rename -t to --dumper.
20456
20457         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20458         methods inherited from Expression return now an Expression.  This
20459         will is used during the tree rewriting as we resolve them during
20460         semantic analysis.
20461
20462         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20463         the spec.  Missing entirely is the information about
20464         accessability of elements of it.
20465
20466         (Expression::ExprClassFromMemberInfo): New constructor for
20467         Expressions that creates a fully initialized Expression based on
20468         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20469         a Type.
20470
20471         (Invocation::Resolve): Begin implementing resolution of invocations.
20472
20473         * literal.cs (StringLiteral):  Implement Emit.
20474
20475 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20476
20477         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20478         member.
20479
20480 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20481
20482         * cs-parser.jay (attribute_arguments): Implement actions.
20483         (attribute): Fix bug in production. Implement action.
20484         (attribute_list): Implement.
20485         (attribute_target): Implement.
20486         (attribute_target_specifier, opt_target_specifier): Implement
20487         (CheckAttributeTarget): New method to check if the attribute target
20488         is valid.
20489         (attribute_section): Implement.
20490         (opt_attributes): Implement.
20491
20492         * attribute.cs : New file to handle attributes.
20493         (Attribute): Class to hold attribute info.
20494
20495         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20496         (attribute_section): Modify production to use 2 different rules to 
20497         achieve the same thing. 1 s/r conflict down !
20498         Clean out commented, useless, non-reducing dimension_separator rules.
20499
20500         * class.cs (TypeContainer.attributes): New member to hold list
20501         of attributes for a type.
20502         (Struct::Struct): Modify to take one more argument, the attribute list.
20503         (Class::Class): Ditto.
20504         (Field::Field): Ditto.
20505         (Method::Method): Ditto.
20506         (Property::Property): Ditto.
20507
20508         * cs-parser.jay (struct_declaration): Update constructor call to
20509         pass in the attributes too.
20510         (class_declaration): Ditto.
20511         (constant_declaration): Ditto.
20512         (field_declaration): Ditto.
20513         (method_header): Ditto.
20514         (fixed_parameter): Ditto.
20515         (parameter_array): Ditto.
20516         (property_declaration): Ditto.
20517
20518         * constant.cs (Constant::Constant): Update constructor similarly.
20519         Use System.Collections.
20520
20521         * parameter.cs (Parameter::Parameter): Update as above.
20522
20523 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20524
20525         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20526         (TypeContainer.delegates): New member to hold list of delegates.
20527
20528         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20529         this time as I seem to be on crack ;-)
20530
20531 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20532
20533         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20534         tell whether an identifier represents a namespace.
20535
20536         * expression.cs (NamespaceExpr): A namespace expression, used only
20537         temporarly during expression resolution.
20538         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20539         utility functions to resolve names on expressions.
20540
20541 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20542
20543         * codegen.cs: Add hook for StatementExpressions. 
20544
20545         * class.cs: Fix inverted test for static flag in methods.
20546
20547 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20548
20549         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20550         to make it coincide with MS' number.
20551         (Operator::CheckBinaryOperator): Ditto.
20552
20553         * ../errors/errors.txt : Remove error numbers added earlier.
20554
20555         * ../errors/cs1019.cs : Test case for error # 1019
20556
20557         * ../errros/cs1020.cs : Test case for error # 1020
20558
20559         * cs-parser.jay : Clean out commented cruft.
20560         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20561         used anywhere - non-reducing rule.
20562         (namespace_declarations): Non-reducing rule - comment out.
20563
20564         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20565         with TypeContainer::AddEnum.
20566
20567         * delegate.cs : New file for delegate handling classes.
20568         (Delegate): Class for declaring delegates.
20569
20570         * makefile : Update.
20571
20572         * cs-parser.jay (delegate_declaration): Implement.
20573
20574 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20575
20576         * class.cs (Event::Define): Implement.
20577         (Event.EventBuilder): New member.
20578
20579         * class.cs (TypeContainer::Populate): Update to define all enums and events
20580         we have.
20581         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20582         readonly fields for all these cases ?
20583
20584 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20585
20586         * class.cs (Property): Revamp to use the convention of making fields readonly.
20587         Accordingly modify code elsewhere.
20588
20589         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20590         the Define method of the Property class.
20591
20592         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20593         trivial bug.
20594         (TypeContainer::Populate): Update to define all the properties we have. Also
20595         define all enumerations.
20596
20597         * enum.cs (Define): Implement.
20598
20599 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20600
20601         * cs-parser.jay (overloadable_operator): The semantic value is an
20602         enum of the Operator class.
20603         (operator_declarator): Implement actions.
20604         (operator_declaration): Implement.
20605
20606         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20607         validity of definitions.
20608         (Operator::CheckBinaryOperator): Static method to check for binary operators
20609         (TypeContainer::AddOperator): New method to add an operator to a type.
20610
20611         * cs-parser.jay (indexer_declaration): Added line to actually call the
20612         AddIndexer method so it gets added ;-)
20613
20614         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20615         already taken care of by the MS compiler ?  
20616
20617 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20618
20619         * class.cs (Operator): New class for operator declarations.
20620         (Operator::OpType): Enum for the various operators.
20621
20622 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20623
20624         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20625         ostensibly handle this in semantic analysis.
20626
20627         * cs-parser.jay (general_catch_clause): Comment out
20628         (specific_catch_clauses, specific_catch_clause): Ditto.
20629         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20630         (catch_args, opt_catch_args): New productions.
20631         (catch_clause): Rewrite to use the new productions above
20632         (catch_clauses): Modify accordingly.
20633         (opt_catch_clauses): New production to use in try_statement
20634         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20635         and re-write the code in the actions to extract the specific and
20636         general catch clauses by being a little smart ;-)
20637
20638         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20639         Hooray, try and catch statements parse fine !
20640
20641 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20642
20643         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20644         string from the hashtable of variables.
20645
20646         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20647         I end up making that mistake ;-)
20648         (catch_clauses): Fixed gross error which made Key and Value of the 
20649         DictionaryEntry the same : $1 !!
20650
20651 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20652
20653         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20654
20655         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20656         when the add and remove accessors are specified. 
20657
20658 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20659
20660         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20661         information about indexer_declarator.
20662         (indexer_declarator): Implement actions.
20663         (parsing_indexer): New local boolean used to keep track of whether
20664         we are parsing indexers or properties. This is necessary because 
20665         implicit_parameters come into picture even for the get accessor in the 
20666         case of an indexer.
20667         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20668
20669         * class.cs (Indexer): New class for indexer declarations.
20670         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20671         (TypeContainer::indexers): New member to hold list of indexers for the
20672         type.
20673
20674 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20675
20676         * cs-parser.jay (add_accessor_declaration): Implement action.
20677         (remove_accessor_declaration): Implement action.
20678         (event_accessors_declaration): Implement
20679         (variable_declarators): swap statements for first rule - trivial.
20680
20681         * class.cs (Event): New class to hold information about event
20682         declarations.
20683         (TypeContainer::AddEvent): New method to add an event to a type
20684         (TypeContainer::events): New member to hold list of events.
20685
20686         * cs-parser.jay (event_declaration): Implement actions.
20687
20688 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20689
20690         * cs-parser.jay (dim_separators): Implement. Make it a string
20691         concatenating all the commas together, just as they appear.
20692         (opt_dim_separators): Modify accordingly
20693         (rank_specifiers): Update accordingly. Basically do the same
20694         thing - instead, collect the brackets here.
20695         (opt_rank_sepcifiers): Modify accordingly.
20696         (array_type): Modify to actually return the complete type string
20697         instead of ignoring the rank_specifiers.
20698         (expression_list): Implement to collect the expressions
20699         (variable_initializer): Implement. We make it a list of expressions
20700         essentially so that we can handle the array_initializer case neatly too.
20701         (variable_initializer_list): Implement.
20702         (array_initializer): Make it a list of variable_initializers
20703         (opt_array_initializer): Modify accordingly.
20704
20705         * expression.cs (New::NType): Add enumeration to help us
20706         keep track of whether we have an object/delegate creation
20707         or an array creation.
20708         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20709         members to hold data about array creation.
20710         (New:New): Modify to update NewType
20711         (New:New): New Overloaded contructor for the array creation
20712         case.
20713
20714         * cs-parser.jay (array_creation_expression): Implement to call
20715         the overloaded New constructor.
20716
20717 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20718
20719         * class.cs (TypeContainer::Constructors): Return member
20720         constructors instead of returning null.
20721
20722 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20723
20724         * typemanager.cs (InitCoreTypes): Initialize the various core
20725         types after we have populated the type manager with the user
20726         defined types (this distinction will be important later while
20727         compiling corlib.dll)
20728
20729         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20730         on Expression Classification.  Now all expressions have a method
20731         `Resolve' and a method `Emit'.
20732
20733         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20734         generation from working.     Also add some temporary debugging
20735         code. 
20736
20737 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20738
20739         * codegen.cs: Lots of code generation pieces.  This is only the
20740         beginning, will continue tomorrow with more touches of polish.  We
20741         handle the fundamentals of if, while, do, for, return.  Others are
20742         trickier and I need to start working on invocations soon.
20743
20744         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20745         s.InitStatement. 
20746
20747         * codegen.cs (EmitContext): New struct, used during code
20748         emission to keep a context.   Most of the code generation will be
20749         here. 
20750
20751         * cs-parser.jay: Add embedded blocks to the list of statements of
20752         this block.  So code generation proceeds in a top down fashion.
20753
20754 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20755
20756         * statement.cs: Add support for multiple child blocks.
20757
20758 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20759
20760         * codegen.cs (EmitCode): New function, will emit the code for a
20761         Block of code given a TypeContainer and its ILGenerator. 
20762
20763         * statement.cs (Block): Standard public readonly optimization.
20764         (Block::Block constructors): Link children. 
20765         (Block::Child): Child Linker.
20766         (Block::EmitVariables): Emits IL variable declarations.
20767
20768         * class.cs: Drop support for MethodGroups here, delay until
20769         Semantic Analysis.
20770         (Method::): Applied the same simplification that I did before, and
20771         move from Properties to public readonly fields.
20772         (Method::ParameterTypes): Returns the parameter types for the
20773         function, and implements a cache that will be useful later when I
20774         do error checking and the semantic analysis on the methods is
20775         performed.
20776         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20777         and made a method, optional argument tells whether this is a class
20778         or a structure to apply the `has-this' bit.
20779         (Method::GetCallingConvention): Implement, returns the calling
20780         convention. 
20781         (Method::Define): Defines the type, a second pass is performed
20782         later to populate the methods.
20783
20784         (Constructor::ParameterTypes): implement a cache similar to the
20785         one on Method::ParameterTypes, useful later when we do semantic
20786         analysis. 
20787
20788         (TypeContainer::EmitMethod):  New method.  Emits methods.
20789
20790         * expression.cs: Removed MethodGroup class from here.
20791
20792         * parameter.cs (Parameters::GetCallingConvention): new method.
20793
20794 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20795
20796         * class.cs (TypeContainer::Populate): Drop RootContext from the
20797         argument. 
20798
20799         (Constructor::CallingConvention): Returns the calling convention.
20800         (Constructor::ParameterTypes): Returns the constructor parameter
20801         types. 
20802
20803         (TypeContainer::AddConstructor): Keep track of default constructor
20804         and the default static constructor.
20805
20806         (Constructor::) Another class that starts using `public readonly'
20807         instead of properties. 
20808
20809         (Constructor::IsDefault): Whether this is a default constructor. 
20810
20811         (Field::) use readonly public fields instead of properties also.
20812
20813         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20814         track of static constructors;  If none is used, turn on
20815         BeforeFieldInit in the TypeAttributes. 
20816
20817         * cs-parser.jay (opt_argument_list): now the return can be null
20818         for the cases where there are no arguments. 
20819
20820         (constructor_declarator): If there is no implicit `base' or
20821         `this', then invoke the default parent constructor. 
20822
20823         * modifiers.cs (MethodAttr): New static function maps a set of
20824         modifiers flags into a MethodAttributes enum
20825         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20826         MethodAttr, TypeAttr to represent the various mappings where the
20827         modifiers are used.
20828         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20829
20830 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20831
20832         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20833         method arguments.
20834
20835         * interface.cs (PopulateIndexer): Implemented the code generator
20836         for interface indexers.
20837
20838 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20839
20840         * interface.cs (InterfaceMemberBase): Now we track the new status
20841         here.  
20842
20843         (PopulateProperty): Implement property population.  Woohoo!  Got
20844         Methods and Properties going today. 
20845
20846         Removed all the properties for interfaces, and replaced them with
20847         `public readonly' fields. 
20848
20849 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20850
20851         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20852         initialize their hashtables/arraylists only when they are needed
20853         instead of doing this always.
20854
20855         * parameter.cs: Handle refs and out parameters.
20856
20857         * cs-parser.jay: Use an ArrayList to construct the arguments
20858         instead of the ParameterCollection, and then cast that to a
20859         Parameter[] array.
20860
20861         * parameter.cs: Drop the use of ParameterCollection and use
20862         instead arrays of Parameters.
20863
20864         (GetParameterInfo): Use the Type, not the Name when resolving
20865         types. 
20866
20867 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20868
20869         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20870         and instead use public readonly fields.
20871
20872         * class.cs: Put back walking code for type containers.
20873
20874 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20875
20876         * class.cs (MakeConstant): Code to define constants.
20877
20878         * rootcontext.cs (LookupType): New function.  Used to locate types 
20879
20880
20881 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20882
20883         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20884         this System.Reflection code is.  Kudos to Microsoft
20885
20886         * typemanager.cs: Implement a type cache and avoid loading all
20887         types at boot time.  Wrap in LookupType the internals.  This made
20888         the compiler so much faster.  Wow.  I rule!
20889
20890         * driver.cs: Make sure we always load mscorlib first (for
20891         debugging purposes, nothing really important).
20892
20893         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20894         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20895
20896         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20897         on namespaces that have been imported using the `using' keyword.
20898
20899         * class.cs (TypeContainer::TypeAttr): Virtualize.
20900         (Class::TypeAttr): Return attributes suitable for this bad boy.
20901         (Struct::TypeAttr): ditto.
20902         Handle nested classes.
20903         (TypeContainer::) Remove all the type visiting code, it is now
20904         replaced with the rootcontext.cs code
20905
20906         * rootcontext.cs (GetClassBases): Added support for structs. 
20907
20908 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20909
20910         * interface.cs, statement.cs, class.cs, parameter.cs,
20911         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20912         Drop use of TypeRefs, and use strings instead.
20913
20914 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20915
20916         * rootcontext.cs: 
20917
20918         * class.cs (Struct::Struct): set the SEALED flags after
20919         checking the modifiers.
20920         (TypeContainer::TypeAttr): new property, returns the
20921         TypeAttributes for a class.  
20922
20923         * cs-parser.jay (type_list): Oops, list production was creating a
20924         new list of base types.
20925
20926         * rootcontext.cs (StdLib): New property.
20927         (GetInterfaceTypeByName): returns an interface by type name, and
20928         encapsulates error handling here.
20929         (GetInterfaces): simplified.
20930         (ResolveTree): Encapsulated all the tree resolution here.
20931         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20932         types. 
20933
20934         * driver.cs: Add support for --nostdlib, to avoid loading the
20935         default assemblies.
20936         (Main): Do not put tree resolution here. 
20937
20938         * rootcontext.cs: Beginning of the class resolution.
20939
20940 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20941
20942         * rootcontext.cs: Provide better error reporting. 
20943
20944         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20945
20946         * rootcontext.cs (CreateInterface): Handle the case where there
20947         are no parent interfaces.
20948
20949         (CloseTypes): Routine to flush types at the end.
20950         (CreateInterface): Track types.
20951         (GetInterfaces): Returns an array of Types from the list of
20952         defined interfaces.
20953
20954         * typemanager.c (AddUserType): Mechanism to track user types (puts
20955         the type on the global type hash, and allows us to close it at the
20956         end). 
20957
20958 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20959
20960         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20961         RecordInterface instead.
20962
20963         * cs-parser.jay: Updated to reflect changes above.
20964
20965         * decl.cs (Definition): Keep track of the TypeBuilder type that
20966         represents this type here.  Not sure we will use it in the long
20967         run, but wont hurt for now.
20968
20969         * driver.cs: Smaller changes to accomodate the new code.
20970
20971         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20972         when done. 
20973
20974         * rootcontext.cs (CreateInterface):  New method, used to create
20975         the System.TypeBuilder type for interfaces.
20976         (ResolveInterfaces): new entry point to resolve the interface
20977         hierarchy. 
20978         (CodeGen): Property, used to keep track of the code generator.
20979
20980 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20981
20982         * cs-parser.jay: Add a second production for delegate_declaration
20983         with `VOID'.
20984
20985         (enum_body): Put an opt_comma here instead of putting it on
20986         enum_body or enum_member_declarations so we can handle trailing
20987         commas on enumeration members.  Gets rid of a shift/reduce.
20988
20989         (type_list): Need a COMMA in the middle.
20990
20991         (indexer_declaration): Tell tokenizer to recognize get/set
20992
20993         * Remove old targets.
20994
20995         * Re-add the parser target.
20996
20997 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20998
20999         * cs-parser.jay: Add precendence rules for a number of operators
21000         ot reduce the number of shift/reduce conflicts in the grammar.
21001
21002 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21003
21004         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21005         and put it here.
21006
21007         Get rid of old crufty code.
21008
21009         * rootcontext.cs: Use this to keep track of the parsed
21010         representation and the defined types available to the program. 
21011
21012         * gen-treedump.cs: adjust for new convention.
21013
21014         * type.cs: Split out the type manager, and the assembly builder
21015         from here. 
21016
21017         * typemanager.cs: the type manager will live here now.
21018
21019         * cil-codegen.cs: And the code generator here. 
21020
21021 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21022
21023         * makefile: Fixed up for easy making.
21024
21025 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21026
21027         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21028         the 
21029
21030         (unary_expression): Expand pre_increment_expression and
21031         post_decrement_expression to reduce a shift/reduce.
21032
21033 2001-07-11  Simon Cozens
21034
21035         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21036
21037         Improve allow_keyword_as_indent name.
21038
21039 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21040
21041         * Adjustments for Beta2. 
21042
21043 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21044
21045         * decl.cs: Added `Define' abstract method.
21046         (InTransit): new property, used to catch recursive definitions. 
21047
21048         * interface.cs: Implement `Define'. 
21049
21050         * modifiers.cs: Map Modifiers.constants to
21051         System.Reflection.TypeAttribute flags.
21052
21053         * class.cs: Keep track of types and user-defined types.
21054         (BuilderInit): New method for creating an assembly
21055         (ResolveType): New function to launch the resolution process, only
21056         used by interfaces for now.
21057
21058         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21059         that are inserted into the name space. 
21060
21061 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21062
21063         * ARGH.  I have screwed up my tree so many times due to the use of
21064         rsync rather than using CVS.  Going to fix this at once. 
21065
21066         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21067         load types.
21068
21069 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21070
21071         * Experiment successful: Use System.Type rather that our own
21072         version of Type.  
21073
21074 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21075
21076         * cs-parser.jay: Removed nsAliases from here.
21077
21078         Use new namespaces, handle `using XXX;' 
21079
21080         * namespace.cs: Reimplemented namespace handling, use a recursive
21081         definition of the class.  Now we can keep track of using clauses
21082         and catch invalid using clauses.
21083
21084 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21085
21086         * gen-treedump.cs: Adapted for all the renaming.
21087
21088         * expression.cs (Expression): this class now has a Type property
21089         which returns an expression Type.
21090
21091         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21092         `Type', as this has a different meaning now in the base
21093
21094 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21095
21096         * interface.cs, class.cs: Removed from all the sources the
21097         references to signature computation, as we can not do method
21098         signature computation during the parsing time, as we are not
21099         trying to solve at that point distinguishing:
21100
21101         class X {
21102                 void a (Blah x) {}
21103                 void a (NS.Blah x) {}
21104         }
21105
21106         Which depending on the context might be valid or not, as we do not
21107         know if Blah is the same thing as NS.Blah at that point.
21108
21109         * Redid everything so the code uses TypeRefs now instead of
21110         Types.  TypeRefs are just temporary type placeholders, that need
21111         to be resolved.  They initially have a pointer to a string and the
21112         current scope in which they are used.  This is used later by the
21113         compiler to resolve the reference to an actual Type. 
21114
21115         * DeclSpace is no longer a CIR.Type, and neither are
21116         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21117         are all DeclSpaces, but no Types. 
21118
21119         * type.cs (TypeRefManager): This implements the TypeRef manager,
21120         which keeps track of all the types that need to be resolved after
21121         the parsing has finished. 
21122
21123 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21124
21125         * ARGH.  We are going to have to store `foreach' as a class rather
21126         than resolving it, as we need to verify error 1579 after name
21127         resolution.   *OR* we could keep a flag that says `This request to
21128         IEnumerator comes from a foreach statement' which we can then use
21129         to generate the error.
21130
21131 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21132
21133         * class.cs (TypeContainer.AddMethod): we now add methods to the
21134         MethodGroup instead of the method hashtable.  
21135
21136         * expression.cs: Add MethodGroup abstraction, which gets us one
21137         step closer to the specification in the way we handle method
21138         declarations.  
21139
21140         * cs-parser.jay (primary_expression): qualified_identifier now
21141         tried to match up an identifier to a local variable reference or
21142         to a parameter reference.
21143
21144         current_local_parameters is now a parser global variable that
21145         points to the current parameters for the block, used during name
21146         lookup.
21147
21148         (property_declaration): Now creates an implicit `value' argument to
21149         the set accessor.
21150
21151 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21152
21153         * parameter.cs: Do not use `param' arguments as part of the
21154         signature, per the spec.
21155
21156 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21157
21158         * decl.cs: Base class for classes, structs and interfaces.  This
21159         is the "Declaration Space" 
21160
21161         * cs-parser.jay: Use CheckDef for checking declaration errors
21162         instead of having one on each function.
21163
21164         * class.cs: Factor out some code for handling error handling in
21165         accordance to the "Declarations" section in the "Basic Concepts"
21166         chapter in the ECMA C# spec.
21167
21168         * interface.cs: Make all interface member classes derive from
21169         InterfaceMemberBase.
21170
21171 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21172
21173         * Many things: all interfaces are parsed and generated in
21174         gen-treedump.  Support for member variables, constructors,
21175         destructors, properties, constants is there.
21176
21177         Beginning of the IL backend, but very little done, just there for
21178         testing purposes. 
21179
21180 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21181
21182         * cs-parser.jay: Fix labeled statement.
21183
21184         * cs-tokenizer.cs (escape): Escape " and ' always.
21185         ref_line, ref_name: keep track of the line/filename as instructed
21186         by #line by the compiler.
21187         Parse #line.
21188
21189 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21190
21191         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21192         to match the values in System.CodeDOM.
21193
21194         Divid renamed to Divide.
21195
21196         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21197         statements. 
21198         (Statements.set): remove.
21199
21200         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21201         statements. 
21202
21203         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21204         falseStatements always have valid values. 
21205
21206         * cs-parser.jay: Use System.CodeDOM now.
21207