2005-09-21 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / mcs / ChangeLog
1 2005-09-21  Marek Safar  <marek.safar@seznam.cz>
2
3         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4         attributes.
5         
6         * class.cs (GeneratedBaseInitializer): New class for customization
7         compiler generated initializers.
8         (MemberBase.DoDefine): Check Obsolete attribute here.
9         (FieldMember.DoDefine): Ditto.
10         
11         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
12         constants.
13         
14         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
15         (MemberCore.GetObsoleteAttribute): Removed argument.
16         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
17         (MemberCore.CheckObsoleteType): New helper.
18         
19         * delegate.cs,
20         * enum.cs,
21         * statement.cs: Updates after MemberCore changes.
22         
23         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
24         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
25         
26         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
27         obsolete attribute for compiler construct.
28         (As.DoResolve): Cache result.
29         
30         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
31
32 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
33
34         * cs-parser.jay: interface_accessors replaced by
35         accessor_declarations.
36
37         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
38         location.
39         
40         * statement.cs (GotoCase.Resolve): Convert null constant to
41         null case.
42         (SwitchLabel.ResolveAndReduce): Ditto.
43         (SwitchLabel.NullStringCase): Custom null stamp.
44         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
45         
46         typemanager.cs (CSharpSignature): Don't skip first argument
47         for full names.
48
49 2005-09-18  Miguel de Icaza  <miguel@novell.com>
50
51         * driver.cs: Set InEmacs based on the environment variable EMACS. 
52
53         * location.cs (InEmacs): in this mode, do not report column
54         location as it confuses Emacs.
55
56 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
57
58         * cfold.cs, constant.cs, convert.cs, ecore.cs,
59         expression.cs, iterators.cs, literal.cs: Store constants and
60         literals location.
61         
62         * class.cs (MemberBase.ShortName): Pass location.
63         
64         * cs-parser.jay: Some location fixes.
65         
66         * ecore.cs (Expression.Location): Made virtual.
67
68 2005-09-05  Miguel de Icaza  <miguel@novell.com>
69
70         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
71         if the underlying types are the same, otherwise we need to produce
72         code that will do the proper cast.
73
74         This was exposed by Marek's constant rewrite which produced
75         invalid code for the call site:
76
77         enum X : long { a }
78         void Method (X v) {}
79
80         Method ((X) 5)
81
82         This fixes test-49.cs
83
84 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
85
86         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
87           Type/Object should be allowed as well. Fixed bug #75968.
88
89 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
90
91         * expression.cs : (Binary.DoResolve): when one is enum constant and
92           another is constant 0, then return enum one *as enum type*.
93           Fixed bug 74846.
94
95 2005-09-02  Raja R Harinath  <rharinath@novell.com>
96
97         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
98         internal.
99
100         Fix #75941.
101         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
102         flow-branching for LocalVariableReferences in case we were invoked
103         from a MemberAccess.
104         * expression.cs (LocalVariableReference.VerifyAssigned): New.
105         Carved out of ...
106         (LocalVariableReference.DoResolveBase): ... this.
107         (MemberAccess.Resolve): Do the check that was disabled during
108         SimpleNameResolve.
109
110 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
111
112         * class.cs :
113           (PartialContainer.Create): check abstract/sealed/static strictly
114           but abstract/sealed can exist only at one side. Fixed bug #75883.
115
116 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
117
118         Fix #75945.
119         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
120         specified, don't default to UnmanagedType.I4.
121
122 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
123
124         * expression.cs : conditional operator should check possibly
125           incorrect assign expression. Fixed bug #75946.
126
127 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
128
129         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
130           Reverting the change. gmcs is much complex than mcs on this matter.
131
132 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
133
134         * cs-tokenizer.cs : To read another token ahead of the actual 
135           consumption, use new SavedToken and cache token instead of moving
136           back the stream with SeekableStreamReader (it seemed problematic).
137         * cs-parser.jay,
138           driver.cs : Thus use StreamReader directly.
139         * support.cs : Thus removed SeekableStreamReader.
140
141 2005-08-30  Raja R Harinath  <rharinath@novell.com>
142
143         Fix #75934.
144         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
145         (ScopeInfo.EmitScopeType): Use it to construct field names from
146         names of captured locals.
147
148         Fix #75929.
149         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
150         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
151         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
152         (ExplicitConversion): Remove enum cases already handled by
153         implicit conversion.  Move implicit conversion check to the beginning.
154         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
155         * expression.cs (ArrayCreation.EmitDynamicInitializers):
156         Don't treat System.Enum as a struct.
157
158 2005-08-30  Jb Evain  <jbevain@gmail.com>
159
160         * attribute.cs: handles as expression in parameters.
161
162 2005-08-30  Raja R Harinath  <rharinath@novell.com>
163
164         Fix #75802.
165         * class.cs (TypeContainer.VerifyClsName): Don't use a
166         PartialContainer when verifying CLS compliance.
167         (AbstractPropertyEventMethod): Set Parent here, ...
168         (PropertyMethod): ... not here.
169
170 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
171
172         * attribute.cs : escaped attribute name should not be allowed to be
173           resolved (e.g. @class as classAttribute). Fixed bug #75930.
174
175 2005-08-29  Raja R Harinath  <rharinath@novell.com>
176
177         Fix #75927.
178         * convert.cs (ImplicitStandardConversionExists): Allow zero also
179         when converting a long constant to unsigned long.
180         * expression.cs (Invocation.OverloadResolve): Add sanity check to
181         detect where IsApplicable and VerifyArgumentsCompat disagree.
182
183 2005-08-29  Raja R Harinath  <rharinath@novell.com>
184         and Carlos Alberto Cortez  <carlos@unixmexico.org>
185
186         Fix #75848.
187         * class.cs (TypeContainer.CanElideInitializer): New helper.
188         (TypeContainer.EmitFieldInitializers): Use it to determine if we
189         can safely emitting the initializer of a field.
190
191 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
192
193         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
194           allowed inside a switch (without loop). Fixed bug #75433.
195
196 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
197
198         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
199         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
200
201 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
202
203         * driver.cs : kinda reverting the default encoding changes (not exact 
204           revert since I noticed that "codepage:reset" might not work fine).
205
206 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
207
208         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
209           Location. Now getter and setter store location correctly.
210           (errors/cs0111-12.cs now reports the expected location.)
211
212 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
213
214         * driver.cs : Use default encoding on the environment.
215           Removed (now that) extra parameter for SeekableStreamReader.
216         * support.cs : (SeekableStreamReader) third .ctor() argument for
217           StreamReader is not required (always true). preamble size could
218           be acquired in simpler and safe way.
219
220 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
221
222         * cs-parser.jay: report CS0642 at warning level 3
223           and report CS0642 for an if else statement also
224           fixes bug #74745. Patch by John Luke (and a bit
225           modified by me).
226           Removed extra CS0642 warning check for "while",
227           "for" and "fixed".
228         * statement.cs: In Block.Resolve(), CS0642 check
229           is reimplemented to check a sequence of an empty
230           statement and a block.
231
232           Both fix bug #66777.
233
234 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
235
236         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
237         detection until I fix it.
238         
239         * cs-tokenizer.cs: Changed error message.
240         
241         * cs-parser.jay: Fixed 2 error locations.
242         
243         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
244         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
245         properties.
246         
247         * enum.cs (GetSignatureForError): Fixed.
248         
249         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
250         method detection.
251         
252         * class.cs,
253         * typemanager.cs (RegisterProperty): Removed.
254         
255         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
256
257 2005-08-24  Raja R Harinath  <rharinath@novell.com>
258
259         Fix #75874.
260         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
261         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
262
263 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
264
265         * expression.cs : tiny fix is required for not warning positive ulong.
266           See test-441.cs.
267
268 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
269
270         * expression.cs : add CS0652 check for constant and integral
271           expression. Fixed bug #53974.
272
273 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
274
275         * expression.cs : in DoNumericPromotions(), check if there is implicit
276           conversion overload for string (to check CS0034). Fixed bug #52492.
277
278 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
279
280         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
281
282 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
283
284         * ecore.cs : report location when it is *not* Null.
285
286 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
287
288         * codegen.cs,
289           ecore.cs,
290           flowanalysis.cs,
291           expression.cs:
292           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
293           correctly. Fixed bug #75721.
294
295 2005-08-23  Raja R Harinath  <rharinath@novell.com>
296
297         * support.cs (SeekableStreamReader.Position): Avoid an expensive
298         loop that performs 'min (pos, char_count)'.
299
300         Fix #75862.
301         * expression.cs (Unary.ResolveOperator): Don't discard implicit
302         converted value in Operator.OnesComplement.
303
304 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
305
306         * anonymous.cs: If the anon method is pulled into a helper class,
307         it needs to be `internal' not `private'. Fixes runtime behavior on
308         msft. bug #75704
309
310 2005-08-20  Martin Baulig  <martin@ximian.com>
311
312         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
313         scope if we don't already have it.
314
315         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
316         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
317         fixes #75867.
318
319 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
320
321         Fix #75803
322         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
323         is a partial class.
324
325 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
326
327         The big constants rewrite
328         Fix #75746, #75685 and more
329         As a side effect saved 1MB for MWF ;-)
330         
331         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
332         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
333         enum based for corlib compilation.
334         
335         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
336         subtractions.
337         
338         * class.cs (FixedField.Define): Use ResolveAsConstant.
339         
340         * const.cs (IConstant): Interface constants and enums.
341         (Const.ResolveValue): New method for constant resolvning.
342         (ExternalConstant): Constants from imported assemblies.
343         
344         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
345         conversion; like enums.
346         (Constant.ToType): Converts this constant to different type.
347         (Constant.Increment): Adds 1.
348         
349         * convert.cs (ImplicitConversionRequired): Simplified.
350         
351         * cs-parser.jay: Create EnumMember directly.
352         
353         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
354         
355         * doc.cs (GenerateEnumDocComment): Removed.
356         
357         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
358         (ConvertIntLiteral): Removed.
359         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
360         
361         * enum.cs (EnumMember): Implement IConstant.
362         (Enum.IsValidEnumConstant): Removed.
363         (Enum.GetNextDefaultValue): Removed.
364         (Enum.FindMembers): Updated.
365         (Enum.GenerateDocComment): Iterate enum members.
366         
367         * expression.cs (Cast.TryReduce): Handle enums correctly.
368         (New.Constantify): Made public.
369         (MemberAccess.DoResolve): Removed contant specific if(s).
370         
371         * literal.cs (NullLiteral): Implement new abstract methods.
372         
373         * statement.cs (GotoCase.Resolve): Use new constant methods.
374         (SwitchLabel.ResolveAndReduce): Use new constant methods.
375         
376         * typemanager.cs (LookupEnum): Removed.
377         (IsEnumType): Fixed to work with corlib.
378         (RegisterConstant): Removed.
379         (LookupConstant): Removed.
380         (GetConstant): Changed to work with IConstant.
381
382 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
383
384         * location.cs : Fixed overflown (>255) column number.
385
386 2005-08-03  Raja R Harinath  <rharinath@novell.com>
387
388         First cut of the qualified-alias-member feature.
389         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
390         token.
391         * cs-parser.jay (DOUBLE_COLON): New token.
392         (namespace_or_type_name): Add rule for recognizing
393         qualified-alias-members.
394         (primary_expression): Likewise.
395         (element_access): Allow QualifiedAliasMember as a possible
396         type-bearing expression.
397         (local_variable_type, local_variable_pointer_type): Likewise.
398         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
399         aliases in the current and enclosing namespace declarations.
400         (NamespaceEntry.UsingAlias): Add CS0440 warning.
401         * decl.cs (MemberName.is_double_colon): New.
402         (MemberName.MemberName): Add new constructor for alias-member.
403         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
404         * expression.cs (QualifiedAliasMember): New expression type.
405
406 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
407
408         * location.cs : it borked when no argument was specified.
409
410 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
411
412         * location.cs : tiny ToString() format fix.
413
414 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
415
416         * statement.cs : oops, it was missing.
417
418 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
419
420         A set of fixes for precise line/column location.
421
422         * location.cs :
423           "token" field now holds a file/line "delta", a line number offset 
424           from the segment, and a column number. See also:
425           http://lists.ximian.com/pipermail/mono-devel-list/2004-
426           December/009508.html
427           Removed static IsNull. Use instance IsNull property instead.
428         * cs-tokenizer.cs :
429           For some tokens it stores Location. For Identifier it stores
430           LocatedToken which is a pair of string name and location.
431           Column numbers are adjusted only at getChar().
432         * report.cs :
433           Use Location.ToString() for reporting (it now contains column).
434         * cs-parser.jay :
435           Largely modified to use LocatedToken instead of
436           string (IDENTIFIER), and to acquire Location from some tokens.
437         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
438           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
439           codegen.cs :
440           Now MemberName holds Location. DeclSpace.ctor() receives Location
441           as a parameter. Removed extra parameters to all derived classes.
442           Replaced Location.IsNull() with instance property.
443         * assign.cs, expression.cs :
444           Added .ctor() overload that omits Location.
445         * attribute.cs :
446           Added "nameEscaped" flag that indicates the identifier was escaped
447           in the source file. This fixes bug #57047.
448
449 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
450
451         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
452         New method, looking for lo-case imported cls type.
453
454         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
455         here.
456
457         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
458
459         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
460
461         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
462         all_imported_types.
463         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
464
465         Optimized to save 3.5 MB for SWF compilation.
466
467 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
468
469         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
470         (PartialContainer.Create): Moved logic AddToContainer.
471         (PartialContainer.MarkForDuplicationCheck): Shares name.
472         
473         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
474         place.
475         
476         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
477         initialization.
478         (Namespace.GetSignatureForError): New method.
479         
480         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
481         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
482
483 2005-08-01  Raja R Harinath  <rharinath@novell.com>
484
485         Fix #75669.
486         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
487         member lookup rather than qualifier_type, since qualifier_type can
488         be null.
489
490 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
491
492         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
493         enum member.
494
495 2005-07-31  Miguel de Icaza  <miguel@novell.com>
496
497         * statement.cs: Copy the local exception into the exception
498         captured local.  Fixes 75674
499
500 2005-07-31  Raja R Harinath  <harinath@gmail.com>
501
502         Fix #75658.
503         * expression.cs (Invocation.OverloadResolve): Don't report error
504         CS1501 if error CS1502 has been reported.
505         (New.DoResolve): Delegate CS1501 reporting to
506         Invocation.OverloadResolve.
507
508         Fix #75656.
509         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
510         invariant-meaning-in-block property in an enclosing block if
511         necessary.
512
513 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
514
515         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
516         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
517         (Switch.CheckSwitch): Just save 50kb for SWF.
518
519 2005-07-27  Martin Baulig  <martin@ximian.com>
520
521         * anonymous.cs (CaptureContext.AddField): Added
522         `AnonymousContainer am' argument; compute its toplevel scope if
523         it's not already computed.  Fixes #75649.
524
525 2005-07-26  Raja R Harinath  <rharinath@novell.com>
526
527         Fix #75628.
528         * class.cs (Constructor.Emit): Reset block to null if the block
529         resolve fails.
530
531 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
532
533         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
534
535 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
536
537         * class.cs (MethodData.Define): Check whether accessor implementing
538         interface is public.
539
540         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
541
542 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
543
544         Fix #57245
545         * namespace.cs (LookupType): Moved same type check to...
546         
547         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
548         with the same name.
549
550 2005-07-21  Raja R Harinath  <rharinath@novell.com>
551
552         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
553         already found a typebuilder.
554         * class.cs (MethodCore.IsDuplicateImplementation): Compare
555         MemberNames, not strings.
556
557         * const.cs (Error_ExpressionMustBeConst): 
558         Rename from Error_EpressionMustBeConst.
559         * const.cs, class.cs, statement.cd: Update.
560
561 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
562
563         Fix #65573
564
565         * const.cs (Const.LookupConstantValue): Report missing contant expression
566         everytime.
567         (Error_EpressionMustBeConstant): Only one error method.
568
569         * class.cs, statement.c: Updated.
570
571 2005-07-20  Raja R Harinath  <rharinath@novell.com>
572
573         * statement.cs (Block.Flags): Add back HasVarargs.
574         (Block.flags): Make protected.
575         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
576
577         * typemanager.cs (types, typecontainers, user_types): Remove.
578         (UserTypes, TypeContainers): Likewise.
579         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
580         (CleanUp, Reset): Update.
581         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
582         (GetNestedType): Use Type.GetNestedType.
583         (CoreLookupType): Take two arguments, the namespace and the
584         basename of the type.  Update to use the Namespace.Lookup
585         mechanism.
586         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
587         (RealMemberLookup): Use IsNestedChildOf instead of playing with
588         string concatenation and substring matches.
589         * class.cs, enum.cs, delegate.cs: Update to changes.
590
591 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
592
593         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
594         Expression and made virtual.
595
596         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
597         (ImplicitStandardConversionExists): Fixed `byte' typo ?
598
599         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
600
601         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
602         error message.
603
604         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
605         change.
606
607 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
608
609         Fix #57707
610         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
611         AssemblyCultureAttribute is not used on executable.
612
613         * rootcontext.cs,
614         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
615
616 2005-07-16  Raja R Harinath  <rharinath@novell.com>
617
618         Fix #60638.
619         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
620         New.  Reports CS0252/CS0253.
621         Mostly taken from preliminary patch by Duncak Mak.
622         (Binary.DoResolveOperator): Store results of operator lookup.
623         Use them to detect if we need to warn about unintended reference
624         comparisons.
625
626 2005-07-15  Raja R Harinath  <rharinath@novell.com>
627
628         Fix #72969.
629         * namespace.cs (Namespace.Lookup): Add back location parameter.
630         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
631         * delegate.cs, ecore.cs, expression.cs: Update to changes.
632
633         * codegen.cs (EmitContext.DeclSpace): Make readonly.
634         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
635         (Namespace.LookupType): ... this.
636         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
637         of namespaces.
638         * typemanager.cs (LookupTypeReflection): Remove buggy code that
639         purported to handle pointers.
640         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
641         CoreLookupType.
642
643 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
644
645         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
646         type as namespace.
647
648 2005-07-15  Raja R Harinath  <rharinath@novell.com>
649
650         * namespace.cs (Namespace.Lookup): Drop location parameter.
651         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
652         (NamespaceEntry.Lookup): ... this.
653         (NamespaceEntry.Error_AmbiguousTypeReference):
654         Move here from DeclSpace.
655         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
656         names ...
657         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
658         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
659         Move to NamespaceEntry.
660         * delegate.cs, expression.cs: Update to changes.
661
662 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
663
664         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
665         CheckAttributeType and refactored.
666         (Attribute.ResolvePossibleAttributeType): Changed to reuse
667         ResolveAsTypeTerminal error handling.
668         (ResolveAsTypeTerminal): Introduced because of global attributes extra
669         handling.
670         (GetSignatureForError): Print errors in same way.
671
672         * class.cs,
673         * codegen.cs: Reflect attribute GetSignatureForError change.
674
675         * ecore.cs,
676         * expression.cs: Add silent parameter to ResolveAsTypeStep.
677
678         * namespace.cs (UsingEntry): Refactored to make fields private.
679
680         * assign.cs,
681         statement.cs: Error_UnexpectedKind has extra parameter.
682
683 2005-07-14  Raja R Harinath  <rharinath@novell.com>
684
685         * ecore.cs (IAlias): Remove.
686         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
687         that implement the interface.
688         * namespace.cs (Namespace): Likewise.
689         (Namespace.declspaces): Renamed from 'defined_names'.
690         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
691         DeclSpace instead of an IAlias.
692         * tree.cs (Tree.AddDecl): Update.
693
694 2005-07-12  Raja R Harinath  <rharinath@novell.com>
695
696         * statement.cs (Block.Flags); Remove HasVarargs.
697         (Block.HasVarargs): Move to ToplevelBlock.
698         (Block.ThisVariable, Block.AddThisVariable): Likewise.
699         (Block.Variables): Make protected.  Initialize variable hashtable
700         if necessary.
701         (Block.AddVariable): Update.
702         (Block.Resolve): Update to changes.
703         (ToplevelBlock.HasVarargs): New boolean.
704         (ToplevelBlock.ThisVariable): Move here from Block.
705         (ToplevelBlock.AddThisVariable): Likewise.
706         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
707         * expression.cs (This.ResolveBase): Update to changes.
708         (ArglistAccess.DoResolve): Likewise.
709
710 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
711
712         Fix #75321
713         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
714
715         * class.cs (TypeContainer.VerifyMembers): Distinguish between
716         not used and not used & assigned.
717         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
718
719 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
720
721         Fix #75053
722         * expression.cs (Is.DoResolve): null is never provided type.
723
724 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
725
726         Fix #52496
727         * cs-parser.jay: Less strict event error rule to catch more errors.
728
729 2005-07-08  Martin Baulig  <martin@ximian.com>
730
731         Fix test-iter-10.cs - distinguish whether we `yield' in a property
732         gettter (allowed) or setter (not allowed).
733
734         * class.cs (Accessor): Implement IIteratorContainer.
735         (Accessor.Yields): New public field.
736         (PropertyBase.PropertyMethod.Define): Handle iterators on a
737         per-accessor basis.
738
739         * cs-parser.jay
740         (get_accessor_declaration, set_accessor_declaration): Set the
741         `yields' flag on the accessor, not the property.
742         (property_declaration): Do the iterators check on a per-accessor
743         basis and not for the whole property.
744
745 2005-07-08  Martin Baulig  <martin@ximian.com>
746
747         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
748         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
749
750 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
751
752         Fix #74975
753         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
754         (ExtractSecurityPermissionSet): Cope with self referencing security
755         attributes properly.
756
757         * driver.cs (SetOutputFile): Made public property OutputFile.
758
759 2005-07-07  Raja R Harinath  <rharinath@novell.com>
760
761         Fix #75486.
762         * class.cs (TypeContainer.first_nonstatic_field): Rename from
763         has_nonstatic_fields.  Make into a FieldBase pointer.
764         (TypeContainer.AddField): Add CS0282 check.
765         (TypeContainer.EmitType): Update.
766
767 2005-07-06  Miguel de Icaza  <miguel@novell.com>
768
769         * cs-tokenizer.cs (consume_identifier): Do not create strings to
770         compare if they start with __.
771
772 2005-07-06  Raja R Harinath  <rharinath@novell.com>
773
774         * statement.cs (Switch.SwitchGoverningType): Only look at
775         UserCasts that don't need implicit standard conversions to one of
776         the allowed switch types (Fixes test-322.cs).
777         (LocalInfo.Resolve): Re-enable sanity-test.
778
779 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
780
781         * cs-tokenizer.cs (consume_identifier): Detect double undescores
782         
783         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
784         
785         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
786
787 2005-07-06  Raja R Harinath  <rharinath@novell.com>
788
789         Fix #75472.
790         * ecore.cs (SimpleName.GetSignatureForError): Add.
791         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
792         (MemberAccess.GetSignatureForError): Add.
793
794 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
795  
796         The big error and warning messages review.
797         
798         * anonymous.cs,
799         * assign.cs,
800         * attribute.cs,
801         * class.cs,
802         * codegen.cs,
803         * convert.cs,
804         * cs-parser.jay,
805         * cs-tokenizer.cs,
806         * decl.cs,
807         * delegate.cs,
808         * doc.cs,
809         * driver.cs,
810         * ecore.cs,
811         * enum.cs,
812         * expression.cs,
813         * flowanalysis.cs,
814         * iterators.cs,
815         * literal.cs,
816         * location.cs,
817         * modifiers.cs,
818         * namespace.cs,
819         * parameter.cs,
820         * pending.cs,
821         * report.cs,
822         * rootcontext.cs,
823         * statement.cs,
824         * support.cs,
825         * tree.cs,
826         * typemanager.cs: Updated.
827         
828         * class.cs: (MethodCore.SetYields): Moved here to share.
829         (PropertyMethod.Define): Moved iterator setup here.
830         
831         * iterators.cs: Add orig_method to have full access to parent
832         container.
833
834 2005-07-05  Raja R Harinath  <rharinath@novell.com>
835
836         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
837         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
838         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
839         variable of struct type.
840         * expression.cs (Unary.ResolveOperator): Update to change.
841         (Indirection.VerifyFixed): Likewise.
842         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
843         (ParameterReference.VerifyFixed): Value parameters are fixed.
844         (This.VerifyFixed): Treat 'this' as a value parameter.
845         * statement.cs (LocalInfo.IsFixed): Remove.
846
847 2005-07-01  Martin Baulig  <martin@ximian.com>
848
849         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
850         `ec.EmitThis ()' to get the correct scope.
851
852 2005-07-01  Martin Baulig  <martin@ximian.com>
853
854         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
855         instance is a ParameterReference; fixes #75299.
856
857 2005-07-01  Martin Baulig  <martin@ximian.com>
858
859         Reverted Marek's latest patch (r46725):
860         - it contains structural changes which are neither mentioned in
861           the ChangeLog nor explained anywhere; for example the additional
862           argument of EmitContext's and Iterator's .ctor's and the
863           TypeContainer.DefineMembers() change.
864         - structural changes like this should go in in seperate patches
865           and not be hidden in a huge patch which just seems to affect
866           warnings and errors.
867           a big and hard to understand patch.
868         - it breaks iterators and causes regressions, for instance in
869           test-iter-03.cs.      
870
871 2005-06-30  Raja R Harinath  <rharinath@novell.com>
872
873         Fix #75412.
874         * expression.cs (Indexers.map): Remove.
875         (Indexers.Append): Filter out inaccessible setters and getters.
876         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
877
878         Fix #75283.
879         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
880         Refactored from ...
881         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
882         (FieldExpr.Emit, PropertyExpr.Emit): Update.
883         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
884         * expression.cs (Invocation.EmitCall): Add CS0120 check.
885
886 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
887
888         Fix #75322
889         * class.cs (FieldBase.GetInitializerExpression): One more field
890         for backup.
891
892 2005-06-28  Miguel de Icaza  <miguel@novell.com>
893
894         * pending.cs: Do not define a proxy if the base method is virtual,
895         it will be picked up by the runtime (bug 75270).
896
897 2005-06-08  Martin Baulig  <martin@ximian.com>
898
899         The big Iterators rewrite :-)
900
901         * iterators.cs: Rewrite this to use the anonymous methods framework.
902
903         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
904         before the TypeContainers; see 2test-21.cs.
905
906         * class.cs
907         (TypeContainer.DefineType): Don't create a new EmitContext if we
908         already have one (this only happens if we're an Iterator).
909         (TypeContainer.Define): Also call Define() on all our iterators.
910         (Method.CreateEmitContext): Added support for iterators.
911
912         * anonymous.cs
913         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
914         (AnonymousContainer.CreateMethodHost): Moved here from
915         AnonymousMethod and made abstract.
916         (AnonymousContainer.CreateScopeType): New abstract method.
917         (AnonymousContainer.IsIterator): New public property.
918         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
919         get the ScopeTypeBuilder rather than manually defining it here. 
920         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
921         iterators here.
922
923         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
924         before RootContext.DefineTypes().
925
926         * codegen.cs (EmitContext.RemapToProxy): Removed.
927         (EmitContext.CurrentAnonymousMethod): Changed type from
928         AnonymousMethod -> AnonymousContainer.
929         (EmitContext.ResolveTopBlock): Protect from being called twice.
930         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
931         (EmitContext.EmitThis): Removed the iterators hacks; use the
932         anonymous methods framework for that.
933
934         * statement.cs
935         (ToplevelBlock.Container): Make this a property, not a field.
936         (ToplevelBlock.ReParent): New public method; move the
937         ToplevelBlock into a new container.
938         (Foreach.TemporaryVariable): Simplify.
939
940 2005-06-05  Martin Baulig  <martin@ximian.com>
941
942         * statement.cs (LocalInfo.CompilerGenerated): New flag.
943         (Block.AddTemporaryVariable): New public method; creates a new
944         `LocalInfo' for a temporary variable.
945         (Block.EmitMeta): Create the LocalBuilders for all the temporary
946         variables here.
947         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
948         non-iterator variables.
949
950 2005-06-05  Martin Baulig  <martin@ximian.com>
951
952         * statement.cs (Foreach.TemporaryVariable): Create the
953         LocalBuilder in the Emit phase and not in Resolve since in some
954         situations, we don't have an ILGenerator during Resolve; see
955         2test-19.cs for an example.
956
957 2005-06-04  Martin Baulig  <martin@ximian.com>
958
959         **** Merged r45395 from GCS ****
960
961         The big Foreach rewrite - Part II.
962
963         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
964         with `PropertyInfo ienumerator_getcurrent'.
965
966         * codegen.cs (VariableStorage): Removed.
967
968         * statement.cs
969         (Foreach): Derive from Statement, not ExceptionStatement.
970         (Foreach.CollectionForeach): New nested class.  Moved all the code
971         dealing with collection foreach here.
972         (Foreach.ForeachHelperMethods): Removed.
973         (Foreach.TemporaryVariable): Implement IMemoryLocation.
974
975 2005-05-23  Martin Baulig  <martin@ximian.com>
976
977         * statement.cs (Try.DoResolve): Don't create a `finally' if we
978         don't need to.  Fix #75014.
979
980 2005-05-20  Martin Baulig  <martin@ximian.com>
981
982         Merged r44808 from GMCS.
983
984         * class.cs (TypeContainer.CircularDepException): Removed.
985         (TypeContainer.DefineType): Removed the `InTransit' stuff.
986         (TypeContainer.CheckRecursiveDefinition): Check for circular class
987         (CS0146) and interface (CS0529) dependencies here.
988
989 2005-06-21  Raja R Harinath  <rharinath@novell.com>
990
991         * expression.cs (Invocation.EmitCall): Fix initialization
992         'this_call' to reflect current behaviour.  Fix indentation.
993
994         * convert.cs (FindMostEncompassedType): Add two trivial special
995         cases (number_of_types == 0 || number_of_types == 1).
996         (FindMostEncompasingType): Likewise.
997
998 2005-06-17  Raja R Harinath  <rharinath@novell.com>
999
1000         Some cleanups preparing for the fix of #75283.
1001         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1002         error testing.
1003         (EventExpr.InstanceResolve): Likewise.
1004         (EventExpr.DoResolve): Remove redundant checks.
1005
1006 2005-06-10  Duncan Mak  <duncan@novell.com>
1007
1008         * cs-tokenizer.cs (process_directives): New flag for controlling
1009         the processing of preprocessor directives.
1010         (x_token): After seeing a '#', return Token.NONE instead of going
1011         to handle_preprocessing_directive() when not processing
1012         directives. This avoids unnecessary processing during the token peek in
1013         is_punct().
1014
1015         This fixes #74939.
1016
1017         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1018         the existing error reporting methods instead of Report.Error.
1019
1020         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1021         after Raja's rewrite.
1022
1023 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1024
1025         * class.cs: Small fix.
1026
1027 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1028
1029         Fix #75160.
1030         * class.cs (GetPartialBases): Fix return value check of
1031         part.GetClassBases.
1032
1033 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1034
1035         Ensure that partial classes are registered in their enclosing
1036         namespace.  Initial part of fix of #75160.
1037         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1038         Register declspace with namespace here, not in
1039         DeclSpace.RecordDecl.
1040         * cs-parser.jay: Pass namespace to RecordDecl.
1041         * class.cs (PartialContainer.Create): Likewise.
1042         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1043         called.
1044         * decl.cs (Declspace.RecordDecl): Remove.
1045         * namespace.cs (NamespaceEntry.DefineName): Remove.
1046
1047 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1048
1049         * rootcontext.cs: Reset TargetExt as well.
1050
1051 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1052
1053         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1054         -langversion:ISO-1.
1055
1056 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1057
1058         Fix #75080, cs0119.cs.
1059         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1060         of ...
1061         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1062         allowing ExprClass.Type and ExprClass.Namespace for
1063         ResolveFlags.VariableOrValue.
1064         (Expression.Resolve) [1-argument variant]: Change default resolve
1065         flags based on language version.
1066         (Expression.Error_UnexpectedKind): Use a simple string array
1067         rather than an ArrayList.
1068         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1069         not ExprClass.Type.
1070         (TypeOfVoid.DoResolve): Likewise.
1071         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1072         flags argument -- it always has the same value.
1073
1074 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1075
1076         Fix #75081.
1077         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1078         Use it in the error message.
1079         * assign.cs, expression.cs, statement.cs: Update.
1080
1081 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1082
1083         Fix #75088.
1084         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1085         the "almostMatchedMember" case too.
1086         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1087         that failed the accessibility checks to 'almost_match'.
1088
1089 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1090
1091         * attribute.cs: Use internal MethodBuilder methods to set
1092         ExactSpelling and SetLastError on PInvoke methods, instead
1093         of passing them via charset.  Fixes #75060.
1094
1095 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1096
1097         * parameter.cs (Parameter): Remove TODO comment.
1098         (Parameter.DefineParameter): Remove Location parameter.
1099         (Parameters.LabelParameters): Likewise.
1100         * class.cs (Constructor.Emit): Update to change.
1101         (MethodData.Emit): Likewise.
1102         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1103         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1104
1105 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1106
1107         * parameter.cs,
1108           Removed Parameters.Location and added Parameter.Location instead.
1109           Removed Location parameter from Emit() and GetSignature().
1110         * anonymous.cs,
1111           class.cs,
1112           cs-parser.jay,
1113           delegate.cs,
1114           iterators.cs,
1115           statement.cs :
1116           Modified all related calls.
1117
1118 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1119
1120         Improve user-defined conversion handling.
1121         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1122         applicable operators.
1123         (AddConversionOperators): New.  Helper for GetConversionOperators.
1124         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1125         there is only one most encompassed/encompassing type.
1126         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1127         "applicable operator" handling.
1128         (UserConversion): Move cache here from GetConversionOperators.
1129         Directly cache the chosen operator, rather than the whole
1130         MethodGroup.
1131         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1132         case.  Allow conversion of decimal to sbyte and byte too.
1133         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1134         New static methods.  Used to avoid allocating EmptyExpressions in
1135         convert.cs.
1136
1137 2005-05-24  Duncan Mak  <duncan@novell.com>
1138
1139         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1140         another class, used in Convert.ExplicitNumericConversion.
1141         (CastToDecimal): New class, similar to above, but casts to
1142         System.Decimal, used in Convert.ImplicitNumericConversion and also
1143         in explicit convesion from double/float to decimal.
1144
1145         * convert.cs (ImplicitNumericConversion): Handle implicit
1146         conversions to System.Decimal.
1147         (ExplicitNumericConversion): handle explicit conversions to
1148         System.Decimal.
1149
1150         This fixes #68711.
1151         
1152 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1153
1154         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1155         know the type at this stage, just break through.   Fixes #75008 
1156
1157 2005-05-19  Martin Baulig  <martin@ximian.com>
1158
1159         * delegate.cs
1160         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1161         to disable error reporting.
1162
1163         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1164         here since we don't want to report an error; see the new test-336.cs.
1165
1166 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1167
1168         * statement.cs (ToplevelBlock.GetParameterReference)
1169         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1170         Move here from class Block.
1171         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1172         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1173
1174 2005-05-18  Martin Baulig  <martin@ximian.com>
1175
1176         Fix #74978.
1177
1178         * flowanalysis.cs
1179         (FlowBranching.Reachability): Add non-static public And() and Or()
1180         methods.
1181         (FlowBranchingSwitch): New class; do the `break_origins' thing
1182         like in FlowBranchingLoop.
1183         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1184         reachability, not just locals and parameters.
1185         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1186         switch; MergeBreakOrigins() now takes care of that.
1187
1188 2005-05-18  Martin Baulig  <martin@ximian.com>
1189
1190         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1191         a loop and may leave it, reset the barrier; fixes #74974.
1192
1193 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1194         
1195         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1196         is back.
1197         
1198         * cs-parser.jay: Catch more lexical errors.
1199         
1200         * report.cs: Add one more Error method.
1201         
1202         * rootcontext.cs,
1203         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1204
1205 2005-05-17  Martin Baulig  <martin@ximian.com>
1206
1207         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1208         #70970. 
1209
1210 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1211
1212         Fix test-382.cs.  Emit values of decimal constants.
1213         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1214         Carved out of ...
1215         (TypeContainer.AddField): ... this.
1216         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1217         with initializers to include 'Const's.
1218         (ClassPart.RegisterFieldForInitialization): Forward to
1219         PartialContainer.
1220         * const.cs (Const.Const): Pass initializer to base class.
1221         (Const.Define): In case of decimal constants, register them for
1222         initialization in a static constructor.
1223
1224 2005-05-14  Martin Baulig  <martin@ximian.com>
1225
1226         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1227         do not call ResolveUnreachable() on unreachable statements in
1228         here, see the comment in the source code.
1229
1230 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1231
1232         Fix #74934.
1233         * expression.cs (BinaryResolveOperator): If one of the operands of
1234         an equality comparison is 'null' and the other is a pointer type,
1235         convert the null to a NullPointer.
1236         * convert.cs (ImplicitReferenceConversion): If the expression is a
1237         NullLiteral and the target type is a pointer type, return a
1238         NullPointer instead.
1239         (ImplicitConversionStandard): Likewise.
1240
1241 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1242         
1243         * cs-parser.jay: Set readonly context based on special constructs.
1244         
1245         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1246         readonly variable error handling.
1247         
1248         * rootcontext.cs (EmitCode): Don't verify members when error
1249         occurred.
1250         
1251         * statement.cs (LocalInfo): Add reaodnly context information.
1252         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1253
1254 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1255
1256         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1257         for #74041 to initialize 'resolved' to false only for explicit
1258         blocks.  Fixes #74873.
1259
1260 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1261
1262         Fix #74920.
1263         * typemanager.cs (unmanaged_enclosing_types): New.
1264         (IsUnmanagedType): Avoid infloops by using
1265         'unmanaged_enclosing_types' to talk with recursive invocations.
1266
1267 2005-05-13  Martin Baulig  <martin@ximian.com>
1268
1269         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1270         instance variable, not a local.  Fix #74873.
1271         (Block.ResolveUnreachable): Set it to true here.
1272
1273 2005-05-11  Duncan Mak  <duncan@novell.com>
1274
1275         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1276         continuing to process for 'arg'.
1277         (handle_preprocessing_directive): Check the argument of the #endif
1278         directive and report error CS1025 if there are any trailing
1279         characters.
1280
1281         According to the C# spec, having even whitespace after the #endif
1282         directive is illegal; however, because we call arg.TrimEnd ()
1283         beforehand, we have the same behavior as csc, allowing whitespace
1284         after the directive.
1285
1286         Fixes #74892.
1287
1288 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1289
1290         Fix #74863.
1291         
1292         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1293         (Constructor.GetObsoleteAttribute): Implemented correctly.
1294
1295 2005-05-10  Martin Baulig  <martin@ximian.com>
1296
1297         * support.cs (ReflectionParameters.ParameterModifier): Use
1298         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1299         and `ParameterAttributes.In'.  Fixes #74884.
1300
1301 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1302
1303         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1304         
1305         * expression.cs (Argument.GetParameterModifier): Turned to property.
1306         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1307         
1308         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1309         its C# equivalent.
1310         
1311 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1312
1313         Fix #74852.
1314         * decl.cs (MemberCache.AddMethods): Register override methods,
1315         rather than non-override methods.
1316         * typemanager.cs (RegisterOverride): New.
1317         (IsOverride): Update.
1318
1319 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1320
1321         Fix #73105.
1322         
1323         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1324         recursive declaration.
1325         
1326         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1327         
1328 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1329
1330         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1331         
1332         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1333
1334 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1335
1336         Fix #74797.
1337         * decl.cs (DeclSpace.FamilyAccessible): 
1338         Use TypeManager.IsNestedFamilyAccessible.
1339
1340         Fix reopened #64812.
1341         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1342         internal'.
1343
1344 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1345             Abin Thomas  <projectmonokochi@rediffmail.com>
1346             Anoob V E  <projectmonokochi@rediffmail.com>
1347             Harilal P R  <projectmonokochi@rediffmail.com>
1348
1349         Fix #64812.
1350         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1351         allow access to all static members.
1352
1353 2005-05-04  Martin Baulig  <martin@ximian.com>
1354
1355         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1356
1357 2005-05-04  Martin Baulig  <martin@ximian.com>
1358
1359         Fix #74655.
1360
1361         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1362         section at the end; make things work if `default' is not the last
1363         section.        
1364
1365 2005-05-04  Martin Baulig  <martin@ximian.com>
1366
1367         Fix #70400.
1368
1369         * statement.cs (Switch): Replaced the `got_default' field with a
1370         `default_section' one.
1371         (Switch.CheckSwitch): Set `default_section' here.
1372         (Switch.Resolve): If we're a constant switch and the constant is
1373         not found, use the default section.
1374
1375 2005-05-03  Martin Baulig  <martin@ximian.com>
1376
1377         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1378
1379         * statement.cs (Foreach.ArrayForeach): New nested class.
1380         (Foreach.TemporaryVariable): New nested class.
1381         (Foreach.EmitArrayForeach): Removed; this is now in the new
1382         ArrayForeach class.
1383
1384 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1385
1386         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1387         more conservative.
1388         (VerifyPendingMethods): Revert change below.
1389
1390         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1391         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1392         that used to trigger warning -28.  Remove warning -28.
1393         * expression.cs (Invocation.OverloadResolve): Use
1394         TypeManager.IsOverride to distinguish override methods.
1395
1396         Fix #74773.
1397         * pending.cs (VerifyPendingMethods): If a base type implements the
1398         requested interface, don't bother checking individual methods of
1399         the base type.  As a side-effect, this prevents the creation of
1400         unnecessary proxies.
1401
1402 2005-05-02  Martin Baulig  <martin@ximian.com>
1403
1404         Fix #70182.
1405
1406         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1407         Also `And' the locals if the old vector is null.
1408         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1409         null; in this case we basically reset all the variables.        
1410
1411 2005-05-02  Martin Baulig  <martin@ximian.com>
1412
1413         Fix #74529.
1414
1415         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1416         Added `FlowBranching branching' argument; always `and' the
1417         variables instead of `or'ing them unless we're an infinite loop.
1418
1419         * statement.cs (While.Resolve): Create a new sibling unless we're
1420         infinite.       
1421
1422 2005-05-02  Martin Baulig  <martin@ximian.com>
1423
1424         Fix #70140.
1425
1426         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1427         arguments; use it instead of creating a new TopLevelBlock.
1428         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1429         our ConstructorInitializer.
1430
1431         * statement.cs
1432         (TopLevelBlock.TopLevelBranching): New public property.
1433         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1434         and create our `TopLevelBranching'.
1435
1436         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1437         anonymous method host, use `block.TopLevelBranching' rather than
1438         creating a new branching.
1439
1440 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1441
1442         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1443         a ScopeInfo, if any of the current children is a child of the new
1444         entry, move those children there.
1445
1446 2005-04-30  Martin Baulig  <martin@ximian.com>
1447
1448         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1449         at the beginning of a SwitchSection.  Fix #73335.
1450
1451 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1452
1453         Fix #74378
1454         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1455         
1456         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1457         (FieldExpr.DoResolve): Obsolete members are ignored for field
1458         initializers.
1459         
1460 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1461
1462         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1463         of arrays detection.
1464
1465         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1466         verification.
1467         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1468
1469         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1470         arrays report.
1471
1472 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1473
1474         * cs-parser.jay: Use the prefered version of -unsafe in error
1475         message.
1476
1477 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1478
1479         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1480         circumstances.
1481
1482 2005-04-20  John Luke  <john.luke@gmail.com>
1483
1484         * driver.cs: fix typo in error message, --outout to --output
1485
1486 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1487
1488         * codegen.cs (InRefOutArgumentResolving): New field.
1489         
1490         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1491         fields outside contructor.
1492         
1493         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1494         
1495 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1496
1497         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1498         parameter code was not completed ever, so it was not as up-to-date
1499         as local variables.  Must finish it.
1500
1501         The bug fix was to compare the Toplevel of the block, not the
1502         current block.  Thanks for Ben for pointing this out. 
1503
1504 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1505
1506         * decl.cs (AddMethods): Use the declaring type of the problem
1507         method to determine if we want to squash a warning.
1508
1509 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1510
1511         * attribute.cs: Removed debug output.
1512
1513         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1514         
1515         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1516         Report.Stderr.
1517         
1518 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1519
1520         Fix #74481.
1521         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1522         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1523         all null comparisons against reference types.
1524
1525 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1526
1527         Fix# 74565
1528         * class.cs (TypeContainer.CircularDepException) New nested
1529         exception class.
1530         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1531         (TypeContainer.DefineType): Removed error, reset InTransit before
1532         exit.
1533         (Class.DefineType): Throw exception when is in Transit.
1534         Catch exception and report error.
1535         (Struct.DefineType): Throw exception when is in Transit.
1536         Catch exception and report error.
1537         (Interface.DefineType): Throw exception when is in Transit.
1538         Catch exception and report error.
1539
1540         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1541         handle nested exception handlers.
1542
1543         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1544         a catch.
1545
1546         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1547         InFinally and InCatch storage.
1548
1549         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1550         (Catch.Resolve): Set and Restore ec.InCatch.
1551         (Try.Resolve): Set and Restore ec.InFinally.
1552         (Try.HasCatch): True when try has catch.
1553
1554 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1555
1556         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1557           for the same event member, so exclude such cases from warning 419.
1558           Fixed bug #74633.
1559
1560 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1561
1562         * expression.cs (Binary.ResolveOperator): Apply patch from John
1563         Luke to fix bug 59864: operators &, | and ^ on enumerations
1564         require that the same enum type on both sides.
1565
1566         * driver.cs: Add warnings to old flag usage, this is to assist
1567         people who produce Makefiles and hope that the Makefiles will be
1568         used on Windows.
1569
1570         * class.cs (TypeContainer.EmitType): Moved the definition of the
1571         special $PRIVATE$ field from the resolve phase to the Emit phase.
1572         During resolve we do not know if we are a struct with
1573         HasExplicitLayout, we know this only after the attributes for the
1574         type are emitted.
1575
1576         Set the FieldOffset to zero on the dummy field that we create for
1577         the class.   Fixes 74590.
1578
1579 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1580
1581         Fix #73834.
1582         * ecore.cs (PropertyExpr.resolved): New.
1583         (DoResolve): Use it to handle a case of double resolution here.
1584         Handle a case of identical-name-and-type-name.
1585         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1586         resolution by storing the results of expression resolution back
1587         into the "probes" array.
1588
1589 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1590
1591         Fix cs0208-7.cs and cs0208-8.cs.
1592         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1593         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1594         error reporting to point out the reason a struct is not unmanaged.
1595
1596 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1597
1598         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1599           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1600
1601 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1602
1603         Fix #74528.
1604         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1605         IdenticalNameAndTypeName here.
1606         (EventExpr.InstanceResolve): Likewise.
1607
1608 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1609
1610         C# 2.0 DefaultCharSetAttribute implementation
1611         
1612         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1613         which allows us to set GlobalNamespace for every resolve.
1614         (Attribute.ResolveArguments): Cut from Resolve.
1615         (Attribute.GetCharSetValue): Returns CharSet named argument.
1616         (Attribute.DefinePInvokeMethod): Gets default charset from
1617         module settings.
1618         (GlobalAttribute.ResolveAsTypeStep): Override.
1619         (GlobalAttribute.ResolveArguments): Override.
1620         
1621         * class.cs (TypeAttr): Is protected.
1622         
1623         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1624         (ModuleClass.DefaultCharSetType): New memeber.
1625         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1626         
1627         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1628         charset from module.
1629         
1630         * delegate.cs (TypeAttr): Override.
1631         (Delegate.DefineType): Use this TypeAttr.
1632         
1633         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1634         at very early stage (before types are defined) to resolve model
1635         module attributes. It will probably not work with corlib but it
1636         should be ok.
1637         
1638         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1639         charset from module.
1640         
1641         * typemanager.cs (default_charset_type): New type.
1642
1643 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1644
1645         * decl.cs (MemberCache.AddMethods): Don't warn if
1646         System.Object.Finalize has buggy MethodAttributes.
1647
1648         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1649         removed below.
1650
1651 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1652
1653         * doc.cs : detect ambiguous reference to overloaded members.
1654           Fixed bug #71603. MS 1.1 csc does not detect it.
1655
1656 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1657
1658         * doc.cs : delegates must not be referenced with parameters.
1659           Fixed bug #71605.
1660
1661 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1662
1663         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1664
1665 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1666
1667         * driver.cs (MainDriver): Stop processing if the CLS stage found
1668         errors. 
1669
1670         (CompilerCallableEntryPoint.InvokeCompiler): Always
1671         reset after execution;   Take a TextWriter argument for the
1672         output.
1673
1674         * report.cs: Use the error stream instead of hardcoding stderr. 
1675
1676 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1677
1678         * class.cs: Reduce code paths to test, too small of an
1679         optimization to make it worth the extra testing.  Always perform
1680         it. 
1681
1682 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1683
1684         Fix #74510.
1685         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1686         operators that had errors reported on them.
1687
1688 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1689
1690         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1691         argument types.
1692         (Attribute.Resolve): Add named argument type checking.
1693         
1694         * class.cs (FixedField.Define): Use IsPrimitiveType
1695         
1696         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1697         
1698         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1699         unsafe parameter types.
1700         
1701         * statement.cs (Using.ResolveExpression): Add better error description.
1702         
1703         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1704         
1705 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1706
1707         Fix #74484.
1708         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1709         AttributeUsageAttribute in the emitcontext of the attribute class,
1710         not in the emitcontext of the attributable entity it was attached to.
1711         * cs-parser.jay: Use 'current_class', not 'current_container',
1712         when creating a GlobalAttribute.
1713
1714 2005-04-08  Alp Toker  <alp@atoker.com>
1715
1716         * pending.cs: The fix to #58413 failed to compile methods implementing
1717         interfaces with/without params modifiers and vice versa, even though
1718         params modifiers aren't part of the signature. Make the modifier check
1719         less strict as in csc.
1720
1721 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1722             Anoob V E  <projectmonokochi@rediffmail.com>
1723             Harilal P R  <projectmonokochi@rediffmail.com>
1724
1725         Fix #58413.
1726         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1727         modifiers of pending methods.
1728         (PendingImplementation.PendingImplementation): Initialize it.
1729         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1730         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1731         with ParameterData.  Add check for modifiers.
1732         * class.cs (MethodData.Define): Update to changes.
1733
1734 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1735
1736         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1737
1738 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1739
1740         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1741         property.
1742         
1743         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1744         
1745         * rootcontext.cs,
1746         * typemanager.cs: Registered RequiredAttributeAttribute.
1747         
1748 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1749
1750         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1751         Warning CS0169 is back at level 3.
1752         (IMethodData.SetMemberIsUsed): New method.
1753         
1754         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1755         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1756         
1757         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1758
1759         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1760         contants.
1761         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1762         is used.
1763         
1764         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1765         is used.
1766         
1767         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1768         to avoid the problems with nested types.
1769
1770 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1771             Anoob V.E  <projectmonokochi@rediffmail.com>
1772             Harilal P.R  <projectmonokochi@rediffmail.com>
1773             Raja R Harinath  <rharinath@novell.com>
1774
1775         Fix #73820.
1776         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1777         attribute.
1778         * typemanager (GetConstructor): Make public.
1779
1780 2005-04-05  John Luke  <john.luke@gmail.com>
1781             Raja R Harinath  <rharinath@novell.com>
1782
1783         Fix #62232.
1784         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1785         struct too.  Return false quicker in a few cases.
1786         (VerifyUnManaged): Use it.
1787
1788 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1789
1790         Fix #74041.
1791         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1792         not 'unreachable_seen'.
1793
1794 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1795
1796         * attribute.cs (Attribute.GetValue): Removed unused.
1797         
1798         * codegen.cs (CodeGen.TrimExt): Removed unused.
1799         
1800         * cs-parser.jay (output): Removed unused.
1801         
1802         * cs-tokenizer.cs (hex_digits): Removed unused.
1803         
1804         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1805         
1806         * expression.cs (Indirection.LoadExprValue): Removed unused.
1807         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1808         
1809         * iterators.cs (Iterator.param_types): Removed unused.
1810         
1811         * statement.cs (Goto.block): Removed unused.
1812         (ToplevelBlock.did): Removed unused.
1813         (Switch.ResolveConstantSwitch): Removed unused.
1814
1815 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1816
1817         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1818         resetting thingy.
1819
1820 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1821
1822         Fix #74232 and cs0208-3.cs.
1823         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1824         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1825         unmanaged type.  Don't use FieldBuilders when 't' is a
1826         TypeBuilder.  Use ModFlags and MemberType fields.
1827         * class.cs (MemberBase.member_type): Rename from MemberType.
1828         (MemberBase.MemberType): New property.  Determines member_type on
1829         demand.
1830         (MemberBase.DoDefine): Don't initialize MemberType here.
1831         (FieldMember.Define): Likewise.
1832
1833 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1834
1835         Fix #74241
1836         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1837         Attributes are emitted there.
1838         
1839 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1840
1841         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1842         keyword in 'partial enum' too.
1843         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1844         is not allowed).
1845         Report from Kamil Skalski <nazgul@omega.pl>.
1846
1847         Fix #74309.
1848         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1849         have partial containers too.
1850
1851         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1852         in block' checks to Block.CheckInvariantMeaningInBlock.
1853         * statement.cs (Block.GetKnownVariableInfo): Make private.
1854         (Block.IsVariableUsedInChildBlock): Remove.
1855         (Block.IsVariableUsedInBlock): Likewise.
1856         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1857         conflicting declaration.
1858         (Block.AddVariable): Make error messages less long-winded and more
1859         specific.  Show location of conflicting declaration.
1860         * parameter.cs (Parameters.Location): New readonly property.
1861
1862 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1863
1864         Clean up semantics of invoking ResolveMemberAccess.
1865         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1866         can have an instance, ensure that we pass in a non-TypeExpression
1867         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1868         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1869         argument.  Update to changes and simplify.
1870         (FieldExpr.Emitinstance): Remove CS0120 check.
1871         (PropertyExpr.EmitInstance): Likewise.
1872         * expression.cs (Argument.Resolve): Likewise.
1873         (Invocation.DoResolve): Update to changes in semantics of
1874         InstanceExpression.
1875
1876 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1877
1878         Fix #74241
1879         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1880         customization.
1881         
1882         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1883
1884 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1885
1886         Fix difference in behaviour with commandline invocation.
1887         * driver.cs (Driver.Reset): New.
1888         (CompilerCallableEntryPoint): Call it.
1889
1890         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1891         variable" warnings if the boolean expression failed to resolve.
1892
1893 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1894
1895         * attribute.cs: Fix the union of several permissions when some of them
1896         are unrestricted (so the result isn't an unrestricted permission set).
1897         Fix #74036.
1898
1899 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1900
1901         * ecore.cs (MemberExpr): New class.  Convert from interface
1902         IMemberExpr.
1903         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1904         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1905         error checks.
1906         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1907         (MethodGroupExpr.IsExplicitImpl): Remove.
1908         (Expression.GetFieldFromEvent): Remove.
1909         (SimpleName.MemberStaticCheck): Remove.
1910         (SimpleName.DoSimpleNameResolve): Update to changes.
1911         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1912         (MemberAccess.IdenticalNameAndTypeName): Remove.
1913         (MemberAccess.error176): Move to MemberExpr.
1914         (MemberAccess.DoResolve): Update to changes.
1915         (BaseAccess.DoResolve): Likewise.
1916
1917 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1918
1919         C# 2.0 Conditional attribute class implementation
1920         
1921         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1922         Analyzes class whether it has attribute which has ConditionalAttribute
1923         and its condition is not defined.
1924         
1925         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1926         (Class.IsExcluded): New method. Search for at least one defined
1927         condition in ConditionalAttribute of attribute class.
1928
1929 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1930
1931         * ecore.cs (PropertyExpr): Derive from Expression, not
1932         ExpressionStatement.
1933         (PropertyExpr.EmitStatement): Remove.
1934
1935 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1936
1937         Fix #74060.
1938         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1939         internal field "value__" of an enum be private.  The examples for
1940         "value__" that I found on MSDN all used FieldAttributes.Private.
1941
1942         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1943         Don't mention IL method attribute names.
1944
1945         Fix #47991.  Remove a TODO.
1946         * statement.cs (Block.Toplevel): Make into a field.
1947         (Block.Parameters): Move into ToplevelBlock.
1948         (Block.known_variables): Rename from child_variable_names.
1949         (Block.Block): Remove variants that take Parameters.  Initialize
1950         'Toplevel' with the immediately surrounding toplevel block.
1951         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1952         LocalInfo parameter.
1953         (Block.GetKnownVariableInfo): New.
1954         (Block.IsVariableNameUsedInChildBlock): Update.
1955         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1956         the block, even though it may not be in scope.
1957         (Block.AddVariable): Remove Parameters parameter.  Use
1958         Toplevel.Parameters instead.
1959         (Block.AddConstant): Remove Parameters parameter.
1960         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1961         (Block.IsParamaterReference): Likewise.
1962         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1963         (ToplevelBlock.Parameters): New.  Moved from Block.
1964         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1965         initialize Parameters to a non-null value.
1966         * cs-parser.jay: Update to changes.
1967         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1968         simple names that mean different things in the same block.  Use
1969         Block.IsVariableNameUsedInBlock.
1970
1971 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1972
1973         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1974         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1975         GetTypeHandle.  It is possible for a reflected type to derive from
1976         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1977         System.Array during mscorlib compilation).
1978         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1979         contain a method_hash, don't create one either.  Don't create a
1980         deep copy of the base cache's method_hash.
1981         (MemberCache.SetupCache): Rename back from DeepCopy.
1982         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1983         already initialized.  If we see an override function, add its
1984         underlying base virtual function to the member_hash too.
1985
1986         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1987
1988 2005-03-26  Raja R Harinath  <harinath@acm.org>
1989
1990         Fix #73038.
1991         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1992         fails to resolve, ensure that the LHS is still resolved as an
1993         lvalue.
1994
1995 2005-03-25  Raja R Harinath  <harinath@acm.org>
1996
1997         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1998         ec.ContainerType.
1999         (Enum.current_ec): Remove.
2000         (Enum.LookupEnumValue): Remove EmitContext argument.
2001         Just uses the one created during DefineType.
2002         (Enum.FindMembers): Update.
2003         * expression.cs (MemberAccess.DoResolve): Update.
2004
2005 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2006
2007         * assign.cs (Assign.DoResolve): Check for CS1717 when
2008         source and target are same (uses Equals).
2009
2010         * expression.cs (LocalVariableReference, ParameterReference,
2011         This): Implemented Equals, GetHashCode.
2012
2013         * statement.cs (Block.GetParameterReference): Removed useless
2014         local variable.
2015
2016 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2017
2018         Fix cs0128.cs
2019         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2020         blocks before deciding whether the error is cs0136 or cs0128.
2021
2022         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2023         (using_alias_directive, using_namespace_directive): Pass
2024         MemberName, not an expression to Namespace.UsingAlias and
2025         Namespace.Using.
2026         (MakeName): Use the MemberName of the namespace.
2027         * namespace.cs (Namespace.MemberName): New.
2028         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2029         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2030         Likewise.
2031         * decl.cs (MemberName.Name): Make readonly.
2032         (MemberName.FromDotted): New "constructor".
2033         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2034         (MemberCore.Name): Compute from MemberName on demand.
2035         (MemberCore.SetMemberName): Provide a way to change the
2036         MemberName.
2037         (MemberCore.AddToContainer): Don't take a fullname parameter.
2038         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2039         fully qualified name of the container to the member name.
2040         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2041         only if the type is a member of the root container.
2042         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2043         MemberName.Left rather than searching for an embedded ".".
2044         (PartialContainer.CreatePart): Update to changes in RootContext.
2045         (MemberBase.ShortName): Turn into a property.  Use
2046         MemberCore.SetMemberName.
2047         (MemberBase.ExplicitInterfaceName): Remove.
2048         (MemberBase.UpdateMemberName): Remove.
2049         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2050         (PropertyBase.SetMemberName): New override.
2051         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2052         (Tree.GetDecl): New.
2053         (Tree.AllDecls): Rename from Decls.
2054         * attribute.cs, enum.cs, report.cs: Update to changes.
2055         * driver.cs (MainDriver): Use MemberName.FromDotted on
2056         RootContext.MainClass.
2057
2058 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2059
2060         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2061         checks.
2062
2063         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2064
2065 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2066
2067         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2068         property accessor modifiers.
2069
2070         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2071         fixed buffer attribute (CS1716).
2072         (PropertyMethod.HasCustomAccessModifier): When property accessor
2073         has custom modifier.
2074
2075         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2076         modifiers.
2077         (PropertyExpr.DoResolveLValue): Add CS0272.
2078
2079 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2080
2081         * convert.cs: When converting to a pointer, use the proper Conv.U
2082         or Conv.I depending on the source data type.
2083
2084         * cs-tokenizer.cs: Make the size for large decimal constants,
2085         fixes #72957.
2086
2087 2005-03-17  Martin Baulig  <martin@ximian.com>
2088
2089         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2090         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2091
2092 2005-03-17  Martin Baulig  <martin@ximian.com>
2093
2094         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2095         to bool so we can return an error condition.
2096         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2097         returned an error.
2098
2099 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2100
2101         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2102         attributes.
2103
2104 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2105
2106         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2107         Refactor to avoid traversing the list of assemblies, and to avoid
2108         string concatenation.
2109         * typemanager.cs (guid_attr_type): Remove.
2110         (negative_hits, pointers, references): Remove hashes.
2111         (type_hash): New.
2112         (GetConstructedType): New.  Uses type_hash to handle constructed
2113         types (arrays, references, pointers).
2114         (GetReferenceType, GetPointerType): Use it.
2115         (GetNestedType): New.  Uses type_hash to handle nested types of
2116         reflected types.
2117         (LookupType, LookupTypeDirect): Remove.
2118         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2119         'types' hash and LookupTypeReflection directly.
2120         (params_string, params_object): Use GetConstructedType.
2121         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2122         top-level types.
2123         (Namespace.Lookup): Use cached_types.
2124         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2125         provided by old TypeManager.LookupType.
2126         * rootcontext.cs (MakeFQN): Remove.
2127         * decl.cs (DeclSpace.MakeFQN): Likewise.
2128         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2129         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2130         TypeManager.GetConstructedType.
2131         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2132
2133 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2134
2135         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2136         indexers.
2137
2138         * cs-parser.jay: Reports CS1527 for any namespace element.
2139
2140         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2141         Added CS0407.
2142
2143         * expression.cs (ParameterReference.IsAssigned): Changed error to
2144         CS0269.
2145         (Error_WrongNumArguments): Moved CS0245 detection here.
2146
2147         * statement.cs (Return.Resolve): Add CS1622 report.
2148
2149 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2150
2151         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2152
2153 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2154
2155         * attribute.cs expression.cs: Get rid of some allocations.
2156
2157 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2158
2159         * doc.cs : just eliminate the latest change.
2160
2161 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2162
2163         * doc.cs : commented out the latest change. It breaks xml-030.cs
2164
2165 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2166
2167         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2168           fail. So invoke CreateType() in FindDocumentedType().
2169
2170 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2171
2172         * cs-tokenizer.cs : added IsKeyword().
2173         * doc.cs : Detect keyword incorrectly used as identifier.
2174           Allow identifiers prefixed by @.
2175
2176 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2177
2178         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2179         It caused exception in namespace resolving (again!).
2180         
2181         * class.cs (Class.ctor): Removed exit.
2182         (PropertyMethod.ctor): ditto.
2183         
2184         * codegen.cs (Codegen.Reset): Reset static data.
2185         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2186         
2187         * cs-tokenizer.cs (Cleanup): Removed.
2188         
2189         * driver.cs (GetSystemDir): Rewrote to one line command.
2190         It caused problem with unloaded dynamic modules.
2191         (UnixParseOption): Removed Exit.
2192         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2193         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2194         Now can be mcs used as library.
2195         
2196         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2197         empty location.
2198         
2199         * location.cs (Reset): Reset static data.
2200         
2201         * namespace.cs (Reset): Reset static data.
2202         
2203         * report.cs (Report.Reset): Reset static data.
2204         
2205         * rootcontext.cs (RootContext.Reset): Reset static data.
2206         
2207         * tree.cs (RootTypes.ctor): Use Location.Null
2208         
2209         * typemanager.cs (TypeManager.Reset): Reset static data.
2210         (CoreLookupType): Removed Exit.
2211         (TypeHandle.Reset): Reset static data.
2212         
2213 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2214
2215         Fix #73516.
2216         * typemanager.cs (ComputeNamespaces): Import namespaces from
2217         referenced modules too.
2218
2219 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2220
2221         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2222         than '.'.
2223
2224 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2225
2226         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2227         enclosing DeclSpace.  This ensures that a name-lookup populates
2228         more caches and there are fewer 'TypeExpression's.  Carve out
2229         nested type lookup into ...
2230         (LookupNestedTypeInHierarchy): ... this.
2231
2232 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2233
2234         Clean up a few partial-class semantics.  
2235         Fixes test-357.cs and cs1618-2.cs.
2236         * cs-parser.jay (struct_declaration): Use 'current_class' as
2237         parent of newly-created struct.  Remove call to Register ().
2238         Use 'pop_current_class' to complete handing the current struct.
2239         (interface_declaration): Likewise.
2240         (class_declaration): Likewise.
2241         (enum_declaration): Use 'current_class' as parent of newly created
2242         enum.
2243         (delegate_declaration): Likewise.
2244         (pop_current_class): New function.  This is used to handle closing
2245         up the 'current_class' and 'current_container', and pointing them
2246         to the enclosing class/container.
2247         (CSharpParser): Initialize 'current_class' too.
2248         * decl.cs (MemberCore): Add check for invariant: a partial
2249         container is not a parsed entity, and thus does not enclose any
2250         parsed members.
2251         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2252         (DeclSpace.BaseTypeExpr): Use it.
2253         (DeclSpace.LookupType): Add check for invariant.
2254         * class.cs (TypeContainer): Add check for invariant: a nested
2255         class should have the same NamespaceEntry as its enclosing class.
2256         (TypeContainer.EmitFieldInitializers): Make virtual.
2257         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2258         MemberCore.
2259         (TypeContainer.Register): Remove.
2260         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2261         null.  Use TypeResolveEmitContext for resolving base types and
2262         interfaces.  Move initialization of Parts.TypeBuilder here from
2263         ...
2264         (TypeContainer.DefineNestedTypes): ... here.
2265         (PartialContainer): Take a Namespace not a NamespaceEntry.
2266         (PartialContainer.Create): Don't use Register.  Call the
2267         appropriate Add... function directly.
2268         (ClassPart): Take both the PartialContainer and the enclosing
2269         class as constructor arguments.
2270         (ClassPart.EmitFieldInitializers): Override.
2271         (ClassPart.PartFindNestedTypes): Remove.
2272         (FieldBase.GetInitializerExpression): Resolve the initializer
2273         expression in the emit context of the enclosing class.
2274         * tree.cs (RootTypes): Remove Register ().
2275         
2276 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2277
2278         * cs-parser.jay: Removed CS0134.
2279         
2280         * driver.cs: Removed CS1901.
2281         
2282         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2283         for predefined types.
2284
2285 2005-03-07  Duncan Mak  <duncan@novell.com>
2286
2287         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2288         well. Fixes bug #73454.
2289
2290 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2291
2292         * cs-tokenizer.cs (xtoken): Add CS1035.
2293         
2294         * class.cs (MethodData.Define): Add CS0683.
2295         (FieldMember.ctor): Add CS0681.
2296
2297 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2298
2299         * ecore.cs (SimpleName.DoResolve): Rename from
2300         SimpleName.DoResolveAllowStatic.
2301         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2302         Pass 'intermediate' flag to MemberStaticCheck.
2303         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2304         of "intermediate" lookups via MemberAccess.
2305         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2306         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2307
2308 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2309
2310         Fix #73394.
2311         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2312         slipped in because of variable names that are identical to a
2313         builtin type's BCL equivalent ('string String;', 'int Int32;').
2314         (PropertyExpr.EmitInstance): Likewise.
2315
2316 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2317
2318         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2319         
2320         * report.cs (warning_ignore_table): Made public.
2321
2322 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2323
2324         Fix #73282.
2325         * class.cs (MethodData.Emit): Pass 'container' to
2326         container.GetObsoleteAttribute instead of 'container.Parent'.
2327
2328 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2329
2330         * cs-parser.jay: Add 1534 error test.
2331
2332         * iterators.cs (Yield.CheckContext): Add error 1629.
2333         (Iterator.ctor): Save unsafe modifier.
2334         (MoveNextMethod.DoEmit): Restore unsafe context.
2335
2336         * namespace.cs (UsingAlias): Better error message.
2337
2338 2005-03-03  Dan Winship  <danw@novell.com>
2339
2340         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2341         the warning message [#73219]
2342
2343 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2344
2345         Fix compile with MCS 1.0.0.0.
2346         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2347         w_restore to not depend on string constant folding.
2348
2349 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2350
2351         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2352         CS0246 check to users who passed 'silent = false'.
2353         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2354         check.
2355         (SimpleName.SimpleNameResolve): Update.
2356         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2357         (MemberAccess.IdenticalNameAndTypeName): Update.
2358         * doc.cs (FindDocumentedTypeNonArray): Update.
2359
2360 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2361
2362         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2363         * parameters.cs (ComputeAndDefineParameters): Remove.
2364         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2365         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2366         Use GetParameterInfo.
2367
2368 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2369
2370         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2371
2372 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2373
2374         Unify DeclSpace.LookupType and DeclSpace.FindType.
2375         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2376         is in charge of defining nested types on demand.
2377         (DeclSpace.LookupType): Use it when the current_type is a
2378         TypeBuilder.  Use LookupTypeDirect for reflected types.
2379         (DeclSpace.FindType): Remove.
2380         (DeclSpace.LookupInterfaceOrClass): Likewise.
2381         (DeclSpace.DefineTypeAndParents): Likewise.
2382         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2383         DeclSpace.LookupType.
2384         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2385         * typemanager.cs (LookupType): Simplify.
2386         (AddUserType): Remove type from negative_hits.
2387         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2388         * class.cs (TypeContainer.FindMembers): Move handling of nested
2389         types ...
2390         (TypeContainer.FindMembers_NestedTypes): ... here.
2391         (TypeContainer.FindNestedType): Implement override.
2392         (ClassPart.FindNestedType): Delegate to PartialContainer.
2393         (ClassPart.PartFindNestedType): Looks up the nested types of the
2394         part alone.
2395
2396 2005-03-02  Martin Baulig  <martin@ximian.com>
2397
2398         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2399         static constructor in static classes.
2400
2401 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2402
2403         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2404         sizeParamIndex is not specified.
2405
2406 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2407
2408         Fix #73117
2409         * report.cs (WarningMessage.IsEnabled): Missing null check.
2410
2411 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2412
2413         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2414         in the fields and not in the properties.
2415
2416 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2417
2418         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2419         fields as well.
2420
2421 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2422
2423         * attribute.cs: Small refactoring (improved robustness).
2424         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2425         (ValidateGuid): Removed.
2426         (Resolve): Removed referenced to above mentioned.
2427         (GetAttributeUsage): Made private and changed to work without
2428         class assistance.
2429         (GetIndexerAttributeValue): Don't crash.
2430         (GetConditionalAttributeValue): Ditto.
2431         (GetClsCompliantAttributeValue): Ditto.
2432         (ExtractSecurityPermissionSet): All attributes exceptions are
2433         error 648.
2434         (GetPropertyValue): New helper.
2435         (GetMethodImplOptions): New method.
2436         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2437         some missing properties.
2438         
2439         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2440         (Method.ApplyAttributeBuilder): Updated.
2441         
2442         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2443         exception.
2444
2445 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2446
2447         Fix #73052.
2448         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2449         non-simple types (array, pointer, reference).
2450
2451 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2452
2453         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2454
2455         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2456         for operators.
2457         (Method.CheckBase): Catch wrong destructor here.
2458         (MethodData.Define): Add errors 550, 668.
2459
2460         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2461
2462         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2463
2464         * pending.cs (VerifyPendingMethods): Add error 551.
2465
2466         * typemanager.cs (CSharpName): Next error report helper.
2467
2468 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2469
2470         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2471         attributes. Removed useless attribute double check.
2472         It saves almost 2MBs for corlib.
2473
2474 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2475
2476         Fix #72924.
2477         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2478         called twice in case of error.
2479
2480 2005-02-23  Chris Toshok  <toshok@ximian.com>
2481
2482         Fix compiler portions of #72827.
2483         * statement.cs (Block.Emit): call Begin/EndScope on the
2484         EmitContext instead of the ILGenerator.
2485
2486         * codegen.cs (EmitContext.BeginScope): new method, call
2487         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2488         we have one.)
2489         (EmitContext.BeginScope): same, but EndScope and CloseScope
2490
2491         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2492         offset and call the superclass's OpenScope(int) with it.
2493         (SymbolWriter.CloseScope): get the current il
2494         offset and call superclass's CloseScope(int) with it.
2495
2496 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2497
2498         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2499         CS1677 for out and ref as well.
2500
2501         * class.cs (Method.Define): Add error CS1599 detection.
2502         
2503         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2504         
2505         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2506         
2507         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2508         
2509         * support.cs.cs (ModifierDesc): New helper method.
2510
2511 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2512             Abin Thomas  <projectmonokochi@rediffmail.com>
2513             Anoob V E  <projectmonokochi@rediffmail.com>
2514             Harilal P R  <projectmonokochi@rediffmail.com>
2515
2516         Fix #57851, #72718.
2517         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2518         MemberLookup (used for error reporting) actually returns a result.
2519         Fix error report number (122, not 112).
2520
2521 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2522             Anoob V E  <projectmonokochi@rediffmail.com>
2523             Harilal P R  <projectmonokochi@rediffmail.com>
2524
2525         Fix #71134.
2526         * pending.cs (PendingImplementation.GetAbstractMethods):
2527         Find NonPublic members too.
2528
2529 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2530
2531         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2532         Fixed error 217.
2533         
2534         * class.cs (MethodCore.CheckMethodAgainstBase):
2535         Add error 239 report.
2536
2537 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2538
2539         Fix #68955.
2540         * expression.cs (Invocation.IsApplicable): Make public.
2541         (Invocation.IsParamsMethodApplicable): Likewise.
2542         * delegate.cs (Delegate.VerifyApplicability): Don't use
2543         Invocation.VerifyArgumentCompat for parameter applicability
2544         testing.  Use Invocation.IsApplicable and
2545         Invocation.IsParamsMethodApplicable.
2546
2547 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2548
2549         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2550         
2551         * class.cs (Operator.Define): Add error 217 report.
2552         
2553 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2554
2555         * namespace.cs (UsingEntry.Resolve): Undo change below.
2556
2557 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2558
2559         Fix #72756.
2560         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2561         disable the error message when the extended MemberLookup also
2562         fails.
2563         (Expression.MemberLookupFinal): Update.
2564         (SimpleName.DoSimpleNameResolve): Update.
2565         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2566         Don't use MemberLookupFinal.
2567         (New.DoResolve): Update.
2568         (BaseAccess.CommonResolve): Update.
2569
2570 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2571
2572         Fix #72732.
2573         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2574         occured previously, don't resolve again.
2575
2576 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2577
2578         Fix #69949
2579         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2580         argument. Call ResolveAttributeUsage for unresolved.
2581         when types doesn't match ctor arguments.
2582         
2583         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2584         for nested attribute classes.
2585         (Class.attribute_usage): Removed.
2586         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2587         for attribute class.
2588         
2589         * ecore.cs (IsAttribute): Removed.
2590         
2591         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2592         
2593         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2594         now normal types.
2595         (attribute_types): Removed.
2596         (EmitCode): Global attributes are emited as the latest.
2597
2598 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2599
2600         * class.cs (EmitFieldInitializers): Don't emit field initializer
2601         for default values when optimilization is on.
2602         
2603         * constant.cs (Constant.IsDefaultValue): New property.
2604         
2605         * driver.cs: Add /optimize handling.
2606         
2607         * constant.cs,
2608         * ecore.cs,
2609         * literal.cs: Implement new IsDefaultValue property.
2610         
2611         * rootcontext.cs (Optimize): New field, holds /optimize option.
2612
2613 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2614
2615         Fix crasher in re-opened #72347.
2616         * namespace.cs (Namespace.Lookup): Return null if
2617         DeclSpace.DefineType returns null.
2618
2619         Fix #72678.
2620         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2621
2622 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2623
2624         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2625         now returns null if it cannot resolve to an lvalue.
2626         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2627         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2628         returned null.  Remove check for SimpleName.
2629         (EventExpr.DoResolveLValue): New.
2630         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2631         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2632         error from ...
2633         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2634         avoid CS0131 error.
2635         (Unary.ResolveOperator): Move CS0211 check ...
2636         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2637         CS0131 error.
2638         (Unary.DoResolveLValue): Simplify.
2639         (AddressOf.DoResolveLValue): New.
2640         (ArrayAccess.DoResolveLValue): New.
2641
2642 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2643
2644         * attribute.cs (Attribute.Resolve): Add arguments casting for
2645         when types doesn't match ctor arguments.
2646
2647 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2648
2649         Fix parts of #63202.
2650         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2651         lookup of operator in base type.  Ensure that all checks happen
2652         when the operator resolves to an "op_..." method.
2653
2654 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2655
2656         Fix #71992.
2657         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2658         'ignore_cs0104' parameter.  Pass it to ...
2659         (NamespaceEntry.Lookup): ... this.
2660         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2661         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2662         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2663         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2664         Update.  Request that cs0104 errors be ignored.
2665         (ComposedCast.ResolveAsTypeStep): Update.
2666
2667 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2668
2669         Fix #59209.
2670         * expression.cs (Invocation.BetterFunction): Remove support for
2671         comparing virtual functions and their overrides.
2672         (Invocation.IsOverride): New.
2673         (Invocation.OverloadResolve): Don't consider 'override' functions
2674         during candidate selection.  Store them in a lookaside list.
2675         If the selected method is a 'virtual' function, use the list to
2676         find any overrides that are closer to the LHS type.
2677
2678 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2679
2680         * expression.cs (New.DoResolve): Add complex core type reduction.
2681         (New.Constantify): Converts complex core type syntax like 'new int ()'
2682         to simple constant.
2683         
2684 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2685
2686         * decl.cs (EntryType.EntryType): New constructor to create an
2687         updated copy of a cache entry.
2688         (MemberCache.AddMethods): Use it.
2689         (MemberCache.ClearDeclaredOnly): Remove.
2690         (MemberCache.MemberCache): Update.
2691
2692 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2693
2694         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2695         variable.  This one is represents the actual low-level declaration
2696         of the method, as opposed to the semantic level `IsStatic'.   
2697
2698         An anonymous method which is hosted into a static method might be
2699         actually an instance method.  IsStatic would reflect the
2700         container, while MethodIsStatic represents the actual code
2701         generated.
2702
2703         * expression.cs (ParameterReference): Use the new MethodIsStatic
2704         instead of IsStatic.
2705
2706         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2707         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2708         set on the current EmitContext. 
2709
2710         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2711         resolve our casted expression as an LValue.  This triggers the
2712         proper LValue processing that is later required by Assign.
2713
2714         This fixes 72347.
2715
2716         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2717
2718 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2719
2720         C# 2.0 Fixed buffer implementation
2721
2722         * anonymous.cs: Update after RegisterHelperClass renaming.
2723
2724         * attribute.cs (AttributeTester.fixed_buffer_cache):
2725         Cache of external fixed buffers.
2726         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2727         implementation if field is fixed buffer else null.
2728
2729         * class.cs
2730         (TypeContainer.AddField): Accept FieldMember instead of Field.
2731         (FieldBase.IsFieldClsCompliant): Extracted code from
2732         VerifyClsCompliance descendant customization.
2733         (FixedField): New class handles fixed buffer fields.
2734         (FixedFieldExternal): Keeps information about imported fixed
2735         buffer.
2736         (IFixedField): Make access to internal or external fixed buffer
2737         same.
2738
2739         * cs-parser.jay: Add fixed buffer parsing.
2740
2741         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2742         buffer.
2743
2744         * expression.cs (Indirection): Extended implementation to accept
2745         fixed buffer field.
2746         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2747         (ElementAccess.MakePointerAccess): Get type as parameter.
2748         (DoResolve): Add fixed buffer field expression conversion.
2749         (DoResolveLValue): Ditto.
2750         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2751         (ArrayPtr): Derives from FixedBufferPtr.
2752         (ArrayPtr.Emit): Add extra emit for array elements.
2753
2754         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2755
2756         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2757         for compiler generated types.
2758         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2759
2760         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2761         and consume less memory.
2762         (Fixed.Resolve): Add fixed buffer case.
2763
2764         * typemanager.cs (compiler_generated_attr_ctor,
2765         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2766         (HasElementType): Add our own implementation to work on every
2767         runtime.
2768
2769 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2770
2771         * anonymous.cs (CaptureContext): Track whether `this' has been
2772         referenced.   
2773
2774         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2775         only captured `this' if it was implicitly done (instance
2776         methods/variables were used). 
2777
2778         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2779         `this' must be captured.
2780
2781 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2782  
2783         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2784         is null it means that there has been no need to capture anything,
2785         so we just create a sibling.
2786
2787         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2788
2789         Just a partial fix.  The other half is fairly elusive.
2790         
2791 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2792
2793         Fix #52586, cs0121-4.cs.
2794         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2795         and return a hashtable.
2796         (MemberCache.ClearDeclaredOnly): New.
2797         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2798         the method_hash of a base type too.
2799         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2800         type methods.  Overwrite entries with the same MethodHandle so
2801         that the ReflectedType is correct.  The process leaves in base
2802         virtual functions and their overrides as distinct entries.
2803         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2804         matters since it was boxed in a ArrayList before.
2805         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2806         modifier.
2807         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2808         case of a virtual function and its override (choose the overload
2809         as better).
2810         (Invocation.OverloadResolve): Avoid 'override' members during
2811         'applicable_type' calculation.
2812
2813 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2814
2815         Combine two near-redundant caches.
2816         * typemanager.cs (method_params): Rename from method_internal_params.
2817         (TypeManager.GetParameterData): New.  Replace
2818         Invocation.GetParameterData.
2819         (TypeManager.LookupParametersByBuilder): Remove.
2820         * expression.cs (Invocation.method_parameter_cache): Remove.
2821         (Invocation.GetParameterData): Remove.
2822         Update to changes.
2823         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2824         Update to changes.
2825
2826 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2827
2828         Fix #72015.
2829         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2830         TypeManager.multicast_delegate_type is null, resolve it by looking
2831         up "System.MulticastDelegate".
2832         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2833
2834 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2835             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2836             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2837
2838         Fix cs0164.cs.
2839         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2840         (LabeledStatement.AddReference): New.  Set 'referenced'.
2841         (Goto.Resolve): Use it.
2842
2843 2005-02-05  John Luke  <john.luke@gmail.com>
2844
2845         * driver.cs: remove duplicate -doc line in Usage ()
2846
2847 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2848
2849         * location.cs (Location.AddFile): Fix CS2002 error report.
2850
2851 2005-02-02  Martin Baulig  <martin@ximian.com>
2852
2853         * delegate.cs (Delegate.DefineType): Report an internal error if
2854         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2855         details.        
2856
2857 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2858
2859         Fix a crasher in a variant of #31984.
2860         * const.cs (Constant.CheckBase): New override that defers the
2861         new-or-override check in case the base type hasn't been populated
2862         yet.
2863         (Constant.Define): Ensure the new-or-override check is performed.
2864
2865 2005-02-01  Duncan Mak  <duncan@ximian.com>
2866
2867         * const.cs (LookupConstantValue): Check that `ce' is not null
2868         before calling GetValue ().
2869
2870 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix test-334.cs (#69519).
2873         * cs-parser.jay (using_alias_directive): Pass in an expression to
2874         NamespaceEntry.UsingAlias.
2875         (using_namespace_directive): Pass in an expression to
2876         NamespaceEntry.Using.
2877         (namespace_name): Don't flatten to a string.
2878         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2879         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2880         ResolveAsTypeStep.
2881         (NamespaceEntry.UsingEntry): Likewise.
2882         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2883         changes.
2884         (NamespaceEntry.LookupForUsing): Remove.
2885         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2886         names.
2887         (NamespaceEntry.Lookup): Remove support for dotted names.
2888
2889 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2890
2891         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2892         split into two.
2893         (NamespaceEntry.ImplicitParent): Compute on demand.
2894         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2895         parallels the current.
2896         (NamespaceEntry.LookupForUsing): Use it.
2897         (NamespaceEntry.Lookup): If the current namespace-entry is
2898         implicit, don't search aliases and using tables.
2899
2900 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2901
2902         Fix #31984.
2903         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2904         BaseCache here.
2905         (TypeContainer.BaseCache): Compute on demand.
2906         (TypeContainer.FindMembers): Define constants and types if they're
2907         not already created.
2908         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2909         check.
2910         * const.cs (Constant.Define): Make idempotent.
2911
2912 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2913
2914         * pending.cs: Produce better code (no nops produced by using Ldarg
2915         + value).
2916         
2917         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2918         i - 1' it should be arg + 1.
2919
2920         Fixes bug #71819.
2921
2922 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2923
2924         * attribute.cs (Attribute.CheckAttributeType): Make private
2925         non-virtual.
2926         (Attribute.ResolveType): Make virtual.
2927         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2928         handling of RootContext.Tree.Types.
2929
2930 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2931
2932         Update attribute-handling to use the SimpleName/MemberAccess
2933         mechanisms.
2934         * cs-parser.jay (attribute): Pass in an expression to the
2935         constructors of Attribute and GlobalAttribute.
2936         * attribute.cs (Attribute): Take an expression for the name.
2937         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2938         passed in attribute name expression.
2939         (Attribute.CheckAttributeType): Use it.
2940         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2941         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2942         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2943         argument to prevent error messages if the lookup fails.
2944
2945 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2946
2947         * expression.cs (Indirection): Implemented IVariable interface
2948         to support indirection in AddressOf operator.
2949         (PointerArithmetic.Emit): Add optimalization for case where
2950         result can be precomputed.
2951
2952 2005-01-26  Martin Baulig  <martin@ximian.com>
2953
2954         * class.cs (TypeContainer.AttributeTargets): Return the correct
2955         AttributeTargets depending on our `Kind' instead of throwing an
2956         exception; fixes #71632.
2957
2958 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2959
2960         Fix #71257
2961         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2962         constant members.
2963
2964 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2965
2966         Fix #71602.
2967         * expression.cs (MemberAccess.DoResolve): Don't complain with
2968         cs0572 when the LHS of a member access has identical name and type
2969         name.
2970
2971 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2972
2973         Fix #71651, #71675
2974         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2975         CreatePermission.
2976         Create custom PermissionSet only for PermissionSetAttribute.
2977
2978 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2979
2980         Fix #71649
2981         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2982         delegates in static class.
2983
2984 2005-01-24  Martin Baulig  <martin@ximian.com>
2985
2986         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2987         merging an implicit block, just use its reachability.
2988
2989         * statement.cs (Block.Resolve): Make the unreachable code check
2990         work wrt. implicit blocks; see test-337 from #63842.
2991
2992 2005-01-21  Alp Toker  <alp@atoker.com>
2993  
2994         * cs-parser.jay: destructor_declaration's container is PartialContainer
2995         not Class when partial types are used, so use Kind prop instead of
2996         'is'.
2997         
2998 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2999
3000         * cs-parser.jay: Improve error reporting when an interface
3001         declares new types.
3002
3003 2005-01-20  Dick Porter  <dick@ximian.com>
3004
3005         * support.cs: SeekableStreamReader fix from Sandor Dobos
3006         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3007         chars are read.  Fixes bug 70369.
3008
3009 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3010
3011         * cs-parser.jay (catch_clause): Simplify current_block handling
3012         somewhat.
3013
3014 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3015
3016         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3017         code with ImplicitStandardConversion to handle the implicit
3018         conversion of method groups into valid delegate invocations. 
3019
3020         The problem is that in parameter handling we were using this code
3021         path.  Fixes bug #64698
3022
3023 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3024
3025         * cs-parser.jay: Fix several infelicities.
3026         - Avoid assigning to the parser value stack.  Code like 
3027           '$3 = null' is unclean.  Synthesize a value for the code block
3028           instead. 
3029         - Avoid using oob_stack for storing location information.  Use ...
3030         (_mark_): ... this.  New (empty) rule.  Saves the current location
3031         in $$.
3032         (foreach_statement): Avoid using oob_stack for current_block
3033         handling.  Use technique used in for_statement and
3034         using_statement.  Synthesize a value for the code block to store
3035         additional intermediate information.
3036
3037 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3038
3039         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3040         of a different type is only allowed to private fields of a
3041         containing type, not on fields of a base class.
3042
3043         See test-174.cs and error cs0122-9.cs
3044
3045 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3046
3047         Fix test-335.cs (bug #58126).
3048         * cs-parser.jay (argument): Split out non-expression parts of the
3049         rule into 'non_simple_argument'.
3050         (invocation_expression): Support parenthesized invocations with
3051         multiple arguments, and with single non-simple arguments.
3052
3053 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3054
3055         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3056         places.
3057
3058 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3059
3060         Fix cs0038-1.cs, cs1640-6.cs.
3061         * ecore.cs (Expression.Resolve): Remove special-case for
3062         SimpleName in error-handling.
3063         (Expression.almostMatchedMembers): Relax access permission to
3064         protected.
3065         (Expression.MemberLookupFailed): Handle duplicates in
3066         almostMatchedMembers list.
3067         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3068         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3069         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3070         overload if the passed in MemberInfo is a MethodBase.
3071
3072 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3073
3074         Fix #70749
3075         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3076         for non-CAS & merge permission sets properly.
3077
3078 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3079
3080         Improve standard-compliance of simple name and member access 
3081         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3082         * ecore.cs (FullNamedExpression): New abstract base class 
3083         for Namespaces and TypeExpressions.
3084         (ResolveFlags.SimpleName): Remove.
3085         (SimpleName): Remove support for dotted names.
3086         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3087         DeclSpace.FindType and DeclSpace.LookupType.
3088         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3089         (Expression.ExprClassName): Make member function.
3090         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3091         a namespace.  Remove creation of dotted "SimpleName"s.
3092         (MemberAccess.DoResolve): Likewise.
3093         * decl.cs (DeclSpace.Cache): Make private.
3094         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3095         (DeclSpace.FindType): Update.
3096         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3097         FullNamedExpression.
3098         * namespace.cs (Namespace): Derive from FullNamedExpression
3099         so that it can be part of expression resolution.
3100         (Namespace.Lookup): Return an FullNamedExpression.
3101         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3102         namespace.
3103         * rootcontext.cs (NamespaceLookup): Remove.
3104         (LookupType): Move to DeclSpace.
3105         * attribute.cs (CheckAttributeType): Update.
3106         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3107         (FindDocumentedTypeNonArray): Likewise.
3108
3109 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3110
3111         Fix cs0509.cs, cs1632.cs.
3112         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3113         is the same as IsInterface.
3114         (TypeContainer.GetClassBases): Likewise.
3115         * statement.cs (LabeledStatement.ig): New field.
3116         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3117         label.
3118         (LabeledStatement.DoEmit): Check that the label was created with
3119         the same ILGenerator.
3120
3121 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3122
3123         Fix #71058
3124         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3125         accessors to its properties.
3126
3127         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3128         from accessors to property.
3129         
3130 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3131
3132         Fix #70722
3133         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3134         only for overrides.
3135         
3136 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3137
3138         * attribute.cs: Check for null and empty strings.  
3139
3140         I have lost another battle to Paolo.
3141
3142 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3143
3144         Fix #70942
3145         * class.cs (PropertyMethod): Set Parent field in ctors.
3146         (SetMethod.InternalParameters): Add unsafe switch hack.
3147         Override MarkForDuplicationCheck where it is appropriate.
3148
3149         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3150         It says whether container allows members with the same name.
3151         Base default is no.
3152         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3153         Removed is_method parameter.
3154
3155 2005-01-06  Duncan Mak  <duncan@ximian.com>
3156
3157         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3158         because the previous change led to incorrect reporting of CS1032
3159         ("Cannot define/undefine preprocessor symbols after first token in
3160         file"). Instead of using `tokens_seen' as the only flag that
3161         triggers CS1040, introduce `comments_seen'. This new flag is used
3162         to signify having seen comments on the current line, so it is
3163         unset after a newline.
3164
3165 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3166
3167         * doc.cs : When searching for a type, find nested type too.
3168           This fixes bug #71040.
3169
3170 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3171
3172         * doc.cs :
3173           - Warn missing member comment on those classes which also does not
3174             have doc comments. Fixed bug #71041.
3175           - Don't warn missing doc comment on default constructor.
3176             Fixed bug #71042.
3177
3178 2005-01-06  Duncan Mak  <duncan@ximian.com>
3179
3180         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3181         comments, set `tokens_seen' to true. This allows us to detect
3182         misplaced preprocessor directives (i.e. not at the beginning of
3183         the a line, nor after whitespaces). In that case, report error
3184         CS1040. This fixes bug #56460.
3185
3186         * cs-parser.jay (interface_member_declaration): Add checks for
3187         IsExplicitImpl, and report CS0541 error if an interface member is
3188         defined as an explicit interface declaration.
3189
3190 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3191
3192         Fix #70817
3193         * class.cs (PropertyMethod): Set Parent field in ctors.
3194         (SetMethod.InternalParameters): Add unsafe switch hack.
3195         
3196         * decl.cs (MemberCore.Parent): Cannot be readonly.
3197
3198 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3199
3200         * decl.cs (DeclSpace.ResolveType): Remove.
3201         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3202         Merge in code from ...
3203         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3204         * class.cs, enum.cs: Update to changes.
3205
3206 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3207
3208         * anonymous.cs: Ensure that we init the scope of our parent if it
3209         has not been initialized yet.
3210
3211 2004-12-30  Duncan Mak  <duncan@ximian.com>
3212
3213         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3214         if field.FieldBuilder is null. Fixes #70758.
3215
3216         * convert.cs: Fixed some typos and updated some of the comments.
3217         (ImplicitStandardConversionExists):
3218         (TryImplicitIntConversion): If `target_type' is an interface and
3219         the type of `ic' implements this interface, return true or a new
3220         BoxedCast instead of null. This fixes #70468.
3221
3222 2004-12-29  Duncan Mak  <duncan@ximian.com>
3223
3224         * expression.cs (Argument.Emit): Check that Expr is
3225         IMemoryLocation before casting to it, and report CS1510 otherwise.
3226
3227         This fixes #70402.
3228
3229 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3230
3231         * statement.cs (Block.ThisVariable): remove the recursion here, to
3232         make the --profile more sane.
3233
3234 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3235
3236         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3237         assembly, by JB Evain.
3238
3239 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3240
3241         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3242           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3243         "parent" refers to enclosing type/class.  "base" refers to superclass.
3244
3245 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3246
3247         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3248         Ensure that we only have GlobalAttributes.
3249         * attribute.cs (Attribute.Emit): Make non-virtual.
3250         (GlobalAttribute.Emit): Remove.
3251         (Attribute.Resolve): Make virtual.
3252         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3253         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3254         the argument. Don't create one.
3255         (Attribute.GetObsoleteAttribute): Likewise.
3256         (Attribute.GetClsCompliantAttributeValue): Likewise.
3257         * class.cs, decl.cs: Update to changes.
3258
3259 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3260
3261         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3262         
3263         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3264         
3265         * statement.cs (Foreach.Resolve): Add error 186 report.
3266
3267 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3268
3269         * expression.cs (Conditional.DoResolve): Add warning 429.
3270         
3271         * statement.cs (If.Resolve): Add warning 665.
3272
3273 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3274
3275         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3276         except when in the parser, and in GlobalAttribute.
3277         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3278         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3279         RootContext.Tree.Types.NamespaceEntry once work is done.
3280         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3281         and resets RootContext.Tree.Types.NamespaceEntry.
3282
3283 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3284
3285         * cs-parser.jay: Don't create a block for every variable.
3286
3287 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3288
3289         * location.cs: Provide extra information.
3290
3291         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3292         variables from the captured environment, it is the ldarg_0.
3293
3294 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3295
3296         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3297         find a conclusion.
3298         
3299         * class.cs: Changed warning level for 169 to avoid developer
3300         displeasure from warning flooding. It will be changed back when they
3301         fix most of current BCL warnings.
3302         
3303         * RootContext.cs: Pushed default WarningLevel to 3.
3304         
3305         * statement.cs: Removed unused variable.
3306
3307 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3308
3309         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3310         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3311         Add error 502 report.
3312         (StaticClass.DefineType): Add error 441 report.
3313         (Class.AllowedModifiersProp): New virtual property as temporary
3314         extension to AllowedModifiers.
3315         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3316         to share implementation with StaticClass and don't call virtual
3317         methods from ctor.
3318         
3319         * driver.cs (MainDriver): Add error 1558 test.
3320
3321         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3322         report. Moved error 36 test here.
3323
3324         * statement.cs (Throw.Resolve): Add error 724 report.
3325
3326         * typemanager.cs: Add out_attribute_type core type.
3327         
3328 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3329
3330         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3331         3018 report.
3332         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3333
3334         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3335         3017 report.
3336         
3337         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3338
3339         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3340         Add error 3023 report.
3341         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3342
3343         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3344         implementation.
3345
3346 2004-12-12  John Luke  <john.luke@gmail.com>
3347
3348         * driver.cs (AddArgs): take -- into account when
3349         adding arguments, fixes bug 65710 
3350
3351 2004-12-12  Martin Baulig  <martin@ximian.com>
3352
3353         * expression.cs (Unary.TryReduceNegative): Added support for
3354         SByteConstant and ByteConstant.
3355         (Unary.Reduce): Check error values from TryReduceNegative().
3356
3357 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3358
3359         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3360         and report exception as error 182.
3361
3362 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3363
3364         * driver.cs (Main): Fix message when there are warnings.
3365
3366 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3367
3368         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3369
3370 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3371
3372         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3373         Reduced number of warnings.
3374         
3375         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3376
3377 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3378
3379         * driver.cs: Removed message.
3380
3381         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3382
3383 2004-12-08    <vargaz@freemail.hu>
3384
3385         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3386
3387 2004-12-08  Martin Baulig  <martin@ximian.com>
3388
3389         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3390         instead of a CS3002 for properties and indexer.
3391
3392 2004-12-08  Martin Baulig  <martin@ximian.com>
3393
3394         * decl.cs (MemberName.ToString): Make this work again.
3395
3396 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3397
3398         * attribute.cs (Resolve): Add error 591 detection.
3399
3400         * class.cs (FieldMember.Define): Add error 1547 detection.
3401         (Indexer.Define): Add error 620 detection.
3402         (Operator.Define): Add error 590 detection.
3403
3404         * ecore.cs: Missing argument for error 79.
3405
3406         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3407         detection.
3408
3409 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3410
3411         Fix #70106
3412         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3413         only.
3414
3415 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3416
3417         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3418           Some operator comments were suppressed.
3419         * doc.cs : Implicit/explicit operator name in doc comments are like
3420           "op_Explicit(type)~returnType", so added suffix handling.
3421
3422 2004-12-07  Martin Baulig  <martin@ximian.com>
3423
3424         * decl.cs
3425         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3426         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3427         (DeclSpace.ec): New protected field; store the EmitContext here.
3428         (DeclSpace.EmitContext): New public property; moved here from
3429         `TypeContainer'.
3430         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3431         EmitContext.
3432
3433         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3434         (Enum.Emit): Don't create a new EmitContext.
3435
3436         * delegate.cs (Delegate.DefineType): Always create the
3437         EmitContext.
3438
3439         * iterators.cs (Iterators.DefineIterator): Create a new
3440         EmitContext and store it in `ec'.
3441
3442 2004-08-24  Martin Baulig  <martin@ximian.com>
3443
3444         * typemanager.cs
3445         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3446         this for accessibility checks.
3447         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3448         IsNestedFamilyAccessible.
3449         (TypeManager.IsSubclassOf): New method, do what the name actually
3450         says.   
3451
3452 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3453
3454         Fix crash on cs0657-17.cs.
3455         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3456         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3457         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3458         the case where the NamespaceEntry gets overwritten.
3459
3460 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3461
3462         Fixed #69195, #56821
3463         * ecore.cs (ResolveBoolean): Tiny refactoring.
3464
3465         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3466         of right expression resolving when left is false constant and
3467         operator is LogicalAnd OR true constant and operator is LogicalOr.
3468
3469         * statement.cs (ResolveUnreachable): Always reports warning.
3470
3471 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3472
3473         * class.cs: Distinguish between 1721 and 1722 (just a little help
3474         for the programmer).
3475
3476 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3477
3478         * delegate.cs: Only allow this on new versions of the language. 
3479
3480 2004-12-02  Duncan Mak  <duncan@ximian.com>
3481
3482         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3483         Expression class.
3484         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3485         here as a static method. Take an additional bool out parameter
3486         `must_do_cs1540_check' for signaling to InstanceResolve.
3487         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3488         member field from PropertyExpr class and made it an argument of
3489         the method instead.
3490         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3491         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3492         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3493         and `remove_accessor' as well as InstanceResolve: report CS0122
3494         where applicable.
3495
3496         Fixes #70129.
3497
3498 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3499
3500         Fix test-327.cs, test-328.cs, and put in early infrastructure
3501         for eventually fixing #52697.
3502         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3503         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3504         from other methods.
3505         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3506         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3507         (VerifyUsing, error246): Update.
3508         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3509         'NamespaceEntry.LookupNamespaceOrType'.
3510
3511 2004-12-03  Martin Baulig  <martin@ximian.com>
3512
3513         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3514         method as our child, call AnonymousMethod.Compatible() on it.
3515
3516 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3517
3518         Disable XML documentation support in 'basic' profile.
3519         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3520         Redirect XmlElement to System.Object.
3521         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3522         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3523         * mcs.exe.sources: Add doc-bootstrap.cs.
3524         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3525         of doc.cs.
3526
3527 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3528
3529         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3530           comments are allowed.
3531
3532 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3533
3534         * delegate.cs: Add checks for subtypes in paramaters and return values
3535         in VerifyMethod () to add support for Covariance/Contravariance
3536         in delegates.
3537         
3538 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3539
3540         * report.cs: Remove extra closing parenthesis.
3541
3542         * convert.cs (Error_CannotImplicitConversion): If the name of the
3543         types are the same, provide some extra information.
3544
3545         * class.cs (FieldBase): Use an unused bit field from the field to
3546         encode the `has_offset' property from the FieldMember.  This saves
3547         a couple of Ks on bootstrap compilation.
3548
3549         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3550         method as our child, return the AnonymousMethod resolved
3551         expression.
3552
3553         * expression.cs (New.DoResolve): Allow return values from
3554         NewDelegate to also include AnonymousMethods.
3555
3556         Fixes #70150.
3557
3558 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3559
3560         Fix bug #70102
3561         * attribute.cs (Resolve): Improved implementation of params
3562         attribute arguments.
3563
3564         * support.cs (ParameterData): Add HasParams to be faster.
3565
3566 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3567
3568         all things are for /doc support:
3569
3570         * doc.cs: new file that supports XML documentation generation.
3571         * mcs.exe.sources: added doc.cs.
3572         * driver.cs:
3573           Handle /doc command line option.
3574           Report error 2006 instead of 5 for missing file name for /doc.
3575           Generate XML documentation when required, after type resolution.
3576         * cs-tokenizer.cs:
3577           Added support for picking up documentation (/// and /** ... */),
3578           including a new XmlCommentState enumeration.
3579         * cs-parser.jay:
3580           Added lines to fill Documentation element for field, constant,
3581           property, indexer, method, constructor, destructor, operator, event
3582           and class, struct, interface, delegate, enum.
3583           Added lines to warn incorrect comment.
3584         * rootcontext.cs :
3585           Added Documentation field (passed only when /doc was specified).
3586         * decl.cs:
3587           Added DocComment, DocCommentHeader, GenerateDocComment() and
3588           OnGenerateDocComment() and some supporting private members for
3589           /doc feature to MemberCore.
3590         * class.cs:
3591           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3592         * delegate.cs:
3593           Added overriden DocCommentHeader.
3594         * enum.cs:
3595           Added overriden DocCommentHeader and GenerateDocComment().
3596
3597 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3598
3599         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3600         unwrapping the enumeration values, chain to
3601         DoConstantNumericPromotions again, so we can promote things to the
3602         fundamental types (takes care of enums that are bytes, sbytes).
3603
3604         Fixes bug #62054.
3605
3606 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3607
3608         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3609         Fix long-standing bug in type-lookup.  Use FindType instead of
3610         LookupType when ec.ResolvingTypeTree.
3611         (Attribute.ResolveType, Attribute.Resolve)
3612         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3613         Update to changes.
3614         (Attributes.Search): Remove internal version.  Update.
3615         (Attributes.SearchMulti): Update.
3616         (Attributes.GetClsCompliantAttribute): Remove.
3617         (Attributes.GetIndexerNameAttribute): Remove.
3618         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3619         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3620         * class.cs (Indexer.Define): Likewise.
3621
3622 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3623
3624         Fix bug #68790
3625         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3626         MarshallByReference members access.
3627
3628         * expression.cs: Use CheckMarshallByRefAccess;
3629         Better error CS0197 message.
3630
3631         * report.cs: Print whole related error message.
3632
3633 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3634
3635         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3636         the current directory to help debugging.
3637
3638 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3639
3640         * class (GetClassBases): Better error 60 report.
3641         (EventProperty): Disabled warning 67 detection.
3642
3643 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3644
3645         Fix bug #60324
3646         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3647
3648         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3649         precise values.
3650
3651 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3652
3653         Fix bug #49488
3654         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3655
3656         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3657
3658 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3659
3660         * attribute.cs (Attribute.Resolve): Refine error reporting and
3661         report a cs0117 if the identifier does not exist, to distinguish
3662         from 0617 which is a miss-use of the actual identifier.
3663
3664         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3665         between cs0070 and cs0079.
3666
3667         * class.cs (MemberBase.DoDefine): When reporting a wrong
3668         accessibility level, we use MethodCore to compare instead of
3669         Method (this was a regression in some refactoring effort).
3670
3671         So now we correctly report cs0056 again.
3672
3673         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3674         testing the target_type (which was known to be object_type) and
3675         not the source type (which is anonymous_method).
3676
3677         Fixed reporting of error cs1660.
3678
3679         * expression.cs (UserCast.Source): Expose the underlying cast.
3680
3681         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3682         allowed types to find a match to int32 first (most common).
3683
3684         In addition, it ignores any ImplicitUserConversions that did an
3685         internal implicit conversion (as the switch statement allows only
3686         one integral conversion to exist).
3687
3688         * class.cs (PartialContainer.Create): rename `name' to
3689         `member_name' for clarity.  Then replace the string calls with a
3690         call to MemberName.GetPartialName, as now using
3691         MemberName.ToString is an error (this is due to the side effects
3692         it had, that were fixed in the past).
3693
3694         This will restore the error reporting on a number of partial class
3695         errors that were missusing this (and getting an exception as a
3696         results, which is now just a plain textual warning, because
3697         yyparse debug output would crash otherwise).
3698
3699 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3700
3701         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3702
3703 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3704
3705         * rootcontext.cs (LookupType): Make sure to cache lookups that
3706         don't give us a negative result. This saves about 5% of corlib
3707         compilation time.
3708
3709 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3710
3711         * report.cs (AbstractMessage.Print): messages are sent to stderr
3712
3713         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3714         non-interface in the list of interfaces (at this point, either
3715         parent was properly set, or a base class is being listed in the
3716         interfaces section).
3717
3718         This flags error 1722, and resolves the crash from bug 69259.
3719
3720 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3721
3722         * statement.cs (Using.EmitExpressionFinally): make this work right
3723         for valuetypes. Fixes 69926.
3724
3725 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3726
3727         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3728         converted to an enum" here, before we try to change the underlying
3729         type.  This code exists, but it is a different code path than the
3730         one used while encoding constants.
3731
3732         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3733         old bug: when converting from the null literal to a pointer,
3734         return an EmptyCast, not the NullLiteral.
3735
3736         This fixes #69921, the recent null_type changes probably made this
3737         bug more prominent.
3738
3739         (ImplicitReferenceConversionExists): In addition, resynchronized
3740         the code here, so it matches the same code in
3741         ImplicitReferenceConversionExists for the `from any class-type S
3742         to any interface-type T'.
3743         
3744
3745 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3746
3747         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3748
3749 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3750
3751         * cs-parser.jay: Use verbosity accordingly. 
3752
3753 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3754
3755         * expression.cs (Unary.ResolveOperator): Do not report warning;
3756         AddressOf reads from variable.
3757         
3758         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3759
3760 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3761
3762         Fix bug #69462
3763
3764         * attribute.cs (Attributable): Removed CheckTargets.
3765         (Attributes.Emit): Explicit attribute targets are tested here.
3766
3767         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3768         not enabled for interfaces.
3769
3770         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3771         (GetAssemblyName): Ouch next bug there.
3772
3773 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3774
3775         * expression.cs: Error 275 added.
3776         
3777 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3778
3779         Fix bug #69177 (Implemented decimal constant support)
3780
3781         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3782         (BinaryFold): Add DecimalConstant.
3783
3784         * const.cs (Define): Decimal constant 
3785         (is not constant.
3786         (ChangeType): Add decimal type handling.
3787         (LookupConstantValue): Don't set value for decimal type but
3788         emit DecimalConstantAttribute. Needed for constant optimization.
3789
3790         * constant.cs (ToDecimal): New method.
3791         (ConvertToDecimal): New method.
3792         (IntConstant): Implemented ConvertToDecimal.
3793         (DecimalConstant.Emit): Emit optimized version for decimals in
3794         int range.
3795
3796         * expression.cs (ResolveOperator): Changed order of constant
3797         reduction to work correctly with native types which have
3798         overloaded operators.
3799         (ResolveMemberAccess): Extract constant value from attribute
3800         for decimal type.
3801
3802         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3803
3804         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3805         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3806         (ChangeType): Decimal is special.
3807         (TypeToCoreType): Add decimal type.
3808
3809 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3810
3811         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3812         decimal types.
3813
3814 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3815
3816         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3817         test cs1667-5.cs.
3818
3819 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3820
3821         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3822
3823         * pending.cs (PendingImplementation): Grab only interfaces.
3824
3825 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3826
3827         * statement.cs (ForeachHelperMethods): Add location member and
3828         error 202 detection.
3829
3830 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3831
3832         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3833         automatically handled by executable.make.
3834         (PROGRAM): Make profile-specific.
3835
3836 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3837
3838         * expression.cs (DoResolveBase): Fixed wrong warning for out
3839         variables.
3840
3841 2004-11-18  Martin Baulig  <martin@ximian.com>
3842
3843         Merged latest changes into gmcs.  Please keep this comment in
3844         here, it makes it easier for me to see what changed in MCS since
3845         the last time I merged.
3846
3847 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3848
3849         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3850         (TypeHandle.GetMemberCache): New.
3851         (TypeHandle.TypeHandle): Update.
3852         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3853         (TypeManager.LookupParentInterfacesCache):
3854         Rename from LookupInterfaceCache.  Optimize slightly.
3855         (TypeManager.MemberLookup_FindMembers): Update.
3856         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3857         multi-type variant.
3858         (AddCacheContents): Rename from AddHashtable.
3859         * class.cs (TypeContainer.parent_container): Remove.
3860         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3861         (TypeContainer.DoDefineMembers): Don't initialize it.
3862         Update to name changes.
3863         
3864 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3865
3866         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3867         that factors the code to check access modifiers on override.  
3868
3869         (PropertyBase): Use the code here.
3870
3871         Patch from Lluis S'anchez, fixes bug #69361.
3872
3873 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3874
3875         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3876         routine that is used to report the use of a captured variable
3877         whose address has been taken.
3878
3879         There are two checks: one when variables are being captured and
3880         the other check is when the address of a variable is taken. 
3881         
3882         (because an anonymous methods might be resolved before *or* after
3883         the address has been taken) and 
3884
3885         * expression.cs (Conditional.DoResolve): Remove the special
3886         casing that Martin added to trueExpr and falseExpr being both
3887         NullLiteral.  We get the right behavior now just by introducing
3888         the null_type into the compiler. 
3889
3890         * convert.cs (ExplicitConversion): Change the code to use
3891         null_type instead of testing `expr is NullLiteral'.
3892         (ImplicitConversionStandard): use null_type too.
3893         (ImplicitReferenceConversionExists): use null_type too.
3894         (ImplicitReferenceConversion): use null_type too.
3895
3896         * literal.cs: The type of `NullLiteral' is now null_type instead
3897         of object_type. 
3898         (Resolve): Set the type here.
3899
3900         * typemanager.cs: Introduce null_type.
3901
3902 2004-11-17  Martin Baulig  <martin@ximian.com>
3903
3904         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3905         direction, like FindMembers() does.  Fixes #69546, testcase is in
3906         test-315.cs.    
3907
3908 2004-11-16  Martin Baulig  <martin@ximian.com>
3909
3910         This is based on a patch from Marek Safar, see bug #69082.
3911         Fixes bugs #63705 and #67130.
3912
3913         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3914         method; create a MemberCache for an interface type and cache the
3915         result.
3916
3917         * decl.cs (IMemberContainer.ParentContainer): Removed.
3918         (IMemberContainer.ParentCache): New property.
3919         (MemberCache.SetupCacheForInterface): Removed.
3920         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3921         to create a cache for an interface's "parent".
3922
3923         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3924         interfaces too.
3925
3926 2004-11-16  Martin Baulig  <martin@ximian.com>
3927
3928         Merged back from gmcs; these changes already went into gmcs a
3929         couple of weeks ago.
3930
3931         * typemanager.cs
3932         (TypeManager.AddUserType): Removed the `ifaces' argument.
3933         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
3934         `TypeExpr []'.
3935         (TypeManager.AddUserInterface): Removed.
3936         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
3937         `TypeExpr []'.
3938         (TypeManager.GetInterfaces): Likewise.
3939         (TypeManager.GetExplicitInterfaces): Likewise.
3940
3941         * ecore.cs (TypeExpr.GetInterfaces): Removed.
3942
3943         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
3944         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
3945
3946 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3947
3948         * statement.cs: Avoid adding bools to a hashtable.
3949
3950 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3951
3952         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3953         calling an unsafe method from a safe location.
3954
3955 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3956
3957         Fix #69167
3958         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3959
3960 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3961
3962         * namespace.cs (VerifyUsing): use GetPartialName instead of
3963         ToString. 
3964
3965 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3966
3967         * statement.cs (Return.Resolve): Fix regression in typo: if
3968         `in_exc', we have to request a NeedReturnLabel, this was a typo
3969         introduced in the anonymous method check-in.  Fixes #69131.
3970
3971         * Indexers were using the ShortName when defining themselves,
3972         causing a regression in the compiler bootstrap when applying the
3973         patch from 2004-11-02 (first part), now they use their full name
3974         and the bug is gone.
3975
3976 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3977
3978         * driver.cs: Strip the path from the names of embedded resources. Fixes
3979         #68519.
3980
3981 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3982
3983         Fix error message regression: cs0104-2.cs.
3984         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3985         (AliasEntry.Resolve): Update.
3986         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3987         'silent' flag.
3988         (RootContext.LookupType): Update.
3989
3990 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3991
3992         * cs-parser.jay: Add support for handling accessor modifiers
3993         * class: Add support port accessor modifiers and error checking,
3994         define PropertyMethod.Define as virtual (not abstract anymore)
3995         * ecore.cs: Add checking for proeprties access with access modifiers
3996         * iterators.cs: Modify Accessor constructor call based in the modified
3997         constructor
3998 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3999
4000         * expression.cs (StringConcat): Handle being called twice,
4001         as when we have a concat in a field init with more than two
4002         ctors in the class
4003
4004 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4005
4006         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4007         special case explicit implementations, we should always produce
4008         the .property or .event declaration.
4009         
4010         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4011         since it will not return correct data if people use this
4012         unresolved in the presence of using statements (see test-313).
4013
4014         * class.cs (MethodData.Define): If we are an explicit interface
4015         implementation, set the method name to the full name of the
4016         interface plus the name of the method.  
4017
4018         Notice that using the method.MethodName.GetFullName() does not
4019         work, as it will only contain the name as declared on the source
4020         file (it can be a shorthand in the presence of using statements)
4021         and not the fully qualifed type name, for example:
4022
4023         using System;
4024
4025         class D : ICloneable {
4026                 object ICloneable.Clone ()  {
4027                 }
4028         }
4029
4030         Would produce a method called `ICloneable.Clone' instead of
4031         `System.ICloneable.Clone'.
4032
4033         * namespace.cs (Alias.Resolve): Use GetPartialName.
4034         
4035 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * cs-parser.jay: Add error 1055 report.
4038
4039 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4040
4041         * assign.cs (Assign.DoResolve): Only do the transform of
4042         assignment into a New if the types are compatible, if not, fall
4043         through and let the implicit code deal with the errors and with
4044         the necessary conversions. 
4045
4046 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4047
4048         * cs-parser.jay: Add error 1031 report.
4049
4050         * cs-tokenizer.cs: Add location for error 1038.
4051
4052 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4053
4054         * cs-parser.jay: Add error 1016 report.
4055
4056 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4057
4058         * cs-parser.jay: Add errors 1575,1611 report.
4059
4060 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4061
4062         * cs-parser.jay: Add error 1001 report.
4063
4064 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4065
4066         Fix #68850
4067         * attribute.cs (GetMarshal): Add method argument for
4068         caller identification.
4069
4070         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4071         agument for GetMarshal and RuntimeMissingSupport.
4072
4073 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4074
4075         * attribute.cs (ExtractSecurityPermissionSet): Removed
4076         TypeManager.code_access_permission_type.
4077
4078         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4079
4080 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4081
4082         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4083         for obsolete use of a variable here.   Fixes regression on errors
4084         cs0619-25 and cs0619-26.
4085
4086 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4087
4088         Fix #62358, implemented security attribute encoding.
4089
4090         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4091         Tests permitted SecurityAction for assembly or other types.
4092         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4093         data from SecurityPermissionAttribute to PermisionSet class.
4094
4095         * class.cs (ApplyAttributeBuilder): Added special handling
4096         for System.Security.Permissions.SecurityAttribute based types.
4097
4098         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4099         special handling for System.Security.Permissions.SecurityAttribute
4100         based types.
4101
4102         * enum.cs (ApplyAttributeBuilder): Added special handling
4103         for System.Security.Permissions.SecurityAttribute based types.
4104
4105         * parameter.cs (ApplyAttributeBuilder): Added special handling
4106         for System.Security.Permissions.SecurityAttribute based types.
4107
4108         * rootcontext.cs: Next 2 core types.
4109
4110         * typemanager.cs (TypeManager.security_permission_attr_type):
4111         Built in type for the SecurityPermission Attribute.
4112         (code_access_permission_type): Build in type.
4113
4114 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4115
4116         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4117         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4118         all of this information into
4119         EmitContext.EmitCapturedVariableInstance.
4120         
4121         * codegen.cs (EmitCapturedVariableInstance): move here the
4122         funcionality of emitting an ldarg.0 in the presence of a
4123         remapping.   This centralizes the instance emit code.
4124
4125         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4126         then emit a load of this: it means that we have reached the
4127         topmost ScopeInfo: the one that contains the pointer to the
4128         instance of the class hosting the anonymous method.
4129
4130         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4131         captures to the topmost CaptureContext.
4132
4133 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4134
4135         * expression.cs (LocalVariableReference): Move the knowledge about
4136         the iterators into codegen's EmitCapturedVariableInstance.
4137
4138 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4139
4140         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4141         all code paths return a value from an anonymous method (it is the
4142         same as the 161 error, but for anonymous methods).
4143
4144 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4145
4146         The introduction of anonymous methods in the compiler changed
4147         various ways of doing things in the compiler.  The most
4148         significant one is the hard split between the resolution phase
4149         and the emission phases of the compiler.
4150
4151         For instance, routines that referenced local variables no
4152         longer can safely create temporary variables during the
4153         resolution phase: they must do so from the emission phase,
4154         since the variable might have been "captured", hence access to
4155         it can not be done with the local-variable operations from the runtime.
4156         
4157         * statement.cs 
4158
4159         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4160         is a toplevel block.
4161
4162         (ToplevelBlock): A new kind of Block, these are the blocks that
4163         are created by the parser for all toplevel method bodies.  These
4164         include methods, accessors and anonymous methods.
4165
4166         These contain some extra information not found in regular blocks:
4167         A pointer to an optional CaptureContext (for tracking captured
4168         local variables and parameters).  A pointer to the parent
4169         ToplevelBlock.
4170         
4171         (Return.Resolve): Catch missmatches when returning a value from an
4172         anonymous method (error 1662).
4173         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4174         phase.
4175
4176         (Break.Resolve): ditto.
4177
4178         (SwitchLabel): instead of defining the labels during the
4179         resolution phase, we now turned the public ILLabel and ILLabelCode
4180         labels into methods called GetILLabelCode() and GetILLabel() that
4181         only define the label during the Emit phase.
4182
4183         (GotoCase): Track the SwitchLabel instead of the computed label
4184         (its contained therein).  Emit the code by using
4185         SwitchLabel.GetILLabelCode ().
4186
4187         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4188         whether the Local has been captured or not.
4189
4190         (LocalInfo.IsCaptured): New property, used to tell whether the
4191         local has been captured.
4192         
4193         * anonymous.cs: Vastly updated to contain the anonymous method
4194         support.
4195
4196         The main classes here are: CaptureContext which tracks any
4197         captured information for a toplevel block and ScopeInfo used to
4198         track the activation frames for various local variables.   
4199
4200         Each toplevel block has an optional capture context associated
4201         with it.  When a method contains an anonymous method both the
4202         toplevel method and the anonymous method will create a capture
4203         context.   When variables or parameters are captured, they are
4204         recorded on the CaptureContext that owns them, for example:
4205
4206         void Demo () {
4207              int a;
4208              MyDelegate d = delegate {
4209                  a = 1;
4210              }
4211         }
4212
4213         Here `a' will be recorded as captured on the toplevel
4214         CapturedContext, the inner captured context will not have anything
4215         (it will only have data if local variables or parameters from it
4216         are captured in a nested anonymous method.
4217
4218         The ScopeInfo is used to track the activation frames for local
4219         variables, for example:
4220
4221         for (int i = 0; i < 10; i++)
4222                 for (int j = 0; j < 10; j++){
4223                    MyDelegate d = delegate {
4224                         call (i, j);
4225                    }
4226                 }
4227
4228         At runtime this captures a single captured variable `i', but it
4229         captures 10 different versions of the variable `j'.  The variable
4230         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4231         recorded on a child.  
4232
4233         The toplevel ScopeInfo will also track information like the `this'
4234         pointer if instance variables were referenced (this is necessary
4235         as the anonymous method lives inside a nested class in the host
4236         type of the method). 
4237
4238         (AnonymousMethod): Expanded to track the Toplevel, implement
4239         `AnonymousMethod.Compatible' to tell whether an anonymous method
4240         can be converted to a target delegate type. 
4241
4242         The routine now also produces the anonymous method content
4243
4244         (AnonymousDelegate): A helper class that derives from
4245         DelegateCreation, this is used to generate the code necessary to
4246         produce the delegate for the anonymous method that was created. 
4247
4248         * assign.cs: API adjustments for new changes in
4249         Convert.ImplicitStandardConversionExists.
4250
4251         * class.cs: Adjustments to cope with the fact that now toplevel
4252         blocks are of type `ToplevelBlock'. 
4253
4254         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4255         insteda of standard blocks.
4256
4257         Flag errors if params arguments are passed to anonymous methods.
4258
4259         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4260         `CurrentAnonymousMethod' which points to the current Anonymous
4261         Method.  The variable points to the AnonymousMethod class that
4262         holds the code being compiled.  It is set in the new EmitContext
4263         created for the anonymous method.
4264
4265         (EmitContext.Phase): Introduce a variable and an enumeration to
4266         assist in enforcing some rules about when and where we are allowed
4267         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4268         only one that enfonces this right now).
4269
4270         (EmitContext.HaveCaptureInfo): new helper method that returns
4271         whether we have a CapturedContext initialized.
4272
4273         (EmitContext.CaptureVariable): New method used to register that a
4274         LocalInfo must be flagged for capturing. 
4275
4276         (EmitContext.CapturedParameter): New method used to register that a
4277         parameters must be flagged for capturing. 
4278         
4279         (EmitContext.CapturedField): New method used to register that a
4280         field must be flagged for capturing. 
4281
4282         (EmitContext.HaveCapturedVariables,
4283         EmitContext.HaveCapturedFields): Return whether there are captured
4284         variables or fields. 
4285
4286         (EmitContext.EmitMethodHostInstance): This is used to emit the
4287         instance for the anonymous method.  The instance might be null
4288         (static methods), this (for anonymous methods that capture nothing
4289         and happen to live side-by-side with the current method body) or a
4290         more complicated expression if the method has a CaptureContext.
4291
4292         (EmitContext.EmitTopBlock): Routine that drives the emission of
4293         code: it will first resolve the top block, then emit any metadata
4294         and then emit the code.  The split is done so that we can extract
4295         any anonymous methods and flag any captured variables/parameters.
4296         
4297         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4298         during this phase, the ILGenerator should not be used as labels
4299         and local variables declared here might not be accessible to any
4300         code that is part of an anonymous method.  
4301
4302         Exceptions to this include the temporary variables that are
4303         created by some statements internally for holding temporary
4304         variables. 
4305         
4306         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4307         metadata for a cb
4308
4309         (EmitContext.TemporaryReturn): This method is typically called
4310         from the Emit phase, and its the only place where we allow the
4311         ReturnLabel to be defined other than the EmitMeta.  The reason is
4312         that otherwise we would have to duplicate a lot of logic in the
4313         Resolve phases of various methods that today is on the Emit
4314         phase. 
4315
4316         (EmitContext.NeedReturnLabel): This no longer creates the label,
4317         as the ILGenerator is not valid during the resolve phase.
4318
4319         (EmitContext.EmitThis): Extended the knowledge in this class to
4320         work in anonymous methods in addition to iterators. 
4321
4322         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4323         code is necessary on the stack to access the instance to a local
4324         variable (the variable will be accessed as a field).
4325
4326         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4327         EmitContext.EmitAddressOfParameter): Routines to support
4328         parameters (not completed at this point). 
4329         
4330         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4331         will also remove the parameters.
4332
4333         * convert.cs (Convert): Define a `ConstantEC' which points to a
4334         null.  This is just to prefity some code that uses
4335         ImplicitStandardConversion code and do not have an EmitContext
4336         handy.
4337
4338         The idea is to flag explicitly that at that point in time, it is
4339         known that the conversion will not trigger the delegate checking
4340         code in implicit conversions (which requires a valid
4341         EmitContext). 
4342
4343         Everywhere: pass new EmitContext parameter since
4344         ImplicitStandardConversionExists now requires it to check for
4345         anonymous method conversions. 
4346
4347         (Convert.ImplicitStandardConversionExists): If the type of an
4348         expression is the anonymous_method_type, and the type is a
4349         delegate, we invoke the AnonymousMethod.Compatible method to check
4350         whether an implicit conversion is possible. 
4351
4352         (Convert.ImplicitConversionStandard): Only do implicit method
4353         group conversions if the language level is not ISO_1.
4354
4355         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4356         MethodInfo for the Invoke method.  used by Delegate and
4357         AnonymousDelegate.
4358
4359         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4360         method conversions if the target type is a delegate.
4361
4362         Removed extra debugging nops.
4363
4364         (LocalVariableReference): Turn the `local_info' into a public
4365         field. 
4366
4367         Add `prepared' field, the same hack used for FieldExprs to cope
4368         with composed assignments, as Local variables do not necessarily
4369         operate purely on the stack as they used to: they can be captured
4370         fields. 
4371
4372         Add `temp' for a temporary result, like fields.
4373
4374         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4375
4376         It now copes with Local variables that are captured and emits the
4377         proper instance variable to load it from a field in the captured
4378         case. 
4379
4380         (ParameterReference.DoResolveBase): During the resolve phase,
4381         capture parameters if we are in an anonymous method.
4382
4383         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4384         anonymous method, use the EmitContext helper routines to emit the
4385         parameter reference.
4386
4387         * iterators.cs: Set RemapToProxy to true/false during the
4388         EmitDispose class.
4389
4390         * parameters.cs (GetParameterByName): New helper method. 
4391
4392         * typemanager.cs (anonymous_method_type) a new type that
4393         represents an anonyous method.  This is always an internal type,
4394         used as a fencepost to test against the anonymous-methodness of an
4395         expression. 
4396         
4397 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4398
4399         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4400         561 report.
4401         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4402
4403 2004-10-18  Martin Baulig  <martin@ximian.com>
4404
4405         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4406         `Type' directly, but call ResolveType() on it.
4407         (Catch.Resolve): Likewise.
4408         (Foreach.Resolve): Likewise.
4409
4410 2004-10-18  Martin Baulig  <martin@ximian.com>
4411
4412         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4413         `Type' directly, but call ResolveType() on it.
4414         (Probe.DoResolve): Likewise.
4415         (ArrayCreation.LookupType): Likewise.
4416         (TypeOf.DoResolve): Likewise.
4417         (SizeOf.DoResolve): Likewise.
4418
4419 2004-10-18  Martin Baulig  <martin@ximian.com>
4420
4421         * expression.cs (Invocation.BetterFunction): Put back
4422         TypeManager.TypeToCoreType().
4423
4424 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4425
4426         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4427         the ResolveType.
4428
4429 2004-10-18  Martin Baulig  <martin@ximian.com>
4430
4431         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4432         `Type' directly, but call ResolveType() on it.
4433
4434 2004-10-18  Martin Baulig  <martin@ximian.com>
4435
4436         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4437         `Type' directly, but call ResolveType() on it.
4438         (MemberBase.DoDefine): Likewise.
4439
4440         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4441         `Type' directly, but call ResolveType() on it.
4442         (ComposedCast.DoResolveAsTypeStep): Likewise.
4443
4444         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4445         `Type' directly, but call ResolveType() on it.
4446
4447 2004-10-17  John Luke  <john.luke@gmail.com>
4448
4449         * class.cs (Operator.GetSignatureForError): use CSharpName
4450
4451         * parameter.cs (Parameter.GetSignatureForError): Returns
4452         correct name even if was not defined.
4453
4454 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4455
4456         Fix #65816.
4457         * class.cs (TypeContainer.EmitContext): New property.
4458         (DefineNestedTypes): Create an emitcontext for each part.
4459         (MethodCore.DoDefineParameters): Use container's emitcontext.
4460         Pass type array to InternalParameters.
4461         (MemberBase.DoDefine): Use container's emitcontext.
4462         (FieldMember.Define): Likewise.
4463         (Event.Define): Likewise.
4464         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4465         Pass type array to InternalParameters.
4466         (SetIndexerMethod.GetParameterInfo): Likewise.
4467         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4468         * delegate.cs (Define): Pass emitcontext to
4469         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4470         array to InternalParameters.
4471         * expression.cs (ParameterReference.DoResolveBase): Pass
4472         emitcontext to GetParameterInfo.
4473         (ComposedCast.DoResolveAsTypeStep): Remove check on
4474         ec.ResolvingTypeTree.
4475         * parameter.cs (Parameter.Resolve): Change argument to
4476         EmitContext.  Use ResolveAsTypeTerminal.
4477         (Parameter.GetSignature): Change argument to EmitContext.
4478         (Parameters.ComputeSignature): Likewise.
4479         (Parameters.ComputeParameterTypes): Likewise.
4480         (Parameters.GetParameterInfo): Likewise.
4481         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4482         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4483         * support.cs (InternalParameters..ctor): Remove variant that takes
4484         a DeclSpace.
4485         * typemanager.cs (system_intptr_expr): New.
4486         (InitExpressionTypes): Initialize it.
4487
4488 2004-10-12  Chris Toshok  <toshok@ximian.com>
4489
4490         * cs-parser.jay: fix location for try_statement and catch_clause.
4491
4492 2004-10-11  Martin Baulig  <martin@ximian.com>
4493
4494         * report.cs: Don't make --fatal abort on warnings, we have
4495         -warnaserror for that.
4496
4497 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4498
4499         More DeclSpace.ResolveType avoidance.
4500         * decl.cs (MemberCore.InUnsafe): New property.
4501         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4502         with newly created EmitContext.
4503         (FieldMember.Define): Likewise.
4504         * delegate.cs (Delegate.Define): Likewise.
4505         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4506         only if normal name-lookup fails.
4507         (TypeExpr.DoResolve): Enable error-checking.
4508         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4509         (SizeOf.DoResolve): Likewise.
4510         (ComposedCast.DoResolveAsTypeStep): Likewise.
4511         (StackAlloc.DoResolve): Likewise.
4512         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4513         (Block.Unsafe): New property.
4514         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4515         (Unsafe): Set 'unsafe' flag of contained block.
4516         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4517         (Fixed.Resolve): Likewise.
4518         (Catch.Resolve): Likewise.
4519         (Using.ResolveLocalVariableDecls): Likewise.
4520         (Foreach.Resolve): Likewise.
4521
4522 2004-10-05  John Luke <john.luke@gmail.com>
4523
4524         * cs-parser.jay: add location to error CS0175
4525
4526 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4527
4528         * ecore.cs (Expression.Constantity): Add support for turning null
4529         into a constant.
4530
4531         * const.cs (Const.Define): Allow constants to be reference types
4532         as long as the value is Null.
4533
4534 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4535
4536         * namespace.cs (NamespaceEntry.Using): No matter which warning
4537         level is set, check if this namespace name has already been added.
4538
4539 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4540
4541         * expression.cs: reftype [!=]= null should always use br[true,false].
4542         # 67410
4543
4544 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4545
4546         Fix #67108
4547         * attribute.cs: Enum conversion moved to 
4548         GetAttributeArgumentExpression to be applied to the all
4549         expressions.
4550
4551 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4552
4553         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4554         * class.c (TypeContainer.DefineType): Flag error if
4555         base types aren't accessible due to access permissions.
4556         * decl.cs (DeclSpace.ResolveType): Move logic to
4557         Expression.ResolveAsTypeTerminal.
4558         (DeclSpace.ResolveTypeExpr): Thin layer over
4559         Expression.ResolveAsTypeTerminal.
4560         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4561         Refactor code into NestedAccess.  Use it.
4562         (DeclSpace.NestedAccess): New.
4563         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4564         argument to silence errors.  Check access permissions.
4565         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4566         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4567         (Cast.DoResolve): Likewise.
4568         (New.DoResolve): Likewise.
4569         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4570         (TypeOf.DoResolve): Likewise.
4571
4572         * expression.cs (Invocation.BetterConversion): Return the Type of
4573         the better conversion.  Implement section 14.4.2.3 more faithfully.
4574         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4575         section 14.4.2.2 explicit.
4576         (Invocation.OverloadResolve): Update.
4577         (Invocation): Remove is_base field.
4578         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4579         (Invocation.Emit): Likewise.
4580
4581 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4582
4583         * README: Update to changes.
4584
4585 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4586
4587         * cs-parser.jay: Reverted 642 warning fix.
4588
4589 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4590
4591         Fix bug #66615
4592         * decl.cs (FindMemberWithSameName): Indexer can have more than
4593         1 argument.
4594
4595 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4596
4597         * expression.cs (LocalVariableReference.DoResolveLValue):
4598         Do not report warning 219 for out values.
4599         (EmptyExpression.Null): New member to avoid extra allocations.
4600
4601 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4602
4603         * cs-parser.jay: Fix wrong warning 642 report.
4604
4605         * cs-tokenizer.cs (CheckNextToken): New helper;
4606         Inspect next character if is same as expected.
4607
4608 2004-09-23  Martin Baulig  <martin@ximian.com>
4609
4610         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4611         (Convert.ImplicitReferenceConversionExists): Likewise.
4612
4613 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4614
4615         * class.cs (Operator.Define): Add error 448 and 559 report.
4616
4617 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4618
4619         * class.cs (MemberBase.IsTypePermitted): New protected
4620         method for checking error CS0610.
4621
4622 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4623
4624         * class.cs (TypeContainer.HasExplicitLayout): New property
4625         Returns whether container has StructLayout attribute set Explicit.
4626         (FieldMember): New abstract class for consts and fields.
4627         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4628         (Field): Reuse FieldMember.
4629
4630         * const.cs (Const): Reuse FieldMember.
4631
4632         * rootcontext.cs: EmitConstants call moved to class.
4633
4634 2004-09-22  Martin Baulig  <martin@ximian.com>
4635
4636         Thanks to Peter Sestoft for this bug report.
4637
4638         * expression.cs (Conditional): If both the `trueExpr' and the
4639         `falseExpr' is a NullLiteral, return a NullLiteral.
4640
4641 2004-09-22  Martin Baulig  <martin@ximian.com>
4642
4643         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4644         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4645         for the "get_Current" call.
4646
4647 2004-09-22  Martin Baulig  <martin@ximian.com>
4648
4649         Marek and me just fixed one of our oldest bugs: #28562 :-)
4650
4651         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4652
4653         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4654         we're an EnumConstant, just return that.
4655         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4656         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4657         to get the value which'll actually be written into the attribute.
4658         However, we have to use GetValue() to access the attribute's value
4659         in the compiler.        
4660
4661 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4662
4663         * constant.cs (Constant.IsNegative): New abstract property
4664         IsNegative.
4665
4666         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4667         (StackAlloc.DoResolve): Reused IsNegative.
4668
4669 2004-09-21  Martin Baulig  <martin@ximian.com>
4670
4671         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4672         if we're used in an iterator, we may be called from different
4673         methods.
4674
4675         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4676         we actually have an exception block.
4677
4678 2004-09-20  John Luke <jluke@cfl.rr.com>
4679
4680         * class.cs, cs-parser.jay: Improve the error report for 1520:
4681         report the actual line where the error happens, not where the
4682         class was declared.
4683
4684         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4685         Pass location information that was available elsewhere.
4686
4687 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4688
4689         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4690         runtime to delay sign assemblies.
4691
4692 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4693
4694         * cs-parser.jay: Do not report the stack trace, this is barely
4695         used nowadays.
4696
4697 2004-08-22  John Luke  <john.luke@gmail.com>
4698  
4699         * driver.cs : check that a resource id is not already used
4700         before adding it, report CS1508 if it is, bug #63637
4701
4702 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4703
4704         * ecore.cs: Removed dead code.
4705
4706 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4707
4708         * class.cs: Do not report warning CS0067 on the interfaces.
4709
4710 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4711
4712         * cs-parser.jay: Add error 504 report.
4713
4714 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4715
4716         * rootcontext.cs: WarningLevel is 4 by default now.
4717
4718         * statement.cs (Fixed.Resolve): Do not null
4719         VariableInfo.
4720
4721 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4722
4723         Fixed bug #55780
4724         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4725         deep search when property is not virtual.
4726         (PropertyExpr.ResolveAccessors): Make one call for both
4727         accessors.
4728
4729 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4730
4731         Fixed bug #65766
4732         * statement.cs: Error 152 report constains also location.
4733
4734 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4735
4736         Fixed bug #65766
4737         * const.cs: Explicitly set constant as static.
4738
4739 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4740
4741         Fixed bug #64226
4742         * cs-parser.jay: Add error 1017 report.
4743
4744 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4745
4746         Fixed bug #59980, #64224
4747         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4748
4749         * typemanager.cs (IsSpecialMethod): Simplified
4750
4751 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4752
4753         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4754         condition with better params.
4755
4756 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4757
4758         Fixed bug #65238
4759         * attribute.cs (Resolve): Property has to have both
4760         accessors.
4761
4762 2004-09-14  Martin Baulig  <martin@ximian.com>
4763
4764         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4765
4766 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4767
4768         Fixed bug #61902
4769         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4770         called and is obsolete then this member suppress message
4771         when call is inside next [Obsolete] method or type.
4772
4773         * expression.cs: Use TestObsoleteMethodUsage member.
4774
4775 2004-09-14  Martin Baulig  <martin@ximian.com>
4776
4777         * cs-parser.jay: Sync a bit with the GMCS version.
4778
4779 2004-09-14  Martin Baulig  <martin@ximian.com>
4780
4781         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4782         (CSharpParser.yacc_verbose_flag): New public field.
4783
4784         * genericparser.cs: Removed.
4785
4786 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4787
4788         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4789
4790 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4791
4792         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4793
4794 2004-09-10  Martin Baulig  <martin@ximian.com>
4795
4796         Backported my MemberName changes from GMCS into MCS.
4797
4798         - we are now using a special `MemberName' class instead of using
4799         strings; in GMCS, the `MemberName' also contains the type
4800         arguments.
4801
4802         - changed the grammar rules a bit:
4803           * the old `member_name' is now a `namespace_or_type_name':
4804             The rule is that we use `namespace_or_type_name' everywhere
4805             where we expect either a "member name" (GetEnumerator) or a
4806             "member name" with an explicit interface name
4807             (IEnumerable.GetEnumerator).
4808             In GMCS, the explicit interface name may include type arguments
4809             (IEnumerable<T>.GetEnumerator).
4810           * we use `member_name' instead of just `IDENTIFIER' for
4811             "member names":
4812             The rule is that we use `member_name' wherever a member may
4813             have type parameters in GMCS.       
4814
4815         * decl.cs (MemberName): New public class.
4816         (MemberCore.MemberName): New public readonly field.
4817         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4818         (DeclSpace): Likewise.
4819
4820         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4821         * enum.cs (Enum.ctor): Likewise.
4822
4823         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4824         MemberName.     
4825         (AliasEntry.ctor): Take a MemberName, not an Expression.
4826         (AliasEntry.UsingAlias): Likewise.
4827
4828         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4829         (IMethodData.MemberName): Changed type from string to MemberName.
4830         (MemberBase.ExplicitInterfaceName): Likewise.
4831         (AbstractPropertyEventMethod.SetupName): Make this private.
4832         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4833         argument; compute the member name here.
4834         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4835         on the `member.MemberName' and the `prefix'.
4836
4837         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4838         not `type_name'.
4839         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4840         thus, we get a `MemberName' instead of a `string'.  These
4841         declarations may have type parameters in GMCS.
4842         (interface_method_declaration, delegate_declaration): Likewise.
4843         (class_declaration, interface_declaration): Likewise.
4844         (method_header): Use `namespace_or_type_name' instead of
4845         `member_name'.  We may be an explicit interface implementation.
4846         (property_declaration, event_declaration): Likewise.
4847         (member_name): This is now just an `IDENTIFIER', not a
4848         `namespace_or_type_name'.
4849         (type_name, interface_type): Removed.
4850         (namespace_or_type_name): Return a MemberName, not an Expression.
4851         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4852         call GetTypeExpression() on the MemberName to get an expression.
4853         (IndexerDeclaration.interface_type): Changed type from string to
4854         MemberName.
4855         (MakeName): Operate on MemberName's instead of string's.
4856
4857 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4858
4859         Fix bug #55770.
4860         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4861         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4862         lookup to avoid symbols introduced by 'using'.
4863         * rootcontext.cs (NamespaceLookup): Update.
4864
4865 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4866
4867         * class.cs (TypeContainer.DoDefineMembers): Do not call
4868         DefineDefaultConstructor for static classes.
4869
4870 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4871
4872         * attribute.cs (Attribute.Resolve): Add error 653 report.
4873
4874         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4875         report.
4876         (Method.ApplyAttributeBuilder): Add error 685 report.
4877         (Operator.Define): Add error 564 report.
4878
4879         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4880
4881         * expression.cs (Invocation.DoResolve): Add error
4882         245 and 250 report.
4883
4884         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4885         error 674 report.
4886
4887 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4888
4889         * class.cs (ConstructorInitializer.Resolve):
4890         Wrong error number (515->516).
4891
4892 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4893
4894         * class.cs (Indexer.Define): Add error 631 report.
4895
4896 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4897
4898         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4899
4900 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4901
4902         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4903
4904 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4905
4906         * cs-parser.jay: Added error CS0241 report.
4907
4908 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4909
4910         * cs-parser.jay (fixed_statement): Introduce a scope for the
4911         declaration in the 'fixed' statement.
4912
4913 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4914
4915         * cs-parser.jay: Added CS0230 error report.
4916
4917 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4918
4919         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4920
4921 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4922
4923         * expression.cs (Argument.Resolve): Added error CS0192 and
4924         CS0199 report.
4925
4926 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4927
4928         C# 2.0 #pragma warning feature
4929
4930         * cs-tokenizer.cs (PreProcessPragma): New method; 
4931         Handles #pragma directive.
4932
4933         * report.cs (WarningRegions): New class; Support
4934         class for #pragma warning directive. It tests whether
4935         warning is enabled for a given line.
4936
4937 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4938
4939         * const.cs: Add more descriptive error report, tahnks to
4940         Sebastien. 
4941
4942 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4943
4944         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4945
4946 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4947
4948         * expression.cs: Apply patch from Ben: Remove dead code from
4949         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4950         as that code just threw an exception anwyays.
4951
4952         * const.cs: Remove the call to the turnintoconstant, for details
4953         see bug: #63144
4954         
4955         * literal.cs: The type of the null-literal is the null type;  So
4956         we use a placeholder type (literal.cs:System.Null, defined here)
4957         for it.
4958
4959         * expression.cs (Conditional.DoResolve): Remove some old code that
4960         is no longer needed, conversions have been fixed.
4961
4962         (ArrayCreationExpression.DoResolve): Return false if we fail to
4963         resolve the inner expression.
4964
4965 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4966
4967         Fix test-290.cs.
4968         * cs-parser.jay (delegate_declaration): Record a delegate
4969         declaration as a type declaration.
4970         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4971
4972 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4973
4974         * parameter.cs: Do not crash if the type can not be resolved. 
4975
4976         * expression.cs: Report errors with unsafe pointers, fixes #64896
4977
4978 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4979
4980         * expression.cs: Pointer arith always needs to do a conv.i
4981         if the operand is a long. fix 65320
4982
4983 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4984
4985         Fixed cs0619-37.cs, cs0619-38.cs
4986
4987         * enum.cs (GetObsoleteAttribute): Removed.
4988
4989         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4990         on Enum member is double staged. The first is tested member
4991         and then enum.
4992
4993 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4994
4995         Fixed #56986, #63631, #65231
4996
4997         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4998         adds member to name container.
4999         (TypeContainer.AddToTypeContainer): New method, adds type to
5000         name container.
5001         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5002         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5003         AddOperator): Simplified by reusing AddToMemberContainer.
5004         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5005         instead of field.
5006         (Method.CheckForDuplications): Fixed implementation to test all
5007         possibilities.
5008         (MemberBase): Detection whether member is explicit interface
5009         implementation is now in constructor.
5010         (MemberBase.UpdateMemberName): Handles IndexerName.
5011         (Accessor): Changed to keep also location information.
5012         (AbstractPropertyEventMethod): Is derived from MemberCore.
5013         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5014         will be emited or not.
5015         (PropertyBase.AreAccessorsDuplicateImplementation):
5016         Tests whether accessors are not in collision with some method.
5017         (Operator): Is derived from MethodCore to simplify common
5018         operations.
5019
5020         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5021         must be performed.
5022         (DeclSpace.AddToContainer): Adds the member to defined_names
5023         table. It tests for duplications and enclosing name conflicts.
5024
5025         * enum.cs (EnumMember): Clean up to reuse the base structures
5026
5027 2004-09-03  Martin Baulig  <martin@ximian.com>
5028
5029         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5030         into TypeContainer, to make partial classes work again.
5031
5032 2004-09-03  Martin Baulig  <martin@ximian.com>
5033
5034         * rootcontext.cs (RootContext.V2): Removed.
5035
5036 2004-03-23  Martin Baulig  <martin@ximian.com>
5037
5038         * expression.cs (Invocation.OverloadResolve): Added `bool
5039         may_fail' argument and use it instead of the Location.IsNull() hack.
5040
5041 2004-09-03  Martin Baulig  <martin@ximian.com>
5042
5043         Merged latest changes into gmcs.  Please keep this comment in
5044         here, it makes it easier for me to see what changed in MCS since
5045         the last time I merged.
5046
5047 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5048
5049         Fix #61128.
5050         * expression.cs (BetterConversion): Don't allow either conversion 
5051         to be null.  Remove redundant implicit conversion test when 'q ==
5052         null' -- when this function is invoked, we already know that the
5053         implicit conversion exists.
5054         (BetterFunction): Assume that 'best' is non-null.  Remove
5055         redundant reimplementation of IsApplicable when 'best' is null.
5056         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5057         number of arguments.
5058         (IsAncestralType): Extract from OverloadResolve.
5059         (OverloadResolve): Make robust to the MethodGroupExpr being
5060         unsorted.  Implement all the logic of Section 14.5.5.1, and
5061         support overloading of methods from multiple applicable types.
5062         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5063
5064         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5065         (RealError, Warning): Append type of report to related symbol.
5066
5067 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5068
5069         * enum.cs: Fixed CLS-Compliance checks for enum members.
5070         Error tests cs3008-8.cs, cs3014-8.cs
5071
5072 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5073
5074         Fixed bug #62342, #63102
5075         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5076         like ImplementMethod.
5077
5078 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5079
5080         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5081         Fixed bug #65170.
5082
5083 2004-09-02  Martin Baulig  <martin@ximian.com>
5084
5085         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5086         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5087         on the MethodBase.
5088
5089 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5090
5091         C# 2.0 Static classes implemented
5092
5093         * class.cs (TypeContainer): instance_constructors,
5094         initialized_fields, initialized_static_fields,
5095         default_constructor, base_inteface_types are protected to be
5096         accessible from StaticClass.
5097         (TypeContainer.DefineDefaultConstructor): New virtual method
5098         for custom default constructor generating
5099         (StaticClass): New class to handle "Static classes" feature.
5100
5101         * cs-parser.jay: Handle static keyword on class like instance
5102         of StaticClass.
5103
5104         * driver.cs: Added "/langversion" command line switch with two
5105         options (iso-1, default).
5106
5107 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5108
5109         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5110
5111 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5112
5113         * delegate.cs: Style.
5114
5115 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5116
5117         * delegate.cs: Add seperate instance expr field for miguel.
5118
5119 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5120
5121         * PointerArithmetic (Resolve): make sure we are not doing
5122         pointer arith on void*. Also, make sure we are resolved
5123         by not setting eclass until resolve.
5124
5125         All callers: Make sure that PointerArithmetic gets resolved.
5126
5127 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5128
5129         * ArrayCreation (LookupType): If the type does not resolve 
5130         to an array, give an error.
5131
5132 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5133
5134         * statement.cs (Try.Resolve): Fixed bug #64222
5135
5136 2004-08-27  Martin Baulig  <martin@ximian.com>
5137
5138         * class.cs
5139         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5140         crash here.     
5141
5142 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5143
5144         * ecore.cs (Constantify): Get underlying type via
5145         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5146         Windows in special cases.
5147
5148 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5149
5150         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5151         for obtaining also private methods.
5152         (GetRemoveMethod): Used GetRemoveMethod (true)
5153         for obtaining also private methods.
5154
5155 2004-08-24  Martin Baulig  <martin@ximian.com>
5156
5157         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5158         MethodAttributes.HideBySig for operators.
5159
5160 2004-08-23  Martin Baulig  <martin@ximian.com>
5161
5162         Back to the old error reporting system :-)
5163
5164         * report.cs (Message): Removed.
5165         (Report.MessageData, ErrorData, WarningData): Removed.
5166         (Report.Error, Warning): Back to the old system.
5167
5168 2004-08-23  Martin Baulig  <martin@ximian.com>
5169
5170         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5171
5172         * class.cs (TypeContainer.ParentContainer): New public virtual
5173         method; replaces the explicit interface implementation.
5174         (ClassPart.ParentContainer): Override.
5175
5176 2004-08-23  Martin Baulig  <martin@ximian.com>
5177
5178         * statement.cs (Switch): Added support for constant switches; see
5179         #59428 or test-285.cs.
5180
5181 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5182
5183         Fixed bug #62740.
5184         * statement.cs (GetEnumeratorFilter): Removed useless
5185         logic because C# specs is strict. GetEnumerator must be
5186         public.
5187
5188 2004-08-22  Martin Baulig  <martin@ximian.com>
5189
5190         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5191         a switch and may break, reset the barrier.  Fixes #59867.
5192
5193 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5194
5195         CLS-Compliance speed up (~5% for corlib)
5196
5197         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5198         New method. Tests container for CLS-Compliant names
5199
5200         * class.cs (TypeContainer.VerifyClsName): New method.
5201         Checks whether container name is CLS Compliant.
5202         (Constructor): Implements IMethodData.
5203
5204         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5205         low-case table for CLS Compliance test.
5206         (MemberCache.VerifyClsParameterConflict): New method.
5207         Checks method parameters for CS3006 error.
5208
5209         * enum.cs (EnumMember): Is derived from MemberCore.
5210         (Enum.VerifyClsName): Optimized for better performance.
5211
5212 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5213
5214         * report.cs: Renamed Error_T to Error and changed all
5215         references.
5216
5217 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5218
5219         * class.cs (TypeContainer.IndexerArrayList): New inner class
5220         container for indexers.
5221         (TypeContainer.DefaultIndexerName): New constant for default
5222         indexer name. Replaced all "Item" with this constant.
5223         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5224
5225         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5226         DefaultMemberAttribute constructor.
5227
5228 2004-08-05  Martin Baulig  <martin@ximian.com>
5229
5230         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5231         Fix bug #59429.
5232
5233 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5234
5235         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5236         multi platforms problem.
5237
5238         * compiler.csproj: Included shared files.
5239
5240 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5241
5242         Fix bug 60333, 55971 in the more general way
5243         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5244         Added arg_type argument for constant conversion.
5245         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5246
5247 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5248
5249         Fix bug #59760
5250         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5251         OperatorArrayList, MethodCoreArrayList for typecontainer
5252         containers. Changed class member types to these new types.
5253         (MethodArrayList.DefineMembers): Added test for CS0659.
5254
5255 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5256
5257         * cfold.cs: Synchronize the folding with the code in expression.cs
5258         Binary.DoNumericPromotions for uint operands.
5259
5260         * attribute.cs: Revert patch from Raja, it introduced a regression
5261         while building Blam-1.2.1 (hard to isolate a test case).
5262
5263 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5264
5265         Fix for #55382
5266         * class.cs:
5267         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5268         name collision.
5269         (MethodCore.parent_method): New member. The method we're overriding
5270         if this is an override method.
5271         (MethodCore.CheckBase): Moved from Method class and made common.
5272         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5273         private.
5274         (MethodCore.CheckForDuplications): New abstract method. For custom
5275         member duplication search in a container
5276         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5277         method and its return type.
5278         (Event.conflict_symbol): New member. Symbol with same name in the
5279         parent class.
5280
5281         * decl.cs:
5282         (MemberCache.FindMemberWithSameName): New method. The method
5283         is looking for conflict with inherited symbols.
5284
5285 2004-08-04  Martin Baulig  <martin@ximian.com>
5286
5287         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5288
5289         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5290
5291 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5292
5293         * report.cs (Message): New enum for better error, warning reference in
5294         the code.
5295         (MessageData): New inner abstract class. It generally handles printing of
5296         error and warning messages.
5297         Removed unused Error, Warning, Message methods.
5298
5299 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5300
5301         Fix for cs0592-8.cs test
5302         * attribute.cs
5303         (Attributable.ValidAttributeTargets): Made public.
5304         (Attribute.ExplicitTarget): New member for explicit target value.
5305         (Attribute.CheckTargets): Now we translate explicit attribute
5306         target to Target here.
5307
5308 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5309
5310         * ecore.cs (MethodGroupExpr): new IsBase property.
5311
5312         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5313
5314         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5315         rather than an instance expr.
5316
5317         (DelegateCreation.Emit): Use the method group rather than
5318         the instance expression. Also, if you have base.Foo as the
5319         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5320
5321         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5322
5323         (NewDelegate.DoResolve): Only check for the existance of Invoke
5324         if the method is going to be needed. Use MethodGroupExpr.
5325
5326         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5327
5328         * expression.cs: For pointer arith., make sure to use
5329         the size of the type, not the size of the pointer to
5330         the type.
5331
5332 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5333
5334         Fix for #60722
5335         * class.cs (Class): Added error CS0502 test.
5336
5337 2004-08-03  John Luke  <jluke@cfl.rr.com>
5338             Raja R Harinath  <rharinath@novell.com>
5339
5340         Fix for #60997.
5341         * attribute.cs (Attribute.complained_before): New flag.
5342         (Attribute.ResolveType, Attribute.Resolve),
5343         (Attribute.DefinePInvokeMethod): Set it.
5344         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5345         
5346 2004-08-03  Martin Baulig  <martin@ximian.com>
5347
5348         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5349         use a user-defined operator; we still need to do numeric
5350         promotions in case one argument is a builtin type and the other
5351         one has an implicit conversion to that type.  Fixes #62322.
5352
5353 2004-08-02  Martin Baulig  <martin@ximian.com>
5354
5355         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5356         (LocalInfo.IsThis): New public property.
5357         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5358
5359 2004-08-01  Martin Baulig  <martin@ximian.com>
5360
5361         * class.cs (TypeContainer.GetClassBases): Don't set the default
5362         here since we may get called from GetPartialBases().
5363         (TypeContainer.DefineType): If GetClassBases() didn't return a
5364         parent, use the default one.
5365
5366 2004-07-30  Duncan Mak  <duncan@ximian.com>
5367
5368         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5369
5370 2004-07-30  Martin Baulig  <martin@ximian.com>
5371
5372         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5373
5374         * class.cs (SourceMethod): New public class, derive from the
5375         symbol writer's ISourceMethod.
5376         (Method): Use the new symbol writer API.
5377
5378         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5379         as argument and use the new symbol writer.
5380
5381         * location.cs
5382         (SourceFile): Implement the symbol writer's ISourceFile.
5383         (Location.SymbolDocument): Removed.
5384         (Location.SourceFile): New public property.
5385
5386         * symbolwriter.cs: Use the new symbol writer API.
5387
5388 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5389
5390         * Makefile (install-local): Remove.  Functionality moved to
5391         executable.make.
5392
5393 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5394
5395         * Makefile: Install mcs.exe.config file together with mcs.exe.
5396         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5397         correct runtime version.
5398         
5399 2004-07-25  Martin Baulig  <martin@ximian.com>
5400
5401         * class.cs
5402         (TypeContainer.RegisterOrder): Removed, this was unused.
5403         (TypeContainer, interface_order): Removed.
5404         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5405         TypeContainer as argument since we can also be called with a
5406         `PartialContainer' for a partial class/struct/interface.
5407         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5408         of checking whether we're an `Interface' - we could be a
5409         `PartialContainer'.
5410         (PartialContainer.Register): Override; call
5411         AddClass()/AddStruct()/AddInterface() on our parent.
5412
5413         * cs-parser.jay (interface_member_declaration): Add things to the
5414         `current_container', not the `current_class'.
5415
5416         * rootcontext.cs (RegisterOrder): The overloaded version which
5417         takes an `Interface' was unused, removed.
5418
5419         * typemanager.cs (TypeManager.LookupInterface): Return a
5420         `TypeContainer', not an `Interface'.
5421         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5422         contain a `PartialContainer' for an interface, so check it's
5423         `Kind' to figure out what it is.
5424
5425 2004-07-25  Martin Baulig  <martin@ximian.com>
5426
5427         * class.cs (Class.DefaultTypeAttributes): New public constant.
5428         (Struct.DefaultTypeAttributes): Likewise.
5429         (Interface.DefaultTypeAttributes): Likewise.
5430         (PartialContainer.TypeAttr): Override this and add the
5431         DefaultTypeAttributes.
5432
5433 2004-07-25  Martin Baulig  <martin@ximian.com>
5434
5435         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5436         we can just use the `Parent' field instead.
5437
5438 2004-07-25  Martin Baulig  <martin@ximian.com>
5439
5440         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5441
5442 2004-07-25  Martin Baulig  <martin@ximian.com>
5443
5444         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5445         our parts before defining any methods.
5446         (TypeContainer.VerifyImplements): Make this virtual.
5447         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5448         on our PartialContainer.
5449
5450 2004-07-25  Martin Baulig  <martin@ximian.com>
5451
5452         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5453
5454         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5455         argument, we can just use the `Parent' field instead.
5456
5457         * class.cs
5458         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5459         (MemberBase.DoDefine): Likewise.
5460
5461 2004-07-24  Martin Baulig  <martin@ximian.com>
5462
5463         * decl.cs (MemberCore.Parent): New public field.
5464         (DeclSpace.Parent): Moved to MemberCore.
5465
5466         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5467         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5468         parent's .ctor.
5469         (FieldBase, Field, Operator): Likewise.
5470         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5471         (EventField, Event): Likewise.
5472
5473 2004-07-23  Martin Baulig  <martin@ximian.com>
5474
5475         * class.cs (PartialContainer): New public class.
5476         (ClassPart): New public class.
5477         (TypeContainer): Added support for partial classes.
5478         (TypeContainer.GetClassBases): Splitted some of the functionality
5479         out into GetNormalBases() and GetPartialBases().
5480
5481         * cs-tokenizer.cs (Token.PARTIAL): New token.
5482         (Tokenizer.consume_identifier): Added some hacks to recognize
5483         `partial', but only if it's immediately followed by `class',
5484         `struct' or `interface'.
5485
5486         * cs-parser.jay: Added support for partial clases.
5487
5488 2004-07-23  Martin Baulig  <martin@ximian.com>
5489
5490         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5491         a `DeclSpace' and also made it readonly.
5492         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5493         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5494         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5495
5496         * cs-parser.jay: Pass the `current_class', not the
5497         `current_container' (at the moment, this is still the same thing)
5498         to a new Method, Property, Event, Indexer or Constructor.
5499
5500 2004-07-23  Martin Baulig  <martin@ximian.com>
5501
5502         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5503         and removed the `current_interface' one.
5504         (struct_declaration, class_declaration, interface_declaration):
5505         Set `current_class' to the newly created class/struct/interface;
5506         set their `Bases' and call Register() before parsing their body.
5507
5508 2004-07-23  Martin Baulig  <martin@ximian.com>
5509
5510         * class.cs (Kind): New public enum.
5511         (TypeContainer): Made this class abstract.
5512         (TypeContainer.Kind): New public readonly field.
5513         (TypeContainer.CheckDef): New public method; moved here from
5514         cs-parser.jay.
5515         (TypeContainer.Register): New public abstract method.
5516         (TypeContainer.GetPendingImplementations): New public abstract
5517         method.
5518         (TypeContainer.GetClassBases): Removed the `is_class' and
5519         `is_iface' parameters.
5520         (TypeContainer.DefineNestedTypes): Formerly known as
5521         DoDefineType().
5522         (ClassOrStruct): Made this class abstract.
5523
5524         * tree.cs (RootTypes): New public type. 
5525
5526 2004-07-20  Martin Baulig  <martin@ximian.com>
5527
5528         * tree.cs (Tree.RecordNamespace): Removed.
5529         (Tree.Namespaces): Removed.
5530
5531         * rootcontext.cs (RootContext.IsNamespace): Removed.
5532
5533         * cs-parser.jay (namespace_declaration): Just create a new
5534         NamespaceEntry here.
5535
5536 2004-07-20  Martin Baulig  <martin@ximian.com>
5537
5538         * statement.cs (ExceptionStatement): New abstract class.  This is
5539         now used as a base class for everyone who's using `finally'.
5540         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5541         our local variables before using them.
5542
5543         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5544         virtual method.  This is used by Yield.Resolve() to "steal" an
5545         outer block's `finally' clauses.
5546         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5547         argument.
5548
5549         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5550         version which takes an ExceptionStatement.  This version must be
5551         used to create exception branchings.
5552
5553         * iterator.cs
5554         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5555         (Iterator.EmitMoveNext): Added exception support; protect the
5556         block with a `fault' clause, properly handle 'finally' clauses.
5557         (Iterator.EmitDispose): Run all the `finally' clauses here.
5558
5559 2004-07-20  Martin Baulig  <martin@ximian.com>
5560
5561         * iterator.cs: This is the first of a set of changes in the
5562         iterator code.  Match the spec more closely: if we're an
5563         IEnumerable, then GetEnumerator() must be called.  The first time
5564         GetEnumerator() is called, it returns the current instance; all
5565         subsequent invocations (if any) must create a copy.
5566
5567 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5568
5569         * expression.cs: Resolve the constant expression before returning
5570         it. 
5571
5572 2004-07-19  Martin Baulig  <martin@ximian.com>
5573
5574         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5575         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5576         the return type of the new EmitContext.
5577
5578 2004-07-18  Martin Baulig  <martin@ximian.com>
5579
5580         * class.cs (Property.Define): Fix iterators.
5581
5582         * iterators.cs (Iterator.Define): Moved the
5583         `container.AddInterator (this)' call here from the .ctor; only do
5584         it if we resolved successfully.
5585
5586 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5587
5588         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5589         `true' for preprocessing directives that we parse.  The return
5590         value indicates whether we should return to regular tokenizing or
5591         not, not whether it was parsed successfully.
5592
5593         In the past if we were in: #if false ... #line #endif, we would
5594         resume parsing after `#line'.  See bug 61604.
5595
5596         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5597         building: IsEnumType should return true only for enums, not for
5598         enums or System.Enum itself.  This fixes #61593.
5599
5600         Likely what happened is that corlib was wrong: mcs depended on
5601         this bug in some places.  The bug got fixed, we had to add the
5602         hack, which caused bug 61593.
5603
5604         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5605         that was a workaround for the older conditions.
5606
5607 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5608
5609         * assign.cs: IAssignMethod has a new interface, as documented
5610         inline. All assignment code now uses this new api.
5611
5612         * ecore.cs, expression.cs: All classes which implement
5613         IAssignMethod now use the new interface.
5614
5615         * expression.cs (Invocation): add a hack to EmitCall so that
5616         IndexerAccess can be the target of a compound assignment without
5617         evaluating its arguments twice.
5618
5619         * statement.cs: Handle changes in Invocation api.
5620
5621 2004-07-16  Martin Baulig  <martin@ximian.com>
5622
5623         * iterators.cs: Rewrote this.  We're now using one single Proxy
5624         class for both the IEnumerable and the IEnumerator interface and
5625         `Iterator' derives from Class so we can use the high-level API.
5626
5627         * class.cs (TypeContainer.AddIterator): New method.
5628         (TypeContainer.DoDefineType): New protected virtual method, which
5629         is called from DefineType().
5630         (TypeContainer.DoDefineMembers): Call DefineType() and
5631         DefineMembers() on all our iterators.
5632         (TypeContainer.Emit): Call Emit() on all our iterators.
5633         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5634
5635         * codegen.cs (EmitContext.CurrentIterator): New public field.
5636
5637 2004-07-15  Martin Baulig  <martin@ximian.com>
5638
5639         * typemanager.cs
5640         (TypeManager.not_supported_exception_type): New type.   
5641
5642 2004-07-14  Martin Baulig  <martin@ximian.com>
5643
5644         * iterators.cs: Use real error numbers.
5645
5646 2004-07-14  Martin Baulig  <martin@ximian.com>
5647
5648         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5649         requires this to be a System.Collection.IEnumerable and not a
5650         class implementing that interface.
5651         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5652
5653 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5654
5655         * class.cs: Fixed previous fix, it broke some error tests.
5656
5657 2004-07-12  Martin Baulig  <martin@ximian.com>
5658
5659         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5660         Fixes #61293.
5661
5662 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5663
5664         * assign.cs (LocalTemporary): Add new argument: is_address,If
5665         `is_address' is true, then the value that we store is the address
5666         to the real value, and not the value itself.
5667         
5668         * ecore.cs (PropertyExpr): use the new local temporary
5669         stuff to allow us to handle X.Y += z (where X is a struct)
5670
5671 2004-07-08  Martin Baulig  <martin@ximian.com>
5672
5673         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5674         not always return, just like we're doing in Using.Resolve().
5675
5676 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5677
5678         * cs-parser.jay (fixed_statement): flag this as Pinned.
5679
5680 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5681
5682         * typemanager.cs (TypeManager): Removed MakePinned method, this
5683         mechanism is replaced with the .NET 2.x compatible mechanism of
5684         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5685
5686         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5687         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5688         `IsFixed' property which has a different meaning.
5689
5690 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5691
5692         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5693         visible from inside a nested class, not just the names of the
5694         immediately enclosing class.
5695         Fix for bug #60730.
5696
5697 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5698
5699         * expression.cs (BetterConversion): Remove buggy special-case
5700         handling of "implicit constant expression conversions".  At this
5701         point, we already know that the conversion is possible -- we're
5702         only checking to see which is better.
5703
5704 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5705
5706         * cs-parser.jay: Added error CS0210 test.
5707
5708 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5709
5710         * cs-parser.jay: Added error CS0134 test.
5711
5712 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5713
5714         Fix bug #52507
5715         * cs-parser.jay: Added error CS0145 test.
5716
5717 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5718
5719         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5720
5721 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5722         
5723         * expression.cs (StackAlloc.Resolve): The argument may not
5724         be a constant; deal with this case.
5725         
5726 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5727
5728         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5729         GetIndexerAttributeValue.
5730         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5731
5732         * class.cs (Indexer.Define): Added error tests for CS0415,
5733         CS0609.
5734
5735 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5736
5737         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5738         property code.
5739
5740 2004-06-23  Martin Baulig  <martin@ximian.com>
5741
5742         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5743         neither return nor throw, reset the barrier as well.  Fixes #60457.
5744
5745 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5746
5747         * class.cs : EventAttributes is now set to None by default.
5748           This fixes bug #60459.
5749
5750 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5751
5752         Fix bug #60219
5753         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5754         Don't throw exception but return null (it's sufficient now).
5755
5756 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5757
5758         * typemanager.cs (GetArgumentTypes): Faster implementation.
5759
5760 2004-06-18  Martin Baulig  <martin@ximian.com>
5761
5762         * attribute.cs (Attribute.Resolve): Check whether we're an
5763         EmptyCast which a Constant child.  Fixes #60333.
5764
5765 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5766
5767         * statement.cs (EmitCollectionForeach): Account for the fact that
5768         not all valuetypes are in areas which we can take the address of.
5769         For these variables, we store to a temporary variable. Also, make
5770         sure that we dont emit a `callvirt' on a valuetype method.
5771
5772 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5773
5774         * expression.cs (StackAlloc.DoReSolve): Added test for
5775         negative parameter (CS0247).
5776
5777 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5778
5779         Fix bug #59792
5780         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5781
5782 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5783
5784         Fix bug #59781
5785         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5786         ulong.
5787
5788 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5789
5790         Fix bug #58254 & cs1555.cs, cs1556.cs
5791         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5792
5793 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5794
5795         * cs-parser.jay: Added error CS1669 test for indexers.
5796
5797 2004-06-11  Martin Baulig  <martin@ximian.com>
5798
5799         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5800         call this twice: for params and varargs methods.
5801
5802 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5803
5804         * class.cs:
5805         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5806
5807 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5808
5809         * attribute.cs (Attribute.GetValidTargets): Made public.
5810
5811         * class.cs: 
5812         (AbstractPropertyEventMethod): New class for better code sharing.
5813         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5814         CS1667 report.
5815         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5816
5817 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5818
5819         Fix bug #59477.
5820         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5821         that the call to Resolve is part of a MemberAccess.
5822         (Expression.Resolve): Use it for SimpleName resolution.
5823         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5824         Add 'intermediate' boolean argument.
5825         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5826         error message when the SimpleName can be resolved ambiguously
5827         between an expression and a type.
5828         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5829         public.
5830         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5831         call on the left-side.
5832
5833 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5834
5835         * class.cs:
5836         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5837
5838 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5839
5840         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5841
5842 2004-06-11  Martin Baulig  <martin@ximian.com>
5843
5844         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5845         varargs methods if applicable.
5846
5847 2004-06-11  Martin Baulig  <martin@ximian.com>
5848
5849         * expression.cs (Invocation.EmitCall): Don't use
5850         `method.CallingConvention == CallingConventions.VarArgs' since the
5851         method could also have `CallingConventions.HasThis'.
5852
5853 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5854
5855         * class.cs (Event.GetSignatureForError): Implemented.
5856         Fixed crash in error test cs3010.cs
5857
5858 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5859
5860         * cs-tokenizer.cs: Change the way we track __arglist to be
5861         consistent with the other keywords.
5862
5863 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5864
5865         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5866         tomorrow.
5867
5868 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5869
5870         * codegen.cs: Check that all referenced assemblies have a strongname
5871         before strongnaming the compiled assembly. If not report error CS1577.
5872         Fix bug #56563. Patch by Jackson Harper.
5873         * typemanager.cs: Added a method to return all referenced assemblies.
5874         Fix bug #56563. Patch by Jackson Harper.
5875
5876 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5877
5878         * class.cs:
5879         (Method.ApplyAttributeBuilder): Moved and added conditional
5880         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5881
5882         * delegate.cs:
5883         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5884
5885 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5886
5887         Fixed #59640
5888         * class.cs: (EventField.attribute_targets): Changed default target.
5889
5890 2004-06-08  Martin Baulig  <martin@ximian.com>
5891
5892         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5893
5894 2004-06-08  Martin Baulig  <martin@ximian.com>
5895
5896         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5897
5898 2004-06-07  Martin Baulig  <martin@ximian.com>
5899
5900         Added support for varargs methods.
5901
5902         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5903         keyword.
5904
5905         * cs-parser.jay: Added support for `__arglist'.
5906
5907         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5908
5909         * expression.cs (Argument.AType): Added `ArgList'.
5910         (Invocation): Added support for varargs methods.
5911         (ArglistAccess): New public class.
5912         (Arglist): New public class.
5913
5914         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5915
5916         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5917         a method's top-level block if the method has varargs.
5918
5919         * support.cs (ReflectionParameters, InternalParameters): Added
5920         support for varargs methods.    
5921
5922 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
5923
5924         * class.cs: Provide location in indexer error report.
5925
5926         * driver.cs: Use standard names.
5927
5928         * namespace.cs: Catch the use of using after a namespace has been
5929         declared also on using aliases.
5930
5931 2004-06-03  Raja R Harinath  <rharinath@novell.com>
5932
5933         Bug #50820.
5934         * typemanager.cs (closure_private_ok, closure_invocation_type)
5935         (closure_qualifier_type, closure_invocation_assembly)
5936         (FilterWithClosure): Move to ...
5937         (Closure): New internal nested class.
5938         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
5939         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
5940         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
5941         (MemberLookup, MemberLookupFailed): Use it.
5942         * expression.cs (New.DoResolve): Treat the lookup for the
5943         constructor as being qualified by the 'new'ed type.
5944         (Indexers.GetIndexersForTypeOrInterface): Update.
5945
5946 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
5947
5948         * attribute.cs
5949         (GetConditionalAttributeValue): New method. Returns
5950         condition of ConditionalAttribute.
5951         (SearchMulti): New method.  Returns all attributes of type 't'.
5952         Use it when attribute is AllowMultiple = true.
5953         (IsConditionalMethodExcluded): New method.
5954
5955         * class.cs
5956         (Method.IsExcluded): Implemented. Returns true if method has conditional
5957         attribute and the conditions is not defined (method is excluded).
5958         (IMethodData): Extended interface for ConditionalAttribute support.
5959         (PropertyMethod.IsExcluded): Implemented.
5960
5961         * decl.cs
5962         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
5963
5964         * expression.cs
5965         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
5966         on the method.
5967
5968 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5969
5970         * expression.cs (ArrayCreationExpression): Make this just an
5971         `expression'. It can't be a statement, so the code here was
5972         dead.
5973
5974 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5975
5976         Fixed #59072
5977         * typemanager.cs (GetFullNameSignature): New method for
5978         MethodBase types.
5979
5980 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
5981
5982         Fixed #56452
5983         * class.cs (MemberBase.GetSignatureForError): New virtual method.
5984         Use this method when MethodBuilder is null.
5985         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
5986         Added test for error CS0626 (MONO reports error for this situation).
5987         (IMethodData.GetSignatureForError): Extended interface.
5988
5989 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
5990
5991         * attribute.cs
5992         (AttributeTester.GetObsoleteAttribute): Returns instance of
5993         ObsoleteAttribute when type is obsolete.
5994
5995         * class.cs
5996         (TypeContainer.VerifyObsoleteAttribute): Override.
5997         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5998         (MethodCode.VerifyObsoleteAttribute): Override.
5999         (MemberBase.VerifyObsoleteAttribute): Override.
6000
6001         * decl.cs
6002         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6003         and report proper error.
6004
6005         *delegate.cs
6006         Delegate.VerifyObsoleteAttribute): Override.
6007
6008         * ecore.cs
6009         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6010         and report proper error.
6011         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6012
6013         * enum.cs
6014         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6015         and enum member.
6016
6017         * expression.cs
6018         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6019         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6020         Added test for ObsoleteAttribute.
6021
6022         * statement.cs
6023         (Catch): Derived from Statement.
6024
6025 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6026  
6027         Fixed bug #59071 & cs0160.cs
6028  
6029         * statement.cs (Try.Resolve): Check here whether order of catch
6030         clauses matches their dependencies.
6031
6032 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6033
6034         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6035         caused a regression: #59343.  Referencing nested classes from an
6036         assembly stopped working.
6037
6038 2004-05-31  Martin Baulig  <martin@ximian.com>
6039
6040         MCS is now frozen for beta 2.
6041
6042 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6043
6044         * convert.cs: add a trivial cache for overload operator resolution.
6045
6046 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6047
6048         * decl.cs: If possible, use lookuptypedirect here. We can only do
6049         this if there is no `.' after the namespace. Avoids using
6050         LookupType, which does lots of slow processing.
6051         (FindNestedType) New method, does what it says :-).
6052         * namespace.cs: use LookupTypeDirect.
6053         * rootcontext.cs: use membercache, if possible.
6054         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6055
6056 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6057
6058         * expression.cs:
6059         According to the spec, 
6060
6061         In a member access of the form E.I, if E is a single identifier,
6062         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6063         field, property, localvariable, or parameter with the same type as
6064         the meaning of E as a type-name (§3.8), then both possible
6065         meanings of E are permitted.
6066
6067         We did not check that E as a simple-name had the same type as E as
6068         a type name.
6069
6070         This trivial check gives us 5-7% on bootstrap time.
6071
6072 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6073
6074         * expression.cs (Invocation.OverloadResolve): Avoid the
6075         use of hashtables and boxing here by allocating on demand.
6076
6077 2004-05-30  Martin Baulig  <martin@ximian.com>
6078
6079         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6080         we're doing a silent lookup.  Don't try to lookup nested types in
6081         TypeManager.object_type (thanks to Ben Maurer).
6082
6083 2004-05-30  Martin Baulig  <martin@ximian.com>
6084
6085         Committing a patch from Ben Maurer.
6086
6087         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6088
6089 2004-05-29  Martin Baulig  <martin@ximian.com>
6090
6091         * class.cs (IMethodData.ShouldIgnore): New method.
6092
6093         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6094         `Location' argument, we don't need it anywhere.  Use
6095         `IMethodData.ShouldIgnore ()' instead of
6096         `MethodData.GetMethodFlags ()'.
6097         (TypeManager.AddMethod): Removed.
6098         (TypeManager.AddMethod2): Renamed to AddMethod.
6099
6100 2004-05-29  Martin Baulig  <martin@ximian.com>
6101
6102         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6103
6104         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6105         converting from a class type S to an interface type and we already
6106         have an object on the stack, don't box it again.  Fixes #52578.
6107
6108 2004-05-29  Martin Baulig  <martin@ximian.com>
6109
6110         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6111         Added support for `params' parameters.  Fixes #59267.
6112
6113 2004-05-29  Martin Baulig  <martin@ximian.com>
6114
6115         * literal.cs (NullPointer): Provide a private .ctor which sets
6116         `type' to TypeManager.object_type.  Fixes #59048.
6117
6118 2004-05-29  Martin Baulig  <martin@ximian.com>
6119
6120         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6121         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6122
6123         * ecore.cs (EventExpr.instance_expr): Make the field private.
6124
6125 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6126
6127         Fixed bug #50080 & cs0214-2.cs
6128         * expression.cs (Cast.DoResolve): Check unsafe context here.
6129         
6130         * statement.cs (Resolve.DoResolve): Likewise.
6131
6132 2004-05-26  Martin Baulig  <martin@ximian.com>
6133
6134         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6135
6136         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6137         (RootContext.LookupType): Pass down the `silent' flag.
6138
6139 2004-05-25  Martin Baulig  <martin@ximian.com>
6140
6141         * expression.cs
6142         (MethodGroupExpr.IdenticalTypeName): New public property.
6143         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6144         expression actually refers to a type.
6145
6146 2004-05-25  Martin Baulig  <martin@ximian.com>
6147
6148         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6149         for #56176 and made it actually work.
6150
6151 2004-05-25  Martin Baulig  <martin@ximian.com>
6152
6153         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6154         (FieldExpr, PropertyExpr): Override and implement
6155         CacheTemporaries.  Fixes #52279.
6156
6157 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6158
6159         * location.cs: In the new compiler listing a file twice is a
6160         warning, not an error.
6161
6162 2004-05-24  Martin Baulig  <martin@ximian.com>
6163
6164         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6165         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6166
6167 2004-05-24  Martin Baulig  <martin@ximian.com>
6168
6169         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6170         walking the `using' list.  Fixes #53921.
6171
6172 2004-05-24  Martin Baulig  <martin@ximian.com>
6173
6174         * const.cs (Const.LookupConstantValue): Added support for
6175         EmptyCast's; fixes #55251.
6176
6177 2004-05-24  Martin Baulig  <martin@ximian.com>
6178
6179         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6180         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6181         which does the CS0135 check.  The reason is that we first need to
6182         check whether the variable actually exists.
6183
6184 2004-05-24  Martin Baulig  <martin@ximian.com>
6185
6186         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6187         than RootContext.LookupType() to find the explicit interface
6188         type.  Fixes #58584.
6189
6190 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6191
6192         * Makefile: Simplify.  Use executable.make.
6193         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6194
6195 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6196
6197         * decl.cs:
6198         * enum.cs:
6199         Use the invariant culture when doing String.Compare for CLS case
6200         sensitivity.
6201         
6202 2004-05-23  Martin Baulig  <martin@ximian.com>
6203
6204         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6205         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6206
6207         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6208         
6209 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6210
6211         * class.cs (MemberBase.Define): Reuse MemberType member for 
6212         resolved type. Other methods can use it too.
6213
6214 2004-05-23  Martin Baulig  <martin@ximian.com>
6215
6216         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6217         the variable also exists in the current block (otherwise, we need
6218         to report a CS0103).  Fixes #58670.
6219
6220 2004-05-23  Martin Baulig  <martin@ximian.com>
6221
6222         * flowanalysis.cs (Reachability.Reachable): Compute this
6223         on-the-fly rather than storing it as a field.
6224
6225 2004-05-23  Martin Baulig  <martin@ximian.com>
6226
6227         * flowanalysis.cs (Reachability.And): Manually compute the
6228         resulting `barrier' from the reachability.      
6229        
6230 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6231
6232         Fix bug #57835
6233         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6234         instance of ObsoleteAttribute when symbol is obsolete.
6235
6236         * class.cs
6237         (IMethodData): Extended interface for ObsoleteAttribute support.
6238
6239 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6240
6241         * attribute.cs: Fix bug #55970
6242
6243 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6244
6245         Fix bug #52705
6246         * attribute.cs
6247         (GetObsoleteAttribute): New method. Creates the instance of
6248         ObsoleteAttribute.
6249         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6250         ObsoleteAttribute when member is obsolete.
6251         (AttributeTester.Report_ObsoleteMessage): Common method for
6252         Obsolete error/warning reporting.
6253
6254         * class.cs
6255         (TypeContainer.base_classs_type): New member for storing parent type.
6256
6257         * decl.cs
6258         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6259         for this MemberCore.
6260
6261 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6262
6263         * attribute.cs, const.cs: Fix bug #58590
6264
6265 2004-05-21  Martin Baulig  <martin@ximian.com>
6266
6267         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6268         out parameters if the end of the method is unreachable.  Fixes
6269         #58098. 
6270
6271 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6272
6273         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6274         Hari was right, why extra method.
6275
6276 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6277
6278         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6279
6280 2004-05-20  Martin Baulig  <martin@ximian.com>
6281
6282         Merged this back from gmcs to keep the differences to a minumum.
6283
6284         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6285         instead of a Declspace.
6286         (Attribute.ResolveType): Likewise.
6287         (Attributes.Search): Likewise.
6288         (Attributes.Contains): Likewise.
6289         (Attributes.GetClsCompliantAttribute): Likewise.
6290
6291         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6292         argument.
6293         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6294         DeclSpace.
6295
6296 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6297
6298         Fix bug #58688 (MCS does not report error when the same attribute
6299         is assigned twice)
6300
6301         * attribute.cs (Attribute.Emit): Distinction between null and default.
6302
6303 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6304
6305         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6306         of a top-level attribute without an attribute target.
6307         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6308         Make non-static.
6309         (Attribute.Conditional_GetConditionName), 
6310         (Attribute.Obsolete_GetObsoleteMessage): Update.
6311         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6312         part of ScanForIndexerName.
6313         (Attribute.CanIgnoreInvalidAttribute): New function.
6314         (Attribute.ScanForIndexerName): Move to ...
6315         (Attributes.ScanForIndexerName): ... here.
6316         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6317         (Attributes.Search): New internal variant that can choose not to
6318         complain if types aren't resolved.  The original signature now
6319         complains.
6320         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6321         complaints suppressed.
6322         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6323         only if it not useful.
6324         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6325         top-level for attributes that are shared between the assembly
6326         and a top-level class.
6327         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6328         * class.cs: Update to reflect changes.
6329         (DefineIndexers): Fuse loops.
6330         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6331         a couple more variants of attribute names.
6332
6333 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6334
6335         Fix bug #52585 (Implemented explicit attribute declaration)
6336
6337         * attribute.cs:
6338         (Attributable.ValidAttributeTargets): New abstract method. It gets
6339         list of valid attribute targets for explicit target declaration.
6340         (Attribute.Target): It holds target itself.
6341         (AttributeSection): Removed.
6342         (Attribute.CheckTargets): New method. It checks whether attribute
6343         target is valid for the current element.
6344
6345         * class.cs:
6346         (EventProperty): New class. For events that are declared like
6347         property (with add and remove accessors).
6348         (EventField): New class. For events that are declared like field.
6349         class.cs
6350
6351         * cs-parser.jay: Implemented explicit attribute target declaration.
6352
6353         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6354         Override ValidAttributeTargets.
6355
6356         * parameter.cs:
6357         (ReturnParameter): Class for applying custom attributes on 
6358         the return type.
6359         (ParameterAtribute): New class. Class for applying custom
6360         attributes on the parameter type.
6361
6362 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6363
6364         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6365         definitions. 
6366
6367         (Method): Allow UNSAFE here.
6368
6369         * modifiers.cs: Support unsafe reporting.
6370
6371 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6372
6373         * decl.cs: Fix bug #58478.
6374
6375 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6376
6377         * statement.cs: When checking for unreachable code on an EmptyStatement,
6378         set the location. Fixes bug #58488.
6379
6380 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6381
6382         * driver.cs: Add -pkg handling.
6383
6384         From Gonzalo: UseShelLExecute=false
6385
6386 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6387
6388         * attribute.cs:
6389         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6390         for attribute.
6391         (Attribute.IsClsCompliaceRequired): Moved to base for better
6392         accesibility.
6393         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6394         when attribute is AttributeUsageAttribute.
6395         (Attribute.GetValidTargets): Simplified.
6396         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6397         attribute for this type.
6398         (Attribute.ApplyAttributes): Method renamed to Emit and make
6399         non-static.
6400         (GlobalAttributeSection): New class for special handling of global
6401         attributes (assembly, module).
6402         (AttributeSection.Emit): New method.
6403
6404         * class.cs: Implemented Attributable abstract methods.
6405         (MethodCore.LabelParameters): Moved to Parameter class.
6406         (Accessor): Is back simple class.
6407         (PropertyMethod): Implemented Attributable abstract class.
6408         (DelegateMethod): Implemented Attributable abstract class.
6409         (Event): New constructor for disctintion between normal Event
6410         and Event with accessors.
6411
6412         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6413
6414         * codegen.cs, const.cs, decl.cs, delegate.cs:
6415         (CommonAssemblyModulClass): Implemented Attributable abstract class
6416         and simplified.
6417
6418         * enum.cs: Implement IAttributeSupport interface.
6419         (EnumMember): New class for emum members. Implemented Attributable
6420         abstract class
6421
6422         * parameter.cs:
6423         (ParameterBase): Is abstract.
6424         (ReturnParameter): New class for easier [return:] attribute handling.
6425
6426         * typemanager.cs: Removed builder_to_attr.
6427
6428 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6429
6430         Fix bug #57151.
6431         * attribute.cs (Attribute.GetPositionalValue): New function.
6432         * class.cs (TypeContainer.VerifyMembers): New function.
6433         (TypeContainer.Emit): Use it.
6434         (ClassOrStruct): New base class for Class and Struct.
6435         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6436         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6437         class.
6438         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6439         then each non-static field should have a FieldOffset attribute.
6440         Otherwise, none of the fields should have a FieldOffset attribute.
6441         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6442         and FieldOffset attributes.
6443         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6444         (TypeManager.field_offset_attribute_type): New core types.
6445         (TypeManager.InitCoreTypes): Initialize them.
6446
6447 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6448
6449         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6450         Return correct type.
6451         From bug #58270.
6452
6453 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6454
6455         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6456         be implicitly converted to ulong.
6457         
6458         * expression.cs: The logic for allowing operator &, | and ^ worked
6459         was wrong, it worked before because we did not report an error in
6460         an else branch.  Fixes 57895.
6461
6462         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6463         allow volatile fields to be reference types.
6464
6465 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6466
6467         * driver.cs: Add support for /debug-
6468
6469 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6470
6471         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6472         Add a 'complain' parameter to silence errors.
6473         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6474         silently overlooked type-resolutions.
6475         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6476         to reflect changes.
6477         (Attributes.Search): New function.
6478         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6479         (Attributes.GetAttributeFullName): Remove hack.
6480         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6481         Update to reflect changes.
6482         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6483         Use Attributes.Search instead of nested loops.
6484
6485 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6486
6487         * decl.cs:
6488         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6489         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6490         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6491
6492         * report.cs: (Report.Warning): Renamed to Warning_T because of
6493         parameter collision.
6494
6495 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6496
6497         * expression.cs (MemberAccess.ResolveMemberAccess):
6498         Exit with non-zero status after Report.Error.
6499         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6500         Likewise.
6501         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6502
6503 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6504
6505         * support.cs: Don't hang when the file is empty.
6506
6507 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6508
6509         * support.cs: In SeekableStreamReader, compute the preamble size of the
6510           underlying stream. Position changes should take into account that initial
6511           count of bytes.
6512
6513 2004-05-03  Todd Berman  <tberman@sevenl.net>
6514
6515         * driver.cs: remove unused GetSysVersion function.
6516
6517 2004-05-03  Todd Berman  <tberman@sevenl.net>
6518
6519         * driver.cs: Remove the hack from saturday, as well as the hack
6520         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6521         link_paths to get that bit proper.
6522
6523 2004-05-01  Todd Berman  <tberman@sevenl.net>
6524
6525         * driver.cs: Try a LoadFrom before a Load, this checks the current
6526         path. This is currently a bug in mono that is be fixed, however, this
6527         provides a workaround for now. This will be removed when the bug
6528         is fixed.
6529
6530 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6531
6532         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6533         incomplete key pairs (#57941).
6534
6535 2004-05-01  Todd Berman  <tberman@sevenl.net>
6536
6537         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6538         from the GAC
6539
6540 2004-04-30  Jackson Harper  <jackson@ximian.com>
6541
6542         * codegen.cs: Open keys readonly.
6543         
6544 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6545
6546         * typemanager.cs: don't report cyclic struct layout when a struct
6547         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6548         which has 2 Pango.Rectangle fields.
6549
6550 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6551
6552         * expression.cs: Handle IntPtr comparisons with IL code
6553         rather than a method call.
6554
6555 2004-04-29  Martin Baulig  <martin@ximian.com>
6556
6557         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6558         the list of PropertyInfo's in class hierarchy and find the
6559         accessor.  Fixes #56013.
6560
6561 2004-04-29  Martin Baulig  <martin@ximian.com>
6562
6563         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6564
6565 2004-04-29  Martin Baulig  <martin@ximian.com>
6566
6567         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6568
6569         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6570
6571 2004-04-29  Martin Baulig  <martin@ximian.com>
6572
6573         * class.cs (ConstructorInitializer.Resolve): Check whether the
6574         parent .ctor is accessible.  Fixes #52146.
6575
6576 2004-04-29  Martin Baulig  <martin@ximian.com>
6577
6578         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6579
6580         * statement.cs (Using.EmitLocalVariableDecls): Use
6581         TypeManager.idisposable_type, not typeof (IDisposable).
6582         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6583
6584 2004-04-29  Martin Baulig  <martin@ximian.com>
6585
6586         * class.cs (Event.Define): Don't emit the field and don't set
6587         RTSpecialName and SpecialName for events on interfaces.  Fixes
6588         #57703. 
6589
6590 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6591
6592         Refactor Attribute.ApplyAttributes.
6593         * attribute.cs (Attributable): New base class for objects that can
6594         have Attributes applied on them.
6595         (Attribute): Make AttributeUsage fields public.
6596         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6597         (Attribute.IsInternalCall): New property.
6598         (Attribute.UsageAttr): Convert to a public read-only property.
6599         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6600         (Attribute.ResolveType, Attribute.Resolve)
6601         (Attribute.ScanForIndexerName): Update to reflect changes.
6602         (Attribute.CheckAttributeTarget): Re-format.
6603         (Attribute.ApplyAttributes): Refactor, to various
6604         Attributable.ApplyAttributeBuilder methods.
6605         * decl.cs (MemberCore): Make Attributable.
6606         * class.cs (Accessor): Make Attributable.
6607         (MethodData.ApplyAttributes): Use proper attribute types, not
6608         attribute names.
6609         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6610         (TypeContainer.ApplyAttributeBuilder)
6611         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6612         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6613         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6614         (Operator.ApplyAttributeBuilder): New factored-out methods.
6615         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6616         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6617         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6618         * parameter.cs (ParameterBase): New Attributable base class
6619         that can also represent Return types.
6620         (Parameter): Update to the changes.
6621
6622 2004-04-29  Jackson Harper  <jackson@ximian.com>
6623
6624         * driver.cs: Prefer the corlib system version when looking for
6625         assemblies in the GAC. This is still a hack, but its a better hack
6626         now.
6627         
6628 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6629
6630         * decl.cs, enum.cs: Improved error 3005 reporting.
6631   
6632         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6633         (related_symbols): New private member for list of symbols
6634         related to reported error/warning.
6635         
6636         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6637
6638 2004-04-29  Martin Baulig  <martin@ximian.com>
6639
6640         * ecore.cs (Expression.Constantify): If we're an enum and
6641         TypeManager.TypeToCoreType() doesn't give us another type, use
6642         t.UnderlyingSystemType.  Fixes #56178.  
6643
6644 2004-04-29  Martin Baulig  <martin@ximian.com>
6645
6646         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6647         interfaces and for each interface, only add members directly
6648         declared in that interface.  Fixes #53255.
6649
6650 2004-04-28  Martin Baulig  <martin@ximian.com>
6651
6652         * expression.cs (ConditionalLogicalOperator): Use a temporary
6653         variable for `left' to avoid that we evaluate it more than once;
6654         bug #52588.
6655
6656 2004-04-28  Martin Baulig  <martin@ximian.com>
6657
6658         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6659         `void[]' (CS1547).
6660
6661 2004-04-28  Martin Baulig  <martin@ximian.com>
6662
6663         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6664         void (CS1547).
6665
6666         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6667         whether the type is not void (CS1547).
6668
6669 2004-04-28  Martin Baulig  <martin@ximian.com>
6670
6671         * expression.cs (Unary.DoResolveLValue): Override this and report
6672         CS0131 for anything but Operator.Indirection.
6673
6674 2004-04-28  Martin Baulig  <martin@ximian.com>
6675
6676         Committing a patch from Ben Maurer; see bug #50820.
6677
6678         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6679         check for classes.
6680
6681         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6682         classes.        
6683
6684 2004-04-28  Martin Baulig  <martin@ximian.com>
6685
6686         Committing a patch from Ben Maurer; see bug #50820.
6687
6688         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6689         check for classes.
6690
6691         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6692         classes.        
6693
6694 2004-04-28  Martin Baulig  <martin@ximian.com>
6695
6696         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6697         (Block.AddLabel): Call DoLookupLabel() to only search in the
6698         current block.
6699
6700 2004-04-28  Martin Baulig  <martin@ximian.com>
6701
6702         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6703         comparing StringConstants and NullLiterals in Equality and Inequality.
6704
6705 2004-04-28  Jackson Harper  <jackson@ximian.com>
6706
6707         * driver.cs: Attempt to load referenced assemblies from the
6708         GAC. This is the quick and dirty version of this method that
6709         doesnt take into account versions and just takes the first
6710         canidate found. Will be good enough for now as we will not have more
6711         then one version installed into the GAC until I update this method.
6712
6713 2004-04-28  Martin Baulig  <martin@ximian.com>
6714
6715         * typemanager.cs (TypeManager.CheckStructCycles): New public
6716         static method to check for cycles in the struct layout.
6717
6718         * rootcontext.cs (RootContext.PopulateTypes): Call
6719         TypeManager.CheckStructCycles() for each TypeContainer.
6720         [Note: We only need to visit each type once.]
6721
6722 2004-04-28  Martin Baulig  <martin@ximian.com>
6723
6724         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6725
6726         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6727         success and added `out object value'.  Use a `bool resolved' field
6728         to check whether we've already been called rather than
6729         `ConstantValue != null' since this breaks for NullLiterals.
6730
6731 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6732
6733         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6734         setting of this flag, since the 'set' method may be non-public.
6735
6736 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6737
6738         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6739         check on current_vector.Block.
6740
6741 2004-04-27  Martin Baulig  <martin@ximian.com>
6742
6743         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6744         a field initializer.  Fixes #56459.
6745
6746 2004-04-27  Martin Baulig  <martin@ximian.com>
6747
6748         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6749         we're not attempting to use an indexer.  Fixes #52154.
6750
6751 2004-04-27  Martin Baulig  <martin@ximian.com>
6752
6753         * statement.cs (Return): Don't create a return label if we don't
6754         need it; reverts my change from January 20th.  Thanks to Ben
6755         Maurer for this.
6756
6757 2004-04-27  Martin Baulig  <martin@ximian.com>
6758
6759         According to the spec, `goto' can only leave a nested scope, but
6760         never enter it.
6761
6762         * statement.cs (Block.LookupLabel): Only lookup in the current
6763         block, don't recurse into parent or child blocks.
6764         (Block.AddLabel): Check in parent and child blocks, report
6765         CS0140/CS0158 if we find a duplicate.
6766         (Block): Removed this indexer for label lookups.
6767         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6768         this already does the error reporting for us.
6769
6770         * flowanalysis.cs
6771         (FlowBranching.UsageVector.Block): New public variable; may be null.
6772         (FlowBranching.CreateSibling): Added `Block' argument.
6773         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6774         label for the target of a `goto' and check whether we're not
6775         leaving a `finally'.
6776
6777 2004-04-27  Martin Baulig  <martin@ximian.com>
6778
6779         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6780         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6781         just for returns).
6782
6783 2004-04-27  Martin Baulig  <martin@ximian.com>
6784
6785         * statement.cs (Block.AddLabel): Also check for implicit blocks
6786         and added a CS0158 check.
6787
6788 2004-04-27  Martin Baulig  <martin@ximian.com>
6789
6790         * flowanalysis.cs (FlowBranchingLoop): New class.
6791         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6792         UsageVector's instead of an ArrayList.
6793         (FlowBranching.Label): Likewise.
6794         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6795         (FlowBranching.AddBreakVector): New method.
6796
6797 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6798
6799         * attribute.cs: Small regression fix: only convert the type if we
6800         the type is different, fixes System.Drawing build.
6801
6802 2004-04-27  Martin Baulig  <martin@ximian.com>
6803
6804         * attribute.cs (Attribute.Resolve): If we have a constant value
6805         for a named field or property, implicity convert it to the correct
6806         type.
6807
6808 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6809
6810         * statement.cs (Block.Block): Implicit blocks share
6811         'child_variable_names' fields with parent blocks.
6812         (Block.AddChildVariableNames): Remove.
6813         (Block.AddVariable): Mark variable as "used by a child block" in
6814         every surrounding block.
6815         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6816         been used in a child block, complain about violation of "Invariant
6817         meaning in blocks" rule.
6818         * cs-parser.jay (declare_local_variables): Don't use
6819         AddChildVariableNames.
6820         (foreach_statement): Don't create an implicit block: 'foreach'
6821         introduces a scope.
6822
6823 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6824
6825         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6826         converting from 0L to ulong.  Fixes 57522.
6827
6828 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6829
6830         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6831         derived class hides via 'new' keyword field from base class (test-242.cs).
6832         TODO: Handle this in the more general way.
6833         
6834         * class.cs (CheckBase): Ditto.
6835
6836 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6837
6838         * decl.cs (caching_flags): New member for storing cached values
6839         as bit flags.
6840         (MemberCore.Flags): New enum where bit flags for caching_flags
6841         are defined.
6842         (MemberCore.cls_compliance): Moved to caching_flags.
6843         (DeclSpace.Created): Moved to caching_flags.
6844
6845         * class.cs: Use caching_flags instead of DeclSpace.Created
6846         
6847 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6848
6849         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6850         if we are only a derived class, not a nested class.
6851
6852         * typemanager.cs: Same as above, but do this at the MemberLookup
6853         level (used by field and methods, properties are handled in
6854         PropertyExpr).   Allow for the qualified access if we are a nested
6855         method. 
6856
6857 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6858
6859         * class.cs: Refactoring.
6860         (IMethodData): New inteface; Holds links to parent members
6861         to avoid member duplication (reduced memory allocation).
6862         (Method): Implemented IMethodData interface.
6863         (PropertyBase): New inner classes for get/set methods.
6864         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6865         (Event): New inner classes for add/remove methods.
6866         (Event.DelegateMethod): Implemented IMethodData interface.
6867
6868         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6869         EmitContext (related to class.cs refactoring).
6870
6871 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6872
6873         * delegate.cs (Delegate.VerifyApplicability): If the number of
6874         arguments are the same as the number of parameters, first try to
6875         verify applicability ignoring  any 'params' modifier on the last
6876         parameter.
6877         Fixes #56442.
6878
6879 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6880
6881         * class.cs (TypeContainer.AddIndexer): Use
6882         'ExplicitInterfaceName' to determine if interface name was
6883         explicitly specified.  'InterfaceType' is not initialized at this time.
6884         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6885         Indexers array is already in the required order.  Initialize
6886         'IndexerName' only if there are normal indexers.
6887         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6888         (TypeContainer.Emit): Emit DefaultMember attribute only if
6889         IndexerName is initialized.
6890         Fixes #56300.
6891
6892 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6893
6894         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6895         Fixes #57007
6896
6897 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6898
6899         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6900         attributes.
6901         Fix for #56456.
6902
6903         * attribute.cs (Attribute.Resolve): Check for duplicate named
6904         attributes.
6905         Fix for #56463.
6906
6907 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6908
6909         * iterators.cs (MarkYield): track whether we are in an exception,
6910         and generate code accordingly.  Use a temporary value to store the
6911         result for our state.
6912
6913         I had ignored a bit the interaction of try/catch with iterators
6914         since their behavior was not entirely obvious, but now it is
6915         possible to verify that our behavior is the same as MS .NET 2.0
6916
6917         Fixes 54814
6918
6919 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6920
6921         * iterators.cs: Avoid creating temporaries if there is no work to
6922         do. 
6923
6924         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6925         Enumerations, use TypeManager.EnumToUnderlying and call
6926         recursively. 
6927
6928         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6929         bug #57013
6930
6931         (This.Emit): Use EmitContext.EmitThis to emit our
6932         instance variable.
6933
6934         (This.EmitAssign): Ditto.
6935
6936         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6937         codepaths, we will move all the functionality into
6938         Mono.CSharp.This 
6939
6940         (FieldExpr.EmitAssign): Ditto.
6941
6942         This fixes several hidden bugs that I uncovered while doing a code
6943         review of this today.
6944
6945         * codegen.cs (EmitThis): reworked so the semantics are more clear
6946         and also support value types "this" instances.
6947
6948         * iterators.cs: Changed so that for iterators in value types, we
6949         do not pass the value type as a parameter.  
6950
6951         Initialization of the enumerator helpers is now done in the caller
6952         instead of passing the parameters to the constructors and having
6953         the constructor set the fields.
6954
6955         The fields have now `assembly' visibility instead of private.
6956
6957 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6958
6959         * expression.cs (Argument.Resolve): Check if fields passed as ref
6960         or out are contained in a MarshalByRefObject.
6961
6962         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6963         another compiler type.
6964
6965 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6966
6967         * class.cs (Indexer.Define): use the new name checking method.
6968         Also, return false on an error.
6969         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6970         (is_identifier_[start/part]_character): make static.
6971
6972 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6973
6974         * expression.cs (Binary.ResolveOperator): Do no append strings
6975         twice: since we can be invoked more than once (array evaluation)
6976         on the same concatenation, take care of this here.  Based on a fix
6977         from Ben (bug #56454)
6978
6979 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6980
6981         * codegen.cs: Fix another case where CS1548 must be reported (when 
6982         delay-sign isn't specified and no private is available #56564). Fix
6983         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6984         error when MCS is used on the MS runtime and we need to delay-sign 
6985         (which seems unsupported by AssemblyBuilder - see #56621).
6986
6987 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6988
6989         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6990         (TypeManager.ComputeNamespaces): Faster implementation for
6991         Microsoft runtime.
6992
6993         * compiler.csproj: Updated AssemblyName to mcs.
6994
6995 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6996
6997         * rootcontext.cs: Add new types to the boot resolution.
6998
6999         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7000         MulticastDelegate is not allowed.
7001
7002         * typemanager.cs: Add new types to lookup: System.TypedReference
7003         and ArgIterator.
7004
7005         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7006         check for TypedReference or ArgIterator, they are not allowed. 
7007
7008         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7009         makes us properly catch 1510 in some conditions (see bug 56016 for
7010         details). 
7011
7012 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7013
7014         * CryptoConvert.cs: update from corlib version
7015         with endian fixes.
7016
7017 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7018
7019         * class.cs (Indexer.Define): Check indexername declaration
7020
7021 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7022
7023         * attribute.cs (IsClsCompliant): Fixed problem with handling
7024         all three states (compliant, not-compliant, undetected).
7025
7026 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7027
7028         * attribute.cs (Attribute): Location is now public.
7029         (Resolve): Store resolved arguments (pos_values) in attribute class.
7030         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7031         (GetClsCompliantAttributeValue): New method that gets
7032         CLSCompliantAttribute value.
7033         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7034         if exists else null.
7035         (AttributeTester): New class for CLS-Compliant verification routines.
7036
7037         * class.cs (Emit): Add CLS-Compliant verification.
7038         (Method.GetSignatureForError): Implemented.
7039         (Constructor.GetSignatureForError): Implemented
7040         (Constructor.HasCompliantArgs): Returns if constructor has
7041         CLS-Compliant arguments.
7042         (Constructor.Emit): Override.
7043         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7044         is needed to test only parameters.
7045         (FieldBase.GetSignatureForError): Implemented.
7046         (TypeContainer): New member for storing base interfaces.
7047         (TypeContainer.FindMembers): Search in base interfaces too.
7048
7049         * codegen.cs (GetClsComplianceAttribute): New method that gets
7050         assembly or module CLSCompliantAttribute value.
7051         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7052         for assembly.
7053         (ModuleClass.Emit): Add error 3012 test.
7054
7055         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7056
7057         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7058         state for all decl types.
7059         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7060         if CLS-Compliant tests are required.
7061         (IsClsCompliaceRequired): New method. Analyze whether code
7062         must be CLS-Compliant.
7063         (IsExposedFromAssembly): New method. Returns true when MemberCore
7064         is exposed from assembly.
7065         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7066         value or gets cached value.
7067         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7068         is explicitly marked with CLSCompliantAttribute.
7069         (IsIdentifierClsCompliant): New abstract method. This method is
7070         used to testing error 3005.
7071         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7072         for identifier and parameters CLS-Compliant testing.
7073         (VerifyClsCompliance): New method. The main virtual method for
7074         CLS-Compliant verifications.
7075         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7076         null. I don't know why is null (too many public members !).
7077         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7078         and get value of first CLSCompliantAttribute that found.
7079
7080         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7081         (VerifyClsCompliance): Override and add extra tests.
7082
7083         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7084         clscheck- disable CLS-Compliant verification event if assembly is has
7085         CLSCompliantAttribute(true).
7086
7087         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7088         ApllyAttribute is now called in emit section as in the other cases.
7089         Possible future Emit integration.
7090         (IsIdentifierClsCompliant): New override.
7091         (VerifyClsCompliance): New override.
7092         (GetEnumeratorName): Returns full enum name.
7093
7094         * parameter.cs (GetSignatureForError): Implemented.
7095
7096         * report.cs (WarningData): New struct for Warning message information.
7097         (LocationOfPreviousError): New method.
7098         (Warning): New method. Reports warning based on the warning table.
7099         (Error_T): New method. Reports error based on the error table.
7100
7101         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7102         verifications are done here.
7103
7104         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7105
7106         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7107         CLSCompliantAttribute.
7108         (all_imported_types): New member holds all imported types from other
7109         assemblies.
7110         (LoadAllImportedTypes): New method fills static table with exported types
7111         from all referenced assemblies.
7112         (Modules): New property returns all assembly modules.
7113
7114 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7115
7116         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7117         throwing a parser error.
7118
7119         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7120         which removes the hardcoded get_/set_ prefixes for properties, as
7121         IL allows for the properties to be named something else.  
7122
7123         Bug #56013
7124
7125         * expression.cs: Do not override operand before we know if it is
7126         non-null.  Fix 56207
7127
7128 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7129
7130         * typemanager.cs: support for pinned variables.
7131
7132 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7133
7134         * decl.cs, typemanager.cs: Avoid using an arraylist
7135         as a buffer if there is only one result set.
7136
7137 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7138
7139         * expression.cs: Make sure you cant call a static method
7140         with an instance expression, bug #56174.
7141
7142 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7143
7144         * class.cs (IsDuplicateImplementation): Improve error reporting to
7145         flag 663 (method only differs in parameter modifier).
7146
7147         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7148         in preprocessor directives.
7149
7150         * location.cs (LookupFile): Allow for the empty path.
7151
7152         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7153         better approach for some of that patch, but its failing with the
7154         CharSet enumeration.  For now try/catch will do.
7155
7156         * typemanager.cs: Do not crash if a struct does not have fields.
7157         Fixes 56150.
7158
7159 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7160
7161         * expression.cs: cs0213, cant fix a fixed expression.
7162         fixes 50231.
7163
7164 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7165
7166         * cs-parser.jay: detect invalid embeded statements gracefully.
7167         bug #51113.
7168
7169 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7170
7171         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7172         As a regex:
7173         s/
7174         the invocation type may not be a subclass of the tye of the item/
7175         The type of the item must be a subclass of the invocation item.
7176         /g
7177
7178         Fixes bug #50820.
7179
7180 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7181
7182         * attribute.cs: Added methods to get a string and a bool from an
7183         attribute. Required to information from AssemblyKeyFileAttribute,
7184         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7185         * codegen.cs: Modified AssemblyName creation to include support for
7186         strongnames. Catch additional exceptions to report them as CS1548.
7187         * compiler.csproj: Updated include CryptoConvert.cs.
7188         * compiler.csproj.user: Removed file - user specific configuration.
7189         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7190         Mono.Security assembly. The original class is maintained and tested in
7191         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7192         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7193         like CSC 8.0 (C# v2) supports.
7194         * Makefile: Added CryptoConvert.cs to mcs sources.
7195         * rootcontext.cs: Added new options for strongnames.
7196
7197 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7198
7199         * driver.cs: For --expect-error, report error code `2'
7200         if the program compiled with no errors, error code `1' if
7201         it compiled with an error other than the one expected.
7202
7203 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7204
7205         * compiler.csproj: Updated for Visual Studio .NET 2003.
7206         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7207         * compiler.sln: Updated for Visual Studio .NET 2003.
7208
7209 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7210
7211         * expression.cs: Fix bug #47234. We basically need to apply the
7212         rule that we prefer the conversion of null to a reference type
7213         when faced with a conversion to 'object' (csc behaviour).
7214
7215 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7216
7217         * statement.cs: Shorter form for foreach, eliminates
7218         a local variable. r=Martin.
7219
7220 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7221
7222         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7223         checks if we can use brtrue/brfalse to test for 0.
7224         * expression.cs: use the above in the test for using brtrue/brfalse.
7225         cleanup code a bit.
7226
7227 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7228
7229         * expression.cs: Rewrite string concat stuff. Benefits:
7230
7231         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7232         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7233         rather than a concat chain.
7234
7235         * typemanager.cs: Add lookups for more concat overloads.
7236
7237 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7238
7239         * expression.cs: Emit shorter il code for array init.
7240
7241         newarr
7242         dup
7243         // set 1
7244
7245         // set 2
7246
7247         newarr
7248         stloc.x
7249
7250         ldloc.x
7251         // set 1
7252
7253         ldloc.x
7254         // set 2
7255
7256 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7257
7258         * statement.cs: Before, two switch blocks would be merged if the
7259         total size of the blocks (end_item - begin_item + 1) was less than
7260         two times the combined sizes of the blocks.
7261
7262         Now, it will only merge if after the merge at least half of the
7263         slots are filled.
7264
7265         fixes 55885.
7266
7267 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7268
7269         * class.cs : csc build fix for GetMethods(). See bug #52503.
7270
7271 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7272
7273         * expression.cs: Make sure fp comparisons work with NaN.
7274         This fixes bug #54303. Mig approved this patch a long
7275         time ago, but we were not able to test b/c the runtime
7276         had a related bug.
7277
7278 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7279
7280         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7281
7282 2004-03-19  Martin Baulig  <martin@ximian.com>
7283
7284         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7285         error here and not in our caller.
7286
7287 2004-03-19  Martin Baulig  <martin@ximian.com>
7288
7289         * interface.cs: Completely killed this file.
7290         (Interface): We're now a TypeContainer and live in class.cs.
7291
7292         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7293         argument; we're now also called for interfaces.
7294         (TypeContainer.DefineMembers): Allow this method being called
7295         multiple times.
7296         (TypeContainer.GetMethods): New public method; formerly known as
7297         Interface.GetMethod().  This is used by PendingImplementation.
7298         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7299         it's now private and non-static.
7300         (Interface): Moved this here; it's now implemented similar to
7301         Class and Struct.
7302         (Method, Property, Event, Indexer): Added `bool is_interface'
7303         argument to their .ctor's.
7304         (MemberBase.IsInterface): New public field.
7305
7306         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7307         instances instead of InterfaceMethod, InterfaceProperty, etc.
7308         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7309         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7310
7311 2004-03-19  Martin Baulig  <martin@ximian.com>
7312
7313         * class.cs (MethodCore.IsDuplicateImplementation): New private
7314         method which does the CS0111 checking.
7315         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7316         Use IsDuplicateImplementation().
7317
7318 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7319
7320         * decl.cs (FindMemberToOverride): New method to find the correct
7321         method or property to override in the base class.
7322         * class.cs
7323             - Make Method/Property use the above method to find the
7324               version in the base class.
7325             - Remove the InheritableMemberSignatureCompare as it is now
7326               dead code.
7327
7328         This patch makes large code bases much faster to compile, as it is
7329         O(n) rather than O(n^2) to do this validation.
7330
7331         Also, it fixes bug 52458 which is that nested classes are not
7332         taken into account when finding the base class member.
7333
7334         Reviewed/Approved by Martin.
7335
7336 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7337
7338         * interface.cs: In all interface classes removed redundant
7339         member initialization.
7340
7341 2004-03-16  Martin Baulig  <martin@ximian.com>
7342
7343         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7344
7345 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7346
7347         * decl.cs (DefineTypeAndParents): New helper method to define a
7348         type's containers before the type itself is defined;  This is a
7349         bug exposed by the recent changes to Windows.Forms when an
7350         implemented interface was defined inside a class that had not been
7351         built yet.   
7352
7353         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7354
7355         (Check): Loop correctly to report errors modifiers
7356         (UNSAFE was not in the loop, since it was the same as TOP).
7357
7358         * interface.cs: Every interface member now takes a ModFlags,
7359         instead of a "is_new" bool, which we set on the base MemberCore. 
7360
7361         Every place where we called "UnsafeOk" in the interface, now we
7362         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7363         the unsafe settings from the member declaration instead of the
7364         container interface. 
7365
7366         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7367
7368         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7369         `set_indexer_name' to the pending bits (one per type).
7370
7371         We fixed a bug today that was picking the wrong method to
7372         override, since for properties the existing InterfaceMethod code
7373         basically ignored the method name.  Now we make sure that the
7374         method name is one of the valid indexer names.
7375
7376 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7377  
7378         * support.cs (SeekableStreamReader): Keep track of stream byte
7379         positions and don't mix them with character offsets to the buffer.
7380
7381         Patch from Gustavo Giráldez
7382
7383 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7384
7385         * interface.cs (InterfaceSetGetBase): Removed double member
7386         initialization, base class does it as well.
7387
7388 2004-03-13  Martin Baulig  <martin@ximian.com>
7389
7390         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7391         when compiling corlib.
7392
7393 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7394
7395         * convert.cs (ExplicitConversion): We were reporting an error on
7396         certain conversions (object_type source to a value type, when the
7397         expression was `null') before we had a chance to pass it through
7398         the user defined conversions.
7399
7400         * driver.cs: Replace / and \ in resource specifications to dots.
7401         Fixes 50752
7402
7403         * class.cs: Add check for duplicate operators.  Fixes 52477
7404
7405 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7406
7407         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7408         that are in the middle of the statements, not only at the end.
7409         Fixes #54987
7410
7411         * class.cs (TypeContainer.AddField): No longer set the
7412         `HaveStaticConstructor' flag, now we call it
7413         `UserDefineStaticConstructor' to diferentiate the slightly
7414         semantic difference.
7415
7416         The situation is that we were not adding BeforeFieldInit (from
7417         Modifiers.TypeAttr) to classes that could have it.
7418         BeforeFieldInit should be set to classes that have no static
7419         constructor. 
7420
7421         See:
7422
7423         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7424
7425         And most importantly Zoltan's comment:
7426
7427         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7428
7429         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7430          before its static fields are used', i.e. initialization does not need
7431          to be triggered by the first access to the type. Setting this flag
7432          helps the JIT to compile better code, since it can run the static
7433          constructor at JIT time, and does not need to generate code to call it
7434          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7435          this flag for lots of classes like String. 
7436          
7437          csc sets this flag if the type does not have an explicit static 
7438          constructor. The reasoning seems to be that if there are only static
7439          initalizers for a type, and no static constructor, then the programmer
7440          does not care when this initialization happens, so beforefieldinit
7441          can be used.
7442          
7443          This bug prevents the AOT compiler from being usable, since it 
7444          generates so many calls to mono_runtime_class_init that the AOT code
7445          is much slower than the JITted code. The JITted code is faster, 
7446          because it does not generate these calls if the vtable is type is
7447          already initialized, which is true in the majority of cases. But the
7448          AOT compiler can't do this."
7449
7450 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7451
7452         * class.cs (MethodData.Emit): Refactor the code so symbolic
7453         information is generated for destructors;  For some reasons we
7454         were taking a code path that did not generate symbolic information
7455         before. 
7456
7457 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7458
7459         * class.cs: Create a Constructor.CheckBase method that
7460         takes care of all validation type code. The method
7461         contains some code that was moved from Define.
7462
7463         It also includes new code that checks for duplicate ctors.
7464         This fixes bug #55148.
7465
7466 2004-03-09  Joshua Tauberer <tauberer@for.net>
7467
7468         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7469         a { ... }-style array creation invokes EmitStaticInitializers
7470         which is not good for reference-type arrays.  String, decimal
7471         and now null constants (NullCast) are not counted toward
7472         static initializers.
7473
7474 2004-03-05  Martin Baulig  <martin@ximian.com>
7475
7476         * location.cs (SourceFile.HasLineDirective): New public field;
7477         specifies whether the file contains or is referenced by a "#line"
7478         directive.
7479         (Location.DefineSymbolDocuments): Ignore source files which
7480         either contain or are referenced by a "#line" directive.        
7481
7482 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7483
7484         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7485         direct access to our parent, so check the method inline there.
7486
7487 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7488
7489         * expression.cs (Invocation.EmitCall): Miguel's last commit
7490         caused a regression. If you had:
7491
7492             T t = null;
7493             t.Foo ();
7494
7495         In Foo the implict this would be null.
7496
7497 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7498
7499         * expression.cs (Invocation.EmitCall): If the method is not
7500         virtual, do not emit a CallVirt to it, use Call.
7501
7502         * typemanager.cs (GetFullNameSignature): Improve the method to
7503         cope with ".ctor" and replace it with the type name.
7504
7505         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7506         as an argument the ConstructorBuilder where it is being defined,
7507         to catch the recursive constructor invocations.
7508
7509 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7510
7511         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7512         routines to check if a type is an enumerable/enumerator allow
7513         classes that implement the IEnumerable or IEnumerator interfaces.
7514
7515         * class.cs (Property, Operator): Implement IIteratorContainer, and
7516         implement SetYields.
7517
7518         (Property.Define): Do the block swapping for get_methods in the
7519         context of iterators.   We need to check if Properties also
7520         include indexers or not.
7521
7522         (Operator): Assign the Block before invoking the
7523         OperatorMethod.Define, so we can trigger the Iterator code
7524         replacement. 
7525
7526         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7527         Property and Operator classes are not created when we parse the
7528         declarator but until we have the block completed, so we use a
7529         singleton SimpleIteratorContainer.Simple to flag whether the
7530         SetYields has been invoked.
7531
7532         We propagate this setting then to the Property or the Operator to
7533         allow the `yield' to function.
7534
7535 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7536
7537         * codegen.cs: Implemented attribute support for modules.
7538         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7539         Assembly/Module functionality.
7540
7541         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7542         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7543         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7544
7545 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7546
7547         * interface.cs (FindMembers): The operation is performed on all base
7548         interfaces and not only on the first. It is required for future CLS Compliance patch.
7549
7550 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7551
7552         * statement.cs, codegen.cs:
7553         This patch deals with patterns such as:
7554
7555         public class List : IEnumerable {
7556
7557                 public MyEnumerator GetEnumerator () {
7558                         return new MyEnumerator(this);
7559                 }
7560
7561                 IEnumerator IEnumerable.GetEnumerator () {
7562                         ...
7563                 }
7564                 
7565                 public struct MyEnumerator : IEnumerator {
7566                         ...
7567                 }
7568         }
7569
7570         Before, there were a few things we did wrong:
7571         1) we would emit callvirt on a struct, which is illegal
7572         2) we emited ldarg when we needed to emit ldarga
7573         3) we would mistakenly call the interface methods on an enumerator
7574         type that derived from IEnumerator and was in another assembly. For example:
7575
7576         public class MyEnumerator : IEnumerator
7577
7578         Would have the interface methods called, even if there were public impls of the
7579         method. In a struct, this lead to invalid IL code.
7580
7581 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7582
7583         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7584           renamed to Emit.
7585
7586         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7587
7588 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7589
7590         * cs-parser.jay: Fix small regression: we were not testing V2
7591         compiler features correctly.
7592
7593         * interface.cs: If the emit context is null, then create one
7594
7595 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7596
7597         * decl.cs (GetSignatureForError): New virtual method to get full name
7598           for error messages.
7599
7600         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7601           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7602
7603         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7604           Duplicated members and code in these classes has been removed.
7605           Better encapsulation in these classes.
7606
7607 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7608
7609         * assign.cs (Assign.DoResolve): When dealing with compound
7610         assignments, there is a new rule in ECMA C# 2.4 (might have been
7611         there before, but it is documented here) that states that in:
7612
7613         a op= b;
7614
7615         If b is of type int, and the `op' is a shift-operator, then the
7616         above is evaluated as:
7617
7618         a = (int) a op b 
7619
7620         * expression.cs (Binary.ResolveOperator): Instead of testing for
7621         int/uint/long/ulong, try to implicitly convert to any of those
7622         types and use that in pointer arithmetic.
7623
7624         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7625         method to print information for from the type, not from the
7626         null-method we were given.
7627
7628 2004-02-01  Duncan Mak  <duncan@ximian.com>
7629
7630         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7631         parsing for cmd, fixes bug #53694.
7632
7633 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7634
7635         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7636         in the member name duplication tests. Property and operator name duplication
7637         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7638
7639 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7640
7641         * interface.cs (PopulateMethod): Fixed crash when interface method
7642         returns not existing type (error test cs0246-3.cs).
7643
7644 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7645
7646         * cs-parser.jay (interface_accessors): Re-write actions to also
7647         store attributes attached to get and set methods. Fix spelling
7648         while at it.
7649
7650         (inteface_property_declaration): Modify accordingly.
7651
7652         (InterfaceAccessorInfo): New helper class to store information to pass
7653         around between rules that use interface_accessors.
7654
7655         * interface.cs (Emit): Apply attributes on the get and set
7656         accessors of properties and indexers too.
7657
7658         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7659         right MethodBuilder when applying attributes to the get and set accessors.
7660
7661 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7662
7663         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7664
7665 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7666
7667         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7668
7669 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7670
7671         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7672         changes that treat `yield' specially when present before `break'
7673         or `return' tokens.
7674
7675         * cs-tokenizer.cs: yield is no longer a keyword.
7676
7677 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7678
7679         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7680         setting for default constructors.
7681         For default constructors are almost every time set wrong Modifier. The
7682         generated IL code has been alright. But inside mcs this values was
7683         wrong and this was reason why several of my CLS Compliance tests
7684         failed.
7685
7686 2004-01-22  Martin Baulig  <martin@ximian.com>
7687
7688         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7689         not a QualifiedIdentifier.  This is what `type_name_expression'
7690         was previously doing.
7691         (type_name_expression): Removed; the code is now in
7692         `namespace_or_type_name'.
7693         (qualified_identifier): Removed, use `namespace_or_type_name'
7694         instead.
7695         (QualifiedIdentifier): Removed this class.      
7696
7697 2004-01-22  Martin Baulig  <martin@ximian.com>
7698
7699         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7700         not a string as alias name.
7701
7702 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7703
7704         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7705         #52730 bug, and instead compute correctly the need to use a
7706         temporary variable when requesting an address based on the
7707         static/instace modified of the field and the constructor.
7708  
7709 2004-01-21  Martin Baulig  <martin@ximian.com>
7710
7711         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7712         class and namespace before looking up aliases.  Fixes #52517.
7713
7714 2004-01-21  Martin Baulig  <martin@ximian.com>
7715
7716         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7717         assinged in a 'try'; fixes exception4.cs.
7718
7719 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7720         * class.cs : Implemented parameter-less constructor for TypeContainer
7721
7722         * decl.cs: Attributes are now stored here. New property OptAttributes
7723
7724         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7725
7726         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7727
7728 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7729
7730         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7731           (CSharpSignature): New method for indexer and property signature.
7732
7733 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7734
7735         * pending.cs (IsVirtualFilter): Faster implementation.
7736
7737 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7738
7739         * typemanager.cs: Avoid inclusion of same assembly more than once.
7740
7741 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7742
7743         * cs-parser.jay: Fixed problem where the last assembly attribute
7744           has been applied also to following declaration (class, struct, etc.)
7745           
7746 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7747
7748         * class.cs: Added error CS0538, CS0539 reporting.
7749         Fixed crash on Microsoft runtime when field type is void.
7750
7751         * cs-parser.jay: Added error CS0537 reporting.
7752
7753         * pending.cs: Added error CS0535 reporting.
7754         Improved error report for errors CS0536, CS0534.
7755
7756 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7757
7758         Merge a few bits from the Anonymous Method MCS tree.
7759
7760         * statement.cs (ToplevelBlock): New class for toplevel methods,
7761         will hold anonymous methods, lifted variables.
7762
7763         * cs-parser.jay: Create toplevel blocks for delegates and for
7764         regular blocks of code. 
7765
7766 2004-01-20  Martin Baulig  <martin@ximian.com>
7767
7768         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7769         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7770         and `NeedExplicitReturn'; added `IsLastStatement'.
7771         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7772         have a `ReturnLabel' or we're not unreachable.
7773
7774         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7775         child's reachability; don't just override ours with it.  Fixes
7776         #58058 (lluis's example).
7777         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7778         InFinally(), InLoop(), InSwitch() and
7779         BreakCrossesTryCatchBoundary() methods.
7780
7781         * statement.cs (Return): Do all error checking in Resolve().
7782         Unless we are the last statement in a top-level block, always
7783         create a return label and jump to it.
7784         (Break, Continue): Do all error checking in Resolve(); also make
7785         sure we aren't leaving a `finally'.
7786         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7787         statement in a top-level block.
7788         (Block.Flags): Added `IsDestructor'.
7789         (Block.IsDestructor): New public property.
7790
7791 2004-01-20  Martin Baulig  <martin@ximian.com>
7792
7793         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7794
7795 2004-01-20  Martin Baulig  <martin@ximian.com>
7796
7797         * statement.cs (Statement.ResolveUnreachable): New public method.
7798         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7799         (Block.Resolve): Resolve unreachable statements.
7800
7801 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7802
7803         * expression.cs: We need to fix the case where we do
7804         not have a temp variable here.
7805
7806         * assign.cs: Only expression compound assignments need
7807         temporary variables.
7808
7809 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7810
7811         * flowanalysis.cs: Reduce memory allocation in a few ways:
7812           - A block with no variables should not allocate a bit
7813             vector for itself.
7814           - A method with no out parameters does not need any tracking
7815             for assignment of the parameters, so we need not allocate
7816             any data for it.
7817           - The arrays:
7818                 public readonly Type[] VariableTypes;
7819                 public readonly string[] VariableNames;
7820             Are redundant. The data is already stored in the variable
7821             map, so we need not allocate another array for it.
7822           - We need to add alot of checks for if (params | locals) == null
7823             due to the first two changes.
7824
7825 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7826
7827         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7828         implement IMemoryLocation, we store a copy on a local variable and
7829         take the address of it.  Patch from Benjamin Jemlich
7830
7831         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7832         to use a special "type_name_expression" rule which reduces the
7833         number of "QualifiedIdentifier" classes created, and instead
7834         directly creates MemberAccess expressions.
7835
7836 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7837
7838         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7839         that fixes #52853.  Null literal assignment to ValueType
7840
7841         * class.cs (MethodData.Emit): Instead of checking the name of the
7842         method to determine if its a destructor, create a new derived
7843         class from Method called Destructor, and test for that.  
7844
7845         * cs-parser.jay: Create a Destructor object instead of a Method.  
7846
7847         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7848
7849         Fixes: 52933
7850
7851 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7852
7853         * expression.cs (Binary.ResolveOperator): Perform an implicit
7854         conversion from MethodGroups to their delegate types on the
7855         Addition operation.
7856
7857         * delegate.cs: Introduce a new class DelegateCreation that is the
7858         base class for `NewDelegate' and `ImplicitDelegateCreation',
7859         factor some code in here.
7860
7861         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7862         conversion from MethodGroups to compatible delegate types. 
7863
7864         * ecore.cs (Expression.Resolve): Do not flag error 654
7865         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7866         we allow conversions from MethodGroups to delegate types now.
7867
7868         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7869         assignments in v2 either.
7870
7871 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7872
7873         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7874         static read-only fields in ctors.
7875
7876         Applied patch from Benjamin Jemlich 
7877
7878         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7879
7880 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7881
7882         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7883         here to return true, as they can be used like this:
7884
7885                 (XXX) int.MEMBER ()
7886
7887         Fixed 49836 and all the other dups
7888
7889 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7890
7891         * driver.cs: Implement /win32res and /win32icon.
7892
7893 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7894
7895         * cs-parser.jay: Add a rule to improve error handling for the
7896         common mistake of placing modifiers after the type.
7897
7898 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7899
7900         * cs-parser.jay (interface_event_declaration): Catch
7901         initialization of events on interfaces, and report cs0068
7902
7903         * cs-parser.jay (interface_event_declaration): Catch
7904         initialization of events. 
7905
7906         * ecore.cs: Better report missing constructors.
7907
7908         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7909         the error reporting done in the wrong place.  Fix.
7910
7911         * expression.cs (Binary.ResolveOperator): Catch the 
7912         operator + (E x, E y) error earlier, and later allow for implicit
7913         conversions in operator +/- (E e, U x) from U to the underlying
7914         type of E.
7915
7916         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7917         52596, if the container class is abstract, the default constructor
7918         is protected otherwise its public (before, we were always public).
7919
7920         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7921         fixed statement.
7922
7923         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7924         Jemlich that fixes bug #52597, MCS was generating invalid code for
7925         idisposable structs.   Thanks to Ben for following up with this
7926         bug as well.
7927
7928 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7929
7930         * driver.cs: Allow assemblies without code to be generated, fixes
7931         52230.
7932
7933 2004-01-07  Nick Drochak <ndrochak@gol.com>
7934
7935         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7936
7937 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7938
7939         * cs-parser.jay: Add rules to improve error reporting if fields or
7940         methods are declared at the namespace level (error 116)
7941
7942         * Add rules to catch event add/remove
7943
7944 2004-01-04  David Sheldon <dave-mono@earth.li>
7945
7946   * expression.cs: Added matching ")" to error message for 
7947   CS0077
7948
7949 2004-01-03 Todd Berman <tberman@gentoo.org>
7950
7951         * ecore.cs, attribute.cs:
7952         Applying fix from #52429.
7953
7954 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7955
7956         * ecore.cs, expression.cs, statement.cs:
7957         Total rewrite of how we handle branching. We
7958         now handle complex boolean expressions with fewer
7959         jumps. As well if (x == 0) no longer emits a ceq.
7960
7961         if (x is Foo) is much faster now, because we generate
7962         better code.
7963
7964         Overall, we get a pretty big improvement on our benchmark
7965         tests. The code we generate is smaller and more readable.
7966
7967         I did a full two-stage bootstrap. The patch was reviewed
7968         by Martin and Miguel.
7969
7970 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7971
7972         * cs-parser.jay: Make primary_expression not take a QI.
7973         we dont need this because the member_access rule covers
7974         us here. So we replace the rule with just IDENTIFIER.
7975
7976         This has two good effects. First, we remove a s/r conflict.
7977         Second, we allocate many fewer QualifiedIdentifier objects.
7978
7979 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7980
7981         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7982         set the correct information via SRE. This prevents
7983         hanging on the MS runtime. Fixes #29374.
7984
7985 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7986
7987         * convert.cs: correctly handle conversions to value types
7988         from Enum and ValueType as unboxing conversions.
7989
7990         Fixes bug #52569. Patch by Benjamin Jemlich.
7991
7992 2004-01-02  Ravi Pratap  <ravi@ximian.com>
7993
7994         * expression.cs (BetterConversion): Prefer int -> uint
7995         over int -> ulong (csc's behaviour). This fixed bug #52046.
7996
7997 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7998
7999         * decl.cs (MemberCache.FindMembers): now returns a
8000         MemberInfo [].
8001
8002         * typemanager.cs: In general, go with with ^^.
8003         (CopyNewMethods): take an IList.
8004         (RealMemberLookup): Only allocate an arraylist
8005         if we copy from two sets of methods.
8006
8007         This change basically does two things:
8008         1) Fewer array lists allocated due to CopyNewMethods.
8009         2) the explicit cast in MemberList costed ALOT.
8010
8011 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8012
8013         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8014         a hashtable to avoid needless string allocations when an identifier is
8015         used more than once (the common case).
8016
8017 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8018
8019         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8020         is broken, it will not return anything. So, we
8021         have to use the information we have in mcs to
8022         do the task.
8023
8024         * typemanager.cs: Add a cache for GetInterfaces,
8025         since this will now be used more often (due to ^^)
8026
8027         (GetExplicitInterfaces) New method that gets the
8028         declared, not effective, interfaces on a type
8029         builder (eg, if you have interface IFoo, interface
8030         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8031         { IBar }.
8032
8033         This patch makes MCS able to bootstrap itself on
8034         Windows again.
8035
8036 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8037
8038         * expression.cs: Remove the Nop's that Miguel put
8039         in by mistake.
8040
8041 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8042
8043         * report.cs, codegen.cs: Give the real stack trace to
8044         the error when an exception is thrown.
8045
8046 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8047
8048         * decl.cs: only allocate hashtables for ifaces if 
8049         it is an iface!
8050
8051 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8052
8053         * expression.cs: fix the error from cs0121-2.cs
8054         (a parent interface has two child interfaces that
8055         have a function with the same name and 0 params
8056         and the function is called through the parent).
8057
8058 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8059
8060         * class.cs, rootcontext.cs, typmanager.cs: do not
8061         leak pointers.
8062
8063 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8064
8065         * codegen.cs: remove stack for the ec flow branching.
8066         It is already a linked list, so no need.
8067
8068 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8069
8070         * Makefile: Allow custom profiler here.
8071
8072 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8073
8074         * typemanager.cs (LookupType):
8075           - Use a static char [], because split takes
8076             a param array for args, so it was allocating
8077             every time.
8078           - Do not store true in a hashtable, it boxes.
8079
8080 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8081
8082         * flowanalysis.cs: bytify common enums.
8083
8084 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8085
8086         * modifiers.cs: Add a new set of flags for the
8087         flags allowed on explicit interface impls.
8088         * cs-parser.jay: catch the use of modifiers in
8089         interfaces correctly.
8090         * class.cs: catch private void IFoo.Blah ().
8091
8092         All related to bug #50572.
8093
8094 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8095
8096         * decl.cs: Rewrite the consistant accessability checking.
8097         Accessability is not linear, it must be implemented in
8098         a tableish way. Fixes #49704.
8099
8100 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8101
8102         * expression.cs: Handle negation in a checked context.
8103         We must use subtraction from zero. Fixes #38674.
8104
8105 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8106
8107         * class.cs: Ignore static void main in DLLs.
8108         * rootcontext.cs: Handle the target type here,
8109         since we are have to access it from class.cs
8110         * driver.cs: account for the above.
8111
8112 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8113
8114         * report.cs: Give line numbers and files if available.
8115
8116 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8117
8118         * driver.cs: Implement /addmodule.
8119
8120         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8121         ModuleBuilders.
8122
8123 2003-12-20  Martin Baulig  <martin@ximian.com>
8124
8125         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8126         (FieldBase.IsAssigned): Removed this field.
8127         (FieldBase.SetAssigned): New public method.
8128         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8129
8130 2003-12-20  Martin Baulig  <martin@ximian.com>
8131
8132         * expression.cs (LocalVariableReference.DoResolve): Don't set
8133         `vi.Used' if we're called from DoResolveLValue().
8134
8135         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8136         returns the usage vector it just merged into the current one -
8137         pass this one to UsageWarning().
8138         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8139         of the `EmitContext', don't call this recursively on our children.
8140
8141 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8142
8143         * driver.cs: Implement /target:module.
8144
8145 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8146
8147         * support.cs (CharArrayHashtable): New helper class.
8148
8149         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8150         char arrays, not strings, so we can avoid creating a string in
8151         consume_identifier if the identifier is a keyword.
8152
8153 2003-12-16  Martin Baulig  <martin@ximian.com>
8154
8155         * statement.cs (LocalInfo.Assigned): Removed this property.
8156         (LocalInfo.Flags): Removed `Assigned'.
8157         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8158         and uses flow analysis.
8159         (Block.UsageWarning): Made this method private.
8160         (Block.Resolve): Call UsageWarning() if appropriate.
8161
8162         * expression.cs (LocalVariableReference.DoResolve): Always set
8163         LocalInfo.Used here.
8164
8165 2003-12-13  Martin Baulig  <martin@ximian.com>
8166
8167         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8168         any value here; we're now using flow analysis to figure out
8169         whether a statement/block returns a value.
8170
8171 2003-12-13  Martin Baulig  <martin@ximian.com>
8172
8173         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8174         working again.
8175         (FlowBranching.MergeFinally): Don't call
8176         `branching.CheckOutParameters()' here, this is called in
8177         MergeTopBlock().
8178         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8179         when adding the `finally' vector.       
8180
8181 2003-12-13  Martin Baulig  <martin@ximian.com>
8182
8183         * flowanalysis.cs
8184         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8185         actually work and also fix #48962.
8186
8187 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8188
8189         * decl.cs: Do not check System.Object for nested types,
8190         since we know it does not have any. Big bang for buck:
8191
8192         BEFORE:
8193            Run 1:   8.35 seconds
8194            Run 2:   8.32 seconds
8195            corlib:  17.99 seconds
8196         AFTER:
8197            Run 1:   8.17 seconds
8198            Run 2:   8.17 seconds
8199            corlib:  17.39 seconds
8200
8201 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8202
8203         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8204         time we are returning 0 members, so we save alot here.
8205
8206 2003-12-11  Martin Baulig  <martin@ximian.com>
8207
8208         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8209         `MergeChild()', also just take the `FlowBranching' as argument;
8210         call Merge() on it and return the result.
8211         (FlowBranching.Merge): We don't need to do anything if we just
8212         have one sibling.
8213
8214 2003-12-11  Martin Baulig  <martin@ximian.com>
8215
8216         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8217         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8218         Maurer for this idea.
8219
8220 2003-12-11  Martin Baulig  <martin@ximian.com>
8221
8222         * flowanalysis.cs (MergeResult): This class is now gone; we now
8223         use the `UsageVector' for this.  The reason for this is that if a
8224         branching just has one sibling, we don't need to "merge" them at
8225         all - that's the next step to do.
8226         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8227         `MergeResult'.
8228
8229 2003-12-11  Martin Baulig  <martin@ximian.com>
8230
8231         Reworked flow analyis and made it more precise and bug-free.  The
8232         most important change is that we're now using a special `Reachability'
8233         class instead of having "magic" meanings of `FlowReturns'.  I'll
8234         do some more cleanups and optimizations and also add some more
8235         documentation this week.
8236
8237         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8238         largely reworked this class.
8239         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8240         the new `Reachability' class instead of having "magic" values here.
8241         (FlowBranching): We're now using an instance of `Reachability'
8242         instead of having separate `Returns', `Breaks' etc. fields.
8243
8244         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8245         based on flow analysis; ignore the return value of block.Emit ().
8246
8247 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8248
8249         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8250         if they are private.
8251
8252 2003-12-09  Martin Baulig  <martin@ximian.com>
8253
8254         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8255         call them directly on the UsageVector.
8256
8257 2003-12-09  Martin Baulig  <martin@ximian.com>
8258
8259         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8260         Changed return type from `FlowReturns' to `Reachability'.
8261
8262 2003-12-09  Martin Baulig  <martin@ximian.com>
8263
8264         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8265         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8266         `Reachable' fields with a single `Reachability' one.
8267
8268 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8269
8270         * class.cs (FindMembers): Remove foreach's.
8271
8272         Bootstrap times:
8273
8274         BEFORE
8275                 Run 1:   8.74 seconds
8276                 Run 2:   8.71 seconds
8277
8278         AFTER
8279                 Run 1:   8.64 seconds
8280                 Run 2:   8.58 seconds
8281
8282
8283 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8284
8285         * cs-parser.jay:
8286         * gen-treedump.cs:
8287         * statement.cs:
8288         This patch does a few things:
8289                 1. EmptyStatement is now a singleton, so it is never reallocated.
8290                 2. All blah is EmptyStatement constructs have been changed to
8291                    blah == EmptyStatement.Value, which is much faster and valid
8292                    now that EmptyStatement is a singleton.
8293                 3. When resolving a block, rather than allocating a new array for
8294                    the non-empty statements, empty statements are replaced with
8295                    EmptyStatement.Value
8296                 4. Some recursive functions have been made non-recursive.
8297         Mainly the performance impact is from (3), however (1) and (2) are needed for
8298         this to work. (4) does not make a big difference in normal situations, however
8299         it makes the profile look saner.
8300
8301         Bootstrap times:
8302
8303         BEFORE
8304         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8305         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8306         Total memory allocated: 56397 KB
8307
8308         AFTER
8309         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8310         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8311         Total memory allocated: 55666 KB
8312
8313 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8314
8315         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8316         than the hashtable in a hashtable version
8317
8318         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8319         we always end up concating a string. This results in a huge perf
8320         loss, because many strings have to be tracked by the GC. In this
8321         patch, we first use a hashtable that works with two keys, so that
8322         the strings do not need to be concat'ed.
8323
8324         Bootstrap times:
8325         BEFORE
8326                 Run 1:   8.74 seconds
8327                 Run 2:   8.71 seconds
8328
8329         AFTER
8330                 Run 1:   8.65 seconds
8331                 Run 2:   8.56 seconds
8332
8333 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8334
8335         * Makefile: Add a new target `do-time' that does a quick and simple
8336         profile, leaving easy to parse output.
8337
8338 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8339
8340         * codegen.cs (Init): Create the dynamic assembly with 
8341         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8342
8343 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8344
8345         * support.cs: Make the PtrHashtable use only one
8346         instance of its comparer.
8347
8348 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8349
8350         * typemanager.cs: Fix lookup of GetNamespaces.
8351
8352 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8353
8354         * expression.cs: Removed redundant line.
8355
8356         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8357         ArrayLists, use for loops with bounds.  
8358
8359         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8360         arraylist.
8361
8362         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8363         arraylists, use for loop with bounds.
8364
8365         The above three changes give us a 0.071 second performance
8366         improvement out of 3.294 seconds down to 3.223.  On my machine
8367         the above changes reduced the memory usage by 1,387 KB during
8368         compiler bootstrap.
8369
8370         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8371         QualifiedIdentifiers.  Before we created a new string through
8372         concatenation, and mostly later on, the result would be
8373         manipulated by DecomposeQI through string manipulation.
8374
8375         This reduced the compiler memory usage for bootstrapping from
8376         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8377         compile times in 0.05 seconds.
8378
8379 2003-11-28  Dick Porter  <dick@ximian.com>
8380
8381         * support.cs: Do string compares with the Invariant culture.
8382
8383         * rootcontext.cs: 
8384         * gen-treedump.cs: 
8385         * expression.cs: 
8386         * driver.cs: 
8387         * decl.cs: 
8388         * codegen.cs: 
8389         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8390         the comparison is done with the Invariant culture.
8391
8392 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8393
8394         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8395         GetEnumerator method.
8396
8397         (ProbeCollectionType): Iterate starting at the most specific type
8398         upwards looking for a GetEnumerator
8399
8400         * expression.cs: Shift count can be up to 31 for int/uint and 63
8401         for long/ulong.
8402
8403 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8404
8405         * statement.cs (Block.LookupLabel): Also look for the label on the
8406         children blocks.  Use a hash table to keep track of visited
8407         nodes. 
8408
8409         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8410         we actually did transform the other operand, otherwise fall back
8411         to the common codepath that casts to long.
8412
8413         * cs-tokenizer.cs: Use the same code pattern as the int case.
8414         Maybe I should do the parsing myself, and avoid depending on the
8415         Parse routines to get this done.
8416
8417 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8418
8419         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8420         which fixes bug 51347.  This time test it.
8421
8422         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8423         attributes for example can not tell the difference between these.
8424         The difference was only a syntax feature of the language. 
8425
8426         * attribute.cs: Apply attributes to delegates.
8427
8428         * delegate.cs: Call the apply attributes method.
8429
8430 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8431
8432         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8433         comparing 0 vs Byte.MinValue, not the value
8434
8435         (ImplicitConversionRequired): When reporting a conversion error,
8436         use error 31 to print out the constant error instead of the
8437         simpler 29.
8438
8439         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8440         which fixes bug 51347.
8441
8442 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8443
8444         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8445         which fixes the -warnaserror command line option.
8446
8447 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8448
8449         * cfold.cs (DoNumericPromotions): During constant folding of
8450         additions on UIntConstant, special case intconstants with
8451         IntConstants like we do on the expression binary operator. 
8452
8453 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8454
8455         * convert.cs (ImplicitReferenceConversion): We were missing a case
8456         (System.Enum are not value types or class types, so we need to
8457         classify them separatedly).
8458
8459         * driver.cs: We do not support error 2007.
8460
8461 2003-11-12 Jackson Harper <jackson@ximian.com>
8462
8463         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8464         system directory. Also use the full file name so users can
8465         libraries names mscorlib-o-tron.dll in a non system dir.
8466
8467 2003-11-10  Martin Baulig  <martin@ximian.com>
8468
8469         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8470         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8471         calling `ResolveType()' on them, directly assign their `Type'.
8472
8473 2003-11-08  Martin Baulig  <martin@ximian.com>
8474
8475         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8476         return value and the `out parent' parameter.
8477         (TypeContainer.DefineType): Moved the CS0644 check into
8478         GetClassBases().  Don't pass the interface types to the
8479         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8480         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8481
8482         * ecore.cs (TypeExpr.IsAttribute): New property.
8483         (TypeExpr.GetInterfaces): New method.
8484
8485         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8486         TypeExpr instead of a Type.
8487         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8488         (Interface.DefineType): Don't pass the interface types to the
8489         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8490         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8491
8492         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8493         instead of a `Type[]'.
8494         (TypeManager.RegisterBuilder): Likewise.
8495         (TypeManager.AddUserInterface): Likewise.
8496         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8497         `Type[]' and also return a `TypeExpr[]'.
8498         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8499
8500 2003-11-08  Martin Baulig  <martin@ximian.com>
8501
8502         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8503         Expression.     
8504
8505 2003-11-08  Martin Baulig  <martin@ximian.com>
8506
8507         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8508         TypeManager.ResolveExpressionTypes().
8509
8510         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8511         instead of an Expression.
8512         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8513         (TypeExpression): New public class; formerly known as `TypeExpr'.
8514
8515         * expression.cs (ComposedCast): Derive from TypeExpr.
8516
8517         * typemanager.cs (TypeManager.system_*_expr): These are now
8518         TypExpr's instead of Expression's.
8519         (TypeManager.ResolveExpressionTypes): New public static function;
8520         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8521         of them.        
8522
8523 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8524
8525         * expression.cs (New.DoResolve): Do not dereference value that
8526         might be a null return.
8527
8528         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8529         sure that the constant value has the right type.  Fixes an
8530         unreported bug, similar to 50425.
8531
8532         * const.cs (Const.LookupConstantValue): Call
8533         ImplicitStandardConversionExists before doing a conversion to
8534         avoid havng the TypeManager.ChangeType do conversions.
8535
8536         Reduced the number of casts used
8537
8538         (Const.ChangeType): New routine to enable reuse of the constant
8539         type changing code from statement.
8540
8541         * typemanager.cs (ChangeType): Move common initialization to
8542         static global variables.
8543
8544         Fixes #50425.
8545
8546         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8547         every value type to go through, even if it was void.  Fix that. 
8548
8549         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8550         character of the define, and the is_identifier_part_character for
8551         the rest of the string.
8552
8553 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8554
8555         * expression.cs (UnaryMutator.EmitCode): When I updated
8556         LocalVariableReference.DoResolve, I overdid it, and dropped an
8557         optimization done on local variable references.
8558
8559 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8560
8561         * ecore.cs: Convert the return from Ldlen into an int.
8562
8563 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8564
8565         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8566         the accessibility, this is a special case for toplevel non-public
8567         classes (internal for instance).
8568
8569 2003-10-20  Nick Drochak <ndrochak@gol.com>
8570
8571         * ecore.cs: Fix typo and build.  Needed another right paren.
8572
8573 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8574
8575         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8576         `internal' case regular and protected, but not allowing protected
8577         to be evaluated later.  Bug 49840
8578
8579 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8580
8581         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8582         to kb.Nlast, and not the kb.nFirst to isolate the switch
8583         statement.
8584
8585         Extract the underlying type, so enumerations of long/ulong are
8586         treated like long/ulong.
8587
8588 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8589
8590         * expression.cs (New): Overload the meaning of RequestedType to
8591         track the possible creation of the NewDelegate type, since
8592         DoResolve is invoked more than once for new constructors on field
8593         initialization.
8594
8595         See bugs: #48800 and #37014
8596
8597         * cs-parser.jay (declare_local_constants): Take an arraylist
8598         instead of a single constant.
8599
8600         (local_constant_declaration): It should take a
8601         constant_declarators, not a constant_declarator.  Fixes 49487
8602
8603         * convert.cs: Fix error report.
8604
8605 2003-10-13 Jackson Harper <jackson@ximian.com>
8606
8607         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8608         bug #49611
8609
8610 2003-10-09  Martin Baulig  <martin@ximian.com>
8611
8612         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8613         to the .ctor.
8614         (MethodCore.DoDefineParameters): Removed the TypeContainer
8615         argument; use the DeclSpace which was passed to the .ctor instead.
8616         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8617         TypeContainer; we only need a DeclSpace here.
8618
8619 2003-10-09  Martin Baulig  <martin@ximian.com>
8620
8621         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8622         to the .ctor.
8623         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8624         EmitContext's .ctor.    
8625
8626 2003-10-09  Martin Baulig  <martin@ximian.com>
8627
8628         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8629         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8630         AsAccessible(), moved them as well.
8631
8632         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8633
8634 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8635
8636         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8637
8638 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8639
8640         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8641         generation for >=, as spotted by Paolo, bug 48679.  
8642         Patch from David Waite.
8643
8644         * cs-tokenizer.cs: Add handling for #pragma.
8645
8646         * cs-parser.jay: Allow for both yield and yield return in the
8647         syntax.  The anti-cobolization of C# fight will go on!
8648
8649         * class.cs (TypeBuilder.DefineType): Catch error condition here
8650         (Parent.DefineType erroring out and returning null).
8651
8652         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8653         coping with enumerations variables, we were mistakenly processing
8654         them as a regular value type instead of built-in types.  Fixes the
8655         bug #48063
8656
8657         * typemanager.cs (IsBuiltinOrEnum): New method.
8658
8659 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8660
8661         * cs-parser.jay: Upgrade: yield now needs the return clause.
8662
8663 2003-09-19  Martin Baulig  <martin@ximian.com>
8664
8665         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8666         `MemberCache parent' argument.  Normally, an interface doesn't
8667         have a parent type except System.Object, but we use this in gmcs
8668         for generic type parameters.
8669
8670 2003-09-18  Martin Baulig  <martin@ximian.com>
8671
8672         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8673         on `type.IsInterface'; don't check whether the type has a parent
8674         to determine whether it's an interface.
8675
8676 2003-09-15  Martin Baulig  <martin@ximian.com>
8677
8678         * class.cs (TypeContainer.DefineType): Added an error flag to
8679         avoid reporting duplicate CS0146's ("class definition is
8680         circular.").
8681
8682         * driver.cs (Driver.MainDriver): Abort if
8683         RootContext.ResolveTree() reported any errors.
8684
8685 2003-09-07  Martin Baulig  <martin@ximian.com>
8686
8687         * report.cs (Error, Warning): Added overloaded versions which take
8688         a `params object[] args' and call String.Format().
8689
8690 2003-09-07  Martin Baulig  <martin@ximian.com>
8691
8692         * decl.cs (DeclSpace..ctor): Don't call
8693         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8694         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8695         (DeclSpace.RecordDecl): New method.
8696
8697         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8698
8699 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8700
8701         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8702         value attributes to be applied to ParameterBuilders.
8703
8704         * class.cs (MethodCore.LabelParameters): Make static and more
8705         generic so that it can be used from other places - like interface
8706         methods, for instance.
8707
8708         * interface.cs (Interface.Emit): Call LabelParameters before
8709         emitting attributes on the InterfaceMethod.
8710
8711 2003-08-26  Martin Baulig  <martin@ximian.com>
8712
8713         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8714         resolving aliases; fixes #47927.
8715
8716 2003-08-26  Martin Baulig  <martin@ximian.com>
8717
8718         * statement.cs (Using.DoResolve): This is internally emitting a
8719         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8720         do not always return.  Fixes #47681.
8721
8722 2003-08-26  Martin Baulig  <martin@ximian.com>
8723
8724         * decl.cs (MemberCore): Moved WarningNotHiding(),
8725         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8726         into MemberBase.
8727         (AdditionResult): Make this nested in DeclSpace.
8728         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8729         argument; call NamespaceEntry.Define() unless we're nested in a
8730         class or struct.
8731
8732         * namespace.cs (Namespace.DefineName): New public function.  This
8733         is called from DeclSpace's .ctor to add 
8734         (Namespace.Lookup): Include DeclSpaces in the lookup.
8735
8736         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8737
8738         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8739
8740 2003-08-25  Martin Baulig  <martin@ximian.com>
8741
8742         * convert.cs (Convert.ExplicitReferenceConversion): When
8743         converting from an interface type to a class, unbox if the target
8744         type is a struct type.  Fixes #47822.
8745
8746 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8747
8748         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8749         #47854.
8750
8751 2003-08-22  Martin Baulig  <martin@ximian.com>
8752
8753         * class.cs (TypeManager.DefineType): When defining a nested type,
8754         call DefineType() on our parent; fixes #47801.
8755
8756 2003-08-22  Martin Baulig  <martin@ximian.com>
8757
8758         * class.cs (MethodData.Define): While checking if a method is an
8759         interface implementation, improve the test a bit more to fix #47654.
8760
8761 2003-08-22  Martin Baulig  <martin@ximian.com>
8762
8763         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8764         correctly; fixes #47722.
8765
8766 2003-08-22  Martin Baulig  <martin@ximian.com>
8767
8768         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8769         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8770
8771         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8772
8773 2003-08-22  Martin Baulig  <martin@ximian.com>
8774
8775         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8776         can only be assigned in static constructors.  Fixes #47161.
8777
8778 2003-08-22  Martin Baulig  <martin@ximian.com>
8779
8780         Rewrote and improved the flow analysis code.
8781
8782         * flowbranching.cs (FlowBranching): Make this class abstract.
8783         (FlowBranching.CreateBranching): New static function to create a
8784         new flow branching.
8785         (FlowBranchingBlock, FlowBranchingException): New classes.
8786         (FlowBranching.UsageVector.Type): New public readonly field.
8787         (FlowBranching.UsageVector.Breaks): Removed the setter.
8788         (FlowBranching.UsageVector.Returns): Removed the setter.
8789         (FlowBranching.UsageVector): Added Break(), Return(),
8790         NeverReachable() and Throw() methods to modify the reachability.
8791         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8792         done by FlowBranching.Merge().
8793         (FlowBranching.UsageVector.MergeChild): New method; merges the
8794         merge result into the current vector.
8795         (FlowBranching.Merge): New abstract method to merge a branching.
8796
8797 2003-08-12  Martin Baulig  <martin@ximian.com>
8798
8799         * expression.cs (Indirection.CacheTemporaries): Create the
8800         LocalTemporary with the pointer type, not its element type.
8801
8802 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8803
8804         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8805         token was a keyword or not.
8806
8807         Add `error' options where an IDENTIFIER was expected;  Provide
8808         CheckToken and CheckIdentifierToken convenience error reporting
8809         functions. 
8810
8811         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8812
8813         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8814         NameSpaceEntry NameSpaceEntry.
8815
8816         (LookupInterfaceOrClass): Avoid creating a full qualified name
8817         from namespace and name: avoid doing lookups when we know the
8818         namespace is non-existant.   Use new Tree.LookupByNamespace which
8819         looks up DeclSpaces based on their namespace, name pair.
8820
8821         * driver.cs: Provide a new `parser verbose' to display the
8822         exception thrown during parsing.  This is turned off by default
8823         now, so the output of a failure from mcs is more graceful.
8824
8825         * namespace.cs: Track all the namespaces defined in a hashtable
8826         for quick lookup.
8827
8828         (IsNamespace): New method
8829
8830 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8831
8832         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8833         we know that we need to concatenate (full typename can never be
8834         null). 
8835
8836         * class.cs: ditto.
8837
8838         * statement.cs: Use a bitfield;  Do not initialize to null things
8839         which are done by the constructor by default.
8840
8841         * cs-parser.jay: bug fix, parameter was 4, not 3.
8842
8843         * expression.cs: Just use the property;
8844
8845         * statement.cs: No need for GetVariableInfo method.
8846
8847 2003-08-08  Martin Baulig  <martin@ximian.com>
8848
8849         * flowanalysis.cs (FlowReturns): This is now nested in the
8850         `FlowBranching' class.
8851         (MyBitVector): Moved this here from statement.cs.
8852         (FlowBranching.SiblingType): New enum type.
8853         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8854
8855 2003-08-07  Martin Baulig  <martin@ximian.com>
8856
8857         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8858         `FlowBranching' class and called `BranchingType'.
8859
8860 2003-08-07  Martin Baulig  <martin@ximian.com>
8861
8862         * flowanalysis.cs: Moved all the control flow analysis code into
8863         its own file.
8864
8865 2003-08-07  Martin Baulig  <martin@ximian.com>
8866
8867         * assign.cs (Assign.DoResolve): `target' must either be an
8868         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8869         #37319.
8870
8871 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8872
8873         * expression.cs (BinaryMethod): This kind of expression is created by the
8874         Binary class if it determines that the operator has to be handled
8875         by a method.
8876
8877         (BinaryDelegate): This kind of expression is created if we are
8878         dealing with a + or - operator on delegates.
8879
8880         (Binary): remove method, argumetns, and DelegateOperator: when
8881         dealing with methods, 
8882
8883         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8884
8885         * statement.cs (Block): use bitfields for the three extra booleans
8886         we had in use.   Remove unused topblock parameter.
8887
8888         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8889
8890         * assign.cs: Drop extra unneeded tests.
8891
8892 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8893
8894         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8895
8896         * statement.cs (Foreach): Use VariableStorage instead of
8897         LocalBuilders.   
8898
8899         * codegen.cs (VariableStorage): New class used by clients that
8900         require a variable stored: locals or fields for variables that
8901         need to live across yield.
8902
8903         Maybe provide a convenience api for EmitThis+EmitLoad?
8904
8905         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8906         these bad boys.
8907
8908 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8909
8910         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8911         RemapParameterLValue): New methods that are used to turn a
8912         precomputed FieldInfo into an expression like this:
8913
8914                 instance.FieldInfo
8915
8916         The idea is to use this instead of making LocalVariableReference
8917         have more than one meaning.
8918
8919         * cs-parser.jay: Add error production to BASE.
8920
8921         * ecore.cs: Deal with TypeManager.GetField returning null, which
8922         is now a valid return value.
8923
8924         (FieldExprNoAddress): New expression for Fields whose address can
8925         not be taken.
8926
8927         * expression.cs (LocalVariableReference): During the resolve
8928         phases, create new expressions if we are in a remapping context.
8929         Remove code that dealt with remapping here.
8930
8931         (ParameterReference): same.
8932
8933         (ProxyInstance): New expression, like the `This' expression, but
8934         it is born fully resolved.  We know what we are doing, so remove
8935         the errors that are targeted to user-provided uses of `this'.
8936
8937         * statement.cs (Foreach): our variable is now stored as an
8938         Expression;  During resolution, follow the protocol, dont just
8939         assume it will return this.
8940
8941 2003-08-06  Martin Baulig  <martin@ximian.com>
8942
8943         * support.cs (SeekableStreamReader.cs): New public class.
8944
8945         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8946         SeekableStreamReader instead of the normal StreamReader.
8947
8948 2003-08-04  Martin Baulig  <martin@ximian.com>
8949
8950         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8951         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8952         deambiguate casts and delegate invocations.
8953         (parenthesized_expression): Use the new tokens to ensure this is
8954         not a cast of method invocation.
8955
8956         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8957         when reading a `)' and Deambiguate_CloseParens () was previously
8958         called.
8959
8960         * expression.cs (ParenthesizedExpression): New class.  This is
8961         just used for the CS0075 test.
8962         (Binary.DoResolve): Check for CS0075.   
8963
8964 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8965
8966         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8967         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8968         reference comparison.
8969
8970         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8971         examine the ReturnType for equality - this is necessary in the
8972         cases of implicit and explicit operators whose signature also
8973         includes the return type.
8974
8975 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8976
8977         * namespace.cs: Cache the result of the namespace computation,
8978         instead of computing it every time.
8979
8980 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8981
8982         * decl.cs: Use a global arraylist that we reuse over invocations
8983         to avoid excesive memory consumption.  Reduces memory usage on an
8984         mcs compile by one meg (45 average).
8985
8986         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8987         private, work around that.
8988
8989 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8990
8991         * literal.cs (IntLiteral): Define Zero and One static literals. 
8992
8993         * cs-parser.jay (integer_literal): use static literals to reduce
8994         memory usage for the most used literals (0, 1 and -1).  211kb
8995         reduced in memory usage.
8996
8997         Replace all calls to `new ArrayList' with `new
8998         ArrayList(4)' which is a good average number for most allocations,
8999         and also requires only 16 bytes of memory for its buffer by
9000         default. 
9001
9002         This reduced MCS memory usage in seven megabytes for the RSS after
9003         bootstrapping.
9004
9005 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9006
9007         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9008         handle params methods the correct way by forming only one
9009         applicable set with params and normal methods in them. Earlier we
9010         were looking at params methods only if we found no normal methods
9011         which was not the correct thing to do.
9012
9013         (Invocation.BetterFunction): Take separate arguments indicating
9014         when candidate and the best method are params methods in their
9015         expanded form.
9016
9017         This fixes bugs #43367 and #46199.
9018
9019         * attribute.cs: Documentation updates.
9020
9021         (CheckAttribute): Rename to CheckAttributeTarget.
9022         (GetValidPlaces): Rename to GetValidTargets.
9023
9024         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9025         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9026
9027         Fixes bug #44468.
9028
9029 2003-07-28  Martin Baulig  <martin@ximian.com>
9030
9031         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9032         name when looking up the base class of a nested class.  Fixes #46977.
9033
9034 2003-07-26  Martin Baulig  <martin@ximian.com>
9035
9036         * expression.cs (Indexers.Indexer): New nested struct; contains
9037         getter, setter and the indexer's type.
9038         (Indexers.Properties): This is now an ArrayList of
9039         Indexers.Indexer's.
9040         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9041         indexer doesn't have any getters.
9042
9043         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9044         for embedded property and indexer assignments.
9045
9046 2003-07-26  Martin Baulig  <martin@ximian.com>
9047
9048         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9049         preprocessor directive is not the first non-whitespace character
9050         on a line.
9051
9052 2003-07-26  Martin Baulig  <martin@ximian.com>
9053
9054         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9055         namespace parsing, follow the spec more closely.
9056
9057         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9058         NamespaceEntry.Lookup().
9059
9060 2003-07-25  Martin Baulig  <martin@ximian.com>
9061
9062         * MethodCore.cs (OverridesSomething): New public field; it's set
9063         from TypeContainer.DefineMembers if this method overrides
9064         something (which doesn't need to be a method).  Fix #39462.
9065
9066 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9067
9068         * typemanager.cs (GetMembers): Ensure that the list of members is
9069         reversed. This keeps things in sync.
9070
9071         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9072         find an AttributeUsage attribute.
9073
9074         * expression.cs (Invocation.OverloadResolve): Perform the check
9075         which disallows Invoke to be directly called on a Delegate.
9076
9077         (Error_InvokeOnDelegate): Report error cs1533.
9078
9079 2003-07-25  Martin Baulig  <martin@ximian.com>
9080
9081         * expression.cs (Indexers.GetIndexersForType): Only look in the
9082         interface hierarchy if the requested type is already an
9083         interface.  Fixes #46788 while keeping #46502 fixed.
9084
9085 2003-07-25  Martin Baulig  <martin@ximian.com>
9086
9087         * class.cs (TypeContainer.DefineMembers): Check whether all
9088         readonly fields have been assigned and report warning CS0649 if
9089         not.
9090
9091         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9092         a valuetype.
9093
9094 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9095
9096         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9097         returned from GetMethods to make things consistent with the
9098         assumptions MCS makes about ordering of methods.
9099
9100         This should comprehensively fix bug #45127 and it does :-)
9101
9102         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9103         ordering is actually reverse.
9104
9105         * Clean up some debug messages I left lying around.
9106
9107         * interface.cs (Populate*): Get rid of code which emits attributes
9108         since the stage in which we emit attributes is the 'Emit' stage,
9109         not the define stage.
9110
9111         (Emit): Move attribute emission for interface members here.
9112
9113 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9114
9115         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9116         closely: we eliminate methods in base types when we have an
9117         applicable method in a top-level type.
9118
9119         Please see section 14.5.5.1 for an exact description of what goes
9120         on. 
9121
9122         This fixes bug #45127 and a host of other related to corlib compilation.
9123
9124         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9125         array is the method corresponding to the top-level type (this is
9126         because of the changes made to icall.c) so we change this
9127         accordingly.
9128
9129         (MethodGroupExpr.Name): This too.
9130
9131         * typemanager.cs (GetElementType): New method which does the right
9132         thing when compiling corlib. 
9133
9134         * everywhere: Make use of the above in the relevant places.
9135
9136 2003-07-22  Martin Baulig  <martin@ximian.com>
9137
9138         * cs-parser.jay (invocation_expression): Moved
9139         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9140         `cast_expression', but create a InvocationOrCast which later
9141         resolves to either an Invocation or a Cast.
9142
9143         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9144         method; call this before EmitStatement() to make sure that this
9145         expression can be used as a statement.
9146
9147         * expression.cs (InvocationOrCast): New class; resolves to either
9148         an Invocation or a Cast.
9149
9150         * statement.cs (StatementExpression): Call ResolveStatement() on
9151         the ExpressionStatement before emitting it.
9152
9153 2003-07-21  Martin Baulig  <martin@ximian.com>
9154
9155         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9156         `ref' and `out' attributes match; fixes #46220.
9157         (MemberAccess.ResolveMemberAccess): You can't reference a type
9158         through an expression; fixes #33180.
9159         (Indexers.GetIndexersForType): Don't return the indexers from
9160         interfaces the class implements; fixes #46502.
9161
9162 2003-07-21  Martin Baulig  <martin@ximian.com>
9163
9164         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9165         CS0661 checks; fixes bug #30442.
9166
9167 2003-07-21  Martin Baulig  <martin@ximian.com>
9168
9169         * decl.cs (AdditionResult): Added `Error'.
9170
9171         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9172
9173         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9174         makes cs0031.cs actually work.
9175
9176 2003-07-20  Martin Baulig  <martin@ximian.com>
9177
9178         * namespace.cs: Fixed that bug which caused a crash when compiling
9179         the debugger's GUI.
9180
9181 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9182
9183         * typemanager.cs (LookupTypeReflection): Never expose types which
9184         are NotPublic, NestedPrivate, NestedAssembly, or
9185         NestedFamANDAssem.  We used to return these, and later do a check
9186         that would report a meaningful error, but the problem is that we
9187         would not get the real match, if there was a name override.
9188
9189 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9190
9191         * namespace.cs (Namespace, Name): Do not compute the namespace
9192         name dynamically, compute it in the constructor.  This reduced
9193         memory usage by 1697 KB.
9194
9195         * driver.cs: Use --pause to pause at the end.
9196
9197 2003-07-17  Peter Williams  <peter@newton.cx>
9198
9199         * Makefile: Change the name of the test target so that it doesn't
9200         conflict with the recursive test target.
9201
9202 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9203
9204         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9205         AddressOf): Do not use EmitThis, that was wrong, use the actual
9206         this pointer.
9207
9208 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9209
9210         * class.cs (MethodData.Define): While checking if a method is an
9211         interface implementation, improve the test: If we are not public
9212         (use new test here: use the computed MethodAttributes directly,
9213         instead of the parsed modifier flags) check if the `implementing'
9214         method comes from an interface or not.
9215
9216         * pending.cs (VerifyPendingMethods): Slightly better error
9217         message.
9218
9219         * makefile: add test target that does the mcs bootstrap.
9220
9221 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9222
9223         * interface.cs (Define): Do nothing here since there are no
9224         members to populate etc. Move the attribute emission out of here
9225         since this was just totally the wrong place to put it. Attribute
9226         application happens during the 'Emit' phase, not in the 'Define'
9227         phase.
9228
9229         (Emit): Add this method and move the attribute emission here
9230
9231         * rootcontext.cs (EmitCode): Call the Emit method on interface
9232         types too.
9233
9234 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9235
9236         * expression.cs (OverloadResolve): Report error only if Location
9237         is not 'Null' which means that there was a probe going on.
9238
9239 2003-07-14  Martin Baulig  <martin@ximian.com>
9240
9241         * expression.cs (ConditionalLogicalOperator): New public class to
9242         implement user defined conditional logical operators.
9243         This is section 14.11.2 in the spec and bug #40505.
9244
9245 2003-07-14  Martin Baulig  <martin@ximian.com>
9246
9247         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9248
9249 2003-07-14  Martin Baulig  <martin@ximian.com>
9250
9251         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9252
9253         * ecore.cs (IVariable.VerifyFixed): New interface method.
9254
9255         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9256         operator, check whether the variable is actually fixed.  Fixes bug
9257         #36055.  Set a variable definitely assigned when taking its
9258         address as required by the spec.
9259
9260         * statement.cs (LocalInfo.IsFixed): New field.
9261         (LocalInfo.MakePinned): Set `IsFixed' to true.
9262
9263 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9264
9265         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9266         for .ctors, ensure that we only ask for members declared in the
9267         attribute type (BindingFlags.DeclaredOnly).
9268
9269         Fixes bug #43632.
9270
9271         * expression.cs (Error_WrongNumArguments): Report error 1501
9272         correctly the way CSC does.
9273
9274 2003-07-13  Martin Baulig  <martin@ximian.com>
9275
9276         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9277         lookup on the fully qualified name, to make things like "X.X" work
9278         where "X.X" is a fully qualified type name, but we also have a
9279         namespace "X" in the using list.  Fixes #41975.
9280
9281 2003-07-13  Martin Baulig  <martin@ximian.com>
9282
9283         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9284         function. If we're a CompoundAssign, we need to create an embedded
9285         CompoundAssign, not an embedded Assign.
9286         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9287         Fixes #45854.
9288
9289 2003-07-13  Martin Baulig  <martin@ximian.com>
9290
9291         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9292         work to fix bug #46088.
9293
9294 2003-07-13  Ravi Pratap <ravi@ximian.com>
9295
9296         * class.cs (Operator.Emit): Do not emit attributes here - it is
9297         taken care of by the Method class that we delegate too. This takes
9298         care of bug #45876.
9299
9300 2003-07-10  Martin Baulig  <martin@ximian.com>
9301
9302         * expression.cs (TypeOfVoid): New class.
9303         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9304
9305 2003-07-10  Martin Baulig  <martin@ximian.com>
9306
9307         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9308         bug #35957.
9309
9310 2003-07-10  Martin Baulig  <martin@ximian.com>
9311
9312         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9313         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9314
9315         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9316
9317         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9318
9319 2003-07-10  Martin Baulig  <martin@ximian.com>
9320
9321         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9322         of decimal.  Fixes #42850.
9323
9324         NOTE: I also fixed the created byte blob, but this doesn't work on
9325         the MS runtime and csc never produces any byte blobs for decimal
9326         arrays.
9327
9328 2003-07-10  Martin Baulig  <martin@ximian.com>
9329
9330         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9331         structs; fixes #32068.
9332         (Block.AddChildVariableNames): Fixed #44302.
9333
9334 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9335
9336         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9337
9338 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9339
9340         * attribute.cs: And this test is onger needed.
9341
9342 2003-07-08  Martin Baulig  <martin@ximian.com>
9343
9344         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9345         inaccessible types.  Fixes #36313.
9346
9347         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9348
9349         * namespace.cs (NamespaceEntry): Create implicit entries for all
9350         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9351         implicit entries for N1.N2 and N1.
9352
9353 2003-07-08  Martin Baulig  <martin@ximian.com>
9354
9355         Rewrote the handling of namespaces to fix a lot of the issues
9356         wrt. `using' aliases etc.
9357
9358         * namespace.cs (Namespace): Splitted this class into a
9359         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9360
9361         * typemanager.cs (TypeManager.IsNamespace): Removed.
9362         (TypeManager.ComputeNamespaces): Only compute namespaces from
9363         loaded assemblies here, not the namespaces from the assembly we're
9364         currently compiling.
9365
9366 2003-07-08  Martin Baulig  <martin@ximian.com>
9367
9368         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9369
9370 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9371
9372         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9373         already fixed it.  
9374
9375         I thought about the memory savings here, but LookupTypeReflection
9376         is used under already very constrained scenarios.  Compiling
9377         corlib or mcs only exposes one hit, so it would not really reduce
9378         any memory consumption.
9379
9380 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9381
9382         * typemanager.cs: fixes bug #45889 by only adding public types from
9383         other assemblies to the list of known types.
9384
9385 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9386
9387         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9388         on the type we resolved.
9389
9390 2003-07-05  Martin Baulig  <martin@ximian.com>
9391
9392         * pending.cs (PendingImplementation.ParentImplements): Don't
9393         create the proxy if the parent is abstract.
9394
9395         * class.cs (TypeContainer.DefineIndexers): Process explicit
9396         interface implementations first.  Fixes #37714.
9397
9398 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9399
9400         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9401         defined recursively;  but since we modify the input parameters
9402         (left is set to `this' temporarily), we reset this value if the
9403         left_is_explicit is false, which gives the original semantics to
9404         the code.  
9405
9406         * literal.cs (NullPointer): new class used to represent a null
9407         literal in a pointer context.
9408
9409         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9410         type is a pointer, use a NullPointer object instead of a
9411         NullLiteral.   Closes 43687
9412
9413         (ExplicitConversion): Convert pointer values using
9414         the conv opcode to the proper type.
9415
9416         * ecore.cs (New): change ValueTypeVariable property into a method,
9417         that returns whether the valuetype is suitable for being used.
9418
9419         * expression.cs (Binary.DoNumericPromotions): Only return if we
9420         the int constant was a valid uint, and we can return both left and
9421         right as uints.  If not, we continue processing, to trigger the
9422         type conversion.  This fixes 39018.
9423
9424         * statement.cs (Block.EmitMeta): During constant resolution, set
9425         the CurrentBlock property on the emitcontext, so that we resolve
9426         constants propertly.
9427
9428 2003-07-02  Martin Baulig  <martin@ximian.com>
9429
9430         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9431         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9432
9433         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9434         than emitting it here.
9435
9436         * statement.cs: Fixed some more flow analysis bugs.
9437
9438 2003-07-02  Martin Baulig  <martin@ximian.com>
9439
9440         * class.cs (MethodData.Define): When implementing interface
9441         methods, set Final unless we're Virtual.
9442
9443         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9444         check work for interface methods.
9445
9446 2003-07-01  Martin Baulig  <martin@ximian.com>
9447
9448         * ecore.cs (EmitContext.This): Replaced this property with a
9449         GetThis() method which takes a Location argument.  This ensures
9450         that we get the correct error location for a CS0188.
9451
9452 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9453
9454         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9455         ImplicitStandardConversion.
9456
9457         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9458
9459 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9460
9461         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9462         optimization.
9463
9464 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9465
9466         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9467         constructors.
9468
9469         (MethodData.Define): Turn off initlocals for unsafe methods.
9470
9471 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9472
9473         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9474         complete;  Fixes #37521.
9475
9476         * delegate.cs: Use Modifiers.TypeAttr to compute the
9477         TypeAttributes, instead of rolling our own.  This makes the flags
9478         correct for the delegates.
9479
9480 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9481
9482         * class.cs (Constructor.Define): Set the private flag for static
9483         constructors as well.
9484
9485         * cs-parser.jay (statement_expression): Set the return value to
9486         null, to avoid a crash when we catch an error.
9487
9488 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9489
9490         * cs-parser.jay: Applied patch from Jackson that adds support for
9491         extern and unsafe modifiers to destructor declarations.
9492
9493         * expression.cs: Report error 21 if the user is trying to index a
9494         System.Array.
9495
9496         * driver.cs: Add an error message, suggested by the bug report.
9497
9498         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9499         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9500
9501 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9502
9503         * namespace.cs: Add some information to reduce FAQs.
9504
9505 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9506
9507         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9508         underlying enumeration types.  Fixes #43915.
9509
9510         * expression.cs: Treat ushort/short as legal values to be used in
9511         bitwise operations.
9512
9513 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9514
9515         * delegate.cs: transfer custom attributes for paramenters from
9516         the delegate declaration to Invoke and BeginInvoke.
9517
9518 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9519
9520         * attribute.cs: handle custom marshalers and emit marshal info
9521         for fields, too.
9522
9523 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9524
9525         * makefile.gnu: Added anonymous.cs to the compiler sources.
9526
9527 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9528
9529         * iterators.cs: Change the name of the proxy class to include two
9530         underscores.
9531
9532         * cs-parser.jay: Update grammar to include anonymous methods.
9533
9534         * anonymous.cs: new file.
9535
9536 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9537
9538         * class.cs (Field.Define): Add missing test for pointers and
9539         safety. 
9540
9541 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9542
9543         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9544         we use the stobj opcode.
9545
9546         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9547         since it wasn't the correct fix. 
9548
9549         It still is puzzling that we are required to use stobj for IntPtr
9550         which seems to be a ValueType.
9551
9552 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9553
9554         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9555         during regular simple name resolution.   Now, the trick is that
9556         instead of returning for processing the simplename, we do a
9557         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9558         contextual lookup type).   If a match is found, return that, if
9559         not, return for further composition.
9560
9561         This fixes long-standing 30485.
9562
9563         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9564         using the address to initialize an object, do an Stobj instead of
9565         using the regular Stelem.
9566
9567         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9568         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9569         Because if we are a BaseIndexerAccess that value will be true.
9570         Fixes 43643.
9571
9572         * statement.cs (GotoCase.Resolve): Return after reporting an
9573         error, do not attempt to continue. 
9574
9575         * expression.cs (PointerArithmetic.Emit): If our operand is a
9576         long, convert our constants to match the operand before
9577         multiplying.  Convert to I type before adding.   Fixes 43670.
9578
9579 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9580
9581         * enum.cs (ImplicitConversionExists) : Rename to
9582         ImplicitEnumConversionExists to remove ambiguity. 
9583
9584         * ecore.cs (NullCast): New type of cast expression class which
9585         basically is very similar to EmptyCast with the difference being
9586         it still is a constant since it is used only to cast a null to
9587         something else
9588         (eg. (string) null)
9589
9590         * convert.cs (ImplicitReferenceConversion): When casting a null
9591         literal, we return a NullCast.
9592
9593         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9594         should be around anymore.
9595
9596         The renaming (reported was slightly wrong). Corrections:
9597
9598         ConvertImplicitStandard -> ImplicitConversionStandard
9599         ConvertExplicitStandard -> ExplicitConversionStandard
9600
9601         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9602         before passing them in !
9603
9604         * convert.cs (ImplicitConversionStandard): When comparing for
9605         equal expr and target types, ensure that expr is not a
9606         NullLiteral.
9607
9608         In general, we must not be checking (expr_type ==
9609         target_type) in the top level conversion methods
9610         (ImplicitConversion, ExplicitConversion etc). This checking is
9611         done in the methods that they delegate to.
9612
9613 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9614
9615         * convert.cs: Move Error_CannotConvertType,
9616         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9617         ImplicitNumericConversion, ImplicitConversionExists,
9618         ImplicitUserConversionExists, StandardConversionExists,
9619         FindMostEncompassedType, FindMostSpecificSource,
9620         FindMostSpecificTarget, ImplicitUserConversion,
9621         ExplicitUserConversion, GetConversionOperators,
9622         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9623         TryImplicitIntConversion, Error_CannotConvertImplicit,
9624         ConvertImplicitRequired, ConvertNumericExplicit,
9625         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9626         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9627         its own file.
9628
9629         Perform the following renames:
9630
9631         StandardConversionExists -> ImplicitStandardConversionExists
9632         ConvertImplicit -> ImplicitConversion
9633         ConvertImplicitStandard -> ImplicitStandardConversion
9634         TryImplicitIntConversion -> ImplicitIntConversion
9635         ConvertImplicitRequired -> ImplicitConversionRequired
9636         ConvertNumericExplicit -> ExplicitNumericConversion
9637         ConvertReferenceExplicit -> ExplicitReferenceConversion
9638         ConvertExplicit -> ExplicitConversion
9639         ConvertExplicitStandard -> ExplicitStandardConversion
9640
9641 2003-05-19  Martin Baulig  <martin@ximian.com>
9642
9643         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9644         (TypeInfo): Added support for structs having structs as fields.
9645
9646         * ecore.cs (FieldExpr): Implement IVariable.
9647         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9648         VariableInfo for the field.
9649
9650 2003-05-18  Martin Baulig  <martin@ximian.com>
9651
9652         * expression.cs (This.DoResolve): Report a CS0027 if we're
9653         emitting a field initializer.
9654
9655 2003-05-18  Martin Baulig  <martin@ximian.com>
9656
9657         * expression.cs (This.ResolveBase): New public function.
9658         (This.DoResolve): Check for CS0188.
9659
9660         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9661         This.Resolve().
9662
9663         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9664         `instance_expression' to null if we don't have any non-static
9665         methods.
9666
9667 2003-05-18  Martin Baulig  <martin@ximian.com>
9668
9669         Reworked the way how local variables and parameters are handled by
9670         the flow analysis code.
9671
9672         * statement.cs (TypeInfo, VariableMap): New public classes.
9673         (VariableInfo): New public class.  This is now responsible for
9674         checking whether a variable has been assigned.  It is used for
9675         parameters and local variables.
9676         (Block.EmitMeta): Take the InternalParameters as argument; compute
9677         the layout of the flow vectors here.
9678         (Block.LocalMap, Block.ParameterMap): New public properties.
9679         (FlowBranching): The .ctor doesn't get the InternalParameters
9680         anymore since Block.EmitMeta() now computes the layout of the flow
9681         vector.
9682         (MyStructInfo): This class is now known as `StructInfo' and nested
9683         in `TypeInfo'; we don't access this directly anymore.
9684
9685         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9686         property and removed IsAssigned(), IsFieldAssigned(),
9687         SetAssigned() and SetFieldAssigned(); we now call them on the
9688         VariableInfo so we don't need to duplicate this code everywhere.
9689
9690         * expression.cs (ParameterReference): Added `Block block' argument
9691         to the .ctor.
9692         (LocalVariableReference, ParameterReference, This): The new
9693         VariableInfo class is now responsible for all the definite
9694         assignment stuff.
9695
9696         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9697         IsParameterAssigned, SetParameterAssigned): Removed.
9698
9699 2003-05-18  Martin Baulig  <martin@ximian.com>
9700
9701         * typemanager.cs (InitCoreTypes): Try calling
9702         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9703         the 3-args-version.  Corlib now also needs our `void_type'.
9704         (GetMethod): Added overloaded version which takes an optional
9705         `bool report_errors' to allow lookups of optional methods.
9706
9707 2003-05-12  Martin Baulig  <martin@ximian.com>
9708
9709         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9710         only used for locals and not for parameters.
9711
9712 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9713
9714         * support.cs (InternalParameters.ParameterType): Return the
9715         ExternalType of the parameter.
9716
9717         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9718         they were unused.
9719
9720 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9721
9722         * class.cs (MethodData.Define): Do not set the `newslot' on
9723         interface members, if they are also flagged as "override".
9724
9725         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9726         better code for ++i and i++.  This only works for static fields
9727         and local variables.
9728
9729         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9730         want to pull the DeclSpace out of the builder_to_declspace instead
9731         of the TypeBuilder (like in TypeContainer.FindMembers).
9732
9733         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9734         instead of LookupTypeContainer.  Fixes the crash on .NET for
9735         looking up interface members.
9736
9737         * const.cs: Create our own emit context during the Definition
9738         stage, so that constants are evaluated in the proper context, when
9739         a recursive definition happens.
9740
9741 2003-05-11  Martin Baulig  <martin@ximian.com>
9742
9743         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9744         new block for a switch section.
9745         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9746         the adding/lookup in the switch block.  Fixes #39828.
9747
9748 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9749
9750         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9751         functionality: I needed to convert the data after I had performed
9752         the add/sub operation into the operands type size.
9753
9754         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9755         pass the type for the box operation, otherwise the resulting
9756         object would have been of type object.
9757
9758         (BoxedCast): Add constructor to specify the type to box as.
9759
9760 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9761
9762         * iterators.cs: I was reusing the `count' variable inadvertently,
9763         take steps to not allow this to happen.
9764
9765 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9766
9767         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9768         by creating an array at the point where the params starts and
9769         putting all those arguments there, then adjusting the size of the
9770         array.
9771
9772 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9773
9774         * expression.cs (New.AddressOf): Implement interface
9775         IMemoryLocation.  This is used when the `new' operator is used in
9776         the context of an invocation to a method on a value type.
9777
9778         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9779         example. 
9780
9781         * namespace.cs: Also check the using aliases here.
9782
9783         * driver.cs: Move the test for using validity after the types have
9784         been entered, so we do a single pass that also includes the using
9785         aliases. 
9786
9787         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9788         in the regular case.   CreateSiblingForFinally is doing extra
9789         error checking.
9790
9791         * attribute.cs (GetAttributeArgumentExpression): Store the result
9792         on an out value, and use the return value to indicate failure
9793         instead of using null (which is a valid return for Constant.GetValue).
9794
9795         * statement.cs: Perform the analysis flow for the increment
9796         portion after the statement, because this will be the real flow of
9797         execution.  Fixes #42385
9798
9799         * codegen.cs (EmitContext.EmitArgument,
9800         EmitContext.EmitStoreArgument): New helper functions when the
9801         RemapToProxy flag is set.
9802
9803         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9804         function.
9805
9806         Add support for remapping parameters. 
9807
9808         * iterators.cs: Propagate parameter values;  Store parameter
9809         values in the proxy classes.
9810
9811 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9812
9813         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9814         need a proxy reference;  I do not know what I was thinking
9815
9816         * cs-parser.jay (constructor_initializer): catch another error,
9817         and display nice message.
9818
9819         (field_declaration): catch void field declaration
9820         to flag a better error. 
9821
9822         * class.cs (MemberBase.CheckBase): Report an error instead of a
9823         warning if a new protected member is declared in a struct. 
9824         (Field.Define): catch the error of readonly/volatile.
9825
9826         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9827
9828         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9829         volatile variable is taken
9830
9831 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9832
9833         * statement.cs (Fixed.Resolve): Report an error if we are not in
9834         an unsafe context.
9835
9836 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9837
9838         * typemanager.cs: reuse the code that handles type clashes for
9839         delegates and enumerations.
9840
9841         * class.cs (Report28): Always report.
9842
9843         * expression.cs (EncodeAsAttribute): Allow nulls here.
9844
9845 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9846
9847         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9848         the functionality for testing whether an expression is valid for
9849         an attribute here.  Also handle the case of arrays of elements
9850         being stored. 
9851
9852         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9853         encoding a linear array into an array of objects that are suitable
9854         to be passed to an CustomAttributeBuilder.
9855
9856         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9857
9858         * ecore.cs: (FieldExpr): Handle field remapping here.
9859
9860         * iteratators.cs: Pass the instance variable (if the method is an
9861         instance method) to the constructors, so we can access the field
9862         variables on the class.
9863
9864         TODO: Test this with structs.  I think the THIS variable on
9865         structs might have to be a pointer, and not a refenrece
9866
9867 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9868
9869         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9870         local variables to fields in a proxy class.
9871
9872         * iterators.cs (PopulateProxy): Rename our internal fields to
9873         <XXX>.  
9874         Create a <THIS> field if we are an instance method, so we can
9875         reference our parent container variables.
9876         (MapVariable): Called back from the EmitContext code to enter a
9877         new variable to field mapping into the proxy class (we just create
9878         a FieldBuilder).
9879
9880         * expression.cs
9881         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9882         for using the remapped locals to fields.
9883
9884         I placed the code here, because that gives the same semantics to
9885         local variables, and only changes the Emit code.
9886
9887         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9888         statements inside iterators.
9889         (VariableInfo): Add a FieldBuilder for the cases when we are
9890         remapping local variables to fields in a proxy class
9891
9892         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9893         current_block != null.
9894
9895         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9896         not cope with strings, as it has been moved to the
9897         TableSwitchEmit.  Fixed bug in switch generation.
9898
9899         * expression.cs (New.DoResolve): Provide more context for the user
9900         when reporting an error.
9901
9902         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9903         pointers. 
9904
9905         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9906         check the permissions for it.  Note than in a type-resolution
9907         context the check was already present in DeclSpace.ResolveType,
9908         but was missing from the MemberAccess.
9909
9910         (ArrayCreation.CheckIndices): warn if the user has
9911         more nested levels of expressions, but there are no more
9912         dimensions specified.  Avoids crash on bug 41906.
9913
9914 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9915
9916         * statement.cs (Block): replace Implicit bool, for a generic
9917         flags.   
9918         New flag: `Unchecked'.  This is used during the EmitMeta phase
9919         (which is out-of-line with the regular Resolve/Emit process for a
9920         statement, as this is done ahead of time, but still gets a chance
9921         to call constant resolve).
9922
9923         (Block.Flags): new enum for adding a new flag.
9924
9925         (Block.EmitMeta): track the state of unchecked.
9926
9927         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9928         to enable constant resolution to work there as well.
9929
9930 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9931
9932         * typemanager.cs (ienumerable_type): Also look up
9933         System.Collections.IEnumerable. 
9934
9935 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9936
9937         TODO: Test more than one conditional per method.
9938
9939         * class.cs (Indexer.Define): Report the location where the user is
9940         referencing the unsupported feature.
9941
9942         (MethodData): Overload the use of `conditionals' to
9943         minimize the creation of needless ArrayLists.   This saves roughly
9944         212kb on my machine.
9945
9946         (Method): Implement the new IIteratorContainer interface.
9947         (Method.SetYields): Implement the method by setting the ModFlags
9948         to contain METHOD_YIELDS.
9949
9950         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9951         which just got set to null.
9952
9953         * iterators.cs: New file.
9954
9955         (Yield, YieldBreak): New statements.
9956
9957         * statement.cs (Return.Resolve): Flag an error if we are used in
9958         an iterator method.
9959
9960         * codegen.cs (InIterator): New flag set if the code is being
9961         compiled in an iterator method.
9962
9963         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9964         internal modifier, and we just use it to avoid adding extra
9965         fields, as this is seldom used.  
9966
9967         * cs-parser.jay: Add yield_statement (yield and yield break).
9968
9969         * driver.cs: New flag -v2 to turn on version 2 features. 
9970
9971         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9972         hashtable when v2 is enabled.
9973
9974 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9975
9976         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9977         there is already a namespace defined with this name.
9978
9979         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9980         people upgraded their corlibs.
9981
9982         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9983         always use fully qualified types, no need to use the compiler
9984         front end.
9985
9986         (TypeManager.IsNamespace): Use binarysearch.
9987
9988         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9989         AddDelegate): I did not quite use the new IsValid API properly: I
9990         have to pass the short-name and the fullname.  I was passing only
9991         the basename instead of the fullname sometimes. 
9992
9993         (TypeContainer.DefineType): call NamespaceClash.
9994
9995         * interface.cs (Interface.DefineType): use NamespaceClash before
9996         defining the type.
9997
9998         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9999         defining the type.
10000
10001         * enum.cs: (Enum.DefineType): use NamespaceClash before
10002         defining the type.
10003
10004         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10005         speed increase.  First, use the negative_hits cache when we get a
10006         negative.  Second, add the type with its full original name
10007         instead of the new . and + encoded name (reflection uses + to
10008         separate type from a nested type).  Use LookupTypeReflection
10009         directly which bypasses the type->name hashtable (that we already
10010         know does not contain the type.
10011
10012         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10013         location/container type. 
10014
10015         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10016
10017 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10018
10019         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10020
10021         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10022         method is being referenced in the method group from a static
10023         context, and report error 120 if so.
10024
10025         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10026         Error118. 
10027
10028         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10029         is created, we create the A namespace).
10030
10031         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10032         Fixes #41591
10033
10034 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10035
10036         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10037         invocation to ModuleBuilder.GetType with the same values will
10038         return a new type instance, so we need to cache its return
10039         values. 
10040
10041         * expression.cs (Binary.ResolveOperator): Only allow the compare
10042         operators on enums if they are of the same type.
10043
10044         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10045         types of ValueType on their own case.  Before we were giving them
10046         the same treatment as objects.
10047
10048         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10049         fullname.  Short name is used to compare against container name.
10050         Fullname is used to check against defined namespace names.
10051
10052         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10053         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10054
10055         (Method.CheckBase): Call parent.
10056         (MemberBase.CheckBase): Check for protected members on sealed
10057         classes.
10058         (PropertyBase.CheckBase): Call parent.
10059         (Field.Define): Call parent.
10060
10061         * report.cs: Negative error codes are now mapped to 8000 - code,
10062         so that the display is render more nicely.
10063
10064         * typemanager.cs: Do not use try/catch, instead report a regular
10065         error. 
10066
10067         (GetPointerType, GetReferenceType): These methods provide
10068         mechanisms to obtain the T* and T& from a T.  We had the code
10069         previously scattered around the code base, and it also used
10070         TypeManager.LookupType that would go through plenty of caches.
10071         This one goes directly to the type source.
10072
10073         In some places we did the Type.GetType followed by
10074         ModuleBuilder.GetType, but not in others, so this unifies the
10075         processing as well.
10076
10077         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10078         statements now that we have namespace information.
10079
10080         * typemanager.cs (IsNamespace): New method, returns whether the
10081         string presented is a namespace or not.
10082
10083         (ComputeNamespaces): New public entry point, computes the list of
10084         available namespaces, using the GetNamespaces API call in Mono, or
10085         the slower version in MS.NET.   
10086
10087         Now before we start the semantic analysis phase, we have a
10088         complete list of namespaces including everything that the user has
10089         provided.
10090
10091         Deleted old code to cache namespaces in .nsc files.
10092
10093 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10094
10095         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10096         class/struct location definition Location for the implicit
10097         constructor location.
10098
10099         (Operator.Define): Use the location of the operator for the
10100         implicit Method definition.
10101
10102         (Constructor.Emit): use the constructor location for the implicit
10103         base initializer constructor.
10104
10105         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10106         and the Expression class now contains two new methods:
10107
10108         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10109         isolate type lookup from the rest of the resolution process.
10110
10111         Since we use Expressions to hold type definitions due to the way
10112         we parse the input we have historically overloaded Resolve to
10113         perform the Type lookups if a special flag is passed.  Now this is
10114         eliminated and two methods take their place. 
10115
10116         The differences in the two methods between xStep and xTerminal is
10117         that xStep is involved in our current lookup system that uses
10118         SimpleNames to compose a name, while xTerminal is used just to
10119         catch the case where the simplename lookup failed.
10120
10121 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10122
10123         * expression.cs (ResolveMemberAccess): Remove redundant code.
10124         TypeExpr expressions are always born fully resolved.
10125
10126         * interface.cs (PopulateMethod): Do not lookup the types twice.
10127         We were doing it once during SemanticAnalysis and once during
10128         PopulateMethod.
10129
10130         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10131         in local variable type definitions, were being returned as a
10132         SimpleName (we decomposed everything into a string), that is
10133         because primary_expression was being used instead of a type in the
10134         grammar (reduce/reduce conflicts).
10135
10136         The part that was wrong is that we converted the expression into a
10137         string (an oversimplification in one hand, compounded with primary
10138         expressions doing string concatenation).
10139
10140         So things like:
10141
10142         A.B.C [] x;
10143
10144         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10145         using clauses from working on this particular context.  And a type
10146         was being matched directly against "A.B.C[]".
10147
10148         We now use the correct approach, and allow for ComposedCast to be
10149         part of the unary expression.  So the "A.B.C []" become a composed
10150         cast of "A.B.C" (as a nested group of MemberAccess with a
10151         SimpleName at the end) plus the rank composition "[]". 
10152
10153         Also fixes 35567
10154
10155 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10156
10157         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10158         for the access level checking.
10159
10160         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10161         `TypeContainer container', because I kept getting confused when I
10162         was debugging this code.
10163
10164         * expression.cs (Indexers): Instead of tracking getters/setters,
10165         we now track them in parallel.  We create one arraylist less, but
10166         most importantly it is possible now for the LValue code to find a
10167         matching get for a set.
10168
10169         (IndexerAccess.DoResolveLValue): Update the code.
10170         GetIndexersForType has been modified already to extract all the
10171         indexers from a type.  The code assumed it did not.
10172
10173         Also make the code set the correct return type for the indexer.
10174         This was fixed a long time ago for properties, but was missing for
10175         indexers.  It used to be void_type.
10176
10177         (Binary.Emit): Test first for doubles instead of
10178         floats, as they are more common.
10179
10180         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10181         when dealing with floats and the <=, >= operators.  This fixes bug
10182         #39314 
10183
10184         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10185         to load the array value by emitting a load on the foreach variable
10186         type.  This was incorrect.  
10187
10188         We now emit the code to load an element using the the array
10189         variable type, and then we emit the conversion operator.
10190
10191         Fixed #40176
10192
10193 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10194
10195         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10196
10197 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10198
10199         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10200         test for protection before we test for signatures. 
10201
10202         (MethodSignature.ToString): implement.
10203
10204         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10205         to the case where we reduced into a LongConstant.
10206
10207         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10208         depend on whether the information is acurrate, because the
10209         Microsoft runtime will always claim that the array type is public,
10210         regardless of the real state.
10211
10212         If the type is a pointer, another problem happens: the type is
10213         reported as non-public in Microsoft.  
10214
10215         In both cases we have to call CheckAccessLevel recursively with
10216         the underlying type as the argument to be tested.
10217
10218 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10219
10220         * assign.cs (Assign.Emit): If we are dealing with a compound
10221         assignment expression, we should use the code path that stores the
10222         intermediate result in a temporary value.  This fixes #40903.
10223
10224         *expression.cs (Indirection.ToString): Provide ToString method for
10225         debugging. 
10226
10227 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10228
10229         * class.cs: Null out fields holding references to Block objects so
10230         they can be garbage collected.
10231
10232         * expression.cs (OverloadResolve): Remove unused local.
10233
10234 2003-04-07  Martin Baulig  <martin@ximian.com>
10235
10236         * codegen.cs (EmitContext.CurrentFile): New public field.
10237         (EmitContext.Mark): Use the CurrentFile to check whether the
10238         location is in the correct file.
10239         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10240
10241 2003-04-07  Martin Baulig  <martin@ximian.com>
10242
10243         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10244
10245         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10246         location.  [FIXME: The location argument which gets passed to this
10247         method is sometimes wrong!]
10248
10249 2003-04-07  Nick Drochak <ndrochak@gol.com>
10250
10251         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10252
10253 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10254
10255         * expression.cs (Indirection.EmitAssign): We were using the
10256         temporary, but returning immediately instead of continuing the
10257         EmitAssing flow.
10258
10259 2003-04-06  Martin Baulig  <martin@ximian.com>
10260
10261         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10262         if it's a nested child, but also deriving from the outer class.
10263         See test 190.cs.
10264
10265         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10266         nested child, but also deriving from the outer class.  See
10267         test-190.cs.
10268         (FilterWithClosure): We may access private members of the outer
10269         class if we're a nested child and deriving from the outer class.
10270         (RealMemberLookup): Only set `closure_private_ok' if the
10271         `original_bf' contained BindingFlags.NonPublic.
10272
10273 2003-04-05  Martin Baulig  <martin@ximian.com>
10274
10275         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10276
10277 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * class.cs (Event.Define): Do not allow abstract events to have
10280         initializers. 
10281
10282 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10285         block in event declarations.
10286
10287         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10288         value type, get its address.
10289
10290         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10291         leaving a class on the stack instead of a boolean value (int
10292         0/1).  Change the code so we compare against null, and then the
10293         result against zero.
10294
10295         * class.cs (TypeContainer.GetClassBases): We were checking for the
10296         parent class being sealed too late.
10297
10298         * expression.cs (Binary.Emit): For <= and >= when dealing with
10299         floating point values, use cgt.un and clt.un instead of cgt and
10300         clt alone.
10301
10302 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10303
10304         * statement.cs: Apply the same optimization as MS: skip the 
10305         GetEnumerator returning an IEnumerator, and use the one returning a 
10306         CharEnumerator instead. This allows us to avoid the try-finally block 
10307         and the boxing.
10308
10309 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10310
10311         * cs-parser.jay: Attributes cannot be applied to
10312                          namespaces. Fixes #40473
10313
10314 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10315
10316         * class.cs:
10317         (Add*): check if the name is valid using the full name for constants,
10318         fields, properties and events.
10319
10320 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10321
10322         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10323         char constants to be part of the enumeration.
10324
10325         * expression.cs (Conditional.DoResolve): Add support for operator
10326         true. Implements the missing functionality from 14.12
10327
10328         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10329         operator true/false as required by the spec.
10330
10331         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10332         implicit conversion to boolean.
10333
10334         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10335         also one where the type implements `operator true'. 
10336
10337         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10338         get an expression that will invoke operator true based on an
10339         expression.  
10340
10341         (GetConversionOperators): Removed the hack that called op_True
10342         here.  
10343
10344         (Expression.ResolveBoolean): Move this from Statement.
10345
10346 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10347
10348         * ecore.cs (FieldExpr): do not allow initialization of initonly
10349         fields on derived classes
10350
10351 2003-03-13  Martin Baulig  <martin@ximian.com>
10352
10353         * statement.cs (Block.Emit): Call ig.BeginScope() and
10354         ig.EndScope() when compiling with debugging info; call
10355         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10356
10357 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10358
10359         * expression.cs (Indexers): Do not construct immediately, allow
10360         for new members to be appended as we go.  Fixes 38143
10361
10362 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10363
10364         * expression.cs: save/restore context when resolving an unchecked
10365         expression.
10366
10367 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10368
10369         * cfold.cs: Catch division by zero in modulus operator during
10370         constant folding.
10371
10372 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10373
10374         * interface.cs (Interface.DefineMembers): Avoid defining members
10375         twice. 
10376
10377 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * driver.cs: handle the +/- options for -noconfig
10380
10381         * statement.cs (Unckeched.Resolve): Also track the state of
10382         unchecked in the Resolve phase.
10383
10384 2003-02-27  Martin Baulig  <martin@ximian.com>
10385
10386         * ecore.cs (Expression.MemberLookup): Don't create a
10387         MethodGroupExpr for something which is not a method.  Fixes #38291.
10388
10389 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10390
10391         * class.cs (MemberBase.CheckParameters): Also check that the type
10392         is unmanaged if it is a pointer.
10393
10394         * expression.cs (SizeOf.Resolve): Add location information.
10395
10396         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10397         a managed type is declared.
10398
10399         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10400         parameter modifiers as well.  Fixes bug 38606
10401
10402         * class.cs: Very sad.  Am backing out the speed up changes
10403         introduced by the ArrayList -> Array in the TypeContainer, as they
10404         were not actually that much faster, and introduced a bug (no error
10405         reports on duplicated methods).
10406
10407         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10408         source first, this will guarantee that we have a valid expression
10409         before calling in lower levels functions that will require a
10410         resolved object.  Then use this original_source in the
10411         target.ResolveLValue instead of the original source that was
10412         passed to us.
10413
10414         Another change.  Use target.Resolve instead of LValueResolve.
10415         Although we are resolving for LValues, we will let the Assign code
10416         take care of that (it will be called again from Resolve).  This
10417         basically allows code like this:
10418
10419         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10420         class Y { void A (X x) { x [0] += o; }
10421
10422         The problem was that the indexer was trying to resolve for
10423         set_Item (idx, object o) and never finding one.  The real set_Item
10424         was set_Item (idx, X).  By delaying the process we get the right
10425         semantics. 
10426
10427         Fixes bug 36505
10428
10429 2003-02-23  Martin Baulig  <martin@ximian.com>
10430
10431         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10432         while calling DoEmit ().
10433
10434         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10435         source files; if you use the #line directive inside a method, the
10436         compiler stops emitting line numbers for the debugger until it
10437         reaches the end of the method or another #line directive which
10438         restores the original file.
10439
10440 2003-02-23  Martin Baulig  <martin@ximian.com>
10441
10442         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10443
10444 2003-02-23  Martin Baulig  <martin@ximian.com>
10445
10446         * statement.cs (Block.AddChildVariableNames): We need to call this
10447         recursively, not just for our immediate children.
10448
10449 2003-02-23  Martin Baulig  <martin@ximian.com>
10450
10451         * class.cs (Event.Define): Always make the field private, like csc does.
10452
10453         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10454         actually work, fixes bug #37521.
10455
10456 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10457
10458         * delegate.cs: When creating the various temporary "Parameters"
10459         classes, make sure that we call the ComputeAndDefineParameterTypes
10460         on those new parameters (just like we do with the formal ones), to
10461         allow them to be resolved in the context of the DeclSpace.
10462
10463         This fixes the bug that Dick observed in Bugzilla #38530.
10464
10465 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10466
10467         * expression.cs (ResolveMemberAccess): When resolving a constant,
10468         do not attempt to pull a constant if the value was not able to
10469         generate a valid constant.
10470
10471         * const.cs (LookupConstantValue): Do not report more errors than required.
10472
10473 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10474
10475         * expression.cs: fixes bug #38328.
10476
10477 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10478
10479         * class.cs: Changed all the various members that can be part of a
10480         class from being an ArrayList to be an Array of the right type.
10481         During the DefineType type_list, interface_list, delegate_list and
10482         enum_list are turned into types, interfaces, delegates and enums
10483         arrays.  
10484
10485         And during the member population, indexer_list, event_list,
10486         constant_list, field_list, instance_constructor_list, method_list,
10487         operator_list and property_list are turned into their real arrays.
10488
10489         Although we could probably perform this operation earlier, for
10490         good error reporting we need to keep the lists and remove the
10491         lists for longer than required.
10492
10493         This optimization was triggered by Paolo profiling the compiler
10494         speed on the output of `gen-sample-program.pl' perl script. 
10495
10496         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10497         not crash in methods like MemberLookupFailed that use this field.  
10498
10499         This problem arises when the compiler fails to resolve a type
10500         during interface type definition for example.
10501
10502 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10503
10504         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10505         inherit from System.Object, so we have to stop at null, not only
10506         when reaching System.Object.
10507
10508 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10509
10510         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10511         DeclaredOnly because the parent indexer might have had a different
10512         name, but did not loop until the top of the hierarchy was reached.
10513
10514         The problem this one fixes is 35492: when a class implemented an
10515         indexer from an interface, we were getting the interface method
10516         (which was abstract) and we were flagging an error (can not invoke
10517         abstract method).
10518
10519         This also keeps bug 33089 functioning, and test-148 functioning.
10520
10521         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10522         out if a method is special is to see if it is declared in a
10523         property or event, or whether it is one of the predefined operator
10524         names.   This should fix correctly #36804.
10525
10526 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10527
10528         The goal here is to remove the dependency on EmptyCast.Peel ().
10529         Killing it completely.
10530
10531         The problem is that currently in a number of places where
10532         constants are expected, we have to "probe" for an EmptyCast, and
10533         Peel, which is not the correct thing to do, as this will be
10534         repetitive and will likely lead to errors. 
10535
10536         The idea is to remove any EmptyCasts that are used in casts that
10537         can be reduced to constants, so we only have to cope with
10538         constants. 
10539
10540         This bug hunt was triggered by Bug 37363 and the desire to remove
10541         the duplicate pattern where we were "peeling" emptycasts to check
10542         whether they were constants.  Now constants will always be
10543         constants.
10544
10545         * ecore.cs: Use an enumconstant here instead of wrapping with
10546         EmptyCast.  
10547
10548         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10549         throwing me off.  By handling this we can get rid of a few hacks.
10550
10551         * statement.cs (Switch): Removed Peel() code.
10552
10553 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10554
10555         * class.cs: Location information for error 508
10556
10557         * expression.cs (New.DoResolve): Add a guard against double
10558         resolution of an expression.  
10559
10560         The New DoResolve might be called twice when initializing field
10561         expressions (see EmitFieldInitializers, the call to
10562         GetInitializerExpression will perform a resolve on the expression,
10563         and later the assign will trigger another resolution
10564
10565         This leads to bugs (#37014)
10566
10567         * delegate.cs: The signature for EndInvoke should contain any ref
10568         or out parameters as well.  We were not doing this in the past. 
10569
10570         * class.cs (Field.Define): Do not overwrite the type definition
10571         inside the `volatile' group.  Turns out that volatile enumerations
10572         were changing the type here to perform a validity test, which
10573         broke conversions. 
10574
10575 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10576
10577         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10578         and structs, we do not want to load the instance variable
10579
10580         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10581         enum_type has to be handled like an object reference (implicit
10582         conversions exists from this to object), but the regular IsClass
10583         and IsValueType tests will never return true for this one.
10584
10585         Also we use TypeManager.IsValueType instead of type.IsValueType,
10586         just for consistency with the rest of the code (this is only
10587         needed if we ever use the construct exposed by test-180.cs inside
10588         corlib, which we dont today).
10589
10590 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10591
10592         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10593         just InternalCall.
10594
10595 2003-02-09  Martin Baulig  <martin@ximian.com>
10596
10597         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10598         (Namespace.DefineNamespaces): New static public method; this is
10599         called when we're compiling with debugging to add all namespaces
10600         to the symbol file.
10601
10602         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10603         pass it to the Namespace's .ctor.
10604
10605         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10606         and MethodBase arguments; pass the namespace ID to the symwriter;
10607         pass the MethodBase instead of the token to the symwriter.
10608         (SymbolWriter.DefineNamespace): New method to add a namespace to
10609         the symbol file.
10610
10611 2003-02-09  Martin Baulig  <martin@ximian.com>
10612
10613         * symbolwriter.cs: New file.  This is a wrapper around
10614         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10615         methods here in near future.
10616
10617 2003-02-09  Martin Baulig  <martin@ximian.com>
10618
10619         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10620         ILGenerator.MarkSequencePoint() which are actually used by the
10621         symbol writer.
10622
10623 2003-02-09  Martin Baulig  <martin@ximian.com>
10624
10625         * location.cs (SourceFile): New public sealed class.  This
10626         contains the name and an index which is used in the location's token.
10627         (Location): Reserve an appropriate number of bits in the token for
10628         the source file instead of walking over that list, this gives us a
10629         really huge performance improvement when compiling with debugging.
10630
10631         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10632         `SourceFile' argument instead of a string.
10633         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10634         but don't parse/tokenize here, we need to generate the list of all
10635         source files before we do that.
10636         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10637         the files.
10638
10639         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10640         instead of a string.
10641
10642         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10643         of a string.
10644
10645 2003-02-09  Martin Baulig  <martin@ximian.com>
10646
10647         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10648         filename on `#line default'.
10649
10650 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10651
10652         * statement.cs: don't clear the pinned var when the fixed statement
10653         returns from the method (fixes bug#37752).
10654
10655 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10656
10657         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10658         to IsValueType.
10659
10660 2003-02-07  Martin Baulig  <martin@ximian.com>
10661
10662         * driver.cs: Removed the `--debug-args' command line argument.
10663
10664         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10665         automatically by the AsssemblyBuilder.
10666         (CodeGen.InitializeSymbolWriter): We don't need to call any
10667         initialization function on the symbol writer anymore.  This method
10668         doesn't take any arguments.
10669
10670 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10671
10672         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10673         from referenced assemblies as well.
10674
10675 2003-02-02  Martin Baulig  <martin@ximian.com>
10676
10677         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10678
10679 2003-02-02  Martin Baulig  <martin@ximian.com>
10680
10681         * class.cs (Constructor.Emit): Open the symbol writer before
10682         emitting the constructor initializer.
10683         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10684         single-stepping through constructor initializers.
10685
10686 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10687
10688         * class.cs: Handle error 549: do not allow virtual methods in
10689         sealed classes. 
10690
10691 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10692
10693         * decl.cs: Check access levels when resolving types
10694
10695 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10696
10697         * statement.cs: Add parameters and locals set in catch blocks that might 
10698         return to set vector
10699
10700 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10701
10702         * class.cs (Operator): Set the SpecialName flags for operators.
10703
10704         * expression.cs (Invocation.DoResolve): Only block calls to
10705         accessors and operators on SpecialName methods.
10706
10707         (Cast.TryReduce): Handle conversions from char constants.
10708
10709
10710 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10711
10712         * statement.cs: small memory and time optimization in FlowBranching.
10713
10714 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10715
10716         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10717         problem that the last fix but in the other sid (Set).
10718
10719         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10720         access when there is no indexer in the hierarchy.
10721
10722 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10723
10724         * class.cs: Combine some if statements.
10725
10726 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10727
10728         * driver.cs: fixed bug #37187.
10729
10730 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10731
10732         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10733         any indexer, it's needed to build a list with all the indexers in the
10734         hierarchy (AllGetters), else we have problems. Fixes #35653.
10735
10736 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10737
10738         * class.cs (MethodData.Define): It is wrong for an interface
10739         implementation to be static in both cases: explicit and implicit.
10740         We were only handling this in one case.
10741
10742         Improve the if situation there to not have negations.
10743
10744         * class.cs (Field.Define): Turns out that we do not need to check
10745         the unsafe bit on field definition, only on usage.  Remove the test.
10746
10747 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10748
10749         * driver.cs: use assembly.Location instead of Codebase (the latest
10750         patch made mcs fail when using MS assemblies).
10751
10752 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10753
10754         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10755         get the path to *corlib.dll.
10756
10757 2003-01-21  Nick Drochak <ndrochak@gol.com>
10758
10759         * cs-tokenizer.cs:
10760         * pending.cs:
10761         * typemanager.cs: Remove compiler warnings
10762
10763 2003-01-20  Duncan Mak  <duncan@ximian.com>
10764
10765         * AssemblyInfo.cs: Bump the version number to 0.19.
10766
10767 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10768
10769         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10770
10771 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10772
10773         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10774
10775 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10776
10777         * cs-parser.jay: Small fix: we were not comparing the constructor
10778         name correctly.   Thanks to Zoltan for the initial pointer.
10779
10780 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10781
10782         * cs-tokenizer.cs: Set file name when specified with #line
10783
10784 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10785
10786         * cs-parser.jay: Only perform the constructor checks here if we
10787         are named like the class;  This will help provider a better
10788         error.  The constructor path is taken when a type definition is
10789         not found, but most likely the user forgot to add the type, so
10790         report that rather than the constructor error.
10791
10792 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10793
10794         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10795         allocations.
10796
10797 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10798
10799         * cs-parser.jay: Add cleanup call.
10800
10801 2003-01-13  Duncan Mak  <duncan@ximian.com>
10802
10803         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10804         consistent with other methods.
10805
10806 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10807
10808         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10809
10810 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10811
10812         * attribute.cs: only set GuidAttr to true when we have a
10813         GuidAttribute.
10814
10815 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10816
10817         * ecore.cs:
10818         * expression.cs:
10819         * typemanager.cs: fixes to allow mcs compile corlib with the new
10820         Type.IsSubclassOf fix.
10821
10822 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10823
10824         * expression.cs (LocalVariableReference.DoResolve): Classify a
10825         constant as a value, not as a variable.   Also, set the type for
10826         the variable.
10827
10828         * cs-parser.jay (fixed_statement): take a type instead of a
10829         pointer_type, so we can produce a better error message later.
10830
10831         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10832         as an error.  
10833
10834         (For.DoEmit): Make inifinite loops have a
10835         non-conditional branch back.
10836
10837         (Fixed.DoEmit): First populate the pinned variables, then emit the
10838         statement, then clear the variables.  Before I was emitting the
10839         code once for each fixed piece.
10840
10841
10842 2003-01-08  Martin Baulig  <martin@ximian.com>
10843
10844         * statement.cs (FlowBranching.MergeChild): A break in a
10845         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10846
10847 2003-01-08  Martin Baulig  <martin@ximian.com>
10848
10849         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10850         lives in the same number space than `param_map'.  Fixes #36154.
10851
10852 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10853
10854         * cs-parser.jay (constructor_declaration): Set the
10855         Constructor.ModFlags before probing for it.  This makes the
10856         compiler report 514, 515 and 132 (the code was there, but got
10857         broken). 
10858
10859         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10860         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10861         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10862
10863 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10864
10865         * enum.cs: create the enum static fields using the enum type.
10866
10867 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10868
10869         * class.cs: don't try to create the ParamBuilder for the return
10870         type if it's not needed (and handle it breaking for the ms runtime
10871         anyway).
10872
10873 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10874
10875         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10876
10877 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10878
10879         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10880         the command.   This showed up while compiling the JANET source
10881         code, which used \r as its only newline separator.
10882
10883 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10884
10885         * class.cs (Method.Define): If we are an operator (because it
10886         reuses our code), then set the SpecialName and HideBySig.  #36128
10887
10888 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10889
10890         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10891         exception, report error 120 `object reference required'.
10892
10893         * driver.cs: Add --pause option, used during to measure the size
10894         of the process as it goes with --timestamp.
10895
10896         * expression.cs (Invocation.DoResolve): Do not allow methods with
10897         SpecialName to be invoked.
10898
10899 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10900
10901         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10902         number before adding it.
10903
10904 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10905
10906         * ecore.cs (StandardImplicitConversion): When in an unsafe
10907         context, we allow conversion between void * to any other pointer
10908         type. This fixes bug #35973.
10909
10910 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10911
10912         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10913         is not thrown when extensionless outputs are used 
10914
10915 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10916
10917         * rootcontext.cs: fixed compilation of corlib.
10918
10919 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10920
10921         * attribute.cs (Attributes.Contains): Add new method.
10922
10923         * class.cs (MethodCore.LabelParameters): if the parameter is an
10924         `out' parameter, check that no attribute `[In]' has been passed.
10925
10926         * enum.cs: Handle the `value__' name in an enumeration.
10927
10928 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10929
10930         * decl.cs: Added special case to allow overrides on "protected
10931         internal" methods
10932
10933 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10934
10935         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10936         since it makes much more sense.
10937
10938         (Attributes.ctor): Don't require a Location parameter.
10939
10940         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10941
10942         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10943         since we already have that information per attribute.
10944
10945         * everywhere : make appropriate changes.
10946
10947         * class.cs (LabelParameters): Write the code which actually
10948         applies attributes to the return type. We can't do this on the MS
10949         .NET runtime so we flag a warning in the case an exception is
10950         thrown.
10951
10952 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10953
10954         * const.cs: Handle implicit null conversions here too.
10955
10956 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10957
10958         * class.cs (MethodCore.LabelParameters): Remove the extra
10959         Type [] parameter since it is completely unnecessary. Instead
10960         pass in the method's attributes so that we can extract
10961         the "return" attribute.
10962
10963 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10964
10965         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10966         of ignoring it and letting the compile continue.
10967
10968         * typemanager.cs (ChangeType): use an extra argument to return an
10969         error condition instead of throwing an exception.
10970
10971 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10972
10973         * expression.cs (Unary.TryReduce): mimic the code for the regular
10974         code path.  Perform an implicit cast in the cases where we can
10975         implicitly convert to one of the integral types, and then reduce
10976         based on that constant.   This fixes bug #35483.
10977
10978 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10979
10980         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10981
10982 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10983
10984         * namespace.cs: fixed bug #35489.
10985
10986 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10987
10988         * class.cs: Remove some dead code.
10989
10990         * cs-parser.jay: Estimate the number of methods needed
10991         (RootContext.MethodCount);
10992
10993         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10994         numbers instead of StringBuilders.
10995
10996         * support.cs (PtrHashtable): Add constructor with initial size;
10997         We can now reduce reallocations of the method table.
10998
10999 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11000
11001         * attribute.cs (ApplyAttributes): Keep track of the emitted
11002         attributes on a per-target basis. This fixes bug #35413.
11003
11004 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11005
11006         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11007         default to the Windows 1252 encoding.
11008
11009         (UnixParseOption): Support version, thanks to Alp for the missing
11010         pointer. 
11011
11012         * AssemblyInfo.cs: Add nice assembly information.
11013
11014         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11015         (bug 35169).
11016
11017         * cs-parser.jay: Allow a trailing comma before the close bracked
11018         in the attribute_section production.
11019
11020         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11021         address of the instance was being taken, I will take this out,
11022         because we take the address of the object immediately here.
11023
11024 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11025
11026         * typemanager.cs (AreMultipleAllowed): Take care of the most
11027         obvious case where attribute type is not in the current assembly -
11028         stupid me ;-)
11029
11030 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11031
11032         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11033         definitions, instead of doing that afterwards.  
11034
11035         Also we use a nice little hack, depending on the constructor, we
11036         know if we are a "composed" name or a simple name.  Hence, we
11037         avoid the IndexOf test, and we avoid 
11038
11039         * codegen.cs: Add code to assist in a bug reporter to track down
11040         the source of a compiler crash. 
11041
11042 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11043
11044         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11045         types have been emitted for a given element and flag an error
11046         if something which does not have AllowMultiple set is used more
11047         than once.
11048
11049         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11050         attribute types and their corresponding AllowMultiple properties
11051
11052         (AreMultipleAllowed): Check the property for a given type.
11053
11054         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11055         property in the case we have a TypeContainer.
11056
11057         (Attributes.AddAttribute): Detect duplicates and just skip on
11058         adding them. This trivial fix catches a pretty gross error in our
11059         attribute emission - global attributes were being emitted twice!
11060
11061         Bugzilla bug #33187 is now fixed.
11062
11063 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11064
11065         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11066         instead of pp_and).
11067
11068         * expression.cs (Binary.ResolveOperator): I can only use the
11069         Concat (string, string, string) and Concat (string, string,
11070         string, string) if the child is actually a concatenation of
11071         strings. 
11072
11073 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11074
11075         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11076         context where we need a 2-character lookahead.
11077
11078         * pending.cs (PendingImplementation): Rework so we can keep track
11079         of interface types all the time, and flag those which were
11080         implemented by parents as optional.
11081
11082 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11083
11084         * expression.cs (Binary.ResolveOperator): Use
11085         String.Concat(string,string,string) or
11086         String.Concat(string,string,string,string) when possible. 
11087
11088         * typemanager: More helper methods.
11089
11090
11091 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11092
11093         * pending.cs: remove the bogus return from GetMissingInterfaces()
11094         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11095
11096 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11097
11098         * namespace.cs: avoid duplicated 'using xxx' being added to
11099         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11100         when we get more than one 'using' statement for the same namespace.
11101         Report a CS0105 warning for it.
11102
11103 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11104
11105         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11106         of calling getChar/putback, uses internal knowledge of it.    
11107
11108         (xtoken): Reorder tokenizer so most common patterns are checked
11109         first.  This reduces the compilation time in another 5% (from 8.11s
11110         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11111
11112         The parsing time is 22% of the compilation in mcs, and from that
11113         64% is spent on the tokenization process.  
11114
11115         I tried using a binary search for keywords, but this is slower
11116         than the hashtable.  Another option would be to do a couple of
11117         things:
11118
11119                 * Not use a StringBuilder, instead use an array of chars,
11120                   with a set value.  Notice that this way we could catch
11121                   the 645 error without having to do it *afterwards*.
11122
11123                 * We could write a hand-parser to avoid the hashtable
11124                   compares altogether.
11125
11126         The identifier consumption process takes 37% of the tokenization
11127         time.  Another 15% is spent on is_number.  56% of the time spent
11128         on is_number is spent on Int64.Parse:
11129
11130                 * We could probably choose based on the string length to
11131                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11132                   computations. 
11133
11134         Another 3% is spend on wrapping `xtoken' in the `token' function.
11135
11136         Handle 0xa0 as whitespace (#34752)
11137
11138 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11139
11140         * typemanager.cs (IsCLRType): New routine to tell whether a type
11141         is one of the builtin types.  
11142
11143         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11144         typecode in more places instead of doing pointer comparissions.
11145         We could leverage some knowledge about the way the typecodes are
11146         laid out.
11147
11148         New code to cache namespaces in assemblies, it is currently not
11149         invoked, to be used soon.
11150
11151         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11152
11153         * expression.cs (Binary.ResolveOperator): specially handle
11154         strings, and do not perform user-defined operator overloading for
11155         built-in types.
11156
11157 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11158
11159         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11160         internalcall as it is a pretty simple operation;  Avoid whenever
11161         possible to call Char.IsLetter.
11162
11163         (consume_identifier): Cut by half the number of
11164         hashtable calls by merging the is_keyword and GetKeyword behavior.
11165
11166         Do not short-circuit, because if we do, we
11167         report errors (ie, #if false && true would produce an invalid
11168         directive error);
11169
11170
11171 2002-11-24  Martin Baulig  <martin@ximian.com>
11172
11173         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11174         check constant ranges and report a CS0221.  Fixes #33186.
11175
11176 2002-11-24  Martin Baulig  <martin@ximian.com>
11177
11178         * cs-parser.jay: Make this work for uninitialized variable
11179         declarations in the `for' initializer.  Fixes #32416.
11180
11181 2002-11-24  Martin Baulig  <martin@ximian.com>
11182
11183         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11184         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11185
11186 2002-11-24  Martin Baulig  <martin@ximian.com>
11187
11188         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11189         argument; if true, we also check for user-defined conversions.
11190         This is only needed if both arguments are of a user-defined type.
11191         Fixes #30443, added test-175.cs.
11192         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11193
11194         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11195
11196 2002-11-24  Martin Baulig  <martin@ximian.com>
11197
11198         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11199         function to get the store opcode.
11200         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11201         only emit the Ldelema if the store opcode is Stobj.  You must run
11202         both test-34 and test-167 to test this.  Fixes #34529.
11203
11204 2002-11-23  Martin Baulig  <martin@ximian.com>
11205
11206         * ecore.cs (Expression.MemberLookup): Added additional
11207         `qualifier_type' argument which is used when we're being called
11208         from MemberAccess.DoResolve() and null if we're called from a
11209         SimpleName lookup.
11210         (Expression.MemberLookupFailed): New method to report errors; this
11211         does the CS1540 check and reports the correct error message.
11212
11213         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11214         argument for the CS1540 check and redone the way how we're dealing
11215         with private members.  See the comment in the source code for details.
11216         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11217         `closure_start_type' to `closure_qualifier_type' and check whether
11218         it's not null.  It was not this filter being broken, it was just
11219         being called with the wrong arguments.
11220
11221         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11222         and pass it the correct `qualifier_type'; this also does the error
11223         handling for us.
11224
11225 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11226
11227         * expression.cs (Invocation.EmitParams): If the we are dealing
11228         with a non-built-in value type, load its address as well.
11229
11230         (ArrayCreation): Use a a pretty constant instead
11231         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11232         static initializers.  
11233
11234         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11235         because they are not really value types, just glorified integers. 
11236
11237         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11238
11239         * ecore.cs: Remove redundant code for enumerations, make them use
11240         the same code path as everything else, fixes the casting issue
11241         with enumerations in Windows.Forms.
11242
11243         * attribute.cs: Do only cast to string if it is a string, the
11244         validation happens later.
11245
11246         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11247         people upgrade their corlibs.
11248
11249         * ecore.cs: Oops, enumerations were not following the entire code path
11250
11251 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11252
11253         * typemanager.cs (FilterWithClosure): Commented out the test for
11254         1540 in typemanager.cs, as it has problems when accessing
11255         protected methods from a parent class (see test-174.cs). 
11256
11257         * attribute.cs (Attribute.ValidateGuid): new method.
11258         (Attribute.Resolve): Use above.
11259
11260 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11261
11262         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11263
11264         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11265         handling for enumerations, as we only needed the TypeContainer
11266         functionality to begin with (this is required for the fix below to
11267         work for enums that reference constants in a container class for
11268         example). 
11269
11270         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11271
11272         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11273         a valid TypeBuilder to perform lookups on.o
11274
11275         * class.cs (InheritableMemberSignatureCompare): Use true in the
11276         call to GetGetMethod and GetSetMethod, because we are comparing
11277         the signature, and we need to get the methods *even* if they are
11278         private. 
11279
11280         (PropertyBase.CheckBase): ditto.
11281
11282         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11283         GotoCase.Resolve): Use Peel on EmpytCasts.
11284
11285         * ecore.cs (EmptyCast): drop child, add Peel method.
11286
11287 2002-11-17  Martin Baulig  <martin@ximian.com>
11288
11289         * ecore.cs (EmptyCast.Child): New public property.
11290
11291         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11292         label resolved to an EmptyCast.  Fixes #34162.
11293         (GotoCase.Resolve): Likewise.
11294         (Block.EmitMeta): Likewise.
11295
11296 2002-11-17  Martin Baulig  <martin@ximian.com>
11297
11298         * expression.cs (Invocation.BetterConversion): Prefer int over
11299         uint; short over ushort; long over ulong for integer literals.
11300         Use ImplicitConversionExists instead of StandardConversionExists
11301         since we also need to check for user-defined implicit conversions.
11302         Fixes #34165.  Added test-173.cs.
11303
11304 2002-11-16  Martin Baulig  <martin@ximian.com>
11305
11306         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11307         with the `true' and `false' literals.  Fixes #33151.
11308
11309 2002-11-16  Martin Baulig  <martin@ximian.com>
11310
11311         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11312         October 22nd; don't do the cs1540 check for static members.
11313
11314         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11315         now using our own filter here and doing the cs1540 check again.
11316
11317 2002-11-16  Martin Baulig  <martin@ximian.com>
11318
11319         * support.cs (InternalParameters): Don't crash if we don't have
11320         any fixed parameters.  Fixes #33532.
11321
11322 2002-11-16  Martin Baulig  <martin@ximian.com>
11323
11324         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11325         when looking up static methods to make this work on Windows.
11326         Fixes #33773.
11327
11328 2002-11-16  Martin Baulig  <martin@ximian.com>
11329
11330         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11331         a setter rather than using PropertyInfo.CanWrite.
11332
11333 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11334
11335         * class.cs: Allow acces to block member by subclasses. Fixes build
11336         breaker.
11337
11338 2002-11-14  Martin Baulig  <martin@ximian.com>
11339
11340         * class.cs (Constructor.Emit): Added the extern/block check.
11341         Fixes bug #33678.
11342
11343 2002-11-14  Martin Baulig  <martin@ximian.com>
11344
11345         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11346         iteration while looking for indexers, this is needed because the
11347         indexer may have a different name in our base classes.  Fixed the
11348         error reporting (no indexers at all, not get accessor, no
11349         overloaded match).  Fixes bug #33089.
11350         (IndexerAccess.DoResolveLValue): Likewise.
11351
11352 2002-11-14  Martin Baulig  <martin@ximian.com>
11353
11354         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11355         indexers.  Fixes the first part of bug #33089.
11356         (MethodSignature.InheritableMemberSignatureCompare): Added support
11357         for properties.
11358
11359 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11360
11361         * attribute.cs (Attribute.Resolve): Catch the
11362         NullReferenceException and report it since it isn't supposed to
11363         happen. 
11364
11365 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11366
11367         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11368         LogicalOr and LogicalAnd that can benefit from recursively
11369         handling EmitBranchable.  The code now should be nice for Paolo.
11370
11371 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11372
11373         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11374         the Type lookups, as we perform quite a number of lookups on
11375         non-Types.  This can be removed once we can deterministically tell
11376         whether we have a type or a namespace in advance.
11377
11378         But this might require special hacks from our corlib.
11379
11380         * TODO: updated.
11381
11382         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11383         and double which avoids a conversion from an integer to a double.
11384
11385         * expression.cs: tiny optimization, avoid calling IsConstant,
11386         because it effectively performs the lookup twice.
11387
11388 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11389
11390         But a bogus return here to keep the semantics of the old code
11391         until the Mono runtime is fixed.
11392
11393         * pending.cs (GetMissingInterfaces): New method used to remove all
11394         the interfaces that are already implemented by our parent
11395         classes from the list of pending methods. 
11396
11397         * interface.cs: Add checks for calls after ResolveTypeExpr.
11398
11399 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11400
11401         * class.cs (Class.Emit): Report warning 67: event not used if the
11402         warning level is beyond 3.
11403
11404         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11405         being a NullLiteral.
11406
11407         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11408         specifiers. 
11409
11410         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11411         path that might fail if a type can not be resolved.
11412
11413         * expression.cs (Binary.Emit): Emit unsigned versions of the
11414         operators. 
11415
11416         * driver.cs: use error 5.
11417
11418 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11419
11420         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11421
11422 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11423
11424         * cs-parser.jay (switch_section): A beautiful patch from Martin
11425         Baulig that fixed 33094.
11426
11427 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11428
11429         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11430         Check whether the base is abstract and report an error if so.
11431
11432         * expression.cs (IndexerAccess.DoResolveLValue,
11433         IndexerAccess.DoResolve): ditto. 
11434
11435         (Invocation.DoResolve): ditto.
11436
11437         (Invocation.FullMethodDesc): Improve the report string.
11438
11439         * statement.cs (Block): Eliminate IsVariableDefined as it is
11440         basically just a wrapper for GetVariableInfo.
11441
11442         * ecore.cs (SimpleName): Use new 
11443
11444         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11445         type, as we return the actual parameter ref/unref state on a
11446         different call.
11447
11448 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11449
11450         * support.cs: Return proper flags REF/OUT fixing the previous
11451         commit.  
11452
11453         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11454         not used to mean `ref' but `ref or out' in ParameterReference
11455
11456         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11457         full type signature instead of calling TypeManger.CSharpName
11458         ourselves. 
11459
11460         * support.cs (InternalParameters.ParameterDesc): Do not compare
11461         directly to the modflags, because REF/OUT will actually be bitsets
11462         if set. 
11463
11464         * delegate.cs (VerifyMethod): Check also the modifiers.
11465
11466         * cs-tokenizer.cs: Fix bug where floating point values with an
11467         exponent where a sign was missing was ignored.
11468
11469         * driver.cs: Allow multiple assemblies to be specified in a single
11470         /r: argument
11471
11472 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11473
11474         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11475         because identifiers after a parenthesis would end up in this kind
11476         of production, and we needed to desamiguate it for having casts
11477         like:
11478
11479                 (UserDefinedType *) xxx
11480
11481 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11482
11483         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11484         we should set on the Bindingflags.NonPublic, but not turn on
11485         private_ok.  private_ok controls whether a Private member is
11486         returned (this is chekced on the filter routine), while the
11487         BindingFlags.NonPublic just controls whether private/protected
11488         will be allowed.   This fixes the problem part of the problem of
11489         private properties being allowed to be used in derived classes.
11490
11491         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11492         so we can call the children DoResolveLValue method (this will
11493         properly signal errors on lvalue assignments to base properties)
11494
11495         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11496         getter are null, and we have a property info, we know that this
11497         happened because the lookup failed, so we report an error 122 for
11498         protection level violation.
11499
11500         We also silently return if setter and getter are null in the
11501         resolve functions, this condition only happens if we have flagged
11502         the error before.  This is the other half of the problem. 
11503
11504         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11505         not have accessibility information, that is why we were returning
11506         true in the filter function in typemanager.cs.
11507
11508         To properly report 122 (property is inaccessible because of its
11509         protection level) correctly, we report this error in ResolveAccess
11510         by failing if both the setter and the getter are lacking (ie, the
11511         lookup failed). 
11512
11513         DoResolve and DoLResolve have been modified to check for both
11514         setter/getter being null and returning silently, the reason being
11515         that I did not want to put the knowledge about this error in upper
11516         layers, like:
11517
11518         int old = Report.Errors;
11519         x = new PropertyExpr (...);
11520         if (old != Report.Errors)
11521                 return null;
11522         else
11523                 return x;
11524
11525         So the property expr is returned, but it is invalid, so the error
11526         will be flagged during the resolve process. 
11527
11528         * class.cs: Remove InheritablePropertySignatureCompare from the
11529         class, as we no longer depend on the property signature to compute
11530         whether it is possible to implement a method or not.
11531
11532         The reason is that calling PropertyInfo.GetGetMethod will return
11533         null (in .NET, in Mono it works, and we should change this), in
11534         cases where the Get Method does not exist in that particular
11535         class.
11536
11537         So this code:
11538
11539         class X { public virtual int A { get { return 1; } } }
11540         class Y : X { }
11541         class Z : Y { public override int A { get { return 2; } } }
11542
11543         Would fail in Z because the parent (Y) would not have the property
11544         defined.  So we avoid this completely now (because the alternative
11545         fix was ugly and slow), and we now depend exclusively on the
11546         method names.
11547
11548         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11549         reference method, instead of using the property.
11550
11551         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11552         routines are gone now.
11553
11554         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11555         names, they were incorrectly named.
11556
11557         * cs-tokenizer.cs: Return are more gentle token on failure. 
11558
11559         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11560         had an out-of-sync index variable, which caused it to remove from
11561         the list of pending methods the wrong method sometimes.
11562
11563 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11564
11565         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11566         CanWrite, because those refer to this particular instance of the
11567         property, and do not take into account the fact that we can
11568         override single members of a property.
11569
11570         Constructor requires an EmitContext.  The resolution process does
11571         not happen here, but we need to compute the accessors before,
11572         because the resolution does not always happen for properties.
11573
11574         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11575         subclass, before we did not update this flag, but we did update
11576         bindingflags. 
11577
11578         (GetAccessors): Drop this routine, as it did not work in the
11579         presence of partially overwritten set/get methods. 
11580
11581         Notice that this broke the cs1540 detection, but that will require
11582         more thinking. 
11583
11584 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11585
11586         * class.cs:
11587         * codegen.cs:
11588         * driver.cs: issue a warning instead of an error if we don't support
11589         debugging for the platform. Also ignore a couple of errors that may
11590         arise when trying to write the symbols. Undo my previous patch.
11591
11592 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11593
11594         * driver.cs: ignore /debug switch except for Unix platforms.
11595
11596 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11597
11598         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11599
11600 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11601
11602         * driver.cs: Do not make mcs-debug conditional, so we do not break
11603         builds that use it.
11604
11605         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11606         review this patch.  But basically after all the children variables
11607         have been merged, the value of "Breaks" was not being set to
11608         new_breaks for Switch blocks.  I think that it should be set after
11609         it has executed.  Currently I set this to the value of new_breaks,
11610         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11611         conservative, but I do not understand this code very well.
11612
11613         I did not break anything in the build, so that is good ;-)
11614
11615         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11616
11617 2002-10-20  Mark Crichton  <crichton@gimp.org>
11618
11619         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11620
11621 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11622
11623         * cfold.cs: Fixed compile blocker.
11624
11625 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11626
11627         * driver.cs: I was chekcing the key, not the file.
11628
11629 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11630
11631         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11632         message that we were generating - we just need to silently return
11633         a null.
11634
11635 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11636
11637         * class.cs (Event.Define): Change my previous commit, as this
11638         breaks the debugger.  This is a temporary hack, as it seems like
11639         the compiler is generating events incorrectly to begin with.
11640
11641         * expression.cs (Binary.ResolveOperator): Added support for 
11642         "U operator - (E x, E y)"
11643
11644         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11645         y)".
11646
11647         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11648         init-only variables, but this path did not take into account that
11649         there might be also instance readonly variables.  Correct this
11650         problem. 
11651
11652         This fixes bug 32253
11653
11654         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11655         delegates as well.
11656
11657         * driver.cs: Change the extension for modules to `netmodule'
11658
11659         * cs-parser.jay: Improved slightly the location tracking for
11660         the debugger symbols.
11661
11662         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11663         modifiers that were specified instead of the hardcoded value
11664         (FamAndAssem).  This was basically ignoring the static modifier,
11665         and others.  Fixes 32429.
11666
11667         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11668         fixed a bug in the process (32476)
11669
11670         * expression.cs (ArrayAccess.EmitAssign): Patch from
11671         hwang_rob@yahoo.ca that fixes bug 31834.3
11672
11673 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11674
11675         * driver.cs: Make the module extension .netmodule.
11676
11677 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11678
11679         * driver.cs: Report an error if the resource file is not found
11680         instead of crashing.
11681
11682         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11683         false, like Emit does.
11684
11685 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11686
11687         * typemanager.cs: Remove unused private member.  Also reported mcs
11688         bug to report this as a warning like csc.
11689
11690 2002-10-15  Martin Baulig  <martin@gnome.org>
11691
11692         * statement.cs (Statement.Emit): Made this a virtual method; emits
11693         the line number info and calls DoEmit().
11694         (Statement.DoEmit): New protected abstract method, formerly knows
11695         as Statement.Emit().
11696
11697         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11698
11699 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11700
11701         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11702         have fixed a remaining problem: not every AddXXXX was adding a
11703         fully qualified name.  
11704
11705         Now everyone registers a fully qualified name in the DeclSpace as
11706         being defined instead of the partial name.  
11707
11708         Downsides: we are slower than we need to be due to the excess
11709         copies and the names being registered this way.  
11710
11711         The reason for this is that we currently depend (on the corlib
11712         bootstrap for instance) that types are fully qualified, because
11713         we dump all the types in the namespace, and we should really have
11714         types inserted into the proper namespace, so we can only store the
11715         basenames in the defined_names array.
11716
11717 2002-10-10  Martin Baulig  <martin@gnome.org>
11718
11719         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11720         from bug #31834, see the bug report for a testcase which is
11721         miscompiled.
11722
11723 2002-10-10  Martin Baulig  <martin@gnome.org>
11724
11725         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11726         flow analysis code for this.
11727
11728         * statement.cs (Do, While, For): Tell the flow analysis code about
11729         infinite loops.
11730         (FlowBranching.UsageVector): Added support for infinite loops.
11731         (Block.Resolve): Moved the dead code elimination here and use flow
11732         analysis to do it.
11733
11734 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11735
11736         * class.cs (Field.Define): Catch cycles on struct type
11737         definitions. 
11738
11739         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11740         fields if the fields are static.  We only need to check instance
11741         fields. 
11742
11743         * expression.cs (As.DoResolve): Test for reference type.
11744
11745         * statement.cs (Using.ResolveExpression): Use
11746         ConvertImplicitRequired, not ConvertImplicit which reports an
11747         error on failture
11748         (Using.ResolveLocalVariableDecls): ditto.
11749
11750         * expression.cs (Binary.ResolveOperator): Report errors in a few
11751         places where we had to.
11752
11753         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11754
11755 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11756
11757         * expression.cs: Use StoreFromPtr instead of extracting the type
11758         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11759
11760         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11761         an enumeration value to a System.Enum, but System.Enum is not a
11762         value type, but an class type, so we need to box.
11763
11764         (Expression.ConvertExplicit): One codepath could return
11765         errors but not flag them.  Fix this.  Fixes #31853
11766
11767         * parameter.cs (Resolve): Do not allow void as a parameter type.
11768
11769 2002-10-06  Martin Baulig  <martin@gnome.org>
11770
11771         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11772         if it's a class type and not a struct.  Fixes #31815.
11773
11774 2002-10-06  Martin Baulig  <martin@gnome.org>
11775
11776         * statement.cs: Reworked the flow analysis code a bit to make it
11777         usable for dead code elimination.
11778
11779 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11780
11781         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11782
11783 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11784
11785         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11786         to fix the test 165, will investigate deeper.
11787
11788 2002-10-04  Martin Baulig  <martin@gnome.org>
11789
11790         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11791         finally blocks actually work.
11792         (Try.Resolve): We don't need to create a sibling for `finally' if
11793         there is no finally block.
11794
11795 2002-10-04  Martin Baulig  <martin@gnome.org>
11796
11797         * class.cs (Constructor.Define): The default accessibility for a
11798         non-default constructor is private, not public.
11799
11800 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11801
11802         * class.cs (Constructor): Make AllowedModifiers public, add
11803         EXTERN.
11804
11805         * cs-parser.jay: Perform the modifiers test here, as the
11806         constructor for the Constructor class usually receives a zero
11807         because of the way we create it (first we create, later we
11808         customize, and we were never checking the modifiers).
11809
11810         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11811         is a version of LookupTypeReflection that includes the type-name
11812         cache.  This can be used as a fast path for functions that know
11813         the fully qualified name and are only calling into *.GetType() to
11814         obtain a composed type.
11815
11816         This is also used by TypeManager.LookupType during its type
11817         composition.
11818
11819         (LookupType): We now also track the real type name, as sometimes
11820         we can get a quey for the real type name from things like
11821         ComposedCast.  This fixes bug 31422.
11822
11823         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11824         complete type fullname, it does not have to go through the type
11825         resolution system to obtain the composed version of the type (for
11826         obtaining arrays or pointers).
11827
11828         (Conditional.Emit): Use the EmitBoolExpression to
11829         generate nicer code, as requested by Paolo.
11830
11831         (ArrayCreation.CheckIndices): Use the patch from
11832         hwang_rob@yahoo.ca to validate the array initializers. 
11833
11834 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11835
11836         * class.cs (ConstructorInitializer.Emit): simplify code by using
11837         Invocation.EmitCall, and at the same time, fix the bugs in calling
11838         parent constructors that took variable arguments. 
11839
11840         * ecore.cs (Expression.ConvertNumericExplicit,
11841         Expression.ImplicitNumericConversion): Remove the code that
11842         manually wrapped decimal (InternalTypeConstructor call is now gone
11843         as well).
11844
11845         * expression.cs (Cast.TryReduce): Also handle decimal types when
11846         trying to perform a constant fold on the type.
11847
11848         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11849
11850         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11851         that only turned off an error report, and did nothing else. 
11852
11853 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11854
11855         * driver.cs: Handle and ignore /fullpaths
11856
11857 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11858
11859         * expression.cs (Binary.ResolveOperator): Catch the case where
11860         DoNumericPromotions returns true, 
11861
11862         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11863
11864 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11865
11866         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11867         report error 70.
11868
11869 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11870
11871         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11872         conversion exists, but it is also required that the conversion be
11873         performed.  This manifested in "(Type64Enum) 2".  
11874
11875         * class.cs (TypeManager.AddMethod): The fix is not to change
11876         AddEnum, because that one was using a fully qualified name (every
11877         DeclSpace derivative does), but to change the AddMethod routine
11878         that was using an un-namespaced name.  This now correctly reports
11879         the duplicated name.
11880
11881         Revert patch until I can properly fix it.  The issue
11882         is that we have a shared Type space across all namespaces
11883         currently, which is wrong.
11884
11885         Options include making the Namespace a DeclSpace, and merge
11886         current_namespace/current_container in the parser.
11887
11888 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11889
11890         * cs-parser.jay: Improve error reporting when we get a different
11891         kind of expression in local_variable_type and
11892         local_variable_pointer_type. 
11893
11894         Propagate this to avoid missleading errors being reported.
11895
11896         * ecore.cs (ImplicitReferenceConversion): treat
11897         TypeManager.value_type as a target just like object_type.   As
11898         code like this:
11899
11900         ValueType v = 1;
11901
11902         Is valid, and needs to result in the int 1 being boxed before it
11903         is assigned to the value type v.
11904
11905         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11906         to validate the enumeration name.
11907
11908         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11909         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11910         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11911
11912         * ecore.cs (TryImplicitIntConversion): When doing an
11913         implicit-enumeration-conversion, check if the type is 64-bits and
11914         perform a conversion before passing to EnumConstant.
11915
11916 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11917
11918         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11919         report ambiguous type references.  Unlike the MS version, we
11920         report what the ambiguity is.   Innovation at work ;-)
11921
11922         (DeclSpace.FindType): Require a location argument to
11923         display when we display an ambiguous error.
11924
11925         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11926
11927         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11928
11929         * expression.cs (EmitDynamicInitializers): Apply patch from
11930         hwang_rob@yahoo.ca that fixes the order in which we emit our
11931         initializers. 
11932
11933 2002-09-21  Martin Baulig  <martin@gnome.org>
11934
11935         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11936         delegate takes no arguments.
11937
11938 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11939
11940         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11941         from integers.
11942
11943         * expression.cs: Extract the underlying type.
11944
11945         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11946
11947         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11948
11949 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11950
11951         * class.cs (TypeContainer.DefineType): We can not use the nice
11952         PackingSize with the size set to 1 DefineType method, because it
11953         will not allow us to define the interfaces that the struct
11954         implements.
11955
11956         This completes the fixing of bug 27287
11957
11958         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11959         means also structs.  This fixes part of the problem. 
11960         (Expresion.ImplicitReferenceConversionExists): ditto.
11961
11962         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11963         error if there were no errors reported during the type lookup
11964         process, to avoid duplicates or redundant errors.  Without this
11965         you would get an ambiguous errors plus a type not found.  We have
11966         beaten the user enough with the first error.  
11967
11968         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11969         reference. 
11970
11971         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11972         during the resolution process, stop the lookup, this avoids
11973         repeated error reports (same error twice).
11974
11975         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11976
11977         * typemanager.cs (LookupType): Redo the type lookup code to match
11978         the needs of System.Reflection.  
11979
11980         The issue is that System.Reflection requires references to nested
11981         types to begin with a "+" sign instead of a dot.  So toplevel
11982         types look like: "NameSpace.TopLevelClass", and nested ones look
11983         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11984         levels. 
11985
11986 2002-09-19  Martin Baulig  <martin@gnome.org>
11987
11988         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11989         says that a method always returns or always throws an exception,
11990         don't report the CS0161.
11991
11992         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11993         set `Returns = new_returns'.
11994
11995 2002-09-19  Martin Baulig  <martin@gnome.org>
11996
11997         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11998         to an enum constant, check for a CS0176.
11999
12000 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12001
12002         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12003         for operators that must be in pairs and report errors.
12004
12005         * ecore.cs (SimpleName.DoResolveType): During the initial type
12006         resolution process, when we define types recursively, we must
12007         check first for types in our current scope before we perform
12008         lookups in the enclosing scopes.
12009
12010         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12011
12012         (Invocation.VerifyArgumentsCompat): Call
12013         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12014         I thought we were supposed to always call this, but there are a
12015         few places in the code where we dont do it.
12016
12017 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12018
12019         * driver.cs: Add support in -linkres and -resource to specify the
12020         name of the identifier.
12021
12022 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12023
12024         * ecore.cs (StandardConversionExists): Sync with the conversion
12025         code: allow anything-* to void* conversions.
12026
12027         (FindMostSpecificSource): Use an Expression argument
12028         instead of a Type, because we might be handed over a Literal which
12029         gets a few more implicit conversions that plain types do not.  So
12030         this information was being lost.
12031
12032         Also, we drop the temporary type-holder expression when not
12033         required.
12034
12035 2002-09-17  Martin Baulig  <martin@gnome.org>
12036
12037         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12038         this is an explicit interface implementation.
12039
12040 2002-09-17  Martin Baulig  <martin@gnome.org>
12041
12042         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12043         different `IndexerName' attributes.
12044
12045         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12046         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12047         virtual CommonResolve().
12048
12049 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12052         and convert that to the UnderlyingType.
12053
12054         * statement.cs (Foreach.Resolve): Indexers are just like variables
12055         or PropertyAccesses.
12056
12057         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12058         inside quoted strings, we were not doing this before.
12059
12060 2002-09-16  Martin Baulig  <martin@gnome.org>
12061
12062         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12063         resolve it.  This is needed for the definite assignment check of the
12064         instance expression, fixes bug #29846.
12065         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12066
12067 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12068
12069         * parameter.cs: Fix compile error.  Cannot reference static member
12070         from an instance object.  Is this an mcs bug?
12071
12072 2002-09-14  Martin Baulig  <martin@gnome.org>
12073
12074         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12075         multiple times.  Fixes bug #30295, added test-166.cs.
12076
12077 2002-09-14  Martin Baulig  <martin@gnome.org>
12078
12079         * statement.cs (Block.Emit): Don't emit unreachable code.
12080         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12081         `break' statements.
12082         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12083
12084 2002-09-14  Martin Baulig  <martin@gnome.org>
12085
12086         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12087         is set.
12088
12089 2002-09-14  Martin Baulig  <martin@gnome.org>
12090
12091         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12092         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12093         be false on the ms runtime.
12094
12095 2002-09-13  Martin Baulig  <martin@gnome.org>
12096
12097         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12098         the CS0038 error message.
12099
12100 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12101
12102         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12103         constant inside, return it.
12104
12105 2002-09-12  Martin Baulig  <martin@gnome.org>
12106
12107         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12108         implicit conversion can be done between enum types.
12109
12110         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12111         check whether an implicit conversion to the current enum's UnderlyingType
12112         exists and report an error if not.
12113
12114         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12115         without debugging support.
12116
12117         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12118         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12119
12120 2002-09-12  Martin Baulig  <martin@gnome.org>
12121
12122         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12123
12124         * ecore.cs (IMemberExpr.DeclaringType): New property.
12125         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12126         nonstatic member of an outer type (CS0038).
12127
12128 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12129
12130         * driver.cs: Activate the using-error detector at warning level
12131         4 (at least for MS-compatible APIs).
12132
12133         * namespace.cs (VerifyUsing): Small buglett fix.
12134
12135         * pending.cs (PendingImplementation): pass the container pointer. 
12136
12137         * interface.cs (GetMethods): Allow for recursive definition.  Long
12138         term, I would like to move every type to support recursive
12139         definitions, not the current ordering mechanism that we have right
12140         now.
12141
12142         The situation is this: Attributes are handled before interfaces,
12143         so we can apply attributes to interfaces.  But some attributes
12144         implement interfaces, we will now handle the simple cases
12145         (recursive definitions will just get an error).  
12146
12147         * parameter.cs: Only invalidate types at the end if we fail to
12148         lookup all types.  
12149
12150 2002-09-09  Martin Baulig  <martin@gnome.org>
12151
12152         * ecore.cs (PropertyExpr.Emit): Also check for
12153         TypeManager.system_int_array_get_length so this'll also work when
12154         compiling corlib.  Fixes #30003.
12155
12156 2002-09-09  Martin Baulig  <martin@gnome.org>
12157
12158         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12159         and throw an exception if we can't get the type's size.  Fixed #30040,
12160         added test-165.cs.
12161
12162 2002-09-09  Martin Baulig  <martin@gnome.org>
12163
12164         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12165
12166         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12167         context.  Fixes bug #30027.
12168
12169         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12170         virtual functions.  Fixes bug #30043, added test-164.cs.
12171
12172 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12173
12174         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12175
12176 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12177
12178         * driver.cs: Use an object to get the windows codepage since it's not a
12179         static property.
12180
12181 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12182
12183         * statement.cs (For.Emit): for infinite loops (test == null)
12184         return whether there is a break inside, not always "true".
12185
12186         * namespace.cs (UsingEntry): New struct to hold the name of the
12187         using definition, the location where it is defined, and whether it
12188         has been used in a successful type lookup.
12189
12190         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12191         strings.
12192
12193         * decl.cs: ditto.
12194
12195 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12196
12197         * attribute.cs : Fix incorrect code which relied on catching
12198         a NullReferenceException to detect a null being passed in
12199         where an object was expected.
12200
12201 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12202
12203         * statement.cs (Try): flag the catch variable as assigned
12204
12205         * expression.cs (Cast): Simplified by using ResolveType instead of
12206         manually resolving.
12207
12208         * statement.cs (Catch): Fix bug by using ResolveType.
12209
12210 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12211
12212         * expression.cs (BetterConversion): Special case for when we have
12213         a NullLiteral as the argument and we have to choose between string
12214         and object types - we choose string the way csc does.
12215
12216         * attribute.cs (Attribute.Resolve): Catch the
12217         NullReferenceException and report error #182 since the Mono
12218         runtime no more has the bug and having this exception raised means
12219         we tried to select a constructor which takes an object and is
12220         passed a null.
12221
12222 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12223
12224         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12225         message (1502, 1503) when we can't locate a method after overload
12226         resolution. This is much more informative and closes the bug
12227         Miguel reported.
12228
12229         * interface.cs (PopulateMethod): Return if there are no argument
12230         types. Fixes a NullReferenceException bug.
12231
12232         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12233         expressions too. Previously we were checking only in one place for
12234         positional arguments leaving out named arguments.
12235
12236         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12237         type to the enum type is not allowed. Remove code corresponding to
12238         that.
12239
12240         (ConvertNumericExplicit): Allow explicit conversions from
12241         the underlying type to enum type. This precisely follows the spec
12242         and closes a bug filed by Gonzalo.
12243
12244 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12245
12246         * compiler.csproj:
12247         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12248
12249 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12250
12251         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12252         it was important that we stored the right value after the
12253         reduction in `converted'.
12254
12255 2002-09-04  Martin Baulig  <martin@gnome.org>
12256
12257         * location.cs (Location.SymbolDocument): Use full pathnames for the
12258         source files.
12259
12260 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12261
12262         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12263         of the expression resolve mechanism, because that will catch the
12264         SimpleName error failures.
12265
12266         (Conditional): If we can not resolve the
12267         expression, return, do not crash.
12268
12269 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12270
12271         * cs-tokenizer.cs:
12272         (location): display token name instead of its number.
12273
12274 2002-08-28  Martin Baulig  <martin@gnome.org>
12275
12276         * expression.cs (Binary.ResolveOperator): Don't silently return
12277         but return an error if an operator cannot be applied between two
12278         enum types.
12279
12280 2002-08-28  Martin Baulig  <martin@gnome.org>
12281
12282         * class.cs (Constructor.Define): Set the permission attributes
12283         correctly instead of making all constructors public.
12284
12285 2002-08-28  Martin Baulig  <martin@gnome.org>
12286
12287         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12288         for private members before reporting a CS0103; if we find anything,
12289         it's a CS0122.
12290
12291 2002-08-28  Martin Baulig  <martin@gnome.org>
12292
12293         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12294         to check whether `closure_start_type == closure_invocation_type',
12295         we also need to check whether `m.DeclaringType == closure_invocation_type'
12296         before bypassing the permission checks.  We might be accessing
12297         protected/private members from the base class.
12298         (TypeManager.RealMemberLookup): Only set private_ok if private
12299         members were requested via BindingFlags.NonPublic.
12300
12301         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12302
12303         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12304         MethodGroupExpr.IsExplicitImpl if appropriate.
12305         (Invocation.DoResolve): Don't report the CS0120 for explicit
12306         interface implementations.
12307
12308 2002-08-27  Martin Baulig  <martin@gnome.org>
12309
12310         * expression.cs (Invocation.DoResolve): If this is a static
12311         method and we don't have an InstanceExpression, we must report
12312         a CS0120.
12313
12314 2002-08-25  Martin Baulig  <martin@gnome.org>
12315
12316         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12317         `==' between a valuetype and an object.
12318
12319 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12320
12321         * ecore.cs (TypeExpr): Provide a ToString method.
12322
12323 2002-08-24  Martin Baulig  <martin@gnome.org>
12324
12325         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12326         now called proggie.dbg and it's a binary file.
12327
12328 2002-08-23  Martin Baulig  <martin@gnome.org>
12329
12330         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12331
12332 2002-08-23  Martin Baulig  <martin@gnome.org>
12333
12334         * struct.cs (MyStructInfo.ctor): Make this work with empty
12335         structs; it's not allowed to use foreach() on null.
12336
12337 2002-08-23  Martin Baulig  <martin@gnome.org>
12338
12339         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12340         writer the full pathname of the generated assembly.
12341
12342 2002-08-23  Martin Baulig  <martin@gnome.org>
12343
12344         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12345         A `finally' block never returns or breaks; improved handling of
12346         unreachable code.
12347
12348 2002-08-23  Martin Baulig  <martin@gnome.org>
12349
12350         * statement.cs (Throw.Resolve): Allow `throw null'.
12351
12352 2002-08-23  Martin Baulig  <martin@gnome.org>
12353
12354         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12355         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12356         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12357         MemberLookup would return a wrong event if this is an explicit
12358         interface implementation and the class has an event with the same
12359         name.
12360
12361 2002-08-23  Martin Baulig  <martin@gnome.org>
12362
12363         * statement.cs (Block.AddChildVariableNames): New public method.
12364         (Block.AddChildVariableName): Likewise.
12365         (Block.IsVariableNameUsedInChildBlock): Likewise.
12366         (Block.AddVariable): Check whether a variable name has already
12367         been used in a child block.
12368
12369         * cs-parser.jay (declare_local_variables): Mark all variable names
12370         from the current block as being used in a child block in the
12371         implicit block.
12372
12373 2002-08-23  Martin Baulig  <martin@gnome.org>
12374
12375         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12376         find the symbol writer.
12377
12378         * driver.cs: csc also allows the arguments to /define being
12379         separated by commas, not only by semicolons.
12380
12381 2002-08-23  Martin Baulig  <martin@gnome.org>
12382
12383         * interface.cs (Interface.GetMembers): Added static check for events.
12384
12385 2002-08-15  Martin Baulig  <martin@gnome.org>
12386
12387         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12388         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12389
12390         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12391         why the MethodData.EmitDestructor() change was necessary.
12392
12393 2002-08-20  Martin Baulig  <martin@gnome.org>
12394
12395         * class.cs (TypeContainer.FindMembers): Added static check for events.
12396
12397         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12398
12399         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12400         use Type.GetEvents(), not Type.FindMembers().
12401
12402 2002-08-20  Martin Baulig  <martin@gnome.org>
12403
12404         * decl.cs (MemberCache): Added a special method cache which will
12405         be used for method-only searched.  This ensures that a method
12406         search will return a MethodInfo with the correct ReflectedType for
12407         inherited methods.      
12408
12409 2002-08-20  Martin Baulig  <martin@gnome.org>
12410
12411         * decl.cs (DeclSpace.FindMembers): Made this public.
12412
12413 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12414
12415         * delegate.cs: fixed build on windows.
12416         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12417
12418 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12419
12420         * ecore.cs (StandardConversionExists): Return a false
12421         if we are trying to convert the void type to anything else
12422         since that is not allowed.
12423
12424         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12425         we flag error 70 in the event an event is trying to be accessed
12426         directly from outside the declaring type.
12427
12428 2002-08-20  Martin Baulig  <martin@gnome.org>
12429
12430         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12431         MemberCache from typemanager.cs to decl.cs.
12432
12433 2002-08-19  Martin Baulig  <martin@gnome.org>
12434
12435         * class.cs (TypeContainer): Implement IMemberContainer.
12436         (TypeContainer.DefineMembers): Create the MemberCache.
12437         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12438         return public members if BindingFlags.Public was given, check
12439         whether members are static.
12440
12441 2002-08-16  Martin Baulig  <martin@gnome.org>
12442
12443         * decl.cs (DeclSpace.Define): Splitted this in Define and
12444         DefineMembers.  DefineMembers is called first and initializes the
12445         MemberCache.
12446
12447         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12448         DefineMembers() on all our DeclSpaces.
12449
12450         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12451         but call DefineMembers() on all nested interfaces.  We call their
12452         Define() in our new Define() function.
12453
12454         * interface.cs (Interface): Implement IMemberContainer.
12455         (Interface.Define): Moved all code except the attribute stuf to
12456         DefineMembers().
12457         (Interface.DefineMembers): Initialize the member cache.
12458
12459         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12460         need this anymore since we can use MemberCache.FindMembers directly.
12461
12462 2002-08-19  Martin Baulig  <martin@gnome.org>
12463
12464         * typemanager.cs (MemberCache): When creating the cache for an
12465         interface type, add all inherited members.
12466         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12467         to `out bool used_cache' and documented it.
12468         (TypeManager.MemberLookup): If we already used the cache in the first
12469         iteration, we don't need to do the interfaces check.
12470
12471 2002-08-19  Martin Baulig  <martin@gnome.org>
12472
12473         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12474         here from IMemberFinder and don't implement this interface anymore.
12475         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12476
12477         * typemanager.cs (IMemberFinder): This interface is now only used by
12478         classes which actually support the member cache.
12479         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12480         since we only put DeclSpaces into this Hashtable.
12481         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12482         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12483
12484 2002-08-16  Martin Baulig  <martin@gnome.org>
12485
12486         * typemanager.cs (ICachingMemberFinder): Removed.
12487         (IMemberFinder.MemberCache): New property.
12488         (TypeManager.FindMembers): Merged this with RealFindMembers().
12489         This function will never be called from TypeManager.MemberLookup()
12490         so we can't use the cache here, just the IMemberFinder.
12491         (TypeManager.MemberLookup_FindMembers): Check whether the
12492         IMemberFinder has a MemberCache and call the cache's FindMembers
12493         function.
12494         (MemberCache): Rewrote larger parts of this yet another time and
12495         cleaned it up a bit.
12496
12497 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12498
12499         * driver.cs (LoadArgs): Support quoting.
12500
12501         (Usage): Show the CSC-like command line arguments.
12502
12503         Improved a few error messages.
12504
12505 2002-08-15  Martin Baulig  <martin@gnome.org>
12506
12507         * typemanager.cs (IMemberContainer.Type): New property.
12508         (IMemberContainer.IsInterface): New property.
12509
12510         The following changes are conditional to BROKEN_RUNTIME, which is
12511         defined at the top of the file.
12512
12513         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12514         class'es members, but add all members from TypeHandle.ObjectType
12515         if we're an interface.
12516         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12517         is the current type.
12518         (MemberCache.CacheEntry.Container): Removed this field.
12519         (TypeHandle.GetMembers): Include inherited members.
12520
12521 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12522
12523         * typemanager.cs: fixed compilation and added a comment on a field that
12524         is never used.
12525
12526 2002-08-15  Martin Baulig  <martin@gnome.org>
12527
12528         * class.cs (ConstructorInitializer.Resolve): In the
12529         Expression.MemberLookup call, use the queried_type as
12530         invocation_type.
12531
12532         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12533         declared' attribute, it's always true.
12534         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12535         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12536         temporary wrapper for FindMembers which tells MemberLookup whether
12537         members from the base classes are included in the return value.
12538         This will go away soon.
12539         (TypeManager.MemberLookup): Use this temporary hack here; once the
12540         new MemberCache is completed, we don't need to do the DeclaredOnly
12541         looping here anymore since the MemberCache will take care of this.
12542         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12543         (MemberCache): When creating the MemberCache for a class, get
12544         members from the current class and all its base classes.
12545         (MemberCache.CacheEntry.Container): New field.  This is a
12546         temporary hack until the Mono runtime is fixed to distinguish
12547         between ReflectedType and DeclaringType.  It allows us to use MCS
12548         with both the MS runtime and the unfixed Mono runtime without
12549         problems and without accecting performance.
12550         (MemberCache.SearchMembers): The DeclaredOnly looping from
12551         TypeManager.MemberLookup is now done here.      
12552
12553 2002-08-14  Martin Baulig  <martin@gnome.org>
12554
12555         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12556         Type.GetFields on dynamic types but get the fields from the
12557         corresponding TypeContainer.
12558         (MyStructInfo.GetStructInfo): Added check for enum types.
12559
12560         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12561         (MemberList.SyncRoot): Implemented.
12562         (TypeManager.FilterWithClosure): No need to check permissions if
12563         closure_start_type == closure_invocation_type, don't crash if
12564         closure_invocation_type is null.
12565
12566 2002-08-13  Martin Baulig  <martin@gnome.org>
12567
12568         Rewrote TypeContainer.FindMembers to use a member cache.  This
12569         gives us a speed increase of about 35% for the self-hosting MCS
12570         build and of about 15-20% for the class libs (both on GNU/Linux).
12571
12572         * report.cs (Timer): New class to get enhanced profiling.  This
12573         whole class is "TIMER" conditional since it remarkably slows down
12574         compilation speed.
12575
12576         * class.cs (MemberList): New class.  This is an IList wrapper
12577         which we're now using instead of passing MemberInfo[]'s around to
12578         avoid copying this array unnecessarily.
12579         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12580         (ICachingMemberFinder, IMemberContainer): New interface.
12581         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12582         has already been checked, otherwise use it for the name comparision.
12583         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12584         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12585         if possible.  Returns a MemberList, not a MemberInfo [].
12586         (TypeHandle): New class, implements IMemberContainer.  We create
12587         one instance of this class per type, it contains a MemberCache
12588         which is used to do the member lookups.
12589         (MemberCache): New class.  Each instance of this class contains
12590         all members of a type and a name-based hash table.
12591         (MemberCache.FindMembers): This is our new member lookup
12592         function.  First, it looks up all members of the requested name in
12593         the hash table.  Then, it walks this list and sorts out all
12594         applicable members and returns them.
12595
12596 2002-08-13  Martin Baulig  <martin@gnome.org>
12597
12598         In addition to a nice code cleanup, this gives us a performance
12599         increase of about 1.4% on GNU/Linux - not much, but it's already
12600         half a second for the self-hosting MCS compilation.
12601
12602         * typemanager.cs (IMemberFinder): New interface.  It is used by
12603         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12604         Enum, Delegate or Interface.
12605         (TypeManager.finder_to_member_finder): New PtrHashtable.
12606         (TypeManager.finder_to_container): Removed.
12607         (TypeManager.finder_to_delegate): Removed.
12608         (TypeManager.finder_to_interface): Removed.
12609         (TypeManager.finder_to_enum): Removed.
12610
12611         * interface.cs (Interface): Implement IMemberFinder.
12612
12613         * delegate.cs (Delegate): Implement IMemberFinder.
12614
12615         * enum.cs (Enum): Implement IMemberFinder.
12616
12617         * class.cs (TypeContainer): Implement IMemberFinder.
12618
12619 2002-08-12  Martin Baulig  <martin@gnome.org>
12620
12621         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12622
12623 2002-08-12  Martin Baulig  <martin@gnome.org>
12624
12625         * ecore.cs (ITypeExpression): New interface for expressions which
12626         resolve to a type.
12627         (TypeExpression): Renamed to TypeLookupExpression.
12628         (Expression.DoResolve): If we're doing a types-only lookup, the
12629         expression must implement the ITypeExpression interface and we
12630         call DoResolveType() on it.
12631         (SimpleName): Implement the new ITypeExpression interface.
12632         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12633         hack, the situation that we're only looking up types can't happen
12634         anymore when this method is called.  Moved the type lookup code to
12635         DoResolveType() and call it.
12636         (SimpleName.DoResolveType): This ITypeExpression interface method
12637         is now doing the types-only lookup.
12638         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12639         (ResolveFlags): Added MaskExprClass.
12640
12641         * expression.cs (MemberAccess): Implement the ITypeExpression
12642         interface.
12643         (MemberAccess.DoResolve): Added support for a types-only lookup
12644         when we're called via ITypeExpression.DoResolveType().
12645         (ComposedCast): Implement the ITypeExpression interface.
12646
12647         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12648         Expression.Resolve() with ResolveFlags.Type instead.
12649
12650 2002-08-12  Martin Baulig  <martin@gnome.org>
12651
12652         * interface.cs (Interface.Define): Apply attributes.
12653
12654         * attribute.cs (Attribute.ApplyAttributes): Added support for
12655         interface attributes.
12656
12657 2002-08-11  Martin Baulig  <martin@gnome.org>
12658
12659         * statement.cs (Block.Emit): Only check the "this" variable if we
12660         do not always throw an exception.
12661
12662         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12663         whether the property has a set accessor.
12664
12665 2002-08-11  Martin Baulig  <martin@gnome.org>
12666
12667         Added control flow analysis support for structs.
12668
12669         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12670         with control flow analysis turned off.
12671         (IVariable): New interface.
12672         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12673         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12674         (FieldExpr.DoResolve): Resolve the instance expression with flow
12675         analysis turned off and do the definite assignment check after the
12676         resolving when we know what the expression will resolve to.
12677
12678         * expression.cs (LocalVariableReference, ParameterReference):
12679         Implement the new IVariable interface, only call the flow analysis
12680         code if ec.DoFlowAnalysis is true.
12681         (This): Added constructor which takes a Block argument.  Implement
12682         the new IVariable interface.
12683         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12684         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12685         This does the definite assignment checks for struct members.
12686
12687         * class.cs (Constructor.Emit): If this is a non-static `struct'
12688         constructor which doesn't have any initializer, call
12689         Block.AddThisVariable() to tell the flow analysis code that all
12690         struct elements must be initialized before control returns from
12691         the constructor.
12692
12693         * statement.cs (MyStructInfo): New public class.
12694         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12695         argument to this indexer.  If non-zero, check an individual struct
12696         member, not the whole struct.
12697         (FlowBranching.CheckOutParameters): Check struct members.
12698         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12699         overloaded versions of these methods which take an additional
12700         `int field_idx' argument to check struct members.
12701         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12702         overloaded versions of these methods which take an additional
12703         `string field_name' argument to check struct member.s
12704         (VariableInfo): Implement the IVariable interface.
12705         (VariableInfo.StructInfo): New public property.  Returns the
12706         MyStructInfo instance of the variable if it's a struct or null.
12707         (Block.AddThisVariable): New public method.  This is called from
12708         Constructor.Emit() for non-static `struct' constructor which do
12709         not have any initializer.  It creates a special variable for the
12710         "this" instance variable which will be checked by the flow
12711         analysis code to ensure that all of the struct's fields are
12712         initialized before control returns from the constructor.
12713         (UsageVector): Added support for struct members.  If a
12714         variable/parameter is a struct with N members, we reserve a slot
12715         in the usage vector for each member.  A struct is considered fully
12716         initialized if either the struct itself (slot 0) or all its
12717         members are initialized.
12718
12719 2002-08-08  Martin Baulig  <martin@gnome.org>
12720
12721         * driver.cs (Driver.MainDriver): Only report an error CS5001
12722         if there were no compilation errors.
12723
12724         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12725         `UnsafeContext' property to determine whether the parent is in
12726         unsafe context rather than checking the parent's ModFlags:
12727         classes nested in an unsafe class are unsafe as well.
12728
12729 2002-08-08  Martin Baulig  <martin@gnome.org>
12730
12731         * statement.cs (UsageVector.MergeChildren): Distinguish between
12732         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12733         we return.  Added test17() and test18() to test-154.cs.
12734
12735 2002-08-08  Martin Baulig  <martin@gnome.org>
12736
12737         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12738         Family access, make sure the invoking type isn't a subclass of the
12739         queried type (that'd be a CS1540).
12740
12741         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12742         this method which takes an additional `Type invocation_type'.
12743
12744         * expression.cs (BaseAccess.DoResolve): Use the base type as
12745         invocation and query type.
12746         (MemberAccess.DoResolve): If the lookup failed and we're about to
12747         report a CS0122, try a lookup with the ec.ContainerType - if this
12748         succeeds, we must report a CS1540.
12749
12750 2002-08-08  Martin Baulig  <martin@gnome.org>
12751
12752         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12753         (MethodGroupExpr): Implement the IMemberExpr interface.
12754
12755         * expression (MemberAccess.ResolveMemberAccess): No need to have
12756         any special code for MethodGroupExprs anymore, they're now
12757         IMemberExprs.   
12758
12759 2002-08-08  Martin Baulig  <martin@gnome.org>
12760
12761         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12762         Family, FamANDAssem and FamORAssem permissions.
12763         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12764
12765 2002-08-08  Martin Baulig  <martin@gnome.org>
12766
12767         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12768         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12769         or loop block.
12770
12771 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12772
12773         * driver.cs: implemented /resource option to embed managed resources.
12774
12775 2002-08-07  Martin Baulig  <martin@gnome.org>
12776
12777         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12778         (FieldBase.HasFieldInitializer): New public property.
12779         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12780         returns the field initializer and makes sure it is only resolved once.
12781         (TypeContainer.EmitFieldInitializers): Call
12782         FieldBase.GetInitializerExpression to get the initializer, this ensures
12783         that it isn't resolved multiple times.
12784
12785         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12786         the resolving process (SimpleName/MemberLookup) that we're currently
12787         emitting a field initializer (which must not access any instance members,
12788         this is an error CS0236).
12789
12790         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12791         argument, if the `IsFieldInitializer' flag is set, we must report and
12792         error CS0236 and not an error CS0120.   
12793
12794 2002-08-07  Martin Baulig  <martin@gnome.org>
12795
12796         * ecore.cs (IMemberExpr): New public interface.
12797         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12798         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12799         if the expression is an IMemberExpr.
12800
12801         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12802         to be null, implicitly default to `this' if we're non-static in
12803         this case.  Simplified the code a lot by using the new IMemberExpr
12804         interface.  Also fixed bug #28176 here.
12805
12806 2002-08-06  Martin Baulig  <martin@gnome.org>
12807
12808         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12809         ParameterReferences during semantic analysis so that we can do a
12810         type-only search when resolving Cast, TypeOf and SizeOf.
12811         (block): Pass the `current_local_parameters' to the Block's
12812         constructor.
12813
12814         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12815         argument to the constructor.
12816         (ConstructorInitializer.Resolve): Create a temporary implicit
12817         block with the parameters.
12818
12819         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12820         references here if we aren't doing a type-only search.
12821
12822         * statement.cs (Block): Added constructor which takes a
12823         `Parameters parameters' argument.
12824         (Block.Parameters): New public property.
12825
12826         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12827         to `Parameters' and made it public readonly.
12828
12829 2002-08-06  Martin Baulig  <martin@gnome.org>
12830
12831         * ecore.cs (Expression.Warning): Made this public as well.
12832
12833         * report.cs (Report.Debug): Print the contents of collections.
12834
12835 2002-08-06  Martin Baulig  <martin@gnome.org>
12836
12837         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12838         used to tell Resolve() which kinds of expressions it may return.
12839         (Expression.Resolve): Added overloaded version of this method which
12840         takes a `ResolveFlags flags' argument.  This can be used to tell
12841         Resolve() which kinds of expressions it may return.  Reports a
12842         CS0118 on error.
12843         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12844         ResolveFlags.SimpleName.
12845         (Expression.Error118): Added overloaded version of this method which
12846         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12847         which kinds of expressions are allowed.
12848
12849         * expression.cs (Argument.ResolveMethodGroup): New public method.
12850         Resolves an argument, but allows a MethodGroup to be returned.
12851         This is used when invoking a delegate.
12852
12853         * TODO: Updated a bit.
12854
12855 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12856
12857         Fixed compilation with csc.
12858
12859         * ecore.cs: Expression.Error made public. Is this correct? Should
12860         Warning be made public too?
12861
12862         * expression.cs: use ea.Location instead of ea.loc.
12863         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12864
12865 2002-08-06  Martin Baulig  <martin@gnome.org>
12866
12867         * ecore.cs (Expression.loc): Moved the location here instead of
12868         duplicating it in all derived classes.
12869         (Expression.Location): New public property.
12870         (Expression.Error, Expression.Warning): Made them non-static and
12871         removed the location argument.
12872         (Expression.Warning): Added overloaded version which takes an
12873         `int level' argument.
12874         (Expression.Error118): Make this non-static and removed the
12875         expression and location arguments.
12876         (TypeExpr): Added location argument to the constructor.
12877
12878         * expression.cs (StaticCallExpr): Added location argument to
12879         the constructor.
12880         (Indirection, PointerArithmetic): Likewise.
12881         (CheckedExpr, UnCheckedExpr): Likewise.
12882         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12883         (StringPtr): Likewise.
12884
12885
12886 2002-08-05  Martin Baulig  <martin@gnome.org>
12887
12888         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12889
12890         * assign.cs (Assign.DoResolve): Check whether the source
12891         expression is a value or variable.
12892
12893         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12894         while resolving the corresponding blocks.
12895
12896         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12897         an error, don't silently return null.
12898
12899         * statement.cs (Block.AddVariable): Do the error reporting here
12900         and distinguish between CS0128 and CS0136.
12901         (Block.DoResolve): Report all unused labels (warning CS0164).
12902         (LabeledStatement): Pass the location to the constructor.
12903         (LabeledStatement.HasBeenReferenced): New property.
12904         (LabeledStatement.Resolve): Set it to true here.
12905
12906         * statement.cs (Return.Emit): Return success even after reporting
12907         a type mismatch error (CS0126 or CS0127), this is what csc does and
12908         it avoids confusing the users with any consecutive errors.
12909
12910 2002-08-05  Martin Baulig  <martin@gnome.org>
12911
12912         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12913
12914         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12915
12916         * expression.cs (MemberAccess.DoResolve): Silently return if an
12917         error has already been reported.
12918
12919         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12920         error has already been reported.
12921
12922 2002-08-05  Martin Baulig  <martin@gnome.org>
12923
12924         * statement.cs (UsageVector): Only initialize the `parameters'
12925         vector if we actually have any "out" parameters.
12926
12927 2002-08-05  Martin Baulig  <martin@gnome.org>
12928
12929         * expression.cs (Binary.ResolveOperator): When combining delegates,
12930         they must have the same type.
12931
12932 2002-08-05  Martin Baulig  <martin@gnome.org>
12933
12934         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12935         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12936         work with the ms runtime and we also don't need it: if we're a
12937         PropertyBuilder and not in the `indexer_arguments' hash, then we
12938         are a property and not an indexer.
12939
12940         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12941         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12942         since the latter one doesn't work with the ms runtime.
12943
12944 2002-08-03  Martin Baulig  <martin@gnome.org>
12945
12946         Fixed bugs #27998 and #22735.
12947
12948         * class.cs (Method.IsOperator): New public field.
12949         (Method.CheckBase): Report CS0111 if there's already a method
12950         with the same parameters in the current class.  Report CS0508 when
12951         attempting to change the return type of an inherited method.
12952         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12953         and it's not marked abstract or extern.
12954         (PropertyBase): New abstract base class for Property and Indexer.
12955         (PropertyBase.CheckBase): Moved here from Property and made it work
12956         for indexers.
12957         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12958         the same so we can reuse it there.
12959         (Property, Indexer): Derive from PropertyBase.
12960         (MethodSignature.inheritable_property_signature_filter): New delegate
12961         to find properties and indexers.
12962
12963         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12964         argument and improved error reporting.
12965
12966         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12967         EmptyReadOnlyParameters and made it a property.
12968
12969         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12970         version of this method which takes a `PropertyInfo indexer'.
12971         (TypeManager.RegisterIndexer): New method.
12972
12973         * class.cs: Added myself as author of this file :-)
12974
12975 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12976
12977         * class.cs: fixed compilation on windoze.
12978
12979 2002-08-03  Martin Baulig  <martin@gnome.org>
12980
12981         * interface.cs (Interface.GetInterfaceBases): Check whether all
12982         base interfaces are at least as accessible than the current one.
12983
12984         * class.cs (TypeContainer.GetClassBases): Check whether base types
12985         are at least as accessible than the current type.
12986         (TypeContainer.AsAccessible): Implemented and made non-static.
12987         (MemberBase.CheckParameters): Report errors if the accessibility
12988         checks fail.
12989
12990         * delegate.cs (Delegate.Delegate): The default visibility is
12991         internal for top-level types and private for nested types.
12992         (Delegate.Define): Report errors if the accessibility checks fail.
12993
12994         * enum.cs (Enum.Enum): The default visibility is internal for
12995         top-level types and private for nested types.
12996         (Enum.DefineType): Compute the correct visibility.
12997
12998         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12999         function which takes a `bool is_toplevel' instead of a TypeContainer.
13000
13001         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13002         builtin type.
13003
13004 2002-08-02  Martin Baulig  <martin@gnome.org>
13005
13006         * expression.cs (LocalVariableReferenc): Added constructor which
13007         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13008         (LocalVariableReference.IsReadOnly): New property.
13009         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13010         variable is readonly, use our own readonly flag to do this; you can
13011         use the new constructor to get a writable reference to a read-only
13012         variable.
13013
13014         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13015         reference to the local variable.
13016
13017 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13018
13019         * rootcontext.cs (ResolveCore): Also include System.Exception
13020
13021         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13022         we reach an EmptyStatement.
13023
13024         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13025         is also fine.
13026
13027         * expression.cs (Binary.ResolveOperator): Check error result in
13028         two places.
13029
13030         use brtrue/brfalse directly and avoid compares to null.
13031
13032 2002-08-02  Martin Baulig  <martin@gnome.org>
13033
13034         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13035         Fixes bug #28407, added test-155.cs.
13036
13037 2002-08-01  Martin Baulig  <martin@gnome.org>
13038
13039         * class.cs (Event.EmitDefaultMethod): Make this work with static
13040         events.  Fixes #28311, added verify-3.cs.
13041
13042 2002-08-01  Martin Baulig  <martin@gnome.org>
13043
13044         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13045         `is_disposable' fields.
13046         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13047         `hm.is_disposable' if we're using the collection pattern.
13048         (Foreach.EmitCollectionForeach): Use the correct type for the
13049         enumerator's local variable, only emit the try/finally block if
13050         necessary (fixes #27713).
13051
13052 2002-08-01  Martin Baulig  <martin@gnome.org>
13053
13054         * ecore.cs (Expression.report118): Renamed to Error118 and made
13055         it public static.
13056
13057         * statement.cs (Throw.Resolve): Check whether the expression is of
13058         the correct type (CS0118) and whether the type derives from
13059         System.Exception (CS0155).
13060         (Catch.Resolve): New method.  Do the type lookup here and check
13061         whether it derives from System.Exception (CS0155).
13062         (Catch.CatchType, Catch.IsGeneral): New public properties.
13063
13064         * typemanager.cs (TypeManager.exception_type): Added.
13065
13066 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13067
13068         * driver.cs: Updated About function.
13069
13070 2002-07-31  Martin Baulig  <martin@gnome.org>
13071
13072         Implemented Control Flow Analysis.
13073
13074         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13075         (EmitContext.CurrentBranching): Added.
13076         (EmitContext.StartFlowBranching): Added.
13077         (EmitContext.EndFlowBranching): Added.
13078         (EmitContext.KillFlowBranching): Added.
13079         (EmitContext.IsVariableAssigned): Added.
13080         (EmitContext.SetVariableAssigned): Added.
13081         (EmitContext.IsParameterAssigned): Added.
13082         (EmitContext.SetParameterAssigned): Added.
13083         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13084         Added control flow analysis stuff here.
13085
13086         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13087         resolve the expression as lvalue.
13088         (LocalVariableReference.DoResolve): Check whether the variable has
13089         already been assigned.
13090         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13091         the parameter as assigned here.
13092         (ParameterReference.DoResolve): Check whether the parameter has already
13093         been assigned.
13094         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13095         expression as lvalue.
13096
13097         * statement.cs (FlowBranching): New class for the flow analysis code.
13098         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13099         (LabeledStatement.IsDefined): New public property.
13100         (LabeledStatement.AddUsageVector): New public method to tell flow
13101         analyis that the label may be reached via a forward jump.
13102         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13103         flow analysis.
13104         (VariableInfo.Number): New public field.  This is used by flow analysis
13105         to number all locals of a block.
13106         (Block.CountVariables): New public property.  This is the number of
13107         local variables in this block (including the locals from all parent
13108         blocks).
13109         (Block.EmitMeta): Number all the variables.
13110
13111         * statement.cs: Added flow analysis support to all classes.
13112
13113 2002-07-31  Martin Baulig  <martin@gnome.org>
13114
13115         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13116         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13117         then use this argument.
13118
13119         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13120
13121         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13122         use this to specify /define options.
13123
13124 2002-07-29  Martin Baulig  <martin@gnome.org>
13125
13126         * statement.cs (Fixed): Moved all code that does variable lookups
13127         and resolvings from Emit to Resolve.
13128
13129         * statement.cs (For): Moved all code that does variable lookups
13130         and resolvings from Emit to Resolve.
13131
13132         * statement.cs (Using): Moved all code that does variable lookups
13133         and resolvings from Emit to Resolve.
13134
13135 2002-07-29  Martin Baulig  <martin@gnome.org>
13136
13137         * attribute.cs (Attribute.Resolve): Explicitly catch a
13138         System.NullReferenceException when creating the
13139         CustromAttributeBuilder and report a different warning message.
13140
13141 2002-07-29  Martin Baulig  <martin@gnome.org>
13142
13143         * support.cs (ParameterData.ParameterName): Added method to
13144         get the name of a parameter.
13145
13146         * typemanager.cs (TypeManager.IsValueType): New public method.
13147
13148 2002-07-29  Martin Baulig  <martin@gnome.org>
13149
13150         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13151         is a flag which specifies that it's either ref or out.
13152         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13153         the out parameter to `out Parameter.Modifier mod', also set the
13154         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13155
13156         * support.cs (InternalParameters.ParameterModifier): Distinguish
13157         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13158         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13159
13160         * expression.cs (Argument.GetParameterModifier): Distinguish
13161         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13162         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13163
13164 2002-07-29  Martin Baulig  <martin@gnome.org>
13165
13166         * expression.cs (ParameterReference.ParameterReference): Added
13167         `Location loc' argument to the constructor.
13168
13169         * cs-parser.jay: Pass location to ParameterReference.
13170
13171 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13172
13173         * statement.cs (Try): Initialize the location.
13174
13175         * cs-parser.jay: pass location to Try.
13176
13177         * expression.cs (Unary.Reduce): Change the prototype to return
13178         whether a constant fold could be performed or not.  The result is
13179         returned in an out parameters.  In the case of Indirection and
13180         AddressOf, we want to perform the full tests.
13181
13182 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13183
13184         * statement.cs (Statement.Emit): Flag dead code.
13185
13186 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13187
13188         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13189
13190 2002-07-27  Martin Baulig  <martin@gnome.org>
13191
13192         * class.cs (MethodData.Define): Put back call to
13193         TypeManager.AddMethod(), accidentally commented this out.
13194
13195         * report.cs (Debug): New public method to print debugging information,
13196         this is `[Conditional ("DEBUG")]'.
13197
13198 2002-07-26  Martin Baulig  <martin@gnome.org>
13199
13200         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13201         (switch_statement): Push the current_block to the switch_stack and
13202         pop it again when we're done with the switch.
13203         (switch_section): The new block is a child of the current_block.
13204         Fixes bug #24007, added test-152.cs.
13205
13206 2002-07-27  Martin Baulig  <martin@gnome.org>
13207
13208         * expression.cs (Invocation.EmitArguments): When calling a varargs
13209         function with only its fixed arguments, we need to pass an empty
13210         array.
13211
13212 2002-07-27  Martin Baulig  <martin@gnome.org>
13213
13214         Mono 0.13 has been released.
13215
13216 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * driver.cs: Rename --resource to --linkres, because that is what
13219         we do currently, we dont support --resource yet.
13220
13221         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13222
13223 2002-07-25  Martin Baulig  <martin@gnome.org>
13224
13225         * class.cs (MethodData): New public class.  This is a `method builder'
13226         class for a method or one accessor of a Property/Indexer/Event.
13227         (MethodData.GetMethodFlags): Moved here from MemberBase.
13228         (MethodData.ApplyAttributes): Likewise.
13229         (MethodData.ApplyObsoleteAttribute): Likewise.
13230         (MethodData.ApplyConditionalAttribute): Likewise.
13231         (MethodData.ApplyDllImportAttribute): Likewise.
13232         (MethodData.CheckAbstractAndExternal): Likewise.
13233         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13234         (MethodData.Emit): Formerly known as Method.Emit().
13235         (MemberBase): Moved everything which was specific to a single
13236         accessor/method to MethodData.
13237         (Method): Create a new MethodData and call Define() and Emit() on it.
13238         (Property, Indexer, Event): Create a new MethodData objects for each
13239         accessor and call Define() and Emit() on them.
13240
13241 2002-07-25  Martin Baulig  <martin@gnome.org>
13242
13243         Made MethodCore derive from MemberBase to reuse the code from there.
13244         MemberBase now also checks for attributes.
13245
13246         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13247         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13248         as virtual.
13249         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13250         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13251         (MemberBase.ApplyAttributes): New virtual method; applies the
13252         attributes to a method or accessor.
13253         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13254         (MemberBase.ApplyConditionalAttribute): Likewise.
13255         (MemberBase.ApplyDllImportAttribute): Likewise.
13256         (MemberBase.CheckAbstractAndExternal): Likewise.
13257         (MethodCore.ParameterTypes): This is now a property instead of a
13258         method, it's initialized from DoDefineParameters().
13259         (MethodCore.ParameterInfo): Removed the set accessor.
13260         (MethodCore.DoDefineParameters): New protected virtual method to
13261         initialize ParameterTypes and ParameterInfo.
13262         (Method.GetReturnType): We can now simply return the MemberType.
13263         (Method.GetMethodFlags): Override the MemberBase version and add
13264         the conditional flags.
13265         (Method.CheckBase): Moved some code from Define() here, call
13266         DoDefineParameters() here.
13267         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13268         here to avoid some larger code duplication.
13269         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13270         ensure that abstract and external accessors don't declare a body.
13271
13272         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13273         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13274         lookup in the attribute's parent classes, so we need to abort as soon
13275         as we found the first match.
13276         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13277         the attribute has no arguments.
13278
13279         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13280         of a Method.
13281
13282 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13283
13284         * cs-parser.jay: reverted previous patch.
13285
13286 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13287
13288         * cs-parser.jay: fixed bug #22119.
13289
13290 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13291
13292         * attribute.cs: fixed compilation. The error was:
13293         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13294         be assigned to before control leaves the current method."
13295         [FIXME:  Filed as bug #28186: MCS must report this error.]
13296
13297 2002-07-25  Martin Baulig  <martin@gnome.org>
13298
13299         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13300         method to pull the condition name ouf of a Conditional attribute.
13301         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13302         the obsolete message and error flag out of an Obsolete attribute.
13303
13304         * class.cs (Method.GetMethodFlags): New public method to get the
13305         TypeManager.MethodFlags for this method.
13306         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13307         private methods.
13308         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13309         if we're overriding a virtual function, set the new private variable
13310         `parent_method'; call the new TypeManager.AddMethod().
13311
13312         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13313         the MethodBuilder and the Method in a PtrHashtable.
13314         (TypeManager.builder_to_method): Added for this purpose.
13315         (TypeManager.MethodFlags): Added IsObsoleteError.
13316         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13317         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13318         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13319         the message from the attribute.
13320
13321 2002-07-24  Martin Baulig  <martin@gnome.org>
13322
13323         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13324         preprocessor directives, ensure that the argument to #define/#undef is
13325         exactly one identifier and that it's actually an identifier.
13326
13327         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13328         did not work ....
13329
13330 2002-07-24  Martin Baulig  <martin@gnome.org>
13331
13332         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13333         initialize it to TypeManager.object_type in the constructor.
13334         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13335         of the `hm.get_current' method if we're using the collection pattern.
13336         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13337         for the explicit conversion to make it work when we're using the collection
13338         pattern and the `Current' property has a different return type than `object'.
13339         Fixes #27713.
13340
13341 2002-07-24  Martin Baulig  <martin@gnome.org>
13342
13343         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13344         does not match, but don't report any errors.  This method is called in
13345         order for all methods in a MethodGroupExpr until a matching method is
13346         found, so we don't want to bail out if the first method doesn't match.
13347         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13348         matches, report the 123.  Fixes #28070.
13349
13350 2002-07-24  Martin Baulig  <martin@gnome.org>
13351
13352         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13353         TypeManager.TypeToCoreType() to the top of the method so the
13354         following equality checks will work.  Fixes #28107.
13355
13356 2002-07-24  Martin Baulig  <martin@gnome.org>
13357
13358         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13359         operand is of type uint, and the other operand is of type sbyte,
13360         short or int, the operands are converted to type long." -
13361         Actually do what this comment already told us.  Fixes bug #28106,
13362         added test-150.cs.
13363
13364 2002-07-24  Martin Baulig  <martin@gnome.org>
13365
13366         * class.cs (MethodBase): New abstract class.  This is now a base
13367         class for Property, Indexer and Event to avoid some code duplication
13368         in their Define() and DefineMethods() methods.
13369         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13370         generic methods for Define() and DefineMethods().
13371         (FieldBase): Derive from MemberBase, not MemberCore.
13372         (Property): Derive from MemberBase, not MemberCore.
13373         (Property.DefineMethod): Moved all the code from this method to the
13374         new MethodBase.DefineAccessor(), just call it with appropriate
13375         argumetnts.
13376         (Property.Define): Call the new Property.DoDefine(), this does some
13377         sanity checks and we don't need to duplicate the code everywhere.
13378         (Event): Derive from MemberBase, not MemberCore.
13379         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13380         accessors, this will also make them work with interface events.
13381         (Indexer): Derive from MemberBase, not MemberCore.
13382         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13383         (Indexer.Define): Use the new MethodBase functions.
13384
13385         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13386         argument to the constructor.
13387         (Interface.FindMembers): Added support for interface events.
13388         (Interface.PopluateEvent): Implemented.
13389
13390         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13391
13392 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13393
13394         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13395         but this is required to check for a method name being the same as
13396         the containing class.  
13397
13398         Handle this now.
13399
13400 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13401
13402         * interface.cs: initialize variable.
13403
13404 2002-07-23  Martin Baulig  <martin@gnome.org>
13405
13406         Implemented the IndexerName attribute in interfaces.
13407
13408         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13409         name if this is an explicit interface implementation.
13410         (Indexer.InterfaceIndexerName): New public variable.  If we're
13411         implementing an interface indexer, this is the IndexerName in that
13412         interface.  Otherwise, it's the IndexerName.
13413         (Indexer.DefineMethod): If we're implementing interface indexer,
13414         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13415         and Pending.ImplementIndexer methods.
13416         (Indexer.Define): Also define the PropertyBuilder if we're
13417         implementing an interface indexer and this is neither an explicit
13418         interface implementation nor do the IndexerName match the one in
13419         the interface.
13420
13421         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13422         If a method is defined here, then we always need to create a proxy
13423         for it.  This is used when implementing interface indexers.
13424         (Pending.IsInterfaceIndexer): New public method.
13425         (Pending.ImplementIndexer): New public method.
13426         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13427         This is used when implementing interface indexers to define a proxy
13428         if necessary.
13429         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13430         define a proxy if necessary.
13431
13432         * interface.cs (Interface.IndexerName): New public variable.
13433         (Interface.PopulateIndexer): Set the IndexerName.
13434         (Interface.DefineIndexers): New private method.  Populate all the
13435         indexers and make sure their IndexerNames match.
13436
13437         * typemanager.cs (IndexerPropertyName): Added support for interface
13438         indexers.
13439
13440 2002-07-22  Martin Baulig  <martin@gnome.org>
13441
13442         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13443         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13444         ret if HasReturnLabel.
13445         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13446         variables.
13447
13448         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13449         and set the ec.LoopBeginTryCatchLevel.
13450         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13451         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13452         the current ec.TryCatchLevel, the branch goes out of an exception
13453         block.  In this case, we need to use Leave and not Br.
13454
13455 2002-07-22  Martin Baulig  <martin@gnome.org>
13456
13457         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13458         block unless the block does not always return or it is contained in
13459         another try { ... } catch { ... } block.  Fixes bug #26506.
13460         Added verify-1.cs to the test suite.
13461
13462 2002-07-22  Martin Baulig  <martin@gnome.org>
13463
13464         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13465         then we do not always return.  Fixes bug #24985.
13466
13467 2002-07-22  Martin Baulig  <martin@gnome.org>
13468
13469         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13470         lookup on a per-class level; ie. walk up the class hierarchy until we
13471         found at least one applicable method, then choose the best among them.
13472         Fixes bug #24463 and test-29.cs.
13473
13474 2002-07-22  Martin Baulig  <martin@gnome.org>
13475
13476         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13477         return types of the methods.  The return type is not part of the
13478         signature and we must not check it to make the `new' modifier work.
13479         Fixes bug #27999, also added test-147.cs.
13480         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13481
13482         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13483         on the method's return type.
13484
13485 2002-07-21  Martin Baulig  <martin@gnome.org>
13486
13487         * assign.cs: Make this work if the rightmost source is a constant and
13488         we need to do an implicit type conversion.  Also adding a few more tests
13489         to test-38.cs which should have caught this.
13490
13491         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13492         target in the makefile for this.  The makefile.gnu is primarily intended
13493         for end-users who don't want to debug the compiler.
13494
13495 2002-07-21  Martin Baulig  <martin@gnome.org>
13496
13497         * assign.cs: Improved the Assign class so it can now handle embedded
13498         assignments (X = Y = Z = something).  As a side-effect this'll now also
13499         consume less local variables.  test-38.cs now passes with MCS, added
13500         a few new test cases to that test.
13501
13502 2002-07-20  Martin Baulig  <martin@gnome.org>
13503
13504         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13505         instructions.  Fixes bug #27977, also added test-146.cs.
13506
13507 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13508
13509         * cs-tokenizer.cs: fixed getHex ().
13510
13511 2002-07-19  Martin Baulig  <martin@gnome.org>
13512
13513         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13514         not Type.GetType() to lookup the array type.  This is needed when
13515         we're constructing an array of a user-defined type.
13516         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13517         single-dimensional arrays, but also for single-dimensial arrays of
13518         type decimal.
13519
13520 2002-07-19  Martin Baulig  <martin@gnome.org>
13521
13522         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13523         this function is called, it's not allowed to share LocalBuilders
13524         among ILGenerators.
13525
13526 2002-07-19  Martin Baulig  <martin@gnome.org>
13527
13528         * expression.cs (Argument.Resolve): Report an error 118 when trying
13529         to pass a type as argument.
13530
13531 2002-07-18  Martin Baulig  <martin@gnome.org>
13532
13533         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13534         Conv_R_Un for the signed `long' type.
13535
13536 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13537
13538         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13539         `expr' for the temporary result, as that will fail if we do
13540         multiple resolves on the same expression.
13541
13542 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13543
13544         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13545         ec.TypeContainer for looking up aliases. 
13546
13547         * class.cs (TypeContainer): Remove LookupAlias from here.
13548
13549         * decl.cs (DeclSpace); Move here.
13550
13551 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13552
13553         * class.cs (FindMembers): Only call filter if the constructor
13554         bulider is not null.
13555
13556         Also handle delegates in `NestedTypes' now.  Now we will perform
13557         type lookups using the standard resolution process.  This also
13558         fixes a bug.
13559
13560         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13561         This uses Expressions (the limited kind that can be parsed by the
13562         tree) instead of strings.
13563
13564         * expression.cs (ComposedCast.ToString): Implement, used to flag
13565         errors since now we have to render expressions.
13566
13567         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13568         FormArrayType. 
13569
13570         * ecore.cs (SimpleName.ToString): ditto.
13571
13572         * cs-parser.jay: Instead of using strings to assemble types, use
13573         Expressions to assemble the type (using SimpleName, ComposedCast,
13574         MemberAccess).  This should fix the type lookups in declarations,
13575         because we were using a different code path for this.
13576
13577         * statement.cs (Block.Resolve): Continue processing statements
13578         even when there is an error.
13579
13580 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13581
13582         * class.cs (Event.Define): Also remove the `remove' method from
13583         the list of pending items.
13584
13585         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13586         generate more compact code. 
13587
13588 2002-07-17  Martin Baulig  <martin@gnome.org>
13589
13590         * const.cs (Const.LookupConstantValue): Add support for constant
13591         `unchecked' and `checked' expressions.
13592         Also adding test case test-140.cs for this.
13593
13594 2002-07-17  Martin Baulig  <martin@gnome.org>
13595
13596         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13597         check whether mi.ReturnType implements the IEnumerator interface; the
13598         `==' and the IsAssignableFrom() will fail in this situation.
13599
13600 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13601
13602         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13603         here too.
13604
13605 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13606
13607         * expression.cs: fixed bug #27811.
13608
13609 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13610
13611         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13612         Molaro: when we are a ref, the value already contains a pointer
13613         value, do not take the address of it.
13614
13615 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13616         * removed mb-parser.jay and mb-tokenizer.cs
13617
13618 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13619
13620         * expression.cs: check against the building corlib void type.
13621
13622 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13623
13624         * ecore.cs: fix for valuetype static readonly fields: when 
13625         initializing them, we need their address, not the address of a copy.
13626
13627 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13628
13629         * typemanager.cs: register also enum_type in corlib.
13630
13631 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13632
13633         * class.cs: allow calling this (but not base) initializers in structs.
13634
13635 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13636
13637         * ecore.cs: make sure we compare against the building base types
13638         in GetTypeSize ().
13639
13640 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13641
13642         * typemanager.cs: fix TypeToCoreType() to handle void and object
13643         (corlib gets no more typerefs after this change).
13644
13645 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13646
13647         * expression.cs (ArrayCreation.EmitArrayArguments): use
13648         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13649
13650         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13651         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13652         array indexes, the runtime actually forbids them.
13653
13654         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13655         for array arguments here.
13656
13657         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13658         instead of the default for ValueTypes.
13659
13660         (New.DoEmit): Use IsValueType instead of
13661         IsSubclassOf (value_type)
13662         (New.DoResolve): ditto.
13663         (Invocation.EmitCall): ditto.
13664
13665         * assign.cs (Assign): ditto.
13666
13667         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13668         Statements *are* currently doing part of their resolution during
13669         Emit.  
13670
13671         Expressions do always resolve during resolve, but statements are
13672         only required to propagate resolution to their children.
13673
13674 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13675
13676         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13677
13678         (LoadAssembly): Do not add the dll if it is already specified
13679
13680         (MainDriver): Add the System directory to the link path at the end,
13681         after all the other -L arguments. 
13682
13683         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13684         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13685         ldelem.u1) and using the opposite for sbytes.
13686
13687         This fixes Digger, and we can finally run it.
13688
13689         * driver.cs (UnixParseOption): Move the option parsing here.  
13690         (CSCParseOption): Implement CSC-like parsing of options.
13691
13692         We now support both modes of operation, the old Unix way, and the
13693         new CSC-like way.  This should help those who wanted to make cross
13694         platform makefiles.
13695
13696         The only thing broken is that /r:, /reference: and /lib: are not
13697         implemented, because I want to make those have the same semantics
13698         as the CSC compiler has, and kill once and for all the confussion
13699         around this.   Will be doing this tomorrow.
13700
13701         * statement.cs (Unsafe.Resolve): The state is checked during
13702         resolve, not emit, so we have to set the flags for IsUnsfe here.
13703
13704 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13705
13706         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13707         not catch the Error_ObjectRefRequired in SimpleName (as it is
13708         possible to have a class/instance variable name that later gets
13709         deambiguated), we have to check this here.      
13710
13711 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13712
13713         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13714         make static and put into Expression.
13715
13716         (Event.Define): Register the private field of the event with the 
13717         TypeManager so that GetFieldFromEvent can get at it.
13718
13719         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13720         keep track of the private field associated with an event which
13721         has no accessors.
13722
13723         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13724         private field.
13725
13726         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13727
13728 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13729
13730         * expression.cs (Binary.EmitBranchable): this routine emits the
13731         Binary expression in a branchable context.  This basically means:
13732         we need to branch somewhere, not just get the value on the stack.
13733
13734         This works together with Statement.EmitBoolExpression.
13735
13736         * statement.cs (Statement.EmitBoolExpression): Use
13737         EmitBranchable. 
13738
13739 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13740
13741         * statement.cs (For): Reduce the number of jumps in loops.
13742
13743         (For): Implement loop inversion for the For statement.
13744
13745         (Break): We can be breaking out of a Try/Catch controlled section
13746         (foreach might have an implicit try/catch clause), so we need to
13747         use Leave instead of Br.
13748
13749         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13750         now).  If the instace expression supports IMemoryLocation, we use
13751         the AddressOf method from the IMemoryLocation to extract the
13752         address instead of emitting the instance.
13753
13754         This showed up with `This', as we were emitting the instance
13755         always (Emit) instead of the Address of This.  Particularly
13756         interesting when This is a value type, as we dont want the Emit
13757         effect (which was to load the object).
13758
13759 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13760
13761         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13762
13763         * statement.cs (Checked): Set the CheckedState during the resolve
13764         process too, as the ConvCast operations track the checked state on
13765         the resolve process, and not emit.
13766
13767         * cs-parser.jay (namespace_member_declaration): Flag that we have
13768         found a declaration when we do.  This is used to flag error 1529
13769
13770         * driver.cs: Report ok when we display the help only.
13771
13772 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13773
13774         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13775
13776 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13777
13778         * cs-tokenizer.cs (define): We also have to track locally the
13779         defines.  AllDefines is just used for the Conditional Attribute,
13780         but we also need the local defines for the current source code. 
13781
13782 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13783
13784         * statement.cs (While, For, Do): These loops can exit through a
13785         Break statement, use this information to tell whether the
13786         statement is the last piece of code.
13787
13788         (Break): Flag that we break.
13789
13790         * codegen.cs (EmitContexts): New `Breaks' state variable.
13791
13792 2002-07-03  Martin Baulig  <martin@gnome.org>
13793
13794         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13795         modifiers in method declarations in structs.  Otherwise, you won't
13796         be able to override things like Object.Equals().
13797
13798 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13799
13800         * class.cs (Method, Property, Indexer): Do not allow the public
13801         modifier to be used in explicit interface implementations.
13802
13803         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13804         override modifiers in method declarations in structs
13805
13806 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13807
13808         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13809         integer or real overflow, report an error
13810
13811 2002-07-02  Martin Baulig  <martin@gnome.org>
13812
13813         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13814         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13815         to tell the runtime about our newly created System.Object and
13816         System.ValueType types.
13817
13818 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13819
13820         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13821         struct instead of Ldarg/Starg.
13822
13823 2002-07-02  Martin Baulig  <martin@gnome.org>
13824
13825         * expression.cs (Indirection.Indirection): Call
13826         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13827
13828 2002-07-02  Martin Baulig  <martin@gnome.org>
13829
13830         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13831         ValueType, call TypeManager.TypeToCoreType() on it.
13832         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13833         the OpCodes.Newarr argument.
13834
13835 2002-07-02  Martin Baulig  <martin@gnome.org>
13836
13837         * expression.cs (Invocation.EmitCall): When compiling corlib,
13838         replace all calls to the system's System.Array type to calls to
13839         the newly created one.
13840
13841         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13842         System.Array methods.
13843         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13844         from the system's System.Array type which must be replaced.
13845
13846 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13847
13848         * typemanager.cs: load unverifiable_code_ctor so we can build
13849         corlib using the correct type. Avoid using GetTypeCode() with
13850         TypeBuilders.
13851         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13852         TypeManager.object_type to allow building corlib.
13853
13854 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13855
13856         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13857
13858 2002-07-01  Martin Baulig  <martin@gnome.org>
13859
13860         * class.cs: Make the last change actually work, we need to check
13861         whether `ifaces != null' to avoid a crash.
13862
13863 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13864
13865         * class.cs: when we build structs without fields that implement
13866         interfaces, we need to add the interfaces separately, since there is
13867         no API to both set the size and add the interfaces at type creation
13868         time.
13869
13870 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13871
13872         * expression.cs: the dimension arguments to the array constructors
13873         need to be converted if they are a long.
13874
13875 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13876
13877         * class.cs: don't emit ldarg.0 if there is no parent constructor
13878         (fixes showstopper for corlib).
13879
13880 2002-06-29  Martin Baulig  <martin@gnome.org>
13881
13882         MCS now compiles corlib on GNU/Linux :-)
13883
13884         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13885         ie. check for MethodImplOptions.InternalCall.
13886
13887         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13888         and TypeManager.attribute_type are null, so we must explicitly check
13889         whether parent is not null to find out whether it's an attribute type.
13890         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13891         and SetBuilder, not only if the property is neither abstract nor external.
13892         This is necessary to set the MethodImplOptions on the accessor methods.
13893         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13894         SetBuilder, see Property.Emit().
13895
13896         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13897         populate "System.Object", "System.ValueType" and "System.Attribute" since
13898         they've already been populated from BootCorlib_PopulateCoreTypes().
13899
13900 2002-06-29  Martin Baulig  <martin@gnome.org>
13901
13902         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13903         is the NullLiteral, we also need to make sure that target_type is not
13904         an enum type.   
13905
13906 2002-06-29  Martin Baulig  <martin@gnome.org>
13907
13908         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13909         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13910         before calling BootstrapCorlib_ResolveDelegate ().
13911
13912 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13913
13914         * statement.cs: fixed build-breaker. All tests passed ok.
13915
13916 2002-06-27  Martin Baulig  <martin@gnome.org>
13917
13918         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13919         for System.Decimal when compiling corlib.
13920
13921 2002-06-27  Martin Baulig  <martin@gnome.org>
13922
13923         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13924         switch blocks which contain nothing but a default clause.
13925
13926 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13927
13928        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13929
13930 2002-06-27  Martin Baulig  <martin@gnome.org>
13931
13932         * ecore.cs (PropertyExpr.PropertyExpr): Call
13933         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13934
13935         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13936         is already a TypeBuilder.
13937
13938 2002-06-27  Martin Baulig  <martin@gnome.org>
13939
13940         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13941         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13942         the "from an array-type to System.Array" case.  This makes it work
13943         when compiling corlib.
13944
13945 2002-06-27  Martin Baulig  <martin@gnome.org>
13946
13947         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13948         non-static PropertyExpr, set its InstanceExpression.  This makes
13949         the `ICollection.Count' property work in System/Array.cs.
13950
13951 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13952
13953         * driver.cs: Made error handling more consistent.  Errors now
13954         tracked by Report class, so many methods which used to return int
13955         now return void.  Main() now prints success/failure and 
13956         errors/warnings message.
13957
13958         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13959         the magic number return values (123 and 124).  Now, if the
13960         expected error occurs, the compiler exits with success (exit value
13961         0).  If the compilation completes without seeing that particular
13962         error, the compiler exits with failure (exit value 1).  The
13963         makefile in mcs/errors has been changed to handle the new behaviour.
13964
13965         * report.cs: Made 'expected error' number a property and renamed
13966         it from 'Probe' to 'ExpectedError'.
13967
13968         * genericparser.cs: Removed error handling support, since it is
13969         now all done by Report class.
13970
13971         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13972         class, so parse() no longer returns an int.
13973
13974         * namespace.cs: Use Report.Error instead of GenericParser.error
13975
13976 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13977
13978         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13979         TypeContainer.AddOperator): At the front of the list put the
13980         explicit implementations, so they get resolved/defined first. 
13981
13982 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13983
13984         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13985         interface type is implemented by this TypeContainer.  Used during
13986         explicit interface implementation.
13987
13988         (Property.Define, Indexer.Define, Method.Define): Validate that
13989         the given interface in the explicit implementation is one of the
13990         base classes for the containing type.
13991
13992         Also if we are explicitly implementing an interface, but there is
13993         no match in the pending implementation table, report an error.
13994
13995         (Property.Define): Only define the property if we are
13996         not explicitly implementing a property from an interface.  Use the
13997         correct name also for those properties (the same CSC uses,
13998         although that is really not needed).
13999
14000         (Property.Emit): Do not emit attributes for explicitly implemented
14001         properties, as there is no TypeBuilder.
14002
14003         (Indexer.Emit): ditto.
14004
14005         Hiding then means that we do not really *implement* a pending
14006         implementation, which makes code fail.
14007
14008 2002-06-22  Martin Baulig  <martin@gnome.org>
14009
14010         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14011         the return value of Object.GetType().  [FIXME: we need to do this whenever
14012         we get a type back from the reflection library].
14013
14014 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14015
14016         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14017
14018 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14019
14020         * attribute.cs: Return null if we can not look up the type.
14021
14022         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14023         the interface types found.
14024
14025         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14026         interface types found.
14027
14028         * typemanager.cs (GetInterfaces): Make this routine returns alll
14029         the interfaces and work around the lame differences between
14030         System.Type and System.Reflection.Emit.TypeBuilder in the results
14031         result for GetInterfaces.
14032
14033         (ExpandInterfaces): Given an array of interface types, expand and
14034         eliminate repeated ocurrences of an interface.  This expands in
14035         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14036         be IA, IB, IC.
14037
14038 2002-06-21  Martin Baulig  <martin@gnome.org>
14039
14040         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14041         on System.Enum.
14042
14043 2002-06-21  Martin Baulig  <martin@gnome.org>
14044
14045         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14046         and called with one of the core types, return the corresponding typebuilder for
14047         that type.
14048
14049         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14050         element type.
14051
14052 2002-06-21  Martin Baulig  <martin@gnome.org>
14053
14054         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14055         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14056         (Expression.ConvertReferenceExplicit): Likewise.
14057
14058         * expression.cs (ElementAccess.DoResolve): Likewise.
14059         (ElementAccess.DoResolveLValue): Likewise.
14060
14061 2002-06-10  Martin Baulig  <martin@gnome.org>
14062
14063         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14064         add the "value" parameter to the parameter list.
14065
14066         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14067         to our caller.
14068
14069 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14070
14071         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14072         the argument to an int, uint, long or ulong, per the spec.  Also
14073         catch negative constants in array creation.
14074
14075 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14076
14077         * class.cs: do not allow the same interface to appear twice in
14078         the definition list.
14079
14080 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14081
14082         * ecore.cs: don't use ldlen with System.Array.
14083
14084 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14085
14086         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14087
14088 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14089
14090         * modifiers.cs: produce correct field attributes for protected
14091         internal. Easy fix so miguel can work on ther harder stuff:-)
14092
14093 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14094
14095         * pending.cs: New file.  Move the code from class.cs here.
14096         Support clearning the pending flag for all methods (when not doing
14097         explicit interface implementation).
14098
14099 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14100
14101         * rootcontext.cs: added a couple more types needed to bootstrap.
14102
14103 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14104
14105         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14106         constructor in the type, instead of any constructor in the type
14107         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14108         a bug in the Mono runtime when applying the params attribute). 
14109
14110 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14111         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14112
14113 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14114
14115         * expression.cs (Unary.ResolveOperator): Use TypeManager
14116         to resolve the type.
14117
14118 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14119
14120         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14121         attached.
14122
14123         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14124         with each member too.
14125
14126         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14127         field builders too - this takes care of the enum member case.
14128
14129 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14130
14131         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14132         address-of operator on both value types and pointers.
14133
14134 2002-06-10  Martin Baulig  <martin@gnome.org>
14135
14136         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14137         PropertyBuilder to the `property_builders' list.
14138
14139         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14140         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14141         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14142         find any indexers which are inherited from an interface.
14143
14144 2002-06-09  Martin Baulig  <martin@gnome.org>
14145
14146         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14147         the same type as the constant if necessary.  There's also a test-130.cs
14148         for this.
14149
14150         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14151
14152         * typemanager.cs (TypeManager.ChangeType): Previously known as
14153         Enum.ChangeEnumType().
14154
14155 2002-06-09  Martin Baulig  <martin@gnome.org>
14156
14157         * expression.cs (Cast.TryReduce): Added support for consts.
14158
14159 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14160
14161         * class.cs (Accessor): Hold attributes information so we can pass
14162         it along.
14163
14164         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14165         Modify to pass in attributes attached to the methods.
14166
14167         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14168
14169         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14170         to handle the Accessor kind :-)
14171
14172         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14173
14174 2002-06-08  Martin Baulig  <martin@gnome.org>
14175
14176         * expression.cs (Unary.TryReduceNegative): Added support for
14177         ULongConstants.
14178
14179 2002-06-08  Martin Baulig  <martin@gnome.org>
14180
14181         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14182         name can't be found in the `defined_names' - the caller will do a
14183         MemberLookup in this case and thus find methods in System.Enum
14184         such as Enum.IsDefined().
14185
14186 2002-06-08  Martin Baulig  <martin@gnome.org>
14187
14188         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14189         Convert.ChangeType() which works with TypeBuilder created types.
14190         (Enum.LookupEnumValue, Enum.Define): Use it here.
14191
14192         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14193         `TypeBuilder.BaseType != null' check.
14194         (TypeContainer.FindMembers): Only lookup parent members if we
14195         actually have a parent.
14196         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14197         (ConstructorInitializer.Resolve): Likewise.
14198
14199         * interface.cs (Interface.FindMembers): Added
14200         `TypeBuilder.BaseType != null' check.
14201
14202         * rootcontext.cs (RootContext.ResolveCore): Added
14203         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14204         classes_second_stage.
14205
14206         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14207         debug_type and trace_type when compiling with --nostdlib.       
14208
14209 2002-06-07  Martin Baulig  <martin@gnome.org>
14210
14211         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14212         (AddField): Set it to true when adding a non-static field.
14213         (DefineType): Use `have_nonstatic_fields' to find out whether we
14214         have non-static fields, not `Fields != null'.
14215
14216 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14219         dereferencing a null on the static-field code path)
14220
14221 2002-05-30  Martin Baulig  <martin@gnome.org>
14222
14223         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14224         to take command line arguments.  Use reflection to call the new
14225         custom `Initialize' function on the symbol writer and pass it the
14226         command line arguments.
14227
14228         * driver.cs (--debug-args): New command line argument to pass command
14229         line arguments to the symbol writer.
14230
14231 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14232
14233         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14234         the target type for indexers and properties.  Thanks to Joe for
14235         catching this.
14236
14237 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14238
14239         * typemanager.cs (MethodFlags): returns the method flags
14240         (Obsolete/ShouldIgnore) that control warning emission and whether
14241         the invocation should be made, or ignored. 
14242
14243         * expression.cs (Invocation.Emit): Remove previous hack, we should
14244         not do this on matching a base type, we should do this based on an attribute
14245
14246         Only emit calls to System.Diagnostics.Debug and
14247         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14248         on the command line.
14249
14250         * rootcontext.cs: Global settings for tracing and debugging.
14251
14252         * cs-tokenizer.cs (define): New utility function to track
14253         defines.   Set the global settings for TRACE and DEBUG if found.
14254
14255 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14256
14257         * interface.cs (Populate*): Pass in the TypeContainer as well as
14258         the DeclSpace as parameters so that we can create EmitContexts and
14259         then use that to apply attributes etc.
14260
14261         (PopulateMethod, PopulateEvent, PopulateProperty)
14262         (PopulateIndexer): Apply attributes everywhere.
14263
14264         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14265         etc.
14266
14267         (ApplyAttributes): Update accordingly.
14268
14269         We now apply interface attributes for all members too.
14270
14271 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14272
14273         * class.cs (Indexer.Define); Correctly check if we are explicit
14274         implementation (instead of checking the Name for a ".", we
14275         directly look up if the InterfaceType was specified).
14276
14277         Delay the creation of the PropertyBuilder.
14278
14279         Only create the PropertyBuilder if we are not an explicit
14280         interface implementation.   This means that explicit interface
14281         implementation members do not participate in regular function
14282         lookups, and hence fixes another major ambiguity problem in
14283         overload resolution (that was the visible effect).
14284
14285         (DefineMethod): Return whether we are doing an interface
14286         implementation. 
14287
14288         * typemanager.cs: Temporary hack until we get attributes in
14289         interfaces (Ravi is working on that) and we get IndexerName
14290         support in interfaces.
14291
14292         * interface.cs: Register the indexers as properties.
14293
14294         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14295         warning, I have verified that this is a bug in the .NET runtime
14296         (JavaScript suffers of the same problem).
14297
14298         * typemanager.cs (MemberLookup): When looking up members for
14299         interfaces, the parent of an interface is the implicit
14300         System.Object (so we succeed in searches of Object methods in an
14301         interface method invocation.  Example:  IEnumerable x;  x.ToString
14302         ()) 
14303
14304 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14305
14306         * class.cs (Event): Events should also register if they do
14307         implement the methods that an interface requires.
14308
14309         * typemanager.cs (MemberLookup); use the new GetInterfaces
14310         method. 
14311
14312         (GetInterfaces): The code used to lookup interfaces for a type is
14313         used in more than one place, factor it here. 
14314
14315         * driver.cs: Track the errors at the bottom of the file, we kept
14316         on going.
14317
14318         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14319         instance if the method we are calling is static!
14320
14321 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14322
14323         * attribute.cs (ApplyAttributes): Make this function filter out
14324         the IndexerName attribute (as that attribute in reality is never
14325         applied) and return the string constant for the IndexerName
14326         attribute. 
14327
14328         * class.cs (TypeContainer.Emit): Validate that all the indexers
14329         have the same IndexerName attribute, and if so, set the
14330         DefaultName attribute on the class. 
14331
14332         * typemanager.cs: The return value might contain other stuff (not
14333         only methods).  For instance, consider a method with an "Item"
14334         property and an Item method.
14335
14336         * class.cs: If there is a problem with the parameter types,
14337         return. 
14338
14339 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14340
14341         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14342         looks at user defined conversion after making a call to 
14343         StandardConversionExists - we need this for overload resolution.
14344
14345         * expression.cs : Update accordingly the various method calls.
14346
14347         This fixes 2 bugs filed against implicit user defined conversions 
14348
14349 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14350
14351         * statement.cs: Track the result of the assignment.
14352
14353 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * expression.cs (MemberAccess): Improved error reporting for
14356         inaccessible members.
14357
14358 2002-05-22  Martin Baulig  <martin@gnome.org>
14359
14360         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14361         itself with debugging support.
14362
14363 2002-05-22  Martin Baulig  <martin@gnome.org>
14364
14365         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14366         Removed, this isn't needed anymore.
14367
14368 2002-05-20  Martin Baulig  <martin@gnome.org>
14369
14370         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14371         be underlying type for an enum.
14372
14373 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14374
14375         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14376         that splits out the loading of just the core types.
14377
14378         * rootcontext.cs (ResolveCore): Split the struct resolution in
14379         two, so we can load the enumeration underlying types before any
14380         enums are used.
14381
14382         * expression.cs (Is): Bandaid until we fix properly Switch (see
14383         bug #24985 for details).
14384
14385         * typemanager.cs (ImplementsInterface): The hashtable will contain
14386         a null if there are no interfaces implemented.
14387
14388 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14389
14390         * cs-parser.jay (indexer_declarator): It is fine to have array
14391         parameters
14392
14393 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14394
14395         * typemanager.cs: (RegisterBuilder): New function used to register
14396         TypeBuilders that implement interfaces.  Since
14397         TypeBuilder.GetInterfaces (as usual) does not work with lame
14398         Reflection.Emit. 
14399         (AddUserType): register interfaces.
14400
14401         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14402         dealing with TypeBuilder.  Also, arrays are showing up as
14403         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14404         methods can not be invoked on them!
14405
14406         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14407         (ImplicitReferenceConversionExists): Split out from
14408         StandardConversionExists. 
14409
14410         * expression.cs (As): We were only implementing one of the three
14411         cases for the as operator.  We now implement them all.
14412         (Is): Implement the various other cases for Is as well.
14413
14414         * typemanager.cs (CACHE): New define used to control if we want or
14415         not the FindMembers cache.  Seems to have a negative impact on
14416         performance currently
14417
14418         (MemberLookup): Nested types have full acess to
14419         enclosing type members
14420
14421         Remove code that coped with instance/static returns for events, we
14422         now catch this in RealFindMembers.
14423
14424         (RealFindMembers): only perform static lookup if the instance
14425         lookup did not return a type or an event.  
14426
14427 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14428
14429         * assign.cs (CompoundAssign): We pass more semantic information
14430         now to Compound Assignments than we did before: now we have all
14431         the information at hand, and now we resolve the target *before* we
14432         do the expression expansion, which allows the "CacheValue" method
14433         to have the effect we intended (before, a [x] += 1 would generate
14434         two differen ArrayAccess expressions from the ElementAccess,
14435         during the resolution process).
14436
14437         (CompoundAssign.DoResolve): Resolve target and original_source here.
14438
14439 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14440
14441         * expression.cs (ArrayAccess): dropped debugging information. 
14442
14443         * typemanager.cs: Small bug fix: I was always returning i_members,
14444         instead of one of i_members or s_members (depending on which had
14445         the content).
14446
14447         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14448         method is invoked before any code generation takes place, and it
14449         is a mechanism to inform that the expression will be invoked more
14450         than once, and that the method should use temporary values to
14451         avoid having side effects
14452
14453         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14454
14455         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14456         implementation.
14457
14458         * expression.cs (Indirection, ArrayAccess): Add support for
14459         CacheTemporaries in these two bad boys. 
14460
14461         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14462         ldobj or ldind_ref.  
14463         (StoreFromPtr): Handle stobj as well.
14464
14465         * expression.cs (UnaryMutator): Share more code.
14466
14467         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14468         down: I was not tracking the Filter function as well, which
14469         was affecting the results of the cache.
14470
14471 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14472
14473         * attribute.cs: Remove the hack to handle the CharSet property on
14474         StructLayouts. 
14475
14476 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14477
14478         * attribute.cs (DoResolve): More uglyness, we now only try to
14479         resolve the attribute partially, to extract the CharSet
14480         information (only if we are a StructLayout attribute).  Otherwise 
14481
14482         (GetExtraTypeInfo): Add some code to conditionally kill in the
14483         future this.   I am more and more convinced that the .NET
14484         framework has special code to handle the attribute setting on
14485         certain elements.
14486
14487         * expression.cs (IsParamsMethodApplicable): Revert my previous
14488         foreach change here, it was wrong.
14489
14490 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14493         (pp_expr): do not abort on unknown input, just return.
14494         (eval): abort if there are pending chars.
14495
14496         * attribute.cs (Attribute.Resolve): Positional parameters are
14497         optional.  Deal with that case.
14498
14499         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14500         the Ansi/Unicode/Auto information for the type.
14501
14502         (TypeContainer.DefineType): instantiate the EmitContext here, as
14503         we will be using it during the type definition (to resolve
14504         attributes) and during the emit phase.
14505
14506         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14507         to pull type information out of the attributes
14508
14509         (Attribute.Resolve): track the constructor builder, and allow for
14510         multiple invocations (structs and classes will use this).
14511
14512         * ecore.cs (MemberLookupFinal): new version with all the
14513         parameters customizable.
14514
14515         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14516         constructors.  Return if the result value is null (as the error
14517         would have been flagged already by MemberLookupFinal)
14518
14519         Do not allow instances of abstract classes or interfaces to be
14520         created.
14521
14522         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14523         We have to compare the assembly property here when dealing with
14524         FamANDAssem and Assembly access modifiers, because we might be
14525         creating an assembly from *modules* (that means that we are not
14526         getting TypeBuilders for types defined in other modules that are
14527         part of this assembly).
14528
14529         (Method.Emit): If the method is marked abstract and has a body,
14530         emit an error. 
14531
14532         (TypeContainer.DefineMembers): If both the defined member and the
14533         parent name match are methods, then do not emit any warnings: let
14534         the Method.Define routine take care of flagging warnings.  But if
14535         there is a mismatch (method overrides something else, or method is
14536         overriwritten by something, then emit warning).
14537
14538         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14539         set to null, this means `do not check for the return type on the
14540         signature'. 
14541
14542         (Method.Define): set the return type for the method signature to
14543         null, so that we get methods with the same name and parameters and
14544         different return types.  This is used to flag warning 114 (you are
14545         hiding a method, and you probably want to use the new/override
14546         keywords instead).
14547
14548         * typemanager.cs (MemberLookup): Implemented proper access
14549         control, closing a long standing set of bug reports.  The problem
14550         was that the Framework only has two bits: Public and NonPublic,
14551         and NonPublic includes private and protected methods, but we need
14552         to enforce the FamANDAssem, FamOrAssem and Family. 
14553
14554 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14555
14556         * statement.cs (GotoCase): Return true: Ammounts to giving up
14557         knowledge on whether we return or not, and letting the other case
14558         be responsible for it.
14559
14560 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14561
14562         * driver.cs: Do not load directories for each file processed, only
14563         do it if there is a pattern.
14564
14565         * ecore.cs: Report readonly assigns here as well, as we might have
14566         been resolved only by MemberAccess.
14567
14568         (SimpleName.SimpleNameResolve): Also be useful for LValue
14569         resolution.   We need this to propagate assign to local readonly variables
14570
14571         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14572         do not want to reuse potential criteria memory.
14573
14574         * class.cs (MyEventBuilder): Set reflected_type;
14575
14576         * ecore.cs (Constantify): Added support for constifying bools.
14577
14578         (RootContext.LookupType): Added a cache for values looked up in
14579         the declaration space.
14580
14581         * typemanager.cs (FindMembers): Now is a front-end to
14582         RealFindMembers, and provides a two-level hashtable-based cache to
14583         the request.  
14584
14585         15% performance improvement: from 22.5 to 19.2 seconds.
14586
14587         * expression.cs (IsParamsMethodApplicable): use foreach.
14588         (Invocation.DoResolve): ditto.
14589         (New.DoResolve): ditto.
14590         (ArrayCreation.DoResolve): ditto.
14591
14592         * ecore.cs (FindMostEncompassingType): use foreach.
14593
14594         * delegate.cs (NewDelegate.DoResolve): Use foreach
14595
14596         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14597         (RemoveMethods): use foreach.
14598
14599         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14600         nested foreach statements instead of for, and also break out of
14601         the inner loop once a match is found.
14602
14603         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14604
14605 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14606
14607         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14608         we actually unwrap the expression to allow for extra information
14609         to be extracted. 
14610
14611         * expression.cs: Use Shr_Un on unsigned operations. 
14612
14613 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14614
14615         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14616         applicable operators was not being considered correctly. This closes
14617         the bug Miguel reported.
14618
14619 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14620
14621         * attribute.cs: check that the type derives from System.Attribute
14622         and report the correct error in that case (moved the duplicate code to
14623         its own method, too).
14624
14625 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14626
14627         * attribute.cs: lookup attribute type name as the spec says: first the
14628         bare attribute name and then name + "Attribute" (nant compiles with
14629         mcs after this fix).
14630
14631 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14632
14633         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14634         Because of the way we parse things, we should try to see if a
14635         UIntConstant can fit in an integer.
14636
14637 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14638
14639         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14640         when we are in an explicit context.
14641
14642         (ConvertReferenceExplicit): When converting from Iface type S to Class
14643         T make sure the rules are implemented as an OR.
14644
14645         * parameter.cs (ParameterType): Make it a property for now although the
14646         purpose really isn't anything immediate.
14647
14648         * expression.cs (Is*Applicable): Do better checking on the parameter type
14649         of a ref/out parameter. The ones from the system assemblies are already 
14650         marked with the correct type so we don't need to do any correction.
14651
14652         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14653         the object type is standard too so include that.
14654
14655 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14656
14657         * ecore.cs (StandardConversionExists): Augment with missing code:
14658         deal with IntConstant, LongConstants and Enumerations.
14659
14660         * assign.cs: Report the error, instead of failing silently
14661
14662         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14663         typecontainer that they are declared, because the
14664         typecontainer/namespace will have the list of using clauses that
14665         need to be applied.
14666
14667         Assembly Attributes were escaping the normal registration
14668         mechanism. 
14669
14670         (EmitCode): Apply attributes within an EmitContext that represents
14671         the container they were declared on.
14672
14673         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14674
14675 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14676
14677         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14678         Revamp completely - make much cleaner as we now operate only
14679         on a set of Types.
14680
14681         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14682         to implement the logic detailed in the spec more correctly.
14683
14684         (UserDefinedConversion): Update accordingly.
14685
14686 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14687
14688         * statement.cs: Return flow analysis information up.
14689
14690         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14691         and the default.
14692
14693         (token): Do not consume an extra character before calling
14694         decimal_digits.
14695
14696 2002-05-06  Piers Haken <piersh@friskit.com>
14697
14698         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14699
14700 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14701
14702         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14703         EmitContext during the instance constructor initializer
14704         resolution, to stop access to instance variables.
14705
14706         This is mandated by the spec, last paragraph of the `constructor
14707         initializers' section. 
14708
14709 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14710
14711         * cs-parser.jay, class.cs (Accessor): new class used to represent
14712         an accessor (get or set).  In the past we used `null' to represent
14713         a missing accessor.  But this is ambiguous because there was no
14714         way to tell in abstract indexers/properties if one of them was
14715         specified.
14716
14717         Now there is a way of addressing that.
14718
14719         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14720         instead of FindMembers.
14721
14722         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14723         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14724
14725         * attribute.cs: Treat indexers and properties as the same in terms
14726         of applying attributes
14727
14728         * ecore.cs (FindMostEncompassedType): Use statically initialized
14729         EmptyExpressions()s like we do elsewhere to avoid creating useless
14730         objects (and we take this out of the tight loop).
14731
14732         (GetConversionOperators): Move the code to extract the actual
14733         operators to a separate routine to clean things up.
14734
14735 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14738         events are always registered FieldBuilders.
14739
14740         * class.cs (FieldBase): New class shared by Fields 
14741
14742         * delegate.cs: If we are a toplevel delegate, use our full name.
14743         If we are a nested delegate, then only use our tail name.
14744
14745 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14746
14747         * expression.cs (IsApplicable): Ensure that we add the "&" to
14748         ref/out types before comparing it with the type of the argument.
14749
14750         (IsParamsMethodApplicable): Ditto.
14751
14752         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14753         silly me ;-)
14754
14755         * delegate.cs : Handle the case when we have more than one applicable
14756         method. Flag an error only when we finish checking all.
14757
14758 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14759
14760         * expression.cs: Add support for boolean static initializers.
14761
14762 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14763
14764         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14765
14766         * parameter.cs (ComputeParameterTypes,
14767         ComputeAndDefineParameterTypes): Better error handling: now we
14768         clear the `types' cache if we fail during any of the type lookups.
14769         We also return the status code correctly to our caller
14770
14771         * delegate.cs: If we fail to define a delegate, abort the extra
14772         steps. 
14773
14774         * expression.cs (Binary.ResolveOperator): for
14775         operator==(object,object) and operator !=(object, object) we also
14776         have to verify that there is an implicit conversion from one to
14777         the other.
14778
14779         (ArrayAccess.DoResolve): Array Access can operate on
14780         non-variables. 
14781
14782 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14783
14784         * assign.cs (CompoundAssign): A new class used as a "flag" that
14785         the assignment actually is happening as part of a compound
14786         assignment operator.
14787
14788         During compound assignment, a few new rules exist to enable things
14789         like:
14790
14791         byte b |= 1 + 2
14792
14793         From the spec:
14794
14795         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14796         to the type of x) if y is implicitly convertible to the type of x,
14797         and the operator is a builtin operator and the return type of the
14798         operator is explicitly convertible to the type of x. 
14799
14800         * rootcontext.cs: Reset warning level to 2.  4 catches various
14801         "interesting" features in mcs, we must clean this up at some
14802         point, but currently am trying to kill other bugs ;-)
14803
14804         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14805         in container classes as well.  
14806
14807         * expression.cs (Binary.ResolveOperator): Handle string case
14808         before anything else (as operator overloading does emit an error
14809         before doing anything else).
14810
14811         This code could go away when we move to a table driven model, but
14812         i could not come up with a good plan last night.
14813
14814 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14815
14816         * typemanager.cs (CSharpName): reimplementation using regex.
14817         * class.cs: added null check for fields in Emit
14818         * rootcontext.cs: set warninglevel to 4
14819
14820 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14821
14822         * typemanager.cs (CSharpName): reimplemented with Lupus
14823         suggestion.
14824
14825 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14826
14827         * statement.cs (If): correclty implement Resolve, because we were
14828         not catching sem errors in there.  The same process is needed
14829         everywhere else. 
14830         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14831
14832
14833         (Statement.Warning_DeadCodeFound): Factorize code.
14834         (While): Report dead code here too.
14835
14836         (Statement): Added Resolve virtual method to allow
14837         for resolution split from the emit code.
14838
14839 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14840
14841         * statement.cs (EmitBoolExpression): No longer try to resolve the
14842         expression here.    
14843         (MakeBoolean): New utility function that resolve, implicitly
14844         converts to boolean and tags the expression. 
14845
14846
14847         (If, Do): Implement dead code elimination.
14848         (While): Implement loop inversion
14849
14850         (Do, While, For, If): Resolve the expression prior to calling our
14851         code generation.
14852
14853 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14854
14855         * class.cs:
14856           - added method Report28 (warning: program has more than one entry point)
14857           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14858           - modified method Method.Define, the part at the end of the method
14859
14860         * rootcontext.cs: added static public Location EntryPointLocation;
14861           
14862         * ../errors/cs0028.cs : Add test case for the above warning.              
14863
14864         * typemanager.cs:
14865           - modified method CSharpName to allow arrays of primitive type to
14866             be printed nicely (e.g. instead of System.Int32[][] it now prints
14867             int[][])
14868           - added method CSharpSignature: returns the signature of a method
14869             in string format to be used in reporting errors, warnings, etc.
14870
14871         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14872         with String.Empty.
14873
14874 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14875
14876         * delegate.cs (Define): Fix extremely silly bug where I was
14877         setting the type of the 'object' parameter of the BeginInvoke
14878         method to System.IAsyncResult instead of System.Object ;-)
14879
14880 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14881
14882         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14883         here. 
14884
14885         (Constructor.Emit): return if we fail to initialize the
14886         constructor.  Another door closed!  
14887
14888         * expression.cs (New.DoResolve): Improve error message (from -6 to
14889         1501).  Use DeclaredOnly lookup to find the exact constructor.
14890
14891         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14892         loop.  This is useful.
14893
14894         * cs-parser.jay: Adjust the default parameters so that destructors
14895         have the proper signature.
14896
14897 2002-04-26  Martin Baulig  <martin@gnome.org>
14898
14899         * driver.cs (LoadAssembly): If `assembly' contains any characters
14900         which are only valid in path names and not in assembly names
14901         (currently slash, backslash and point), use Assembly.LoadFrom ()
14902         instead of Assembly.Load () on the `assembly' (before iteration
14903         over the link_paths).
14904
14905 2002-04-26  Martin Baulig  <martin@gnome.org>
14906
14907         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14908
14909 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14910
14911         * class.cs (Property): use the new typemanager.MemberLookup
14912
14913         (TypeContainer.MemberLookup): Implement using the
14914         TypeManager.MemberLookup now. 
14915
14916         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14917         and return MemberInfos, so that these can be used without an
14918         EmitContext (what we had before).
14919
14920 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14921
14922         * expression.cs: Fix the case where the argument to params if the
14923         type of the params.  I omitted handling this before.   Fixed
14924
14925 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14926
14927         * driver.cs: Call BootCorlib_PopulateCoreType
14928
14929         * class.cs (Property.CheckBase): Check for properties only, not
14930         for all members. 
14931
14932         * interface.cs: Temporary hack: try/catch around the
14933         CustomAttributeBuilder, because I am getting an exception that I
14934         do not understand.
14935
14936         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14937         types whose definitions are required to be there (attributes are
14938         defined before standard types).
14939
14940         Compute definitions as we boot the various types, as they are used
14941         immediately (value_type class will need object_type, but if we do
14942         not initialize object_type, we will pass a null, which will let
14943         the runtime pick the System.Object from the existing corlib, which
14944         is not what we want).
14945
14946 2002-04-22  Patrik Torstensson <totte@labs2.com>
14947
14948         * cs-tokenizer.cs: fixed a number of trim() issues.
14949
14950 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14951
14952         * expression.cs (Argument.Type): Ensure that we return the correct
14953         type when we have out or ref parameters [in which case we 
14954         append a "&"].
14955
14956 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14957
14958         * class.cs (Property, Indexer): Allow extern modifier in there. 
14959
14960         * typemanager.cs (InitBaseTypes): Initializes object_type and
14961         value_type, since those will be used early on during the bootstrap
14962         process to compile corlib.
14963
14964         (InitCoreTypes): Move code from here to InitBaseTypes.
14965
14966 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14967
14968         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14969         single-dimension arrays as using the ldlen opcode.  
14970
14971         Daniel Lewis discovered this optimization.  
14972
14973         * typemanager.cs: Add signature for System.Array::get_Length
14974
14975 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14976
14977         * statement.cs: report the error when the foreach does not apply to an
14978         array nor a collection.
14979
14980 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14981
14982         * expression.cs: Add implicit conversions to the operator ~.
14983
14984         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14985
14986         * typemanager.cs: Locate the decimal constructor.
14987
14988 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14989
14990         * attribute.cs: use the new property of TypeOf.
14991         * expression.cs: added 'get' property around typearg.
14992
14993         These changes fix a build breaker reported by NickD. Is this the
14994         correct way to fix?  If not, please, revert my changes and make it
14995         work :-).
14996
14997 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14998
14999         * attribute.cs: Add support for typeof in attribute invocations.
15000         I am not sure that this is right though.
15001
15002 2002-04-14  Duncan Mak  <duncan@ximian.com>
15003
15004         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15005         Binary.Operator.Division case.
15006
15007 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15008
15009         * class.cs (DefineType): Ensure that we do a proper check on
15010         attribute types and also register it with the TypeManager.
15011
15012         (TypeContainer.Targets): The default for attribute types is
15013         AttributeTargets.All.
15014
15015         * attribute.cs (ApplyAttributes): Registering the attribute type
15016         is done elsewhere, not when we discover we have a Usage attribute.
15017
15018 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15019
15020         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15021         and get rid of is_delegate parameter.
15022
15023         * everywhere : update.
15024
15025 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15026
15027         * cs-parser.jay (compilation_unit): Revamp completely to use
15028         some new ideas that I got from Rhys' grammar to solve the problems
15029         with assembly level attributes.
15030
15031         (outer_declaration): New grammar production.
15032
15033         (attribute_sections): Add.
15034
15035         (opt_attributes): Base on attribute_sections
15036
15037         (namespace_declaration): Allow opt_attributes to tackle the case
15038         when we have assembly level attributes - we are clever in this
15039         regard now ;-)
15040
15041         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15042         attributes in the non-global context.
15043
15044         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15045         instead of SetGlobalAttributes.
15046
15047         * class.cs, rootcontext.cs : Ensure we define and generate 
15048         attribute types before anything else.
15049
15050         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15051         and flag the new error -20 for the case when the attribute type
15052         does not have valid targets specified. csc does not catch this.
15053
15054         * ../errors/errors.txt : update for error # -20
15055
15056 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15057
15058         * support.cs (InternalParameters.ParameterModifier): Do some null
15059         checking and return sane values.
15060
15061         * class.cs (Method.Define): If we are a PInvoke method, ensure
15062         that we are static and extern. Report error # 601
15063
15064         * ../errors/cs0601.cs : Add test case for the above error.
15065
15066 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15067
15068         * rootcontext.cs (attribute_types): We need to keep type of
15069         all attribute types separately and emit code for them first.
15070
15071         (RegisterAttribute) : Implement.
15072
15073         * class.cs (DefineType): Check if the current Type is a custom
15074         attribute type and register it accordingly.
15075
15076         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15077         adding the first attribute twice and rename to
15078
15079         (SetGlobalAttributes): this.
15080
15081         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15082         lookups.
15083
15084         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15085         if we are processing global arguments. Hmm, I am unsure of this.
15086
15087 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15088
15089         * expression.cs: added static array of strings to avoid calling
15090         Enum.ToString () for Operator in Binary. Significant recover of
15091         performance.
15092
15093 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15094
15095         * class.cs (FindMembers): Allow the Builders of the various
15096         members to be null.  If they are skip them.  This only happens
15097         during the PInvoke declaration.
15098
15099 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15100
15101         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15102         failure, so we do not keep going afterwards.
15103
15104         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15105         wanted to pass `false' as the `is_delegate' argument.  If this is
15106         the case, why not use delegate_type == null to mean `is_delegate =
15107         false' and anything else as is_delegate = true.
15108
15109 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15110
15111         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15112         code for the section, not the beginning of the tests.
15113
15114 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15115
15116         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15117
15118         * expression.cs (Binary): same.  Warn about errors where we have
15119         Enum/Enum in operator + as well.
15120
15121 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15122
15123         * statement.cs:
15124                 - added support for switch(bool)
15125                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15126                 - add TableSwitchEmit() to handle table-based switch statements
15127
15128 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15129
15130         * expression.cs (Invocation.OverloadResolve): Factor out code which
15131         does parameter compatibility checking with arguments so that we can 
15132         re-use the code even from Delegate.VerifyApplicability
15133
15134         (VerifyArgumentsCompat): Move above code here.
15135
15136         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15137         and instead make a call to the above method.
15138
15139 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15140
15141         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15142         We use it to keep track of classes which are attribute types.
15143
15144 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15145
15146         * delegate.cs (Delegate.Define): Correctly define the types in the
15147         presence of fixed and array parameters.
15148
15149         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15150         doing FindMembers.
15151
15152         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15153         include NonPublic after the first iteration.
15154
15155         * class.cs (Indexer.CheckBase): Only check if both parents are
15156         non-null. 
15157
15158         * cs-parser.jay (accessor_body): If empty, set to null.
15159
15160         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15161         same code path here to resolve constants names that we did have in
15162         MemberAccess.DoResolve.  There is too much code duplicated here.
15163
15164 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15165
15166         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15167
15168         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15169         to MakeUnionSet.
15170
15171         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15172         tokens, numbers and strings.
15173
15174         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15175         parenthesis.
15176
15177         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15178         asyncronous parameters and the regular parameters.  
15179
15180         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15181         specify the target directory.
15182
15183         * expression.cs: (This.DoResolve): Simplify
15184         (As.Emit): Optimize, do not generate IsInst if the expression is
15185         always of the given type.
15186
15187         (Is.DoResolve): Bug fix, we were reporting both always/never for
15188         the is expression.
15189
15190         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15191         creating too many unnecessary arrays.
15192
15193 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15194
15195         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15196         fields instead of rolling our own initializer.   Takes care of all
15197         implicit conversions, and drops unnecessary static checks/argument.
15198
15199 2002-03-31  Dick Porter  <dick@ximian.com>
15200
15201         * driver.cs: use the GetDirectories() return values properly, and
15202         use "/" as path separator.
15203
15204 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15205
15206         * expression.cs (Unary): Optimize - - expr into expr.
15207         (Binary): Optimize a + (-b) into a -b.
15208
15209         * codegen.cs (CodeGen): Made all methods static.
15210
15211 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15212
15213         * rootcontext.cs: 
15214
15215         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15216         TypeBuilder property.
15217
15218         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15219         instead. 
15220
15221         * tree.cs: Removed the various RecordXXXX, and replaced with a
15222         single RecordDecl.  Removed all the accessor methods, and just
15223         left a single access point Type 
15224
15225         * enum.cs: Rename DefineEnum to DefineType.
15226
15227         * decl.cs: New abstract method `DefineType' used to unify the
15228         Defines for Enumerations, Interfaces, TypeContainers and
15229         Delegates.
15230
15231         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15232         LookupBaseClasses method that used to live in class.cs and
15233         interface.cs here, and renamed to FindType.
15234
15235         * delegate.cs: Implement DefineType.  Take advantage of the
15236         refactored pattern for locating the parent builder without taking
15237         the parent_builder argument (which we know does not work if we are
15238         nested, and triggering a toplevel definition).
15239
15240 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15241
15242         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15243         accessibility of a member has changed during override and report
15244         an error if so.
15245
15246         * class.cs (Method.Define, Property.Define): Only complain on
15247         overrides if the method is private, any other accessibility is
15248         fine (and since we just checked the permission is the same, we are
15249         good to go).
15250
15251         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15252         and elif are processed always.  The other pre-processing
15253         directives are only processed if we are "taking" the path
15254
15255 2002-03-29  Martin Baulig  <martin@gnome.org>
15256
15257         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15258         current location is not Null.
15259
15260         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15261         a separate method so we can profile it.
15262
15263         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15264         `span.Seconds' are just seconds, but no minutes or hours.
15265         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15266
15267 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15268
15269         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15270         Remove the gratuitous set of Final:
15271
15272                                 // If an interface implementation, then we can set Final.
15273                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15274                                     implementing.DeclaringType.IsInterface)
15275                                         flags |= MethodAttributes.Final;
15276
15277         I do not know what I was smoking when I used that.
15278
15279
15280         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15281         step into fixing the name resolution issues for delegates and
15282         unifying the toplevel name resolution.
15283
15284 2002-03-28  Martin Baulig  <martin@gnome.org>
15285
15286         * class.cs (Method.Emit): If we have a symbol writer, call its
15287         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15288         tell it about the current method.
15289
15290         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15291         writer that we're going to emit the first byte of IL code for a new
15292         statement (a new source line).
15293         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15294         EmitContext.Mark() before emitting any code.
15295
15296         * location.cs (SymbolDocument): Return null when we're Null.
15297
15298         * statement.cs (Statement): Moved the `Location loc' variable here.
15299         (Statement.EmitBoolExpression): If we have a symbol writer, call
15300         ec.Mark() before emitting any code to tell it that we're at the
15301         beginning of a new statement.
15302         (StatementExpression): Added `Location' argument to the constructor.
15303         (Block): Added public readonly variable `StartLocation' and public
15304         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15305         (Block): Added constructor which takes a start and end location.
15306         (Block.SetEndLocation): New method. This sets the end location.
15307         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15308         local variables we create.
15309         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15310         each statement and do also mark the begin and end of the block.
15311
15312         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15313         tell it the current lexer.Location, use Location.Null for the end of the
15314         block.
15315         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15316         current block, set its end location using SetEndLocation().
15317         (statement_expression): StatementExpression constructor now takes the
15318         lexer.Location as additional argument.
15319         (for_statement, declare_local_variables): Likewise.
15320         (declare_local_variables): When creating a new implicit block, use the
15321         new Block constructor and pass it the lexer.Location.
15322
15323 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15324
15325         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15326         members also on the parent interfaces recursively.
15327
15328 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15329
15330         * report.cs: Use new formats, since Gonzalo finished the missing
15331         bits. 
15332
15333         * expression.cs (Binary.ResolveOperator): added missing operator|
15334         operator& and operator^ for bool/bool.
15335
15336         * cs-parser.jay: CheckDef now takes a Location argument that is
15337         used to report errors more precisly (instead of reporting the end
15338         of a definition, we try to track something which is a lot closer
15339         to the source of the problem).
15340
15341         * cs-tokenizer.cs: Track global token use, so we can properly flag
15342         the use of #define/#undef after the first token has been seen.
15343
15344         Also, rename the reportXXXX to Error_DescriptiveName
15345
15346         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15347         TypeContainer, so that Enum and Interface can use this too.
15348
15349         * class.cs (TypeContainer.LookupInterfaceOrClass,
15350         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15351         `builder' argument.  Typically this was used to pass the parent
15352         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15353         the definition).  
15354
15355         The problem is that a nested class could trigger the definition of
15356         a toplevel class, and the builder would be obviously wrong in that
15357         case. 
15358
15359         So we drop this argument, and we compute dynamically the
15360         TypeBuilder/ModuleBuilder (the correct information was available
15361         to us anyways from DeclSpace.Parent)
15362
15363         * interface.cs (Interface.DefineInterface): Drop builder
15364         parameter cleanup like class.cs
15365
15366         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15367         like class.cs
15368
15369         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15370         values. 
15371
15372         (Try.Emit): Propagate the returns value from the statement.
15373
15374         (Return.Emit): Even if we are leavning 
15375
15376         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15377
15378         * modifiers.cs: Fix the computation of MethodAttributes flags.
15379
15380 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15381
15382         * driver.cs: allow compilation of files that start with '/'.
15383         Add a default case when checking the argument of --target.
15384
15385 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15386
15387         * interface.cs: Implement the same search algorithm for types in
15388         the interface code.
15389
15390         * delegate.cs: Do not allow multiple definition.
15391
15392         * Recovered ChangeLog that got accidentally amputated
15393
15394         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15395
15396         * rootcontext.cs: Load manually enum to allow core classes to
15397         contain enumerations.
15398
15399         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15400         Update to new static methods in TypeManager.
15401
15402         * typemanager.cs (GetMethod, GetConstructor): Use our
15403         implementation of FindMembers to find the members, since during
15404         corlib compilation, the types are TypeBuilders and GetMethod and
15405         GetConstructor do not work.
15406
15407         Make all methods in TypeManager static.
15408
15409         (InitCodeHelpers): Split the functionality from
15410         the InitCodeTypes function.
15411
15412         * driver.cs: Call InitCodeHelpers after we have populated the
15413         types. 
15414
15415         * cs-parser.jay (delegate_declaration): we did not used to compute
15416         the delegate name correctly for void delegates.
15417
15418 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * rootcontext.cs (RootContext): Init the interface_resolve_order
15421         and type_container_resolve_order always.
15422
15423         (ResolveCore, BootstrapCorlib_ResolveClass,
15424         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15425         compiler when compiling with --nostdlib
15426
15427         * class.cs (TypeContainer.DefineType): Check that our parent is
15428         not null.  This test is most important when we are bootstraping
15429         the core types.
15430
15431         * codegen.cs: Split out the symbol writing code.
15432
15433 2002-03-25  Martin Baulig  <martin@gnome.org>
15434
15435         * driver.cs (-g): Made -g an alias for --debug.
15436
15437 2002-03-24  Martin Baulig  <martin@gnome.org>
15438
15439         * codegen.cs (SymbolWriter): New public variable. Returns the
15440         current symbol writer.
15441         (CodeGen): Added `bool want_debugging_support' argument to the
15442          constructor. If true, tell the ModuleBuild that we want debugging
15443         support and ask it for the ISymbolWriter.
15444         (Save): If we have a symbol writer, call it's Close() method after
15445         saving the assembly.
15446
15447         * driver.c (--debug): New command line argument to create a
15448         debugger information file.
15449
15450         * location.cs (SymbolDocument): New public property. Returns an
15451         ISymbolDocumentWriter object for the current source file or null
15452         if we don't have a symbol writer.
15453
15454 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15455
15456         * driver.cs (LoadAssembly): Correctly return when all the paths
15457         have been tried and not before.
15458
15459         * statement.cs (Switch.Emit): return the actual coverage for this
15460         statement (returns/not-returns)
15461
15462         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15463         switch of the statement if we are the last switch section.  That
15464         kills two problems: try/catch problems (we used to emit an empty
15465         nop at the end) and switch statements where all branches would
15466         return. 
15467
15468 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15469
15470         * driver.cs: Add default assemblies (the equivalent to the
15471         Microsoft CSC.RSP file)
15472
15473         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15474         also update tokens_seen and set it to false.
15475
15476         * driver.cs: Implement --recurse for Mike.
15477
15478         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15479         correctly splitting out the paths.
15480
15481 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15482
15483         * interface.cs (Interface.PopulateProperty): Instead of using
15484         `parent' as the declaration space for the set parameters, use
15485         `this' 
15486
15487         * support.cs (InternalParameters): InternalParameters constructor
15488         takes a DeclSpace instead of a TypeContainer.
15489
15490         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15491         types are being initialized, load the address of it before calling
15492         the function.  
15493
15494         (New): Provide a mechanism to disable the generation of local
15495         value type temporaries when the caller will be providing us with
15496         an address to store it.
15497
15498         (ArrayCreation.EmitDynamicInitializers): Use it.
15499
15500 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15501
15502         * expression.cs (Invocation.EmitArguments): Only probe for array
15503         property if there is more than one argument.  Sorry about that.
15504
15505         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15506         empty param arrays.
15507
15508         * class.cs (Method.LabelParameters): Fix incorrect code path that
15509         prevented the `ParamArrayAttribute' from being applied to the
15510         params attribute.
15511
15512 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15513
15514         * support.cs (ReflectionParameters): Correctly compute whether the
15515         last argument is a params array.  Fixes the problem with
15516         string.Split ('a')
15517
15518         * typemanager.cs: Make the assemblies array always be non-null
15519         (empty, but non-null)
15520
15521         * tree.cs (RecordDecl): New function that abstracts the recording
15522         of names.  This reports error 101, and provides a pointer to the
15523         previous declaration.  Fixes a crash in the compiler.
15524
15525         * cs-parser.jay (constructor_declaration): Update to new grammar,
15526         and provide a constructor_body that can be empty.
15527
15528 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15529
15530         * driver.cs: Add support for --resources.
15531
15532         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15533         Make all types for the various array helper methods be integer.
15534
15535         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15536         CheckState to ConvCast.
15537
15538         (ConvCast): Now it takes a `checked' state argument, to avoid
15539         depending on the emit context for the conversion, and just using
15540         the resolve time setting.
15541
15542         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15543         instead of Invocation.EmitArguments.  We do not emit the original
15544         arguments, instead we emit those which have been converted to
15545         unsigned int expressions.
15546
15547         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15548
15549         * codegen.cs: ditto.
15550
15551         * expression.cs (LocalVariableReference): Drop the use of the
15552         Store function that depended on the variable index.
15553
15554         * statement.cs (VariableInfo): Drop the `Idx' property from this
15555         class, as this is not taking into account the indexes for
15556         temporaries tat we generate during the execution, getting the
15557         indexes wrong.
15558
15559         * class.cs: First emit class initializers, then call the parent
15560         constructor. 
15561
15562         * expression.cs (Binary): Fix opcode emision.
15563         (UnaryMutator.EmitCode): Support checked code generation
15564
15565         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15566         matches for events for both the Static and Instance scans,
15567         pointing to the same element.   Fix that.
15568
15569 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * rootcontext.cs (ResolveTree): Always set the
15572         interface_resolve_order, because nested interfaces will be calling
15573         into us.
15574
15575         * class.cs (GetInterfaceOrClass): Track the same resolution
15576         process used by TypeManager.LookupType.  This fixes the nested
15577         type lookups in class declarations (separate path from
15578         LookupType). 
15579
15580         (TypeContainer.DefineType): Also define nested interfaces.
15581         (TypeContainer.RegisterOrder): New public function used to
15582         register the order in which child interfaces need to be closed.
15583
15584         Nested interfaces need to be closed after their parents have been
15585         created. 
15586
15587         * interface.cs (InterfaceAttr): Put all the logic for computing
15588         the interface attribute here. 
15589
15590         (DefineInterface): Register our interface order with the
15591         RootContext or with the TypeContainer depending on the case.
15592
15593 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15594
15595         * cs-parser.jay: rework foreach statement to work with the new
15596         changes to the policy on SimpleNames.
15597
15598         * report.cs: support Stacktrace on warnings as well.
15599
15600         * makefile: drop --unsafe and /unsafe from the compile.
15601
15602 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15603
15604         * ecore.cs (StandardConversionExists): Modify to take an Expression
15605         as the first parameter. Ensure we do null -> reference type conversion
15606         checking.
15607
15608         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15609         temporary Expression objects.
15610
15611 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15612
15613         * interface.cs: workaround bug in method overloading resolution
15614         (there is already a bugzilla bug for it).
15615
15616 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15617
15618         We could also solve this problem by having a separate path for
15619         performing type lookups, instead of DoResolve, we could have a
15620         ResolveType entry point, and only participating pieces of the
15621         production (simplename, deref, array) would implement this. 
15622
15623         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15624         signal SimpleName to only resolve type names and not attempt to
15625         resolve anything else.
15626
15627         * expression.cs (Cast): Set the flag.
15628
15629         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15630
15631         * class.cs: Only report 108 if there is no `new' modifier.
15632
15633         * cs-parser.jay: rework foreach statement to work with the new
15634         changes to the policy on SimpleNames.
15635
15636         * report.cs: support Stacktrace on warnings as well.
15637
15638         * makefile: drop --unsafe and /unsafe from the compile.
15639
15640 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15643         lookups here, instead of doing that at parse time.  This means
15644         that our grammar will not introduce `LocalVariableReferences' as
15645         expressions at this point.  That solves the problem of code like
15646         this:
15647
15648         class X {
15649            static void Main ()
15650            { int X = 1;
15651             { X x = null }}}
15652
15653         This is only half the fix.  The full fix requires parameters to
15654         also be handled in this way.
15655
15656         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15657         makes the use more obvious of the DeclSpace.  The
15658         ec.TypeContainer.TypeBuilder is now only used to pull the
15659         TypeBuilder for it.
15660
15661         My theory is that I can get rid of the TypeBuilder completely from
15662         the EmitContext, and have typecasts where it is used (from
15663         DeclSpace to where it matters).  
15664
15665         The only pending problem is that the code that implements Aliases
15666         is on TypeContainer, and probably should go in DeclSpace.
15667
15668         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15669         lookups here, instead of doing that at parse time.  This means
15670         that our grammar will not introduce `LocalVariableReferences' as
15671         expressions at this point.  That solves the problem of code like
15672         this:
15673
15674         class X {
15675            static void Main ()
15676            { int X = 1;
15677             { X x = null }}}
15678
15679         This is only half the fix.  The full fix requires parameters to
15680         also be handled in this way.
15681
15682         * class.cs (Property.DefineMethod): When implementing an interface
15683         method, set newslot, when implementing an abstract method, do not
15684         set the flag (before we tried never setting it, or always setting
15685         it, which is the difference).
15686         (Indexer.DefineMethod): same.
15687         (Method.DefineMethod): same.
15688
15689         * ecore.cs: Only set the status used flag if we get back a Field.
15690
15691         * attribute.cs: Temporary hack, so Paolo can keep working.
15692
15693 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15694
15695         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15696         the unmanaged type in the case we have a MarshalAs attribute.
15697
15698         (Resolve): Handle the case when we are parsing the special MarshalAs
15699         attribute [we need to store the unmanaged type to use later]
15700
15701         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15702         MarshalAs Attribute.
15703
15704         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15705         on parameters and accordingly set the marshalling info.
15706
15707 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15708
15709         * class.cs: Optimizing slightly by removing redundant code after
15710         we switched to the `NoTypes' return value.
15711         (Property.DefineMethod): use NoTypes here too.
15712
15713         This fixes the bug I introduced in my last batch of changes.
15714
15715 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15716
15717         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15718
15719         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15720         Enums since those are types too. 
15721
15722         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15723
15724         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15725         thanks to a call during the lookup process.
15726
15727 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15728
15729         * statement.cs (Foreach): Lots of work to accomodate a particular
15730         kind of foreach statement that I had not kept in mind.  It is
15731         possible to have foreachs on classes that provide a GetEnumerator
15732         method that return objects that implement the "pattern" for using
15733         a foreach, there is no need to support GetEnumerator
15734         specifically. 
15735
15736         This is needed to compile nant.
15737
15738         * decl.cs: Only report 114 if the member is not `Finalize' and if
15739         the warning level is at least 2.
15740
15741         * class.cs: Moved the compare function from Method to
15742         MethodSignature. 
15743
15744         (MethodSignature.InheritableMemberSignatureCompare): Add new
15745         filter function that is used to extract inheritable methods from a
15746         class. 
15747
15748         (Method.Define): Use the new `inheritable_method_signature_filter'
15749         delegate
15750
15751         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15752         command. 
15753
15754 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15755
15756         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15757
15758         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15759
15760         * expression.cs: Pass location information to
15761         ConvertImplicitStandard. 
15762
15763         * class.cs: Added debugging code to track return values from
15764         interfaces. 
15765
15766 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15767
15768         * expression.cs (Is.DoResolve): If either side of the `is' is an
15769         interface, do not flag the warning.
15770
15771         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15772         for interfaces
15773
15774         * report.cs: Allow for --fatal to be used with --probe.
15775
15776         * typemanager.cs (NoTypes): Move the definition for the empty Type
15777         array here. 
15778
15779         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15780         properties. 
15781         (TypeContainer.DefineProxy): New function used to proxy to parent
15782         implementations when implementing interfaces.
15783         (TypeContainer.ParentImplements): used to lookup if our parent
15784         implements a public function that is required by an interface.
15785         (TypeContainer.VerifyPendingMethods): Hook this up.
15786
15787         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15788         `modules' and `assemblies' arraylists into arrays.  We only grow
15789         these are the very early start up of the program, so this improves
15790         the speedof LookupType (nicely measured).
15791
15792         * expression.cs (MakeByteBlob): Replaced unsafe code with
15793         BitConverter, as suggested by Paolo.
15794
15795         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15796         folding of string concatenation, but if either side is a string,
15797         and the other is not, then return null, and let the runtime use
15798         the concatenation on the string plus the object (using
15799         `Object.ToString'). 
15800
15801 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15802
15803         Constant Folding has been implemented now.
15804
15805         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15806         the error instead on types that are not supported in one's
15807         complement. 
15808
15809         * constant.cs (Constant and all children): New set of functions to
15810         perform implict and explicit conversions.
15811
15812         * ecore.cs (EnumConstant): Implement the new functions to perform
15813         conversion by proxying to the child expression.
15814
15815         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15816         own separate setting that can not be turned off from the command
15817         line using --unchecked or --checked and is only controlled using
15818         the checked/unchecked statements and expressions.  This setting is
15819         used by the constant folder to flag errors.
15820
15821         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15822         ConstantCheckState as well.   
15823
15824         During Resolve, they also have to flag the state, because the
15825         constant folder runs completely in the Resolve phase.
15826
15827         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15828         well.
15829
15830 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15831
15832         * cfold.cs: New file, this file contains the constant folder.
15833
15834         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15835         argument to track whether we are using the resulting address to
15836         load or store a value and provide better error messages. 
15837
15838         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15839         new AddressOf arguments.
15840
15841         * statement.cs (Foreach.EmitCollectionForeach): Update
15842
15843         * expression.cs (Argument.Emit): Call AddressOf with proper
15844         arguments to track usage.
15845
15846         (New.DoEmit): Call AddressOf with new arguments.
15847
15848         (Unary.Emit): Adjust AddressOf call.
15849
15850 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15851
15852         * cs-parser.jay (member_access): Change the case for pre-defined types
15853         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15854         this suggestion.
15855
15856         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15857         a method body.
15858
15859         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15860         essentially like methods and apply attributes like MethodImplOptions to them too.
15861
15862         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15863         not being null.
15864
15865         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15866         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15867         is the DeclSpace.
15868
15869         * Update code everywhere accordingly.
15870
15871         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15872
15873         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15874
15875 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15876
15877         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15878         try performing lookups against those instead of jumping straight into using
15879         the 'using' clauses.
15880
15881         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15882
15883         (LookupType): Perform lookups in implicit parents too.
15884
15885         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15886         sequence as RootContext.LookupType. 
15887
15888         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15889         the various cases of namespace lookups into this method.
15890
15891 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15892
15893         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15894         in positional arguments)
15895
15896         * class.cs (Operator): Update the AllowedModifiers to contain
15897         extern. 
15898
15899         * cs-parser.jay: Update operator declaration to allow for the
15900         operator body to be empty.
15901
15902         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15903         values. 
15904
15905 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * class.cs (Method.Emit): Label parameters.
15908
15909         * driver.cs: Return 1 or 0 as the program exit code.
15910
15911 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * expression.cs: Special case the `null' object when trying to
15914         auto-compute the type, as anything can be explicitly converted to
15915         that. 
15916
15917         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15918         spotting this Paolo.
15919
15920         (Expression.ImplicitNumericConversion): Perform comparissions of
15921         the type using the underlying type in the case of an enumeration
15922         rather than using the enumeration type for the compare.
15923
15924         Cope with the underlying == type case, which is not possible to
15925         catch before. 
15926
15927         (Expression.ConvertNumericExplicit): Perform comparissions of
15928         the type using the underlying type in the case of an enumeration
15929         rather than using the enumeration type for the compare.
15930
15931         * driver.cs: If the user does not supply an extension, assume .exe
15932
15933         * cs-parser.jay (if_statement): Rewrote so that we can track the
15934         location for the if statement.
15935
15936         * expression.cs (Binary.ConstantFold): Only concat strings when
15937         the operation is "+", not everything ;-)
15938
15939         * statement.cs (Statement.EmitBoolExpression): Take a location
15940         argument. 
15941         (If, While, Do): Track location.
15942
15943         * expression.cs (Binary.ResolveOperator): In the object + string
15944         case, I was missing a call to ConvertImplicit
15945
15946 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15947
15948         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15949         Location arguments. Ensure we use RootContext.LookupType to do our work
15950         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15951
15952         * interface.cs (PopulateMethod): Handle the type of the parameter being
15953         null gracefully.
15954
15955         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15956         have a params method with no fixed arguments and a call is made with no
15957         arguments.
15958
15959 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15960
15961         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15962         the verbatim-string-literal
15963
15964         * support.cs (InternalParameters.ParameterModifier): handle null
15965         fixed parameters.
15966         (InternalParameters.ParameterType): ditto.
15967
15968         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15969         duplicating the name of the variable parameter.
15970         (GetParameterByName): Fix bug where we were not looking up array
15971         paramters if they were the only present (thanks Paolo!).
15972         (GetParameterInfo): We only have an empty set of types if both
15973         fixed and array are set to null.
15974         (GetParameterInfo-idx): Handle FixedParameter == null
15975
15976         * cs-parser.jay: Handle the case where there is no catch
15977         statements (missing null test).
15978
15979 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15980
15981         * driver.cs (MainDriver): Be conservative on our command line
15982         handling.
15983
15984         Catch DirectoryNotFoundException when calling GetFiles.
15985
15986         (SplitPathAndPattern): Used to split the input specification into
15987         a path and a pattern that we can feed to Directory.GetFiles.
15988
15989 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * statement.cs (Fixed): Implement the last case of the Fixed
15992         statement (string handling).
15993
15994         * expression.cs (StringPtr): New class used to return a char * to
15995         a string;  Used by the Fixed statement.
15996
15997         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15998
15999         * expression.cs (Binary.ResolveOperator): Remove redundant
16000         MemberLookup pn parent type.
16001         Optimize union call, we do not need a union if the types are the same.
16002         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16003         type.
16004
16005         Specialize the use of MemberLookup everywhere, instead of using
16006         the default settings. 
16007
16008         (StackAlloc): Implement stackalloc keyword.
16009
16010         * cs-parser.jay: Add rule to parse stackalloc.
16011
16012         * driver.cs: Handle /h, /help, /?
16013
16014         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16015         before we supported unsafe code.
16016
16017         * makefile: add --unsafe to the self compilation of mcs.
16018
16019 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * expression.cs (PointerArithmetic): New class that is used to
16022         perform pointer arithmetic.
16023         (Binary.Resolve): Handle pointer arithmetic
16024         Handle pointer comparission.
16025         (ArrayPtr): Utility expression class that is used to take the
16026         address of an array.
16027
16028         (ElementAccess): Implement array access for pointers
16029
16030         * statement.cs (Fixed): Implement fixed statement for arrays, we
16031         are missing one more case before we are done.
16032
16033         * expression.cs (Indirection): Implement EmitAssign and set the
16034         ExprClass to Variable.  This allows pointer dereferences to be
16035         treated as variables, and to have values assigned to them.
16036
16037         * ecore.cs (Expression.StoreFromPtr): New utility function to
16038         store values dereferencing.
16039
16040 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16041
16042         * expression.cs (Binary.ResolveOperator): Ensure that we are
16043         not trying to operate on a void type - this fixes the reported
16044         bug.
16045
16046         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16047         the parent implementation is sealed.
16048
16049         * ../errors/cs0239.cs : Add.
16050
16051         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16052
16053         * typemanager.cs (unverifiable_code_type): Corresponds to 
16054         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16055         which have unsafe code in them.
16056
16057         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16058         unsafe context.
16059
16060 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * cs-tokenizer.cs: Add support for @"litreal strings"
16063
16064         Make tokenizer accept pre-processor directives
16065         on any column (remove the old C-like limitation). 
16066
16067         * rootcontext.cs (EmitCode): Emit any global attributes.
16068         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16069
16070         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16071
16072         * cs-parser.jay: Add support for global attributes.  
16073
16074 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * expression.cs (Indirection): New helper class.  Unary will
16077         create Indirection classes to be able to implement the
16078         IMemoryLocation interface on it.
16079
16080 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16081
16082         * cs-parser.jay (fixed_statement): reference the right statement.
16083
16084         * statement.cs (Fixed.Emit): Finish implementing the fixed
16085         statement for the &x case.
16086
16087 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16088
16089         * class.cs (Property.Define, Method.Define): Remove newslot when
16090         `implementing'.  
16091
16092         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16093         wrong.  NewSlot should only be used if the `new' keyword is present.
16094
16095         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16096         locating our system dir.  Sorry about this.
16097
16098 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16099
16100         * driver.cs (GetSystemDir): Compute correctly the location of our
16101         system assemblies.  I was using the compiler directory instead of
16102         the library directory.
16103
16104 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16105
16106         * expression.cs (BetterFunction): Put back in what Miguel commented out
16107         since it is the correct fix. The problem is elsewhere ;-)
16108
16109         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16110         parameters of the parms method are themselves compatible or not !
16111
16112         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16113         to check that a class implements an interface before saying that an implicit
16114         conversion was allowed. Use ImplementsInterface to do the checking.
16115
16116 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16117
16118         * class.cs (Method.Define): Track whether we are an explicit
16119         implementation or not.  And only call DefineMethodOverride if we
16120         are an explicit implementation.
16121
16122         (Property.DefineMethod): Ditto.
16123
16124 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16125
16126         * expression.cs (BetterFunction): Catch hideous bug which was
16127          preventing us from detecting ambiguous calls due to implicit casts i.e
16128         cs0121.
16129
16130 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16131
16132         * support.cs (Pair): Remove un-needed method.  I figured why I was
16133         getting the error in cs-parser.jay, the variable in a foreach loop
16134         is readonly, and the compiler does not really treat this as a variable.
16135
16136         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16137         instead of EQUALS in grammar.  
16138
16139         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16140
16141         * expression.cs (Unary.DoResolve): Check whether the argument is
16142         managed or not.
16143
16144 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16145
16146         * support.cs: Api for Pair to set a value.  Despite the fact that
16147         the variables are public the MS C# compiler refuses to compile
16148         code that accesses the field if the variable is part of a foreach
16149         statement. 
16150
16151         * statement.cs (Fixed): Begin implementation of the fixed
16152         statement.
16153
16154         (Block.AddVariable): Return the VariableInfo on success and null
16155         on failure instead of true/false. 
16156
16157         * cs-parser.jay (foreach): Catch errors on variables already
16158         defined (we were ignoring this value before) and properly unwind
16159         the block hierarchy
16160
16161         (fixed_statement): grammar for the fixed statement.
16162
16163 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16164
16165         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16166         pointer types to be incretemented.
16167
16168         (SizeOf): Implement.
16169
16170         * cs-parser.jay (pointer_member_access): Implement
16171         expr->IDENTIFIER production.
16172
16173         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16174         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16175         on safe contexts.
16176
16177         (Unary): Implement indirection.
16178
16179         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16180         use in non-unsafe context).
16181
16182         (SimpleName.DoResolve): Check for pointers in field access on safe
16183         contexts. 
16184
16185         (Expression.LoadFromPtr): Factor the load-indirect code in this
16186         function.  This was duplicated in UnboxCast and ParameterReference
16187
16188 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16189
16190         * expression.cs (ComposedCast): report an error if a pointer cast
16191         is used in a safe region.
16192
16193         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16194         pointer type casts in unsafe context.
16195
16196         * codegen.cs (EmitContext): Set up IsUnsafe.
16197
16198         * cs-parser.jay (non_expression_type): Add productions for pointer
16199         casts. 
16200
16201         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16202         code.  We should not use force into static mode if the method is
16203         not virtual.  Fixes bug in MIS
16204
16205         * statement.cs (Do.Emit, While.Emit, For.Emit,
16206         Statement.EmitBoolExpression): Add support to Do and While to
16207         propagate infinite loop as `I do return' semantics.
16208
16209         Improve the For case to also test for boolean constants.
16210
16211         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16212         to the list of attributes we can add.
16213
16214         Remove `EmitContext' argument.
16215
16216         * class.cs (Method.Define): Apply parameter attributes.
16217         (Constructor.Define): Apply parameter attributes.
16218         (MethodCore.LabelParameters): Move here the core of labeling
16219         parameters. 
16220
16221         * support.cs (ReflectionParameters.ParameterModifier,
16222         InternalParameters.ParameterModifier): Use IsByRef on the type and
16223         only return the OUT bit for these parameters instead of in/out/ref
16224         flags.
16225
16226         This is because I miss-understood things.  The ParameterInfo.IsIn
16227         and IsOut represent whether the parameter has the [In] and [Out]
16228         attributes set.  
16229
16230 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * ecore.cs (FieldExpr.Emit): Release temporaries.
16233
16234         * assign.cs (LocalTemporary.Release): new function.
16235
16236         * codegen.cs (EmitContext.GetTemporaryStorage,
16237         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16238         temporary storage.  Now we can "put back" localbuilders when we
16239         are done with them
16240
16241 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16242
16243         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16244         need to make a copy of the variable to generate verifiable code.
16245
16246 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16247
16248         * driver.cs: Compute dynamically the system directory.
16249
16250         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16251         Slower, but more generally useful.  Used by the abstract
16252         registering implementation. 
16253
16254         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16255         the rules for the special rule on Type/instances.  First check if
16256         we have the same name, and if so, try that special static path
16257         rather than the instance path.
16258
16259 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16260
16261         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16262         for, while and if.
16263
16264         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16265         Enum, ValueType, Delegate or Array for non-corlib compiles.
16266
16267         * cs-tokenizer.cs: Catch long identifiers (645)
16268
16269         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16270         piece of code.
16271
16272         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16273         fix, we were returning too early, so we were not registering
16274         pending methods from abstract classes.
16275
16276         Do not register pending methods if the class is abstract.
16277
16278         * expression.cs (Conditional.DoResolve): Report circular implicit
16279         conversions when we neecd to compute it for conditional
16280         expressions. 
16281
16282         (Is.DoResolve): If the expression is always of the provided type,
16283         flag warning 183.  If the expression can not ever be of the
16284         provided type flag warning 184.
16285
16286         * class.cs: Catch 169 as well.
16287
16288         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16289         read. 
16290
16291 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16292
16293         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16294
16295 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * interface.cs: (PopulateMethod): Check for pointers being defined
16298         only if the unsafe context is active.
16299         (PopulateProperty): ditto.
16300         (PopulateIndexer): ditto.
16301
16302         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16303         specified.  If pointers are present, make sure that they are
16304         present in an unsafe context.
16305         (Constructor, Constructor.Define): ditto.
16306         (Field, Field.Define): ditto.
16307         (Property, Property.Define): ditto.
16308         (Event, Event.Define): ditto.
16309
16310         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16311         hashtable if there are classes or structs defined.
16312
16313         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16314         code, as the constant resolution moved.
16315
16316         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16317         the metadata, so we can flag error 133. 
16318
16319         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16320         pointer is being declared in an unsafe context.
16321
16322 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16323
16324         * modifiers.cs (Modifiers.Check): Require a Location argument.
16325         Report error 227 for Unsafe use.
16326
16327         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16328
16329         * statement.cs (For.Emit): If the test is null, then report that
16330         we do `return', as we wont reach anything afterwards.
16331
16332         (Switch.SwitchGoverningType): Track the expression that matched
16333         the conversion.
16334
16335         * driver.cs: Allow negative numbers as an error code to flag.
16336
16337         * cs-parser.jay: Handle 1551.
16338
16339         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16340
16341 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * cs-parser.jay: Report 1518 (type declaration can only contain
16344         class, struct, interface, enum or delegate)
16345
16346         (switch_label): Report 1523 (keywords `case' or `default' must
16347         preced code)
16348
16349         (opt_switch_sections): Report 1522 (empty switch)
16350
16351         * driver.cs: Report 1515 (response file specified multiple times)
16352         Report 1516 (Source file specified multiple times).
16353
16354         * expression.cs (Argument.Resolve): Signal 1510
16355
16356         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16357         access not allowed in static code)
16358
16359 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16360
16361         * typemanager.cs (IsPointerType): Utility method which we are going
16362         to need a lot.
16363
16364         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16365         the object type, so we take care of that.
16366
16367         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16368
16369         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16370         added to non-params parameters :-)
16371
16372         * typemanager.cs (CSharpName): Include 'void' type too. 
16373
16374         (void_ptr_type): Include in the set of core types.
16375
16376         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16377         duplicating code.
16378
16379         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16380         an unsafe context.
16381
16382         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16383         completely forgotten about it.
16384
16385 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16386
16387         * cs-parser.jay (pointer_type): Add. This begins our implementation
16388         of parsing rules for unsafe code.
16389
16390         (unsafe_statement): Implement.
16391
16392         (embedded_statement): Modify to include the above.
16393
16394         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16395
16396         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16397         if the current context is an unsafe one.
16398
16399         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16400         are handled differently, we need separate rules for them.
16401
16402         (local_variable_declaration): Update to use local_variable_pointer_type
16403         to allow variable declarations of unmanaged pointer types.
16404
16405         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16406         in unsafe contexts.
16407
16408         * ../errors/cs0214.cs : Add.
16409
16410 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16411
16412         * makefile: remove 'response' file when cleaning.
16413
16414 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16415
16416         * cs-parser.jay: Report 1524.
16417
16418 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16419
16420         * typemanager.cs (RegisterMethod): drop checking if we have
16421         registered this from here
16422
16423 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16424
16425         * class.cs (Method.EmitDestructor): Implement calling our base
16426         destructor. 
16427
16428         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16429         value of InFinally.
16430
16431         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16432         this routine and will wrap the call in a try/catch block.  Deal
16433         with the case.
16434
16435 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16436
16437         * ecore.cs (Expression.MemberLookup): instead of taking a
16438         parameter `same_type' that was used to tell whether we could
16439         access private members we compute our containing type from the
16440         EmitContext.
16441
16442         (FieldExpr): Added partial support for volatile fields.  This does
16443         not work for volatile fields exposed from assemblies, as I can not
16444         figure out how to extract the modreq from it.
16445
16446         Updated all the source files to use this.
16447
16448         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16449         because it is referenced by MemberLookup very often. 
16450
16451 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16452
16453         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16454         TypeBuilder.GetCustomAttributes to retrieve what we need.
16455
16456         Get rid of redundant default_member_attr_type as this is the same as
16457         default_member_type which already exists.
16458
16459         * interface.cs, attribute.cs : Update accordingly.
16460
16461 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16462
16463         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16464         work for TYpeBuilders though.  Ravi, can you please fix this?
16465
16466         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16467
16468         * expression.cs (Argument.Emit): Handle the case of ref objects
16469         being passed to ref functions;  
16470
16471         (ParameterReference.EmitLoad): Loads the content of the pointer
16472         without dereferencing.
16473
16474 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16477
16478 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16479
16480         * class.cs (Indexer.DefineMethod): Incorporate the interface
16481         type in the name of the method if we are doing explicit interface
16482         implementation.
16483
16484         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16485
16486         (BetterConversion): Fix extremely trivial bug where we were referring to
16487         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16488         again !
16489
16490         * ../errors/bug16.cs : Add although we have fixed it.
16491
16492 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16493
16494         * expression.cs (BaseIndexer): Begin implementation.
16495
16496         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16497
16498         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16499         production directly to remove a shift/reduce, and implement
16500         explicit interface implementation.
16501
16502         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16503         after a floating point suffix.
16504
16505         * expression.cs (DoNumericPromotions): Improved the conversion for
16506         uint/uint.  If we have a constant, we avoid doing a typecast to a
16507         larger type.
16508
16509         * class.cs (Indexer): Implement explicit interface implementation
16510         for indexers.
16511
16512 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16513
16514         * class.cs: make the default instance constructor public and hidebysig.
16515
16516 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16517
16518         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16519         so we can call it from elsewhere.
16520
16521         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16522         we emit it internally if the class has a defined indexer; otherwise the user
16523         emits it by decorating the class definition with the DefaultMemberAttribute.
16524
16525         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16526         attribute is not used on a type which defines an indexer.
16527
16528         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16529         character when we skip whitespace.
16530
16531         * ../errors/cs0646.cs : Add.
16532
16533 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16534
16535         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16536         again. 
16537
16538         * makefile: Add practical target `mcs3.exe' which builds the third
16539         generation compiler. 
16540
16541         * expression.cs (New): Fix structures constructor calling.
16542
16543         * class.cs (Property, Method, Indexer): Emit Final flag on the
16544         method if we are an interface implementation and we are not
16545         abstract. 
16546
16547         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16548         whether this property is referencing a `base' method.
16549
16550         * expression.cs (Invocation.EmitCall): take an extra argument:
16551         is_base, this is used to determine whether the `call' or
16552         `callvirt' opcode should be used.
16553
16554
16555         * delegate.cs: update EmitCall.
16556
16557         * class.cs (Method.Define): Set NewSlot for the cases where we are
16558         not implementing an interface method.
16559
16560         (Property.Define): ditto.
16561
16562 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16563
16564         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16565         'r'.  Allows mcs to parse itself fully.
16566
16567 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16568
16569         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16570         of the number of initializers that require the InitializeArray method.
16571
16572         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16573         update the above field where necessary.
16574
16575         (MakeByteBlob): Update accordingly.
16576
16577         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16578         greater than 2.
16579
16580         (EmitDynamicInitializers): Update in accordance with the new optimization.
16581
16582         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16583         same OpCode applies.
16584
16585         * cs-parser.jay : Fix some glaring errors I introduced.
16586
16587 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16588
16589         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16590         so that we can check for name clashes there too.
16591
16592         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16593         for interface indexers.
16594
16595         * interfaces.cs (Define): Emit the default member attribute.
16596
16597         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16598         variable was being referred to while setting the value ;-)
16599
16600 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16601
16602         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16603         byte-by-byte information when we know the data is zero.
16604
16605         Make the block always a multiple of 4, because
16606         DefineInitializedData has a bug.
16607
16608         * assign.cs: Fix, we should assign from the temporary, not from
16609         the source. 
16610
16611         * expression.cs (MakeByteBlob): Fix my incorrect code.
16612
16613 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16614
16615         * typemanager.cs (EnumToUnderlying): This function is used to get
16616         the underlying type from an enumeration, because it does not
16617         always work. 
16618
16619         * constant.cs: Use the I4_S form for values between -128 and 127.
16620
16621         * statement.cs (Block.LookupLabel): Looks up a label.
16622         (Block): Drop support for labeled blocks.
16623
16624         (LabeledStatement): New kind of statement that represents a label
16625         only.
16626
16627         (Goto): Finally implement this bad boy.
16628
16629         * cs-parser.jay: Update to reflect new mechanism to implement
16630         labels.
16631
16632 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16633
16634         * codegen.cs (EmitContext.This): a codegen property that keeps the
16635         a single instance of this instead of creating many different this
16636         instances. 
16637
16638         * delegate.cs (Delegate.DoResolve): Update to use the property;
16639
16640         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16641
16642         * expression.cs (BaseAccess.DoResolve): Ditto.
16643
16644 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16645
16646         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16647         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16648
16649         (InitCoreTypes): Update accordingly.
16650
16651         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16652         so we can quickly store the state.
16653
16654         (ApplyAttributes): Set the correct implementation flags
16655         for InternalCall methods.
16656
16657 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16658
16659         * expression.cs (EmitCall): if a method is not virtual, then do
16660         not use callvirt on it.
16661
16662         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16663         user defined stuff) requires the use of stobj, which takes an
16664         address on the stack instead of an array and an index.  So emit
16665         the Ldelema operation for it.
16666
16667         (EmitStoreOpcode): Use stobj for valuetypes.
16668
16669         (UnaryMutator.EmitCode): Use the right 1 value depending on
16670         whether we are dealing with int64/uint64, float or doubles.
16671
16672         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16673         constructors that I implemented last night.
16674
16675         (Constructor.IsDefault): Fix to work properly for static
16676         constructors.
16677
16678         * cs-parser.jay (CheckDef): report method signature errors.
16679         Update error number 103 to be 132.
16680
16681         * decl.cs: New AdditionResult enumeration value: MethodExists.
16682         Although we do this check for methods later on in the semantic
16683         analysis, catching repeated default constructors is so easy that
16684         we catch these here. 
16685
16686         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16687         promotions code.
16688
16689         (ParameterReference.EmitAssign, Emit): handle
16690         bools as bytes.
16691
16692         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16693         (ArrayAccess.EmitStoreOpcode): ditto.
16694
16695         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16696
16697         * expression.cs (MakeByteBlob): Complete all the missing types
16698         (uint, short, ushort, byte, sbyte)
16699
16700         * class.cs: Only init instance field initializers on instance
16701         constructors. 
16702
16703         Rename `constructors' to instance_constructors. 
16704
16705         (TypeContainer.AddConstructor): Only add constructors to the list
16706         if it is not static.
16707
16708         Make sure that we handle default_static_constructor independently
16709         everywhere where we handle instance_constructors
16710
16711 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16712
16713         * class.cs: Do not lookup or create a base initializer for a
16714         static constructor.
16715
16716         (ConstructorInitializer.Resolve): use the proper type to lookup
16717         for constructors.
16718
16719         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16720
16721         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16722         in DeclSpace. 
16723
16724         * decl.cs: CloseType is now an virtual method, the default
16725         implementation just closes this type.
16726
16727 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16728
16729         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16730         to PreserveSig by default. Also emit HideBySig on such methods.
16731
16732         Basically, set the defaults to standard values.
16733
16734         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16735         argument, if candidate is better, it can't be worse than the best !
16736
16737         (Invocation): Re-write bits to differentiate between methods being
16738         applicable in their expanded form and their normal form - for params
16739         methods of course.
16740
16741         Get rid of use_standard everywhere as only standard conversions are allowed
16742         in overload resolution. 
16743
16744         More spec conformance.
16745
16746 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16747
16748         * driver.cs: Add --timestamp, to see where the compiler spends
16749         most of its time.
16750
16751         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16752         `this' in static code.
16753
16754         (SimpleName.DoResolve): Implement in terms of a helper function
16755         that allows static-references to be passed upstream to
16756         MemberAccess.
16757
16758         (Expression.ResolveWithSimpleName): Resolve specially simple
16759         names when called by MemberAccess to implement the special
16760         semantics. 
16761
16762         (Expression.ImplicitReferenceConversion): Handle conversions from
16763         Null to reference types before others, as Null's type is
16764         System.Object. 
16765
16766         * expression.cs (Invocation.EmitCall): Handle the special case of
16767         calling methods declared on a reference type from a ValueType
16768         (Base classes System.Object and System.Enum)
16769
16770         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16771         the left hand side is a TypeExpr, not on every enumeration. 
16772
16773         (Binary.Resolve): If types are reference types, then do a cast to
16774         object on operators != and == of both arguments.
16775
16776         * typemanager.cs (FindMembers): Extract instance and static
16777         members if requested.
16778
16779         * interface.cs (PopulateProperty): Use void_type instead of null
16780         as the return type for the setter method.
16781
16782         (PopulateIndexer): ditto.
16783
16784 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16785
16786         * support.cs (ReflectionParameters): Fix minor bug where we
16787         were examining the wrong parameter for the ParamArray attribute.
16788
16789         Cope with requests for the type of the parameter at position
16790         greater than the params parameter's. We now return the element
16791         type of the params array as that makes more sense.
16792
16793         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16794         accordingly as we no longer have to extract the element type
16795         ourselves.
16796
16797         (Invocation.OverloadResolve): Update.
16798
16799 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16800
16801         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16802         against IEnumerator, test whether the return value is a descendant
16803         of the IEnumerator interface.
16804
16805         * class.cs (Indexer.Define): Use an auxiliary method to implement
16806         the other bits of the method definition.  Begin support for
16807         explicit interface implementation.
16808
16809         (Property.DefineMethod): Use TypeManager.void_type instead of null
16810         for an empty return value.
16811
16812 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16813
16814         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16815         dealing with a FieldExpr which is composed of a FieldBuilder, in
16816         the code path we did extract the constant, but we should have
16817         obtained the underlying value to be able to cast it (otherwise we
16818         end up in an infinite loop, this is what Ravi was running into).
16819
16820         (ArrayCreation.UpdateIndices): Arrays might be empty.
16821
16822         (MemberAccess.ResolveMemberAccess): Add support for section
16823         14.5.4.1 that deals with the special case of E.I when E is a type
16824         and something else, that I can be a reference to a static member.
16825
16826         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16827         handle a particular array type to create byte blobs, it is just
16828         something we dont generate byteblobs for.
16829
16830         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16831         arguments. 
16832
16833         * location.cs (Push): remove the key from the hashtable that we
16834         are about to add.   This happens for empty files.
16835
16836         * driver.cs: Dispose files after we have parsed them.
16837
16838         (tokenize): new function that only runs the tokenizer on its
16839         input, for speed testing.
16840
16841 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16842
16843         * class.cs (Event.Define): Define the private field only if there
16844         are no accessors defined.
16845
16846         * expression.cs (ResolveMemberAccess): If there is no associated
16847         field with the event, that means we have an event defined with its
16848         own accessors and we should flag error cs0070 since transforming
16849         ourselves into a field is not valid in that case.
16850
16851         * ecore.cs (SimpleName.DoResolve): Same as above.
16852
16853         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16854         and charset to sane values.
16855
16856 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16857
16858         * assign.cs (DoResolve): Perform check on events only if they 
16859         are being accessed outside the declaring type.
16860
16861         * cs-parser.jay (event_declarations): Update rules to correctly
16862         set the type of the implicit parameter etc.
16863
16864         (add_accessor, remove_accessor): Set current local parameters.
16865
16866         * expression.cs (Binary): For delegate addition and subtraction,
16867         cast the return value from the method into the appropriate delegate
16868         type.
16869
16870 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16871
16872         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16873         of these as the workaround is unnecessary.
16874
16875         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16876         delegate data - none of that is needed at all.
16877
16878         Re-write bits to extract the instance expression and the delegate method
16879         correctly.
16880
16881         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16882         on delegates too.
16883
16884         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16885         of attaching attributes instead of duplicating code everywhere.
16886
16887         * everywhere : Update code to do attribute emission using the above method.
16888
16889 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16890
16891         * expression.cs (IsParamsMethodApplicable): if there are not
16892         parameters, return immediately.
16893
16894         * ecore.cs: The 0 literal can be implicity converted to an enum
16895         type. 
16896
16897         (SimpleName.DoResolve): First lookup the type, then lookup the
16898         members. 
16899
16900         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16901         want to get its address.  If the InstanceExpression is not
16902         addressable, store the result in a temporary variable, then get
16903         the address of it.
16904
16905         * codegen.cs: Only display 219 errors on warning level or above. 
16906
16907         * expression.cs (ArrayAccess): Make it implement the
16908         IMemoryLocation interface.
16909
16910         (Binary.DoResolve): handle the operator == (object a, object b)
16911         and operator != (object a, object b) without incurring into a
16912         BoxedCast (because 5 != o should never be performed).
16913
16914         Handle binary enumerator operators.
16915
16916         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16917         value type, otherwise use Ldelem_ref.
16918
16919         Use precomputed names;
16920
16921         (AddressOf): Implement address of
16922
16923         * cs-parser.jay (labeled_statement): Fix recursive block
16924         addition by reworking the production.
16925
16926         * expression.cs (New.DoEmit): New has a special case:
16927                 
16928                  If we are dealing with a ValueType, we have a few
16929                  situations to deal with:
16930                 
16931                     * The target of New is a ValueType variable, that is
16932                       easy, we just pass this as the variable reference
16933                 
16934                     * The target of New is being passed as an argument,
16935                       to a boxing operation or a function that takes a
16936                       ValueType.
16937                 
16938                       In this case, we need to create a temporary variable
16939                       that is the argument of New.
16940
16941
16942 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16943
16944         * rootcontext.cs (LookupType): Check that current_type is not null before
16945         going about looking at nested types.
16946
16947         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16948         not implement the IAssignMethod interface any more.
16949
16950         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16951         where we tranform them into FieldExprs if they are being resolved from within
16952         the declaring type.
16953
16954         * ecore.cs (SimpleName.DoResolve): Do the same here.
16955
16956         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16957
16958         * ../errors/bug10.cs : Add.
16959
16960         * ../errors/cs0070.cs : Add.
16961
16962         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16963
16964         * assign.cs : Get rid of EventIsLocal everywhere.
16965
16966 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16967
16968         * ecore.cs (ConvertIntLiteral): finished the implementation.
16969
16970         * statement.cs (SwitchLabel): Convert the value we are using as a
16971         key before looking up the table.
16972
16973 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16974
16975         * codegen.cs (EmitTopBlock): Require a Location argument now.
16976
16977         * cs-parser.jay (constructor_declarator): We need to setup
16978         current_local_parameters before we parse the
16979         opt_constructor_initializer, to allow the variables to be bound
16980         to the constructor arguments.
16981
16982         * rootcontext.cs (LookupType): First lookup nested classes in our
16983         class and our parents before we go looking outside our class.
16984
16985         * expression.cs (ConstantFold): Extract/debox the values at the
16986         beginnning. 
16987
16988         * rootcontext.cs (EmitCode): Resolve the constants first before we
16989         resolve the types.  This is not really needed, but it helps debugging.
16990
16991         * statement.cs: report location.
16992
16993         * cs-parser.jay: pass location to throw statement.
16994
16995         * driver.cs: Small bug fix.
16996
16997         * report.cs: Updated format to be 4-zero filled digits.
16998
16999 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17000
17001         * expression.cs (CheckIndices): Fix minor bug where the wrong
17002         variable was being referred to ;-)
17003
17004         (DoEmit): Do not call EmitStaticInitializers when the 
17005         underlying type is System.Object.
17006
17007 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17008
17009         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17010         and do the usual workaround for SRE.
17011
17012         * class.cs (MyEventBuilder.EventType): New member to get at the type
17013         of the event, quickly.
17014
17015         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17016
17017         * assign.cs (Assign.DoResolve): Handle the case when the target
17018         is an EventExpr and perform the necessary checks.
17019
17020         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17021         interface.
17022
17023         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17024
17025         (EventExpr): Set the type in the constructor itself since we 
17026         are meant to be born fully resolved.
17027
17028         (EventExpr.Define): Revert code I wrote earlier.
17029                 
17030         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17031         instance expression is null. The instance expression is a This in that case
17032         or a null, depending on whether it is a static method or not.
17033
17034         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17035         refers to more than one method.
17036
17037         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17038         and accordingly flag errors.
17039
17040 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17041
17042         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17043
17044 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17045
17046         * location.cs (ToString): Provide useful rutine.
17047
17048 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17051         objects, return the actual integral boxed.
17052
17053         * statement.cs (SwitchLabel): define an ILLabel for each
17054         SwitchLabel. 
17055
17056         (Switch.CheckSwitch): If the value is a Literal, extract
17057         the underlying literal.
17058
17059         Also in the unused hashtable we had, add the SwitchLabel so we can
17060         quickly look this value up.
17061
17062         * constant.cs: Implement a bunch of new constants.  Rewrite
17063         Literal based on this.  Made changes everywhere to adapt to this.
17064
17065         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17066         dereferencing array only once, and also copes with enumrations.
17067
17068         bytes are two bytes wide, not one.
17069
17070         (Cast): Perform constant conversions.
17071
17072         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17073         wrappers to the literals here.
17074
17075         * expression.cs (DoNumericPromotions): long literals can converted
17076         to ulong implicity (this is taken care of elsewhere, but I was
17077         missing this spot).
17078
17079         * ecore.cs (Expression.Literalize): Make the return type Literal,
17080         to improve type checking.
17081
17082         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17083
17084 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * literal.cs: Revert code from ravi that checked the bounds.  The
17087         bounds are sane by the definition of the type itself. 
17088
17089         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17090         need to actually look up in our parent hierarchy for interfaces
17091         implemented. 
17092
17093         * const.cs: Use the underlying type for enumerations
17094
17095         * delegate.cs: Compute the basename for the delegate creation,
17096         that should fix the delegate test case, and restore the correct
17097         Type Lookup semantics in rootcontext
17098
17099         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17100         referencing a nested type with the Reflection API is using the "+"
17101         sign. 
17102
17103         * cs-parser.jay: Do not require EOF token at the end.
17104
17105 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17106
17107         * rootcontext.cs (LookupType): Concatenate type names with
17108         a '.' instead of a '+' The test suite passes again.
17109
17110         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17111         field of the enumeration.
17112
17113         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17114         the case when the member is an EventExpr.
17115
17116         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17117         static has an associated instance expression.
17118
17119         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17120
17121         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17122
17123         * class.cs (Event.Define): Register event and perform appropriate checks
17124         for error #111.
17125
17126         We define the Add and Remove methods even if the use provides none because
17127         in that case, we provide default implementations ourselves.
17128
17129         Define a private field of the type of the event. This is done by the CSC compiler
17130         and we should be doing it too ;-)
17131
17132         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17133         More methods we use in code we generate.
17134
17135         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17136         is important.
17137
17138         (InitCoreTypes): Update accordingly for the above.
17139
17140         * class.cs (Event.Emit): Generate code for default accessors that we provide
17141
17142         (EmitDefaultMethod): Do the job in the above.
17143
17144         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17145         appropriate place.
17146
17147 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17148
17149         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17150         builders even if we were missing one.
17151
17152         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17153         pass the Basename as our class name instead of the Name.  The
17154         basename will be correctly composed for us.
17155
17156         * parameter.cs (Paramters): Now takes a Location argument.
17157
17158         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17159         make all the code call directly LookupType in RootContext and take
17160         this chance to pass the Location information everywhere.
17161
17162         * Everywhere: pass Location information.
17163
17164 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17165
17166         * class.cs (Constructor.Define): Updated way of detecting the
17167         length of the parameters.
17168
17169         (TypeContainer.DefineType): Use basename as the type name for
17170         nested types.
17171
17172         (TypeContainer.Define): Do not recursively define types here, as
17173         definition is taken care in order by the RootContext.
17174
17175         * tree.cs: Keep track of namespaces in a per-file basis.
17176
17177         * parameter.cs (Parameter.ComputeSignature): Update to use
17178         DeclSpace. 
17179
17180         (Parameters.GetSignature): ditto.
17181
17182         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17183         instead of a TypeContainer.
17184
17185         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17186         resolve names.  Because we need to be resolve in our context, not
17187         our parents.
17188
17189         * driver.cs: Implement response files.
17190
17191         * class.cs (TypeContainer.DefineType): If we are defined, do not
17192         redefine ourselves.
17193
17194         (Event.Emit): Emit the code for add/remove handlers.
17195         (Event.Define): Save the MethodBuilders for add/remove.
17196
17197         * typemanager.cs: Use pair here too.
17198
17199         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17200         DictionaryEntry requires the first argument to be non-null.  
17201
17202         (enum_declaration): Compute full name for registering the
17203         enumeration.
17204
17205         (delegate_declaration): Instead of using
17206         formal_parameter_list, use opt_formal_parameter_list as the list
17207         can be empty.
17208
17209         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17210         (EventParsing): New property that controls whether `add' and
17211         `remove' are returned as tokens or identifiers (for events);
17212
17213 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17214
17215         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17216         use MyEventBuilder only and let it wrap the real builder for us.
17217
17218         (MyEventBuilder): Revamp constructor etc.
17219
17220         Implement all operations that we perform on EventBuilder in precisely the same
17221         way here too.
17222
17223         (FindMembers): Update to use the EventBuilder member.
17224
17225         (Event.Emit): Update accordingly.
17226
17227 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17228
17229         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17230         by calling the appropriate methods.
17231
17232         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17233         useful.
17234
17235         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17236
17237 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17238
17239         * delegate.cs (Delegate.Populate): Check that the return type
17240         and various parameters types are indeed accessible.
17241
17242         * class.cs (Constructor.Define): Same here.
17243
17244         (Field.Define): Ditto.
17245
17246         (Event.Define): Ditto.
17247
17248         (Operator.Define): Check that the underlying Method defined itself
17249         correctly - so it's MethodBuilder should not be null.
17250
17251         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17252         expression happens to be null.
17253
17254         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17255         members but as of now we don't seem to be able to do anything really useful with it.
17256
17257         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17258         not the EventBuilder.
17259
17260 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17261
17262         * cs-tokenizer.cs: Add support for defines.
17263         Add support for #if, #elif, #else, #endif
17264
17265         (eval_var): evaluates a variable.
17266         (eval): stubbed for evaluating functions.
17267
17268         * cs-parser.jay: Pass the defines information
17269
17270         * driver.cs: Add --define command line option.
17271
17272         * decl.cs: Move MemberCore here.
17273
17274         Make it the base class for DeclSpace.  This allows us to catch and
17275         report 108 and 109 for everything now.
17276
17277         * class.cs (TypeContainer.Define): Extract all the members
17278         before populating and emit the warning 108 (new keyword required
17279         to override) instead of having each member implement this.
17280
17281         (MemberCore.Define): New abstract method, we will be using this in
17282         the warning reporting engine in Populate.
17283
17284         (Operator.Define): Adjust to new MemberCore protocol. 
17285
17286         * const.cs (Const): This does not derive from Expression, it is a
17287         temporary object we use to create fields, it is a MemberCore. 
17288
17289         * class.cs (Method.Define): Allow the entry point to be in a
17290         specific class.
17291
17292         * driver.cs: Rewrite the argument handler to clean it up a bit.
17293
17294         * rootcontext.cs: Made it just an auxiliary namespace feature by
17295         making everything static.
17296
17297         * driver.cs: Adapt code to use RootContext type name instead of
17298         instance variable.
17299
17300         * delegate.cs: Remove RootContext argument.
17301
17302         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17303         argument. 
17304
17305         * class.cs (Event.Define): The lookup can fail.
17306
17307         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17308
17309         * expression.cs: Resolve the this instance before invoking the code.
17310
17311 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17312
17313         * cs-parser.jay: Add a production in element_access that allows
17314         the thing to become a "type" reference.  This way we can parse
17315         things like "(string [])" as a type.
17316
17317         Note that this still does not handle the more complex rules of
17318         casts. 
17319
17320
17321         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17322
17323         * ecore.cs: (CopyNewMethods): new utility function used to
17324         assemble the list of methods from running FindMembers.
17325
17326         (MemberLookup): Rework FindMembers so that 
17327
17328 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17329
17330         * class.cs (TypeContainer): Remove Delegates who fail to be
17331         defined.
17332
17333         * delegate.cs (Populate): Verify that we dont get null return
17334         values.   TODO: Check for AsAccessible.
17335
17336         * cs-parser.jay: Use basename to emit error 574 (destructor should
17337         have the same name as container class), not the full name.
17338
17339         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17340         possible representation.  
17341
17342         Also implements integer type suffixes U and L.
17343
17344 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17345
17346         * expression.cs (ArrayCreation.DoResolve): We need to do the
17347         argument resolution *always*.
17348
17349         * decl.cs: Make this hold the namespace.  Hold the root context as
17350         well.
17351         (LookupType): Move here.
17352
17353         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17354
17355         * location.cs (Row, Name): Fixed the code, it was always returning
17356         references to the first file.
17357
17358         * interface.cs: Register properties defined through interfaces.
17359
17360         * driver.cs: Add support for globbing on the command line
17361
17362         * class.cs (Field): Make it derive from MemberCore as well.
17363         (Event): ditto.
17364
17365 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17366
17367         * class.cs (Event::Define): Check that the type of the event is a delegate
17368         type else flag error #66.
17369
17370         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17371         same.
17372
17373         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17374         values of EntryPoint, CharSet etc etc.
17375
17376         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17377
17378         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17379         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17380         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17381         which needs this to do its work.
17382
17383         * ../errors/cs0066.cs : Add.
17384
17385 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17386
17387         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17388         helper functions.
17389
17390         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17391         clears out the parameters field.
17392         (MemberSignatureCompare): Cleanup
17393
17394         (MemberCore): New base class used to share code between MethodCore
17395         and Property.
17396
17397         (RegisterRequiredImplementations) BindingFlags.Public requires
17398         either BindingFlags.Instace or Static.  Use instance here.
17399
17400         (Property): Refactored code to cope better with the full spec.
17401
17402         * parameter.cs (GetParameterInfo): Return an empty array instead
17403         of null on error.
17404
17405         * class.cs (Property): Abstract or extern properties have no bodies.
17406
17407         * parameter.cs (GetParameterInfo): return a zero-sized array.
17408
17409         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17410         method modifier validation to the typecontainer so we can reuse
17411         this on properties.
17412
17413         (MethodCore.ParameterTypes): return an empty sized array of types.
17414
17415         (Property.Define): Test property modifier validity.
17416
17417         Add tests for sealed/override too.
17418
17419         (Method.Emit): abstract or extern methods have no bodies.
17420
17421 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17422
17423         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17424         thing.
17425
17426         (Method::Define, ::Emit): Modify accordingly.
17427
17428         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17429
17430         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17431
17432         * makefile: Pass in /unsafe.
17433
17434 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17435
17436         * class.cs (MakeKey): Kill routine.
17437
17438         * class.cs (TypeContainer.Define): Correctly define explicit
17439         method implementations (they require the full interface name plus
17440         the method name).
17441
17442         * typemanager.cs: Deply the PtrHashtable here and stop using the
17443         lame keys.  Things work so much better.
17444
17445         This of course broke everyone who depended on `RegisterMethod' to
17446         do the `test for existance' test.  This has to be done elsewhere.
17447
17448         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17449         the object stupid Equals method (because, that like fails all over
17450         the place).  We still do not use it.
17451
17452         * class.cs (TypeContainer.SetRequiredInterface,
17453         TypeContainer.RequireMethods): Killed these two routines and moved
17454         all the functionality to RegisterRequiredImplementations.
17455
17456         (TypeContainer.RegisterRequiredImplementations): This routine now
17457         registers all the implementations required in an array for the
17458         interfaces and abstract methods.  We use an array of structures
17459         which can be computed ahead of time to reduce memory usage and we
17460         also assume that lookups are cheap as most classes will not
17461         implement too many interfaces.
17462
17463         We also avoid creating too many MethodSignatures.
17464
17465         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17466         clear the "pending" bit if we find that there are problems with
17467         the declaration.
17468
17469         (TypeContainer.VerifyPendingMethods): Update to report errors of
17470         methods that look like implementations but are not.
17471
17472         (TypeContainer.Define): Add support for explicit interface method
17473         implementation. 
17474
17475 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17476
17477         * typemanager.cs: Keep track of the parameters here instead of
17478         being a feature of the TypeContainer.
17479
17480         * class.cs: Drop the registration of parameters here, as
17481         InterfaceMethods are also interface declarations.
17482
17483         * delegate.cs: Register methods with the TypeManager not only with
17484         the TypeContainer.  This code was buggy.
17485
17486         * interface.cs: Full registation here.
17487
17488 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17489
17490         * expression.cs: Remove reducer for binary expressions, it can not
17491         be done this way.
17492
17493         * const.cs: Put here the code that used to go into constant.cs
17494
17495         * constant.cs: Put here the code for constants, this is a new base
17496         class for Literals.
17497
17498         * literal.cs: Make Literal derive from Constant.
17499
17500 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17501
17502         * statement.cs (Return.Emit): Report error 157 if the user
17503         attempts to return from a finally block.
17504
17505         (Return.Emit): Instead of emitting a return, jump to the end of
17506         the function.
17507
17508         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17509         LocalBuilder to store the result of the function.  ReturnLabel is
17510         the target where we jump.
17511
17512
17513 2001-12-09  Radek Doulik  <rodo@ximian.com>
17514
17515         * cs-parser.jay: remember alias in current namespace
17516
17517         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17518         namespaces
17519
17520         * class.cs (LookupAlias): lookup alias in my_namespace
17521
17522         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17523         aliases hashtable
17524         (LookupAlias): lookup alias in this and if needed in parent
17525         namespaces
17526
17527 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * support.cs: 
17530
17531         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17532         making things static.  I need this to avoid passing the
17533         TypeContainer when calling ParameterType.
17534
17535         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17536         that did string manipulation to compute the type and then call
17537         GetType.  Use Parameter.ParameterType instead.
17538
17539         * cs-tokenizer.cs: Consume the suffix for floating values.
17540
17541         * expression.cs (ParameterReference): figure out whether this is a
17542         reference parameter or not.  Kill an extra variable by computing
17543         the arg_idx during emission.
17544
17545         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17546         function that returns whether a parameter is an out/ref value or not.
17547
17548         (Parameter.ParameterType): The type of the parameter (base,
17549         without ref/out applied).
17550
17551         (Parameter.Resolve): Perform resolution here.
17552         (Parameter.ExternalType): The full type (with ref/out applied).
17553
17554         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17555         support for expressions on the using statement.
17556
17557 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17558
17559         * statement.cs (Using.EmitLocalVariableDecls): Split the
17560         localvariable handling of the using statement.
17561
17562         (Block.EmitMeta): Keep track of variable count across blocks.  We
17563         were reusing slots on separate branches of blocks.
17564
17565         (Try.Emit): Emit the general code block, we were not emitting it. 
17566
17567         Check the type of the declaration to be an IDisposable or
17568         something that can be implicity converted to it. 
17569
17570         Emit conversions if required.
17571
17572         * ecore.cs (EmptyExpression): New utility class.
17573         (Expression.ImplicitConversionExists): New utility function.
17574
17575 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17576
17577         * statement.cs (Using): Implement.
17578
17579         * expression.cs (LocalVariableReference): Support read only variables.
17580
17581         * statement.cs: Remove the explicit emit for the Leave opcode.
17582         (VariableInfo): Add a readonly field.
17583
17584 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17585
17586         * ecore.cs (ConvCast): new class used to encapsulate the various
17587         explicit integer conversions that works in both checked and
17588         unchecked contexts.
17589
17590         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17591         properly generate the overflow opcodes.
17592
17593 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17594
17595         * statement.cs: The correct type for the EmptyExpression is the
17596         element_type, not the variable type.  Ravi pointed this out.
17597
17598 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17599
17600         * class.cs (Method::Define): Handle PInvoke methods specially
17601         by using DefinePInvokeMethod instead of the usual one.
17602
17603         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17604         above to do the task of extracting information and defining the method.
17605
17606 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17607
17608         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17609         of the condition for string type.
17610
17611         (Emit): Move that here. 
17612
17613         (ArrayCreation::CheckIndices): Keep string literals in their expression
17614         form.
17615
17616         (EmitDynamicInitializers): Handle strings appropriately.
17617
17618 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17619
17620         * codegen.cs (EmitContext): Replace multiple variables with a
17621         single pointer to the current Switch statement.
17622
17623         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17624         EmitContext.
17625
17626 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * statement.cs 
17629
17630         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17631         default'.
17632
17633         (Foreach.Emit): Foreach on arrays was not setting
17634         up the loop variables (for break/continue).
17635
17636         (GotoCase): Semi-implented.
17637
17638 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17639
17640         * attribute.cs (CheckAttribute): Handle system attributes by using
17641         Attribute.GetAttributes to examine information we need.
17642
17643         (GetValidPlaces): Same here.
17644
17645         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17646
17647         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17648
17649         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17650
17651         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17652
17653         (Method::Emit): Handle the case when we are a PInvoke method.
17654
17655 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * expression.cs: Use ResolveWithSimpleName on compound names.
17658
17659 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17660
17661         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17662         before trying to reduce it.
17663
17664         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17665
17666         * constant.cs (LookupConstantValue): Implement.
17667
17668         (EmitConstant): Use the above in emitting the constant.
17669
17670         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17671         that are user-defined by doing a LookupConstantValue on them.
17672
17673         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17674         too, like above.
17675
17676 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17677
17678         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17679
17680         (BaseAccess.DoResolve): Implement.
17681
17682         (MemberAccess.DoResolve): Split this routine into a
17683         ResolveMemberAccess routine that can be used independently
17684
17685 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17688         As that share bits of the implementation.  Is returns a boolean,
17689         while As returns the Type that is being probed.
17690
17691 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17692
17693         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17694         instead of a Literal - much easier.
17695
17696         (EnumInTransit): Remove - utterly useless :-)
17697
17698         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17699
17700         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17701
17702         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17703         chain when we have no associated expression.
17704
17705 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17706
17707         * constant.cs (Define): Use Location while reporting the errror.
17708
17709         Also emit a warning when 'new' is used and there is no inherited
17710         member to hide.
17711
17712         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17713         populated.
17714
17715         (LookupEnumValue): Implement to lookup an enum member's value and define it
17716         if necessary.
17717
17718         (Populate): Re-write accordingly to use the above routine.
17719
17720 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17721
17722         * expression.cs (This): Fix prototype for DoResolveLValue to
17723         override the base class DoResolveLValue.
17724
17725         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17726         declarations) 
17727
17728         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17729         (we need to load the address of the field here).  This fixes
17730         test-22. 
17731
17732         (FieldExpr.DoResolveLValue): Call the DoResolve
17733         function to initialize the Instance expression.
17734
17735         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17736         correctly the GetEnumerator operation on a value type.
17737
17738         * cs-parser.jay: Add more simple parsing error catches.
17739
17740         * statement.cs (Switch): Add support for string switches.
17741         Handle null specially.
17742
17743         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17744
17745 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17746
17747         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17748
17749         (declare_local_constant): New helper function.
17750
17751         * statement.cs (AddConstant): Keep a separate record of constants
17752
17753         (IsConstant): Implement to determine if a variable is a constant.
17754
17755         (GetConstantExpression): Implement.
17756
17757         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17758
17759         * statement.cs (IsVariableDefined): Re-write.
17760
17761 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17762
17763         * class.cs (TypeContainer::FindMembers): Look for constants
17764         in the case when we are looking for MemberTypes.Field
17765
17766         * expression.cs (MemberAccess::DoResolve): Check that in the
17767         case we are a FieldExpr and a Literal, we are not being accessed
17768         by an instance reference.
17769
17770         * cs-parser.jay (local_constant_declaration): Implement.
17771
17772         (declaration_statement): Implement for constant declarations.
17773
17774 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17775
17776         * statement.cs (Switch): Catch double defaults.
17777
17778         (Switch): More work on the switch() statement
17779         implementation.  It works for integral values now, need to finish
17780         string support.
17781
17782
17783 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17784
17785         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17786         integer literals into other integer literals.  To be used by
17787         switch. 
17788
17789 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17790
17791         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17792         some memory.
17793
17794         (EmitDynamicInitializers): Cope with the above since we extract data
17795         directly from ArrayData now.
17796
17797         (ExpectInitializers): Keep track of whether initializers are mandatory
17798         or not.
17799
17800         (Bounds): Make it a hashtable to prevent the same dimension being 
17801         recorded for every element in that dimension.
17802
17803         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17804         from being found.
17805
17806         Also fix bug which was causing the indices to be emitted in the reverse
17807         order.
17808
17809 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17812         unfinished.  They do not work, because the underlying code is
17813         sloppy.
17814
17815 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17816
17817         * cs-parser.jay: Remove bogus fixme.
17818
17819         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17820         on Switch statement.
17821
17822 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17823
17824         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17825         the same. 
17826
17827         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17828         parameter. Apparently, any expression is allowed. 
17829
17830         (ValidateInitializers): Update accordingly.
17831
17832         (CheckIndices): Fix some tricky bugs thanks to recursion.
17833
17834         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17835         I was being completely brain-dead.
17836
17837         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17838         and re-write acordingly.
17839
17840         (DelegateInvocation): Re-write accordingly.
17841
17842         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17843
17844         (MakeByteBlob): Handle types more correctly.
17845
17846         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17847         initialization from expressions but it is incomplete because I am a complete
17848         Dodo :-|
17849
17850 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17851
17852         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17853         on If.  Basically, we have to return `true' (ie, we do return to
17854         our caller) only if both branches of the if return.
17855
17856         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17857         short-circuit operators, handle them as short circuit operators. 
17858
17859         (Cast.DoResolve): Resolve type.
17860         (Cast.Cast): Take an expression as the target type.
17861
17862         * cs-parser.jay (cast_expression): Remove old hack that only
17863         allowed a limited set of types to be handled.  Now we take a
17864         unary_expression and we resolve to a type during semantic
17865         analysis.
17866
17867         Use the grammar productions from Rhys to handle casts (this is
17868         not complete like Rhys syntax yet, we fail to handle that corner
17869         case that C# has regarding (-x), but we will get there.
17870
17871 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17872
17873         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17874         field which is an array type.
17875
17876         * cs-parser.jay (declare_local_variables): Support array initialization too.
17877
17878         * typemanager.cs (MakeKey): Implement.
17879
17880         (everywhere): Use the above appropriately.
17881
17882         * cs-parser.jay (for_statement): Update for array initialization while
17883         declaring variables.
17884
17885         * ecore.cs : The error message was correct, it's the variable's names that
17886         were misleading ;-) Make the code more readable.
17887
17888         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17889         the correct type etc.
17890
17891         (ConvertExplicit): Handle Enum types by examining the underlying type.
17892
17893 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17894
17895         * parameter.cs (GetCallingConvention): Always return
17896         CallingConventions.Standard for now.
17897
17898 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17899
17900         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17901         and `r' after calling DoNumericPromotions.
17902
17903         * ecore.cs: Fix error message (the types were in the wrong order).
17904
17905         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17906         BindingFlags.Instance as well 
17907
17908         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17909         implicit int literal conversion in an empty cast so that we
17910         propagate the right type upstream.
17911
17912         (UnboxCast): new class used to unbox value types.
17913         (Expression.ConvertExplicit): Add explicit type conversions done
17914         by unboxing.
17915
17916         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17917         the target type before applying the implicit LongLiterals to ULong
17918         literal cast.
17919
17920 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17921
17922         * cs-parser.jay (for_statement): Reworked the way For works: now
17923         we declare manually any variables that are introduced in
17924         for_initializer to solve the problem of having out-of-band code
17925         emition (that is what got for broken).
17926
17927         (declaration_statement): Perform the actual variable declaration
17928         that used to be done in local_variable_declaration here.
17929
17930         (local_variable_declaration): Do not declare anything, just pass
17931         the information on a DictionaryEntry
17932
17933 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17934
17935         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17936         re-write of the logic to now make it recursive.
17937
17938         (UpdateIndices): Re-write accordingly.
17939
17940         Store element data in a separate ArrayData list in the above methods.
17941
17942         (MakeByteBlob): Implement to dump the array data into a byte array.
17943
17944 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17945
17946         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17947         into CheckIndices.
17948
17949         * constant.cs (Define): Implement.
17950
17951         (EmitConstant): Re-write fully.
17952
17953         Pass in location info.
17954
17955         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17956         respectively.
17957
17958         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17959         DictionaryEntry since we need location info too.
17960
17961         (constant_declaration): Update accordingly.
17962
17963         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17964         code into another method : UpdateIndices.
17965
17966 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17967
17968         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17969         some type checking etc.
17970
17971 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17972
17973         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17974         bits to provide dimension info if the user skips doing that.
17975
17976         Update second constructor to store the rank correctly.
17977
17978 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17979
17980         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17981         and try to implement.
17982
17983         * ../errors/cs0150.cs : Add.
17984
17985         * ../errors/cs0178.cs : Add.
17986
17987 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17988
17989         * statement.cs: Implement foreach on multi-dimensional arrays. 
17990
17991         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17992         name of the params argument.
17993
17994         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17995         initializing the array.
17996
17997         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17998         we can use this elsewhere.
17999
18000         * statement.cs: Finish implementation of foreach for single
18001         dimension arrays.
18002
18003         * cs-parser.jay: Use an out-of-band stack to pass information
18004         around, I wonder why I need this.
18005
18006         foreach_block: Make the new foreach_block the current_block.
18007
18008         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18009         function used to return a static Parameters structure.  Used for
18010         empty parameters, as those are created very frequently.
18011
18012         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18013
18014 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18015
18016         * interface.cs : Default modifier is private, not public. The
18017         make verify test passes again.
18018
18019 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18020
18021         * support.cs (ReflectionParameters): Fix logic to determine
18022         whether the last parameter is a params one. Test 9 passes again.
18023
18024         * delegate.cs (Populate): Register the builders we define with
18025         RegisterParameterForBuilder. Test 19 passes again.
18026
18027         * cs-parser.jay (property_declaration): Reference $6 instead
18028         of $$ to get at the location.
18029
18030         (indexer_declaration): Similar stuff.
18031
18032         (attribute): Ditto.
18033
18034         * class.cs (Property): Register parameters for the Get and Set methods
18035         if they exist. Test 23 passes again.
18036
18037         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18038         call to EmitArguments as we are sure there aren't any params arguments. 
18039         Test 32 passes again.
18040
18041         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18042         IndexOutOfRangeException. 
18043
18044         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18045         Test 33 now passes again.
18046
18047 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18048
18049         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18050         broke a bunch of things.  Will have to come up with a better way
18051         of tracking locations.
18052
18053         * statement.cs: Implemented foreach for single dimension arrays.
18054
18055 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18056
18057         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18058         an error.  This removes the lookup from the critical path.
18059
18060         * cs-parser.jay: Removed use of temporary_loc, which is completely
18061         broken. 
18062
18063 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18064
18065         * support.cs (ReflectionParameters.ParameterModifier): Report
18066         whether the argument is a PARAMS argument or not.
18067
18068         * class.cs: Set the attribute `ParamArrayAttribute' on the
18069         parameter argument.
18070
18071         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18072         and cons_param_array_attribute (ConstructorInfo for
18073         ParamArrayAttribute)., 
18074
18075         * codegen.cs: Emit the return using the `Return' statement, that
18076         way we can report the error correctly for missing return values. 
18077
18078         * class.cs (Method.Emit): Clean up.
18079
18080         * expression.cs (Argument.Resolve): Take another argument: the
18081         location where this argument is used.  Notice that this is not
18082         part of the "Argument" class as to reduce the size of the
18083         structure (we know the approximate location anyways).
18084
18085         Test if the argument is a variable-reference, if not, then
18086         complain with a 206.
18087
18088         (Argument.Emit): Emit addresses of variables.
18089
18090         (Argument.FullDesc): Simplify.
18091
18092         (Invocation.DoResolve): Update for Argument.Resolve.
18093
18094         (ElementAccess.DoResolve): ditto.
18095
18096         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18097         method should be virtual, as this method is always virtual.
18098
18099         (NewDelegate.DoResolve): Update for Argument.Resolve.
18100
18101         * class.cs (ConstructorInitializer.DoResolve): ditto.
18102
18103         * attribute.cs (Attribute.Resolve): ditto.
18104
18105 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18106
18107         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18108
18109         * expression.cs (ParameterReference): Drop IStackStorage and implement
18110         IAssignMethod instead. 
18111
18112         (LocalVariableReference): ditto.
18113
18114         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18115         IAssignMethod instead. 
18116
18117 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18118
18119         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18120         enumerations that are used in heavily used structures derive from
18121         byte in a laughable and pathetic attempt to reduce memory usage.
18122         This is the kind of pre-optimzations that you should not do at
18123         home without adult supervision.
18124
18125         * expression.cs (UnaryMutator): New class, used to handle ++ and
18126         -- separatedly from the other unary operators.  Cleans up the
18127         code, and kills the ExpressionStatement dependency in Unary.
18128
18129         (Unary): Removed `method' and `Arguments' from this class, making
18130         it smaller, and moving it all to SimpleCall, so I can reuse this
18131         code in other locations and avoid creating a lot of transient data
18132         strucutres when not required.
18133
18134         * cs-parser.jay: Adjust for new changes.
18135
18136 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18137
18138         * enum.cs (Enum.Populate): If there is a failure during
18139         definition, return
18140
18141         * cs-parser.jay (opt_enum_base): we used to catch type errors
18142         here, but this is really incorrect.  The type error should be
18143         catched during semantic analysis.
18144
18145 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18146
18147         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18148         current_local_parameters as expected since I, in my stupidity, had forgotten
18149         to do this :-)
18150
18151         * attribute.cs (GetValidPlaces): Fix stupid bug.
18152
18153         * class.cs (Method::Emit): Perform check on applicability of attributes.
18154
18155         (Constructor::Emit): Ditto.
18156
18157         (Field::Emit): Ditto.
18158
18159         (Field.Location): Store location information.
18160
18161         (Property, Event, Indexer, Operator): Ditto.
18162
18163         * cs-parser.jay (field_declaration): Pass in location for each field.
18164
18165         * ../errors/cs0592.cs : Add.
18166
18167 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18168
18169         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18170
18171         (InitCoreTypes): Update accordingly.
18172
18173         (RegisterAttrType, LookupAttr): Implement.
18174
18175         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18176         info about the same.
18177
18178         (Resolve): Update to populate the above as necessary.
18179
18180         (Error592): Helper.
18181
18182         (GetValidPlaces): Helper to the above.
18183
18184         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18185
18186         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18187
18188 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18189
18190         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18191
18192         * ../errors/cs0617.cs : Add.
18193
18194 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18195
18196         * enum.cs (Emit): Rename to Populate to be more consistent with what
18197         we expect it to do and when exactly it is called.
18198
18199         * class.cs, rootcontext.cs : Update accordingly.
18200
18201         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18202         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18203
18204         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18205
18206         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18207         of a fieldinfo using the above, when dealing with a FieldBuilder.
18208
18209 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18210
18211         * ../errors/cs0031.cs : Add.
18212
18213         * ../errors/cs1008.cs : Add.
18214
18215         * ../errrors/cs0543.cs : Add.
18216
18217         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18218         enum type.
18219
18220         (FindMembers): Implement.
18221
18222         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18223         enums and delegates too.
18224
18225         (enum_types): Rename to builder_to_enum.
18226
18227         (delegate_types): Rename to builder_to_delegate.
18228
18229         * delegate.cs (FindMembers): Implement.
18230
18231 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18232
18233         * typemanager.cs (IsEnumType): Implement.
18234
18235         * enum.cs (Emit): Re-write parts to account for the underlying type
18236         better and perform checking etc.
18237
18238         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18239         of the underlying type.
18240
18241         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18242         value
18243
18244         * enum.cs (error31): Helper to report error #31.
18245
18246         * cs-parser.jay (enum_declaration): Store location of each member too.
18247
18248         * enum.cs (member_to_location): New hashtable. 
18249
18250         (AddEnumMember): Update location hashtable.
18251
18252         (Emit): Use the location of each member while reporting errors.
18253
18254 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18255
18256         * cs-parser.jay: A for_initializer if is a
18257         local_variable_declaration really ammount to have an implicit
18258         block with the variable declaration and no initializer for for.
18259
18260         * statement.cs (For.Emit): Cope with null initializers.
18261
18262         This fixes the infinite loop on for initializers.
18263
18264 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * enum.cs: More cleanup.
18267
18268         * ecore.cs: Remove dead code.
18269
18270         * class.cs (Property.Emit): More simplification.
18271         (Event.Emit): ditto.
18272
18273         Reworked to have less levels of indentation.
18274
18275 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18276
18277         * class.cs (Property): Emit attributes.
18278
18279         (Field): Ditto.
18280
18281         (Event): Ditto.
18282
18283         (Indexer): Ditto.
18284
18285         (Operator): Ditto.
18286
18287         * enum.cs (Emit): Ditto.
18288
18289         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18290         Enums too.
18291
18292         * class.cs (Field, Event, etc.): Move attribute generation into the
18293         Emit method everywhere.
18294
18295         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18296         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18297         as we had no way of defining nested enums !
18298
18299         * rootcontext.cs : Adjust code accordingly.
18300
18301         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18302
18303 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18304
18305         * expression.cs (EvalConstantExpression): Move into ecore.cs
18306
18307         * enum.cs (Enum): Rename some members and make them public and readonly
18308         according to our convention.
18309
18310         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18311         nothing else.
18312
18313         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18314
18315         (Enum::Emit): Write a simple version for now which doesn't try to compute
18316         expressions. I shall modify this to be more robust in just a while.
18317
18318         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18319
18320         (TypeContainer::CloseType): Create the Enum types too.
18321
18322         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18323
18324         * expression.cs (EvalConstantExpression): Get rid of completely.
18325
18326         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18327         user-defined values and other cases.
18328
18329         (IsValidEnumLiteral): Helper function.
18330
18331         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18332         out there in the case we had a literal FieldExpr.
18333
18334         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18335
18336         (Literalize): Revamp a bit to take two arguments.
18337
18338         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18339
18340 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18341
18342         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18343
18344         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18345
18346         (Resolve): Use the above to ensure we have proper initializers.
18347
18348 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18349
18350         * expression.cs (Expression::EvalConstantExpression): New method to 
18351         evaluate constant expressions.
18352
18353         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18354
18355 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18358         in an array.
18359
18360         (Binary.ResolveOperator): Handle operator != (object a, object b)
18361         and operator == (object a, object b);
18362
18363         (Binary.DoNumericPromotions): Indicate whether the numeric
18364         promotion was possible.
18365
18366         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18367         Implement.  
18368
18369         Made the ArrayAccess implement interface IAssignMethod instead of
18370         IStackStore as the order in which arguments are passed reflects
18371         this.
18372
18373         * assign.cs: Instead of using expr.ExprClass to select the way of
18374         assinging, probe for the IStackStore/IAssignMethod interfaces.
18375
18376         * typemanager.cs: Load InitializeArray definition.
18377
18378         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18379         static data that can be used to initialize arrays. 
18380
18381 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18382
18383         * expression.cs: Handle operator== and operator!= for booleans.
18384
18385         (Conditioal.Reduce): Implement reducer for the ?: operator.
18386
18387         (Conditional.Resolve): Implement dead code elimination.
18388
18389         (Binary.Resolve): Catch string literals and return a new
18390         concatenated string.
18391
18392         (Unary.Reduce): Implement reduction of unary expressions.
18393
18394         * ecore.cs: Split out the expression core handling here.
18395
18396         (Expression.Reduce): New method used to perform constant folding
18397         and CSE.  This is needed to support constant-expressions. 
18398
18399         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18400         targets, and optimize for !x.
18401
18402 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18403
18404         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18405         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18406         set custom atttributes.
18407
18408         * literal.cs (Literal::GetValue): New abstract method to return the actual
18409         value of the literal, cast as an object.
18410
18411         (*Literal): Implement GetValue method.
18412
18413         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18414         expressions to the arraylist but objects of type Argument.
18415
18416         * class.cs (TypeContainer::Emit): Emit our attributes too.
18417
18418         (Method::Emit, Constructor::Emit): Ditto.
18419
18420         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18421         to be ignoring earlier.
18422
18423 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18424
18425         * attribute.cs (AttributeSection::Define): Implement to do the business
18426         of constructing a CustomAttributeBuilder.
18427
18428         (Attribute): New trivial class. Increases readability of code.  
18429
18430         * cs-parser.jay : Update accordingly.
18431
18432         (positional_argument_list, named_argument_list, named_argument): New rules
18433
18434         (attribute_arguments): Use the above so that we are more correct.
18435
18436 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18437
18438         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18439         to perform all checks for a method with a params parameter.
18440
18441         (Invocation::OverloadResolve): Update to use the above method and therefore
18442         cope correctly with params method invocations.
18443
18444         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18445         params too.
18446
18447         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18448         constructors in our parent too because we can't afford to miss out on 
18449         protected ones ;-)
18450
18451         * attribute.cs (AttributeSection): New name for the class Attribute
18452
18453         Other trivial changes to improve readability.
18454
18455         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18456         use the new class names.
18457
18458 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18459
18460         * class.cs (Method::Define): Complete definition for params types too
18461
18462         (Indexer::Define): Ditto.
18463
18464         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18465         Cope everywhere with a request for info about the array parameter.
18466
18467 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18468
18469         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18470
18471         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18472         local_variable_type to extract the string corresponding to the type.
18473
18474         (local_variable_type): Fixup the action to use the new helper method.
18475
18476         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18477         go.
18478
18479         * expression.cs : Clean out code which uses the above.
18480
18481 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18482
18483         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18484         and bale out if necessary by returning a false.
18485
18486         (RegisterProperty): Ditto.
18487
18488         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18489         and print out appropriate error messages.
18490
18491         * interface.cs (everywhere): Ditto.
18492
18493         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18494         location to constructor.
18495
18496         * class.cs (Property, Event, Indexer): Update accordingly.
18497
18498         * ../errors/cs111.cs : Added.
18499
18500         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18501         of a method, as laid down by the spec.
18502
18503         (Invocation::OverloadResolve): Use the above method.
18504
18505 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18506
18507         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18508         now take a TypeContainer and a Parameters object.
18509
18510         (ParameterData): Modify return type of ParameterModifier method to be 
18511         Parameter.Modifier and not a string.
18512
18513         (ReflectionParameters, InternalParameters): Update accordingly.
18514
18515         * expression.cs (Argument::GetParameterModifier): Same here.
18516
18517         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18518         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18519         symbol in it at all so maybe this is only for now.
18520
18521 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18522
18523         * support.cs (InternalParameters): Constructor now takes an extra argument 
18524         which is the actual Parameters class.
18525
18526         (ParameterDesc): Update to provide info on ref/out modifiers.
18527
18528         * class.cs (everywhere): Update call to InternalParameters to pass in
18529         the second argument too.
18530
18531         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18532         to return the modifier info [ref/out etc]
18533
18534         (InternalParameters, ReflectionParameters): Implement the above.
18535
18536         * expression.cs (Argument::ParameterModifier): Similar function to return
18537         info about the argument's modifiers.
18538
18539         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18540         too.
18541
18542         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18543         a new SetFormalParameters object which we pass to InternalParameters.
18544
18545 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18546
18547         * expression.cs (NewArray): Merge into the ArrayCreation class.
18548
18549 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18550
18551         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18552         NewUserdefinedArray into one as there wasn't much of a use in having
18553         two separate ones.
18554
18555         * expression.cs (Argument): Change field's name to ArgType from Type.
18556
18557         (Type): New readonly property which returns the proper type, taking into 
18558         account ref/out modifiers.
18559
18560         (everywhere): Adjust code accordingly for the above.
18561
18562         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18563         whether we are emitting for a ref or out parameter.
18564
18565         * expression.cs (Argument::Emit): Use the above field to set the state.
18566
18567         (LocalVariableReference::Emit): Update to honour the flag and emit the
18568         right stuff.
18569
18570         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18571
18572         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18573
18574         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18575
18576         (ReflectionParameters, InternalParameters): Implement the above method.
18577
18578         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18579         reporting errors.
18580
18581         (Invocation::FullMethodDesc): Ditto. 
18582
18583 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18584
18585         * cs-parser.jay: Add extra production for the second form of array
18586         creation. 
18587
18588         * expression.cs (ArrayCreation): Update to reflect the above
18589         change. 
18590
18591         * Small changes to prepare for Array initialization.
18592
18593 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18594
18595         * typemanager.cs (ImplementsInterface): interface might be null;
18596         Deal with this problem;
18597
18598         Also, we do store negative hits on the cache (null values), so use
18599         this instead of calling t.GetInterfaces on the type everytime.
18600
18601 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18602
18603         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18604
18605         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18606         split functionality out into different classes.
18607
18608         (New::FormArrayType): Move into NewBuiltinArray.
18609
18610         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18611         quite useless.
18612
18613         (NewBuiltinArray): New class to handle creation of built-in arrays.
18614
18615         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18616         account creation of one-dimensional arrays.
18617
18618         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18619
18620         (NewUserdefinedArray::DoResolve): Implement.
18621
18622         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18623
18624         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18625         we maintain inside the TypeManager. This is necessary to perform lookups on the
18626         module builder.
18627
18628         (LookupType): Update to perform GetType on the module builders too.     
18629
18630         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18631
18632         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18633
18634 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18635
18636         * expression.cs (New::DoResolve): Implement guts of array creation.
18637
18638         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18639
18640 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18641
18642         * expression.cs: Fix bug I introduced lsat night that broke
18643         Delegates. 
18644
18645         (Expression.Resolve): Report a 246 error (can not resolve name)
18646         if we find a SimpleName in the stream.
18647
18648         (Expression.ResolveLValue): Ditto.
18649
18650         (Expression.ResolveWithSimpleName): This function is a variant of
18651         ResolveName, this one allows SimpleNames to be returned without a
18652         warning.  The only consumer of SimpleNames is MemberAccess
18653
18654 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18655
18656         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18657         might arrive here.  I have my doubts that this is correct.
18658
18659         * statement.cs (Lock): Implement lock statement.
18660
18661         * cs-parser.jay: Small fixes to support `lock' and `using'
18662
18663         * cs-tokenizer.cs: Remove extra space
18664
18665         * driver.cs: New flag --checked, allows to turn on integer math
18666         checking. 
18667
18668         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18669         Threading.Monitor.Exit 
18670
18671 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18672
18673         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18674         Expression Class to be IndexerAccess.
18675
18676         Notice that Indexer::DoResolve sets the eclass to Value.
18677
18678 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18679
18680         * class.cs (TypeContainer::Emit): Emit code for indexers.
18681
18682         * assign.cs (IAssignMethod): New interface implemented by Indexers
18683         and Properties for handling assignment.
18684
18685         (Assign::Emit): Simplify and reuse code. 
18686
18687         * expression.cs (IndexerAccess, PropertyExpr): Implement
18688         IAssignMethod, clean up old code. 
18689
18690 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18691
18692         * typemanager.cs (ImplementsInterface): New method to determine if a type
18693         implements a given interface. Provides a nice cache too.
18694
18695         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18696         method.
18697
18698         (ConvertReferenceExplicit): Ditto.
18699
18700         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18701         various methods, with correct names etc.
18702
18703         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18704         Operator.UnaryNegation.
18705
18706         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18707         we have a unary plus or minus operator.
18708
18709         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18710         UnaryMinus.
18711
18712         * everywhere : update accordingly.
18713
18714         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18715         respectively.
18716
18717         * class.cs (Method::Define): For the case where we are implementing a method
18718         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18719         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18720
18721 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18722
18723         * interface.cs (FindMembers): Implement to work around S.R.E
18724         lameness.
18725
18726         * typemanager.cs (IsInterfaceType): Implement.
18727
18728         (FindMembers): Update to handle interface types too.
18729
18730         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18731         use IsAssignableFrom as that is not correct - it doesn't work.
18732
18733         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18734         and accordingly override EmitStatement.
18735
18736         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18737         using the correct logic :-)
18738
18739 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18740
18741         * ../errors/cs-11.cs : Add to demonstrate error -11 
18742
18743 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18744
18745         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18746         then pass this as a hint to ResolveLValue.
18747
18748         * expression.cs (FieldExpr): Add Location information
18749
18750         (FieldExpr::LValueResolve): Report assignment to readonly
18751         variable. 
18752
18753         (Expression::ExprClassFromMemberInfo): Pass location information.
18754
18755         (Expression::ResolveLValue): Add new method that resolves an
18756         LValue. 
18757
18758         (Expression::DoResolveLValue): Default invocation calls
18759         DoResolve. 
18760
18761         (Indexers): New class used to keep track of indexers in a given
18762         Type. 
18763
18764         (IStackStore): Renamed from LValue, as it did not really describe
18765         what this did.  Also ResolveLValue is gone from this interface and
18766         now is part of Expression.
18767
18768         (ElementAccess): Depending on the element access type
18769
18770         * typemanager.cs: Add `indexer_name_type' as a Core type
18771         (System.Runtime.CompilerServices.IndexerNameAttribute)
18772
18773         * statement.cs (Goto): Take a location.
18774
18775 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18776
18777         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18778         if two delegates are compatible.
18779
18780         (NewDelegate::DoResolve): Update to take care of the case when
18781         we instantiate a delegate from another delegate.
18782
18783         * typemanager.cs (FindMembers): Don't even try to look up members
18784         of Delegate types for now.
18785
18786 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18787
18788         * delegate.cs (NewDelegate): New class to take care of delegate
18789         instantiation.
18790
18791         * expression.cs (New): Split the delegate related code out into 
18792         the NewDelegate class.
18793
18794         * delegate.cs (DelegateInvocation): New class to handle delegate 
18795         invocation.
18796
18797         * expression.cs (Invocation): Split out delegate related code into
18798         the DelegateInvocation class.
18799
18800 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18801
18802         * expression.cs (New::DoResolve): Implement delegate creation fully
18803         and according to the spec.
18804
18805         (New::DoEmit): Update to handle delegates differently.
18806
18807         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18808         because of which we were printing out arguments in reverse order !
18809
18810         * delegate.cs (VerifyMethod): Implement to check if the given method
18811         matches the delegate.
18812
18813         (FullDelegateDesc): Implement.
18814
18815         (VerifyApplicability): Implement.
18816
18817         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18818         delegate invocations too.
18819
18820         (Invocation::Emit): Ditto.
18821
18822         * ../errors/cs1593.cs : Added.
18823
18824         * ../errors/cs1594.cs : Added.
18825
18826         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18827
18828 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18829
18830         * typemanager.cs (intptr_type): Core type for System.IntPtr
18831
18832         (InitCoreTypes): Update for the same.
18833
18834         (iasyncresult_type, asynccallback_type): Ditto.
18835
18836         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18837         correct.
18838
18839         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18840         too.
18841
18842         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18843         the builders for the 4 members of a delegate type :-)
18844
18845         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18846         type.
18847
18848         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18849
18850         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18851
18852 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18853
18854         * statement.cs (Break::Emit): Implement.   
18855         (Continue::Emit): Implement.
18856
18857         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18858         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18859         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18860         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18861         end loop
18862
18863         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18864         properties that track the label for the current loop (begin of the
18865         loop and end of the loop).
18866
18867 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18868
18869         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18870         use of emitting anything at all.
18871
18872         * class.cs, rootcontext.cs : Get rid of calls to the same.
18873
18874         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18875
18876         (Populate): Define the constructor correctly and set the implementation
18877         attributes.
18878
18879         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18880         have been defined.
18881
18882         (AddDelegateType): Implement.
18883
18884         (IsDelegateType): Implement helper method.
18885
18886         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18887
18888         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18889         and accordingly handle it.
18890
18891         * delegate.cs (Populate): Take TypeContainer argument.
18892         Implement bits to define the Invoke method. However, I still haven't figured out
18893         how to take care of the native int bit :-(
18894
18895         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18896         Qualify the name of the delegate, not its return type !
18897
18898         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18899         conversion.
18900
18901         (StandardConversionExists): Checking for array types turns out to be recursive.
18902
18903         (ConvertReferenceExplicit): Implement array conversion.
18904
18905         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18906
18907 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18908
18909         * cs-parser.jay (delegate_declaration): Store the fully qualified
18910         name as it is a type declaration.
18911
18912         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18913         readonly.
18914
18915         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18916         as TypeContainer::DefineType.
18917
18918         (Populate): Method in which all the definition of the various methods (Invoke)
18919         etc is done.
18920
18921         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18922         see.
18923
18924         (CloseDelegate): Finally creates the delegate.
18925
18926         * class.cs (TypeContainer::DefineType): Update to define delegates.
18927         (Populate, Emit and CloseType): Do the same thing here too.
18928
18929         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18930         delegates in all these operations.
18931
18932 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18933
18934         * expression.cs: LocalTemporary: a new expression used to
18935         reference a temporary that has been created.
18936
18937         * assign.cs: Handle PropertyAccess back here, so that we can
18938         provide the proper semantic access to properties.
18939
18940         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18941         a few more explicit conversions. 
18942
18943         * modifiers.cs: `NEW' modifier maps to HideBySig.
18944
18945         * expression.cs (PropertyExpr): Make this into an
18946         ExpressionStatement, and support the EmitStatement code path. 
18947
18948         Perform get/set error checking, clean up the interface.
18949
18950         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18951         them into toplevel access objects.
18952
18953 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18954
18955         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18956         SRE.
18957
18958         * typemanager.cs: Keep track here of our PropertyBuilders again to
18959         work around lameness in SRE.
18960
18961 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18962
18963         * expression.cs (LValue::LValueResolve): New method in the
18964         interface, used to perform a second resolution pass for LValues. 
18965
18966         (This::DoResolve): Catch the use of this in static methods.
18967
18968         (This::LValueResolve): Implement.
18969
18970         (This::Store): Remove warning, assigning to `this' in structures
18971         is 
18972
18973         (Invocation::Emit): Deal with invocation of
18974         methods on value types.  We need to pass the address to structure
18975         methods rather than the object itself.  (The equivalent code to
18976         emit "this" for structures leaves the entire structure on the
18977         stack instead of a pointer to it). 
18978
18979         (ParameterReference::DoResolve): Compute the real index for the
18980         argument based on whether the method takes or not a `this' pointer
18981         (ie, the method is static).
18982
18983         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18984         value types returned from functions when we need to invoke a
18985         method on the sturcture.
18986
18987
18988 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18989
18990         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18991         defining the type in the Modulebuilder or Typebuilder. This is to take
18992         care of nested types which need to be defined on the TypeBuilder using
18993         DefineNestedMethod.
18994
18995         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18996         methods in RootContext, only ported to be part of TypeContainer.
18997
18998         (TypeContainer::GetInterfaceOrClass): Ditto.
18999
19000         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19001
19002         * interface.cs (Interface::DefineInterface): New method. Does exactly
19003         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19004         too.
19005
19006         (Interface::GetInterfaces): Move from RootContext here and port.
19007
19008         (Interface::GetInterfaceByName): Same here.
19009
19010         * rootcontext.cs (ResolveTree): Re-write.
19011
19012         (PopulateTypes): Re-write.
19013
19014         * class.cs (TypeContainer::Populate): Populate nested types too.
19015         (TypeContainer::Emit): Emit nested members too.
19016
19017         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19018         instead just use the name argument passed in as it is already fully
19019         qualified.
19020
19021         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19022         to TypeContainer mapping to see if a type is user-defined.
19023
19024         * class.cs (TypeContainer::CloseType): Implement. 
19025
19026         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19027         the default constructor.
19028
19029         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19030         twice.
19031
19032         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19033
19034         * interface.cs (CloseType): Create the type here.
19035
19036         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19037         the hierarchy.
19038
19039         Remove all the methods which are now in TypeContainer.
19040
19041 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19042
19043         * delegate.cs (Define): Re-write bits to define the delegate
19044         correctly.
19045
19046 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19047
19048         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19049
19050         * expression.cs (ImplicitReferenceConversion): handle null as well
19051         as a source to convert to any reference type.
19052
19053         * statement.cs (Return): Perform any implicit conversions to
19054         expected return type.  
19055
19056         Validate use of return statement.  
19057
19058         * codegen.cs (EmitContext): Pass the expected return type here.
19059
19060         * class.cs (Method, Constructor, Property): Pass expected return
19061         type to EmitContext.
19062
19063 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19064
19065         * expression.cs: Make DoResolve take an EmitContext instead of a
19066         TypeContainer.
19067
19068         Replaced `l' and `location' for `loc', for consistency.
19069
19070         (Error, Warning): Remove unneeded Tc argument.
19071
19072         * assign.cs, literal.cs, constant.cs: Update to new calling
19073         convention. 
19074
19075         * codegen.cs: EmitContext now contains a flag indicating whether
19076         code is being generated in a static method or not.
19077
19078         * cs-parser.jay: DecomposeQI, new function that replaces the old
19079         QualifiedIdentifier.  Now we always decompose the assembled
19080         strings from qualified_identifier productions into a group of
19081         memberaccesses.
19082
19083 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19084
19085         * rootcontext.cs: Deal with field-less struct types correctly now
19086         by passing the size option to Define Type.
19087
19088         * class.cs: Removed hack that created one static field. 
19089
19090 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19091
19092         * statement.cs: Moved most of the code generation here. 
19093
19094 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19095
19096         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19097         seem very right.
19098
19099         (ElementAccess): Remove useless bits for now - keep checks as the spec
19100         says.
19101
19102 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19103
19104         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19105         and start performing checks according to the spec.
19106
19107 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19108
19109         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19110         rank_specifiers instead.
19111
19112         (rank_specifiers): Change the order in which the rank specifiers are stored
19113
19114         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19115
19116         * expression.cs (ElementAccess): Implement the LValue interface too.
19117
19118 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19119
19120         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19121         except that user defined conversions are not included.
19122
19123         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19124         perform the conversion of the return type, if necessary.
19125
19126         (New::DoResolve): Check whether we are creating an array or an object
19127         and accordingly do the needful.
19128
19129         (New::Emit): Same here.
19130
19131         (New::DoResolve): Implement guts of array creation.
19132
19133         (New::FormLookupType): Helper function.
19134
19135 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19136
19137         * codegen.cs: Removed most of the code generation here, and move the
19138         corresponding code generation bits to the statement classes. 
19139
19140         Added support for try/catch/finalize and throw.
19141
19142         * cs-parser.jay: Added support for try/catch/finalize.
19143
19144         * class.cs: Catch static methods having the flags override,
19145         virtual or abstract.
19146
19147         * expression.cs (UserCast): This user cast was not really doing
19148         what it was supposed to do.  Which is to be born in fully resolved
19149         state.  Parts of the resolution were being performed at Emit time! 
19150
19151         Fixed this code.
19152
19153 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19154
19155         * expression.cs: Implicity convert the result from UserCast.
19156
19157 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19158
19159         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19160         prevented it from working correctly. 
19161
19162         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19163         merely ConvertImplicit.
19164
19165 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19166
19167         * typemanager.cs: Make the LookupTypeContainer function static,
19168         and not per-instance.  
19169
19170         * class.cs: Make static FindMembers (the one that takes a Type
19171         argument). 
19172
19173         * codegen.cs: Add EmitForeach here.
19174
19175         * cs-parser.jay: Make foreach a toplevel object instead of the
19176         inline expansion, as we need to perform semantic analysis on it. 
19177
19178 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19179
19180         * expression.cs (Expression::ImplicitUserConversion): Rename to
19181         UserDefinedConversion.
19182
19183         (Expression::UserDefinedConversion): Take an extra argument specifying 
19184         whether we look for explicit user conversions too.
19185
19186         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19187
19188         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19189
19190         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19191         with the appropriate arguments.
19192
19193         * cs-parser.jay (cast_expression): Record location too.
19194
19195         * expression.cs (Cast): Record location info.
19196
19197         (Expression::ConvertExplicit): Take location argument.
19198
19199         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19200         to determine if we are doing explicit conversions.
19201
19202         (UserCast::Emit): Update accordingly.
19203
19204         (Expression::ConvertExplicit): Report an error if everything fails.
19205
19206         * ../errors/cs0030.cs : Add.
19207
19208 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19209
19210         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19211         virtual and newslot bits. 
19212
19213         * class.cs (TypeContainer::RegisterRequiredImplementations):
19214         Record methods we need.
19215
19216         (TypeContainer::MakeKey): Helper function to make keys for
19217         MethodBases, since the Methodbase key is useless.
19218
19219         (TypeContainer::Populate): Call RegisterRequiredImplementations
19220         before defining the methods.   
19221
19222         Create a mapping for method_builders_to_methods ahead of time
19223         instead of inside a tight loop.
19224
19225         (::RequireMethods):  Accept an object as the data to set into the
19226         hashtable so we can report interface vs abstract method mismatch.
19227
19228 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19229
19230         * report.cs: Make all of it static.
19231
19232         * rootcontext.cs: Drop object_type and value_type computations, as
19233         we have those in the TypeManager anyways.
19234
19235         Drop report instance variable too, now it is a global.
19236
19237         * driver.cs: Use try/catch on command line handling.
19238
19239         Add --probe option to debug the error reporting system with a test
19240         suite. 
19241
19242         * report.cs: Add support for exiting program when a probe
19243         condition is reached.
19244
19245 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19246
19247         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19248         we do a forcible conversion regardless of type, to check if 
19249         ForceConversion returns a null.
19250
19251         (Binary::error19): Use location to report error.
19252
19253         (Unary::error23): Use location here too.
19254
19255         * ../errors/cs0019.cs : Check in.
19256
19257         * ../errors/cs0023.cs : Check in.
19258
19259         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19260         case of a non-null MethodInfo object with a length of 0 !
19261
19262         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19263         an applicable member - according to the spec :-)
19264         Also fix logic to find members in base types.
19265
19266         (Unary::ResolveOperator): Same here.
19267
19268         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19269         as I was getting thoroughly confused between this and error19 :-)
19270
19271         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19272         (::FindMostEncompassedType): Implement.
19273         (::FindMostEncompassingType): Implement.
19274         (::StandardConversionExists): Implement.
19275
19276         (UserImplicitCast): Re-vamp. We now need info about most specific
19277         source and target types so that we can do the necessary conversions.
19278
19279         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19280         mathematical union with no duplicates.
19281
19282 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19283
19284         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19285         in order from base classes to child classes, so that we can in
19286         child classes look up in our parent for method names and
19287         attributes (required for handling abstract, virtual, new, override
19288         constructs: we need to instrospect our base class, and if we dont
19289         populate the classes in order, the introspection might be
19290         incorrect.  For example, a method could query its parent before
19291         the parent has any methods and would determine that the parent has
19292         no abstract methods (while it could have had them)).
19293
19294         (RootContext::CreateType): Record the order in which we define the
19295         classes.
19296
19297 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19298
19299         * class.cs (TypeContainer::Populate): Also method definitions can
19300         fail now, keep track of this.
19301
19302         (TypeContainer::FindMembers): Implement support for
19303         DeclaredOnly/noDeclaredOnly flag.
19304
19305         (Constructor::Emit) Return the ConstructorBuilder.
19306
19307         (Method::Emit) Return the MethodBuilder. 
19308         Check for abstract or virtual methods to be public.
19309
19310         * rootcontext.cs (RootContext::CreateType): Register all the
19311         abstract methods required for the class to be complete and the
19312         interface methods that must be implemented. 
19313
19314         * cs-parser.jay: Report error 501 (method requires body if it is
19315         not marked abstract or extern).
19316
19317         * expression.cs (TypeOf::Emit): Implement.
19318
19319         * typemanager.cs: runtime_handle_type, new global type.
19320
19321         * class.cs (Property::Emit): Generate code for properties.
19322
19323 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19324
19325         * expression.cs (Unary::ResolveOperator): Find operators on base type
19326         too - we now conform exactly to the spec.
19327
19328         (Binary::ResolveOperator): Same here.
19329
19330         * class.cs (Operator::Define): Fix minor quirk in the tests.
19331
19332         * ../errors/cs0215.cs : Added.
19333
19334         * ../errors/cs0556.cs : Added.
19335
19336         * ../errors/cs0555.cs : Added.
19337
19338 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19339
19340         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19341         single integer which is really efficient
19342
19343 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19344
19345         *  expression.cs (Expression::ImplicitUserConversion): Use location
19346         even in the case when we are examining True operators.
19347  
19348         * class.cs (Operator::Define): Perform extensive checks to conform
19349         with the rules for operator overloading in the spec.
19350
19351         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19352         some of the other conversions mentioned in the spec.
19353
19354         * typemanager.cs (array_type): New static member for the System.Array built-in
19355         type.
19356
19357         (cloneable_interface): For System.ICloneable interface.
19358
19359         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19360         we start resolving the tree and populating types.
19361
19362         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19363  
19364 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19365
19366         * expression.cs (Expression::ExprClassFromMemberInfo,
19367         Expression::Literalize): Create literal expressions from
19368         FieldInfos which are literals.
19369
19370         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19371         type casts, because they were wrong.  The test suite in tests
19372         caught these ones.
19373
19374         (ImplicitNumericConversion): ushort to ulong requires a widening
19375         cast. 
19376
19377         Int32 constant to long requires widening cast as well.
19378
19379         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19380         for integers because the type on the stack is not i4.
19381
19382 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19383
19384         * expression.cs (report118): require location argument. 
19385
19386         * parameter.cs: Do not dereference potential null value.
19387
19388         * class.cs: Catch methods that lack the `new' keyword when
19389         overriding a name.  Report warnings when `new' is used without
19390         anything being there to override.
19391
19392         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19393
19394         * class.cs: Only add constructor to hashtable if it is non-null
19395         (as now constructors can fail on define).
19396
19397         (TypeManager, Class, Struct): Take location arguments.
19398
19399         Catch field instance initialization in structs as errors.
19400
19401         accepting_filter: a new filter for FindMembers that is static so
19402         that we dont create an instance per invocation.
19403
19404         (Constructor::Define): Catch errors where a struct constructor is
19405         parameterless 
19406
19407         * cs-parser.jay: Pass location information for various new
19408         constructs. 
19409
19410         * delegate.cs (Delegate): take a location argument.
19411
19412         * driver.cs: Do not call EmitCode if there were problesm in the
19413         Definition of the types, as many Builders wont be there. 
19414
19415         * decl.cs (Decl::Decl): Require a location argument.
19416
19417         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19418         into integers, and find the most appropiate integer for it.
19419
19420         * literal.cs: Implement ULongLiteral.
19421
19422         * rootcontext.cs: Provide better information about the location of
19423         failure when CreateType fails.
19424
19425 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19426
19427         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19428         as well.
19429
19430         * expression.cs (Binary::CheckShiftArguments): Add missing type
19431         computation.
19432         (Binary::ResolveOperator): Add type to the logical and and logical
19433         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19434         before.
19435
19436         (Binary::DoNumericPromotions): In the case where either argument
19437         is ulong (and most signed types combined with ulong cause an
19438         error) perform implicit integer constant conversions as well.
19439
19440 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19441
19442         * expression.cs (UserImplicitCast): Method should always be
19443         non-null. 
19444         (Invocation::BetterConversion): Simplified test for IntLiteral.
19445
19446         (Expression::ImplicitNumericConversion): Split this routine out.
19447         Put the code that performs implicit constant integer conversions
19448         here. 
19449
19450         (Expression::Resolve): Become a wrapper around DoResolve so we can
19451         check eclass and type being set after resolve.
19452
19453         (Invocation::Badness): Remove this dead function
19454
19455         (Binary::ResolveOperator): Do not compute the expensive argumnets
19456         unless we have a union for it.
19457
19458         (Probe::Emit): Is needs to do an isinst and then
19459         compare against null.
19460
19461         (::CanConvert): Added Location argument.  If the Location argument
19462         is null (Location.Null), then we do not report errors.  This is
19463         used by the `probe' mechanism of the Explicit conversion.  We do
19464         not want to generate an error for something that the user
19465         explicitly requested to be casted.  But the pipeline for an
19466         explicit cast first tests for potential implicit casts.
19467
19468         So for now, if the Location is null, it means `Probe only' to
19469         avoid adding another argument.   Might have to revise this
19470         strategy later.
19471
19472         (ClassCast): New class used to type cast objects into arbitrary
19473         classes (used in Explicit Reference Conversions).
19474
19475         Implement `as' as well.
19476
19477         Reverted all the patches from Ravi below: they were broken:
19478
19479                 * The use of `level' as a mechanism to stop recursive
19480                   invocations is wrong.  That was there just to catch the
19481                   bug with a strack trace but not as a way of addressing
19482                   the problem.
19483
19484                   To fix the problem we have to *understand* what is going
19485                   on and the interactions and come up with a plan, not
19486                   just get things going.
19487
19488                 * The use of the type conversion cache that I proposed
19489                   last night had an open topic: How does this work across
19490                   protection domains.  A user defined conversion might not
19491                   be public in the location where we are applying the
19492                   conversion, a different conversion might be selected
19493                   (ie, private A->B (better) but public B->A (worse),
19494                   inside A, A->B applies, but outside it, B->A will
19495                   apply).
19496
19497                 * On top of that (ie, even if the above is solved),
19498                   conversions in a cache need to be abstract.  Ie, `To
19499                   convert from an Int to a Short use an OpcodeCast', not
19500                   `To convert from an Int to a Short use the OpcodeCast on
19501                   the variable 5' (which is what this patch was doing).
19502
19503 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19504
19505         * expression.cs (Invocation::ConversionExists): Re-write to use
19506         the conversion cache
19507
19508         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19509         cache all conversions done, not just user-defined ones.
19510
19511         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19512         to determine if a conversion exists instead of acutually trying to 
19513         perform the conversion. It's faster too.
19514
19515         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19516         and only then attempt the implicit conversion.
19517
19518 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19519
19520         * expression.cs (ConvertImplicit): Use a cache for conversions
19521         already found. Check level of recursion and bail out if necessary.
19522
19523 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19526         Export standard methods that we expect for string operations.
19527
19528         * statement.cs (Block::UsageWarning): Track usage of variables and
19529         report the errors for not used variables.
19530
19531         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19532         operator. 
19533
19534 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19535
19536         * codegen.cs: remove unnneded code 
19537
19538         * expression.cs: Removed BuiltinTypeAccess class
19539
19540         Fix the order in which implicit conversions are
19541         done.  
19542
19543         The previous fixed dropped support for boxed conversions (adding a
19544         test to the test suite now)
19545
19546         (UserImplicitCast::CanConvert): Remove test for source being null,
19547         that code is broken.  We should not feed a null to begin with, if
19548         we do, then we should track the bug where the problem originates
19549         and not try to cover it up here.
19550
19551         Return a resolved expression of type UserImplicitCast on success
19552         rather than true/false.  Ravi: this is what I was talking about,
19553         the pattern is to use a static method as a "constructor" for
19554         objects. 
19555
19556         Also, do not create arguments until the very last minute,
19557         otherwise we always create the arguments even for lookups that
19558         will never be performed. 
19559
19560         (UserImplicitCast::Resolve): Eliminate, objects of type
19561         UserImplicitCast are born in a fully resolved state. 
19562
19563         * typemanager.cs (InitCoreTypes): Init also value_type
19564         (System.ValueType). 
19565
19566         * expression.cs (Cast::Resolve): First resolve the child expression.
19567
19568         (LValue): Add new method AddressOf to be used by
19569         the `&' operator.  
19570
19571         Change the argument of Store to take an EmitContext instead of an
19572         ILGenerator, because things like FieldExpr need to be able to call
19573         their children expression to generate the instance code. 
19574
19575         (Expression::Error, Expression::Warning): Sugar functions for
19576         reporting errors.
19577
19578         (Expression::MemberLookup): Accept a TypeContainer instead of a
19579         Report as the first argument.
19580
19581         (Expression::ResolvePrimary): Killed.  I still want to improve
19582         this as currently the code is just not right.
19583
19584         (Expression::ResolveMemberAccess): Simplify, but it is still
19585         wrong. 
19586
19587         (Unary::Resolve): Catch errors in AddressOf operators.
19588
19589         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19590         index to a byte for the short-version, or the compiler will choose
19591         the wrong Emit call, which generates the wrong data.
19592
19593         (ParameterReference::Emit, ::Store): same.
19594
19595         (FieldExpr::AddressOf): Implement.
19596
19597         * typemanager.cs: TypeManager: made public variable instead of
19598         property.
19599
19600         * driver.cs: document --fatal.
19601
19602         * report.cs (ErrorMessage, WarningMessage): new names for the old
19603         Error and Warning classes.
19604
19605         * cs-parser.jay (member_access): Turn built-in access to types
19606         into a normal simplename
19607
19608 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19609
19610         * expression.cs (Invocation::BetterConversion): Fix to cope
19611         with q being null, since this was introducing a bug.
19612
19613         * expression.cs (ConvertImplicit): Do built-in conversions first.
19614
19615 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19616
19617         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19618
19619 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19620
19621         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19622         I had introduced long ago (what's new ?).
19623
19624         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19625         the work of all the checking. 
19626         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19627         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19628
19629         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19630         that is the right way. 
19631
19632         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19633         overloading resolution. Use everywhere instead of cutting and pasting code.
19634
19635         (Binary::ResolveOperator): Use MakeUnionSet.
19636
19637         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19638         we have to convert to bool types. Not complete yet.
19639
19640 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19641
19642         * typemanager.cs (TypeManager::CSharpName): support ushort.
19643
19644         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19645         to provide an expression that performsn an implicit constant int
19646         conversion (section 6.1.6).
19647         (Expression::ConvertImplicitRequired): Reworked to include
19648         implicit constant expression conversions.
19649
19650         (Expression::ConvertNumericExplicit): Finished.
19651
19652         (Invocation::Emit): If InstanceExpression is null, then it means
19653         that we perform a call on this.
19654
19655 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19656
19657         * expression.cs (Unary::Emit): Remove some dead code.
19658         (Probe): Implement Resolve and Emit for `is'.
19659         (Expression::ConvertImplicitRequired): Attempt to do constant
19660         expression conversions here.  Maybe should be moved to
19661         ConvertImplicit, but I am not sure.
19662         (Expression::ImplicitLongConstantConversionPossible,
19663         Expression::ImplicitIntConstantConversionPossible): New functions
19664         that tell whether is it possible to apply an implicit constant
19665         expression conversion.
19666
19667         (ConvertNumericExplicit): Started work on explicit numeric
19668         conversions.
19669
19670         * cs-parser.jay: Update operator constants.
19671
19672         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19673         (Parameters::GetSignature): Hook up VerifyArgs here.
19674         (Parameters::VerifyArgs): Verifies that no two arguments have the
19675         same name. 
19676
19677         * class.cs (Operator): Update the operator names to reflect the
19678         ones that the spec expects (as we are just stringizing the
19679         operator names).
19680
19681         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19682         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19683         previous usage did only work for our methods.
19684         (Expression::ConvertImplicit): Handle decimal implicit numeric
19685         conversions as well.
19686         (Expression::InternalTypeConstructor): Used to invoke constructors
19687         on internal types for default promotions.
19688
19689         (Unary::Emit): Implement special handling for the pre/post
19690         increment/decrement for overloaded operators, as they need to have
19691         the same semantics as the other operators.
19692
19693         (Binary::ResolveOperator): ditto.
19694         (Invocation::ConversionExists): ditto.
19695         (UserImplicitCast::Resolve): ditto.
19696
19697 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19698
19699         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19700         operator, return after emitting body. Regression tests pass again !
19701
19702         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19703         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19704         (Invocation::OverloadResolve): Ditto.
19705         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19706
19707         * everywhere : update calls to the above methods accordingly.
19708
19709 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19712
19713         * expression.cs (ExpressionStatement): New base class used for
19714         expressions that can appear in statements, so that we can provide
19715         an alternate path to generate expression that do not leave a value
19716         on the stack.
19717
19718         (Expression::Emit, and all the derivatives): We no longer return
19719         whether a value is left on the stack or not.  Every expression
19720         after being emitted leaves a single value on the stack.
19721
19722         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19723         facilties of ExpressionStatement if possible.
19724
19725         * cs-parser.jay: Update statement_expression.
19726
19727 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19728
19729         * driver.cs: Change the wording of message
19730
19731 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19732
19733         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19734         the type of the expression to the return type of the method if
19735         we have an overloaded operator match ! The regression tests pass again !
19736         (Unary::ResolveOperator): Ditto.
19737
19738         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19739         to find "op_Implicit", not "implicit" ;-)
19740         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19741         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19742
19743         * everywhere : Correct calls to the above accordingly.
19744
19745         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19746         (ConvertImplicit): Do user-defined conversion if it exists.
19747
19748 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19749
19750         * assign.cs: track location.
19751         (Resolve): Use implicit conversions on assignment.
19752
19753         * literal.cs: Oops.  Not good, Emit of short access values should
19754         pass (Bytes) or the wrong argument will be selected.
19755
19756         * expression.cs (Unary::Emit): Emit code for -expr.
19757
19758         (Unary::ResolveOperator): Handle `Substract' for non-constants
19759         (substract from zero from the non-constants).
19760         Deal with Doubles as well. 
19761
19762         (Expression::ConvertImplicitRequired): New routine that reports an
19763         error if no implicit conversion exists. 
19764
19765         (Invocation::OverloadResolve): Store the converted implicit
19766         expressions if we make them
19767
19768 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19769
19770         * class.cs (ConstructorInitializer): Take a Location argument.
19771         (ConstructorBaseInitializer): Same here.
19772         (ConstructorThisInitializer): Same here.
19773
19774         * cs-parser.jay : Update all calls accordingly.
19775
19776         * expression.cs (Unary, Binary, New): Take location argument.
19777         Update accordingly everywhere.
19778
19779         * cs-parser.jay : Update all calls to the above to take a location
19780         argument.
19781
19782         * class.cs : Ditto.
19783
19784 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19785
19786         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19787         (Invocation::BetterConversion): Same here
19788         (Invocation::ConversionExists): Ditto.
19789
19790         (Invocation::ConversionExists): Implement.
19791
19792 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19793
19794         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19795         Also take an additional TypeContainer argument.
19796
19797         * All over : Pass in TypeContainer as argument to OverloadResolve.
19798
19799         * typemanager.cs (CSharpName): Update to check for the string type and return
19800         that too.
19801
19802         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19803         a given method.
19804
19805 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19806
19807         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19808         (Invocation::BetterFunction): Implement.
19809         (Invocation::BetterConversion): Implement.
19810         (Invocation::ConversionExists): Skeleton, no implementation yet.
19811
19812         Okay, things work fine !
19813
19814 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19815
19816         * typemanager.cs: declare and load enum_type, delegate_type and
19817         void_type. 
19818
19819         * expression.cs (Expression::Emit): Now emit returns a value that
19820         tells whether a value is left on the stack or not.  This strategy
19821         might be reveted tomorrow with a mechanism that would address
19822         multiple assignments.
19823         (Expression::report118): Utility routine to report mismatches on
19824         the ExprClass.
19825
19826         (Unary::Report23): Report impossible type/operator combination
19827         utility function.
19828
19829         (Unary::IsIncrementableNumber): Whether the type can be
19830         incremented or decremented with add.
19831         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19832         complemented. 
19833         (Unary::ResolveOperator): Implement ++, !, ~,
19834
19835         (Invocation::Emit): Deal with new Emit convetion.
19836
19837         * All Expression derivatives: Updated their Emit method to return
19838         whether they leave values on the stack or not.
19839
19840         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19841         stack for expressions that are statements. 
19842
19843 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19844
19845         * expression.cs (LValue): New interface.  Must be implemented by
19846         LValue objects.
19847         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19848         LValue interface.
19849
19850         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19851         interface for generating code, simplifies the code.
19852
19853 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19854
19855         * expression.cs (everywhere): Comment out return statements in ::Resolve
19856         methods to avoid the warnings.
19857
19858 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19859
19860         * driver.cs (parse): Report error 2001 if we can not open the
19861         source file.
19862
19863         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19864         not resolve it.
19865
19866         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19867         object. 
19868
19869         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19870         otherwise nested blocks end up with the same index.
19871
19872         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19873
19874         * expression.cs:  Instead of having FIXMEs in the Resolve
19875         functions, throw exceptions so it is obvious that we are facing a
19876         bug. 
19877
19878         * cs-parser.jay (invocation_expression): Pass Location information.
19879
19880         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19881         Use a basename for those routines because .NET does not like paths
19882         on them. 
19883
19884         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19885         already defined.
19886
19887 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19888
19889         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19890         are loading the correct data types (throws an exception if not).
19891         (TypeManager::InitCoreTypes): Use CoreLookupType
19892
19893         * expression.cs (Unary::ResolveOperator): return the child
19894         expression for expressions which are just +expr.
19895         (Unary::ResolveOperator): Return negative literals for -LITERAL
19896         expressions (otherwise they are Unary {Literal}).
19897         (Invocation::Badness): Take into account `Implicit constant
19898         expression conversions'.
19899
19900         * literal.cs (LongLiteral): Implement long literal class.
19901         (IntLiteral): export the `Value' of the intliteral. 
19902
19903 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19904
19905         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19906
19907         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19908         instead of 'Operator'
19909
19910         * expression.cs (Binary::ResolveOperator): Update accordingly.
19911         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19912         and 'Minus'
19913
19914         * cs-parser.jay (unary_expression): Update to use the new names.
19915
19916         * gen-treedump.cs (GetUnary): Same here.
19917
19918         * expression.cs (Unary::Resolve): Implement.
19919         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19920         operators are found instead of making noise ;-)
19921         (Unary::ResolveOperator): New method to do precisely the same thing which
19922         Binary::ResolveOperator does for Binary expressions.
19923         (Unary.method, .Arguments): Add.
19924         (Unary::OperName): Implement.   
19925         (Unary::ForceConversion): Copy and Paste !
19926
19927         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19928         a unary operator.
19929
19930         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19931         for the inbuilt operators. Only overloading works for now ;-)
19932
19933 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19934
19935         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19936         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19937
19938         * expression.cs (This::Emit): Implement. 
19939         (This::Resolve): Implement.
19940         (TypeOf:Resolve): Implement.
19941         (Expression::ResolveSimpleName): Add an implicit this to instance
19942         field references. 
19943         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19944         Bind instance variable to Field expressions.
19945         (FieldExpr::Instance): New field used to track the expression that
19946         represents the object instance.
19947         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19948         binding 
19949         (FieldExpr::Emit): Implement.
19950
19951         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19952         the last instruction contains a return opcode to avoid generating
19953         the last `ret' instruction (this generates correct code, and it is
19954         nice to pass the peverify output).
19955
19956         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19957         initializer for static and instance variables.
19958         (Constructor::Emit): Allow initializer to be null in the case of
19959         static constructors.  Only emit initializer for instance
19960         constructors. 
19961
19962         (TypeContainer::FindMembers): Return a null array if there are no
19963         matches.
19964
19965         Also fix the code for the MemberTypes.Method branch, as it was not
19966         scanning that for operators (or tried to access null variables before).
19967
19968         * assign.cs (Assign::Emit): Handle instance and static fields. 
19969
19970         * TODO: Updated.
19971
19972         * driver.cs: Stop compilation if there are parse errors.
19973
19974         * cs-parser.jay (constructor_declaration): Provide default base
19975         initializer for non-static constructors.
19976         (constructor_declarator): Do not provide a default base
19977         initializers if none was specified.
19978         Catch the fact that constructors should not have parameters.
19979
19980         * class.cs: Do not emit parent class initializers for static
19981         constructors, that should be flagged as an error.
19982
19983 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19984
19985         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19986         Move back code into TypeContainer::Populate.
19987
19988 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19989
19990         * class.cs (TypeContainer::AddConstructor): Fix the check to
19991         compare against Name, not Basename. 
19992         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19993
19994         * cs-parser.jay : Update accordingly.
19995
19996         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19997         for methods, don't forget to look into the operators too.
19998         (RegisterMethodBuilder): Helper method to take care of this for
19999         methods, constructors and operators.
20000         (Operator::Define): Completely revamp.
20001         (Operator.OperatorMethod, MethodName): New fields.
20002         (TypeContainer::Populate): Move the registering of builders into
20003         RegisterMethodBuilder.
20004         (Operator::Emit): Re-write.
20005
20006         * expression.cs (Binary::Emit): Comment out code path to emit method
20007         invocation stuff for the case when we have a user defined operator. I am
20008         just not able to get it right !
20009
20010 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20011
20012         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20013         argument. 
20014
20015         (Expression::MemberLookup): Provide a version that allows to
20016         specify the MemberTypes and BindingFlags. 
20017
20018         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20019         so it was not fetching variable information from outer blocks.
20020
20021         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20022         Beforefieldinit as it was buggy.
20023
20024         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20025         that Ravi put here.  
20026
20027         * class.cs (Constructor::Emit): Only emit if block is not null.
20028         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20029         deal with this by semantically definining it as if the user had
20030         done it.
20031
20032         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20033         constructors as we now "emit" them at a higher level.
20034
20035         (TypeContainer::DefineDefaultConstructor): Used to define the
20036         default constructors if none was provided.
20037
20038         (ConstructorInitializer): Add methods Resolve and Emit. 
20039
20040         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20041
20042 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20043
20044         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20045         the default constructor builder with our hashtable for methodbuilders
20046         to methodcores.
20047
20048         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20049         and argument_count is 0 in which case we have a match.
20050         (Binary::ResolveOperator): More null checking and miscellaneous coding
20051         style cleanup.
20052
20053 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20054
20055         * rootcontext.cs (IsNameSpace): Compare against null.
20056
20057         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20058
20059         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20060         and Unary::Operator.
20061
20062         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20063         accordingly.
20064
20065         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20066         we have overloaded operators.
20067         (Binary::ResolveOperator): Implement the part which does the operator overload
20068         resolution.
20069
20070         * class.cs (Operator::Emit): Implement.
20071         (TypeContainer::Emit): Emit the operators we have too.
20072
20073         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20074         the case when we have a user-defined operator.
20075
20076 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20077
20078         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20079
20080 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20081
20082         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20083         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20084         (Constructor::Emit): Implement.
20085         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20086         if we have no work to do. 
20087         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20088         Emit method.
20089
20090         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20091         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20092
20093         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20094         of parent.parent.
20095
20096 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20097
20098         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20099         in the source.
20100         (Tree::RecordNamespace): Method to do what the name says ;-)
20101         (Tree::Namespaces): Property to get at the namespaces hashtable.
20102
20103         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20104         keep track.
20105
20106         * rootcontext.cs (IsNamespace): Fixed it :-)
20107
20108 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20109
20110         * class.cs (TypeContainer::FindMembers): Add support for
20111         constructors. 
20112         (MethodCore): New class that encapsulates both the shared aspects
20113         of a Constructor and a Method.  
20114         (Method, Constructor): Factored pieces into MethodCore.
20115
20116         * driver.cs: Added --fatal which makes errors throw exceptions.
20117         Load System assembly as well as part of the standard library.
20118
20119         * report.cs: Allow throwing exceptions on errors for debugging.
20120
20121         * modifiers.cs: Do not use `parent', instead use the real type
20122         container to evaluate permission settings.
20123
20124         * class.cs: Put Ravi's patch back in.  He is right, and we will
20125         have to cope with the
20126
20127 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20128
20129         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20130         FamORAssem, not FamANDAssem.
20131
20132 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20133
20134         * driver.cs: Added --parse option that only parses its input files
20135         and terminates.
20136
20137         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20138         incorrect.  IsTopLevel is not used to tell whether an object is
20139         root_types or not (that can be achieved by testing this ==
20140         root_types).  But to see if this is a top-level *class* (not
20141         necessarly our "toplevel" container). 
20142
20143 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20144
20145         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20146         parent instead of a direct call to GetType.
20147
20148 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20149
20150         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20151         Modifiers.TypeAttr. This should just be a call to that method.
20152
20153         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20154         object so that we can determine if we are top-level or not.
20155
20156         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20157         TypeContainer too.
20158
20159         * enum.cs (Enum::Define): Ditto.
20160
20161         * modifiers.cs (FieldAttr): Re-write.
20162
20163         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20164         (TypeContainer::HaveStaticConstructor): New property to provide access
20165         to precisely that info.
20166
20167         * modifiers.cs (MethodAttr): Re-write.
20168         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20169
20170         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20171         of top-level types as claimed.
20172
20173 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20174
20175         * expression.cs (MemberLookup): Fruitless attempt to lookup
20176         constructors.  Maybe I need to emit default constructors?  That
20177         might be it (currently .NET emits this for me automatically).
20178         (Invocation::OverloadResolve): Cope with Arguments == null.
20179         (Invocation::EmitArguments): new function, shared by the new
20180         constructor and us.
20181         (Invocation::Emit): Handle static and instance methods.  Emit
20182         proper call instruction for virtual or non-virtual invocations.
20183         (New::Emit): Implement.
20184         (New::Resolve): Implement.
20185         (MemberAccess:Resolve): Implement.
20186         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20187         to track instances.
20188         (FieldExpr::Resolve): Set type.
20189
20190         * support.cs: Handle empty arguments.
20191                 
20192         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20193         SimpleLookup): Auxiliary routines to help parse a qualifier
20194         identifier.  
20195
20196         Update qualifier_identifier rule.
20197
20198         * codegen.cs: Removed debugging messages.
20199
20200         * class.cs: Make this a global thing, this acts just as a "key" to
20201         objects that we might have around.
20202
20203         (Populate): Only initialize method_builders_to_methods once.
20204
20205         * expression.cs (PropertyExpr): Initialize type from the
20206         PropertyType. 
20207
20208         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20209         Resolve pattern.  Attempt to implicitly convert value to boolean.
20210         Emit code.
20211
20212         * expression.cs: Set the type for the int32/int32 argument case.
20213         (Binary::ResolveOperator): Set the return type to boolean for
20214         comparission operators
20215
20216         * typemanager.cs: Remove debugging print code.
20217
20218         (Invocation::Resolve): resolve type.
20219
20220         * class.cs: Allocate a MemberInfo of the correct size, as the code
20221         elsewhere depends on the test to reflect the correct contents.
20222
20223         (Method::) Keep track of parameters, due to System.Reflection holes
20224
20225         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20226         mapping here.
20227
20228         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20229         of the exact size and return that.
20230
20231         (Class::LookupMethodByBuilder): New function that maps
20232         MethodBuilders to its methods.  Required to locate the information
20233         on methods because System.Reflection bit us again.
20234
20235         * support.cs: New file, contains an interface ParameterData and
20236         two implementations: ReflectionParameters and InternalParameters
20237         used to access Parameter information.  We will need to grow this
20238         as required.
20239
20240         * expression.cs (Invocation::GetParameterData): implement a cache
20241         and a wrapper around the ParameterData creation for methods. 
20242         (Invocation::OverloadResolve): Use new code.
20243
20244 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20245
20246         * class.cs (TypeContainer::EmitField): Remove and move into 
20247         (Field::Define): here and modify accordingly.
20248         (Field.FieldBuilder): New member.
20249         (TypeContainer::Populate): Update accordingly.
20250         (TypeContainer::FindMembers): Implement.
20251
20252 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20253
20254         * statement.cs: (VariableInfo::VariableType): New field to be
20255         initialized with the full type once it is resolved. 
20256
20257 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20258
20259         * parameter.cs (GetParameterInfo): Use a type cache to compute
20260         things only once, and to reuse this information
20261
20262         * expression.cs (LocalVariableReference::Emit): Implement.
20263         (OpcodeCast::Emit): fix.
20264
20265         (ParameterReference::Resolve): Implement.
20266         (ParameterReference::Emit): Implement.
20267
20268         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20269         that are expressions need to stay as Expressions.
20270
20271         * typemanager.cs (CSharpName): Returns the C# name of a type if
20272         possible. 
20273
20274         * expression.cs (Expression::ConvertImplicit): New function that
20275         implements implicit type conversions.
20276
20277         (Expression::ImplicitReferenceConversion): Implements implicit
20278         reference conversions.
20279
20280         (EmptyCast): New type for transparent casts.
20281
20282         (OpcodeCast): New type for casts of types that are performed with
20283         a sequence of bytecodes.
20284
20285         (BoxedCast): New type used for casting value types into reference
20286         types.  Emits a box opcode.
20287
20288         (Binary::DoNumericPromotions): Implements numeric promotions of
20289         and computation of the Binary::Type.
20290
20291         (Binary::EmitBranchable): Optimization.
20292
20293         (Binary::Emit): Implement code emission for expressions.
20294
20295         * typemanager.cs (TypeManager): Added two new core types: sbyte
20296         and byte.
20297
20298 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20299
20300         * class.cs (TypeContainer::FindMembers): Method which does exactly
20301         what Type.FindMembers does, only we don't have to use reflection. No
20302         implementation yet.
20303
20304         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20305         typecontainer objects as we need to get at them.
20306         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20307
20308         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20309         typecontainer object.
20310
20311         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20312         of just a Report object.
20313
20314 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20315
20316         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20317         "remove_"
20318         (TypeContainer::Populate): Now define the delegates of the type too.
20319         (TypeContainer.Delegates): Property to access the list of delegates defined
20320         in the type.
20321
20322         * delegates.cs (Delegate::Define): Implement partially.
20323
20324         * modifiers.cs (TypeAttr): Handle more flags.
20325
20326 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20327
20328         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20329         and not <=
20330         (Operator::Define): Re-write logic to get types by using the LookupType method
20331         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20332         (Indexer::Define): Ditto.
20333         (Event::Define): Ditto.
20334         (Property::Define): Ditto.
20335
20336 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20337
20338         * class.cs (TypeContainer::Populate): Now define operators too. 
20339         (TypeContainer.Operators): New property to access the list of operators
20340         in a type.
20341         (Operator.OperatorMethodBuilder): New member to hold the method builder
20342         for the operator we are defining.
20343         (Operator::Define): Implement.
20344
20345 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20346
20347         * class.cs (Event::Define): Make the prefixes of the accessor methods
20348         addOn_ and removeOn_ 
20349
20350         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20351         of the location being passed in too. Ideally, this should go later since all
20352         error reporting should be done through the Report object.
20353
20354         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20355         (Populate): Iterate thru the indexers we have and define them too.
20356         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20357         for the get and set accessors.
20358         (Indexer::Define): Implement.
20359
20360 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20361
20362         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20363         my previous implementation, did not work.
20364
20365         * typemanager.cs: Add a couple of missing types (the longs).
20366
20367         * literal.cs: Use TypeManager.bool_type instead of getting it.
20368
20369         * expression.cs (EventExpr): New kind of expressions.
20370         (Expressio::ExprClassFromMemberInfo): finish
20371
20372 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20373
20374         * assign.cs: Emit stores to static fields differently.
20375
20376 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20377
20378         * Merge in changes and adjust code to tackle conflicts. Backed out my
20379         code in Assign::Resolve ;-) 
20380
20381 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20382
20383         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20384         instead Report.Error and also pass in the location.
20385         (CSharpParser::Lexer): New readonly property to return the reference
20386         to the Tokenizer object.
20387         (declare_local_variables): Use Report.Error with location instead of plain 
20388         old error.
20389         (CheckDef): Ditto.
20390
20391         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20392         (Operator.CheckBinaryOperator): Ditto.
20393
20394         * cs-parser.jay (operator_declarator): Update accordingly.
20395
20396         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20397         (CheckBinaryOperator): Same here.
20398
20399         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20400         on the name without any prefixes of namespace names etc. This is because we
20401         already might have something already fully qualified like 
20402         'System.Console.WriteLine'
20403
20404         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20405
20406 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20407
20408         * cs-tokenizer.cs (location): Return a string which also contains
20409         the file name.
20410
20411         * expression.cs (ElementAccess): New class for expressions of the
20412         type 'element access.'
20413         (BaseAccess): New class for expressions of the type 'base access.'
20414         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20415         respectively.
20416
20417         * cs-parser.jay (element_access): Implement action.
20418         (base_access): Implement actions.
20419         (checked_expression, unchecked_expression): Implement.
20420
20421         * cs-parser.jay (local_variable_type): Correct and implement.
20422         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20423
20424         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20425
20426         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20427         name and the specifiers.
20428
20429         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20430
20431         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20432         making them all public ;-)
20433
20434         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20435         class anyways.
20436
20437 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20438
20439         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20440         PropertyExprs.
20441         (FieldExpr, PropertyExprs): New resolved expressions.
20442         (SimpleName::MemberStaticCheck): Perform static checks for access
20443         to non-static fields on static methods. Maybe this should be
20444         generalized for MemberAccesses. 
20445         (SimpleName::ResolveSimpleName): More work on simple name
20446         resolution. 
20447
20448         * cs-parser.jay (primary_expression/qualified_identifier): track
20449         the parameter index.
20450
20451         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20452         (EmitContext::EmitBoolExpression): Chain to expression generation
20453         instead of temporary hack.
20454         (::EmitStatementExpression): Put generic expression code generation.
20455
20456         * assign.cs (Assign::Emit): Implement variable assignments to
20457         local variables, parameters and fields.
20458
20459 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20460
20461         * statement.cs (Block::GetVariableInfo): New method, returns the
20462         VariableInfo for a variable name in a block.
20463         (Block::GetVariableType): Implement in terms of GetVariableInfo
20464
20465         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20466         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20467
20468 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20469
20470         * cs-parser.jay (operator_declaration): Continue on my quest : update
20471         to take attributes argument.
20472         (event_declaration): Ditto.
20473         (enum_declaration): Ditto.
20474         (indexer_declaration): Ditto.
20475
20476         * class.cs (Operator::Operator): Update constructor accordingly.
20477         (Event::Event): Ditto.
20478
20479         * delegate.cs (Delegate::Delegate): Same here.
20480
20481         * enum.cs (Enum::Enum): Same here.
20482
20483 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20484
20485         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20486
20487         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20488
20489         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20490         being passed around as an arraylist.
20491         (Attributes::AddAttribute): Method to add attribute sections.
20492
20493         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20494         (struct_declaration): Update accordingly.
20495         (constant_declaration): Update.
20496         (field_declaration): Update.
20497         (method_header): Update.
20498         (fixed_parameter): Update.
20499         (parameter_array): Ditto.
20500         (property_declaration): Ditto.
20501         (destructor_declaration): Ditto.
20502
20503         * class.cs (Struct::Struct): Update constructors accordingly.
20504         (Class::Class): Ditto.
20505         (Field::Field): Ditto.
20506         (Method::Method): Ditto.
20507         (Property::Property): Ditto.
20508         (TypeContainer::OptAttribute): update property's return type.
20509
20510         * interface.cs (Interface.opt_attributes): New member.
20511         (Interface::Interface): Update to take the extra Attributes argument.
20512
20513         * parameter.cs (Parameter::Parameter): Ditto.
20514
20515         * constant.cs (Constant::Constant): Ditto.
20516
20517         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20518         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20519         the attributes as a parameter.
20520         (InterfaceProperty): Update constructor call.
20521         (InterfaceEvent): Ditto.
20522         (InterfaceMethod): Ditto.
20523         (InterfaceIndexer): Ditto.
20524
20525         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20526         pass the attributes too.
20527         (interface_event_declaration): Ditto.
20528         (interface_property_declaration): Ditto.
20529         (interface_method_declaration): Ditto.
20530         (interface_declaration): Ditto.
20531
20532 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20533
20534         * class.cs (Method::Define): Track the "static Main" definition to
20535         create an entry point. 
20536
20537         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20538         EntryPoint if we find it. 
20539
20540         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20541         (EmitContext::ig): Make this variable public.
20542
20543         * driver.cs: Make the default output file be the first file name
20544         with the .exe extension.  
20545
20546         Detect empty compilations
20547
20548         Handle various kinds of output targets.  Handle --target and
20549         rename -t to --dumper.
20550
20551         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20552         methods inherited from Expression return now an Expression.  This
20553         will is used during the tree rewriting as we resolve them during
20554         semantic analysis.
20555
20556         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20557         the spec.  Missing entirely is the information about
20558         accessability of elements of it.
20559
20560         (Expression::ExprClassFromMemberInfo): New constructor for
20561         Expressions that creates a fully initialized Expression based on
20562         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20563         a Type.
20564
20565         (Invocation::Resolve): Begin implementing resolution of invocations.
20566
20567         * literal.cs (StringLiteral):  Implement Emit.
20568
20569 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20570
20571         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20572         member.
20573
20574 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20575
20576         * cs-parser.jay (attribute_arguments): Implement actions.
20577         (attribute): Fix bug in production. Implement action.
20578         (attribute_list): Implement.
20579         (attribute_target): Implement.
20580         (attribute_target_specifier, opt_target_specifier): Implement
20581         (CheckAttributeTarget): New method to check if the attribute target
20582         is valid.
20583         (attribute_section): Implement.
20584         (opt_attributes): Implement.
20585
20586         * attribute.cs : New file to handle attributes.
20587         (Attribute): Class to hold attribute info.
20588
20589         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20590         (attribute_section): Modify production to use 2 different rules to 
20591         achieve the same thing. 1 s/r conflict down !
20592         Clean out commented, useless, non-reducing dimension_separator rules.
20593
20594         * class.cs (TypeContainer.attributes): New member to hold list
20595         of attributes for a type.
20596         (Struct::Struct): Modify to take one more argument, the attribute list.
20597         (Class::Class): Ditto.
20598         (Field::Field): Ditto.
20599         (Method::Method): Ditto.
20600         (Property::Property): Ditto.
20601
20602         * cs-parser.jay (struct_declaration): Update constructor call to
20603         pass in the attributes too.
20604         (class_declaration): Ditto.
20605         (constant_declaration): Ditto.
20606         (field_declaration): Ditto.
20607         (method_header): Ditto.
20608         (fixed_parameter): Ditto.
20609         (parameter_array): Ditto.
20610         (property_declaration): Ditto.
20611
20612         * constant.cs (Constant::Constant): Update constructor similarly.
20613         Use System.Collections.
20614
20615         * parameter.cs (Parameter::Parameter): Update as above.
20616
20617 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20618
20619         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20620         (TypeContainer.delegates): New member to hold list of delegates.
20621
20622         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20623         this time as I seem to be on crack ;-)
20624
20625 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20626
20627         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20628         tell whether an identifier represents a namespace.
20629
20630         * expression.cs (NamespaceExpr): A namespace expression, used only
20631         temporarly during expression resolution.
20632         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20633         utility functions to resolve names on expressions.
20634
20635 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20636
20637         * codegen.cs: Add hook for StatementExpressions. 
20638
20639         * class.cs: Fix inverted test for static flag in methods.
20640
20641 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20642
20643         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20644         to make it coincide with MS' number.
20645         (Operator::CheckBinaryOperator): Ditto.
20646
20647         * ../errors/errors.txt : Remove error numbers added earlier.
20648
20649         * ../errors/cs1019.cs : Test case for error # 1019
20650
20651         * ../errros/cs1020.cs : Test case for error # 1020
20652
20653         * cs-parser.jay : Clean out commented cruft.
20654         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20655         used anywhere - non-reducing rule.
20656         (namespace_declarations): Non-reducing rule - comment out.
20657
20658         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20659         with TypeContainer::AddEnum.
20660
20661         * delegate.cs : New file for delegate handling classes.
20662         (Delegate): Class for declaring delegates.
20663
20664         * makefile : Update.
20665
20666         * cs-parser.jay (delegate_declaration): Implement.
20667
20668 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20669
20670         * class.cs (Event::Define): Implement.
20671         (Event.EventBuilder): New member.
20672
20673         * class.cs (TypeContainer::Populate): Update to define all enums and events
20674         we have.
20675         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20676         readonly fields for all these cases ?
20677
20678 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20679
20680         * class.cs (Property): Revamp to use the convention of making fields readonly.
20681         Accordingly modify code elsewhere.
20682
20683         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20684         the Define method of the Property class.
20685
20686         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20687         trivial bug.
20688         (TypeContainer::Populate): Update to define all the properties we have. Also
20689         define all enumerations.
20690
20691         * enum.cs (Define): Implement.
20692
20693 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20694
20695         * cs-parser.jay (overloadable_operator): The semantic value is an
20696         enum of the Operator class.
20697         (operator_declarator): Implement actions.
20698         (operator_declaration): Implement.
20699
20700         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20701         validity of definitions.
20702         (Operator::CheckBinaryOperator): Static method to check for binary operators
20703         (TypeContainer::AddOperator): New method to add an operator to a type.
20704
20705         * cs-parser.jay (indexer_declaration): Added line to actually call the
20706         AddIndexer method so it gets added ;-)
20707
20708         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20709         already taken care of by the MS compiler ?  
20710
20711 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20712
20713         * class.cs (Operator): New class for operator declarations.
20714         (Operator::OpType): Enum for the various operators.
20715
20716 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20717
20718         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20719         ostensibly handle this in semantic analysis.
20720
20721         * cs-parser.jay (general_catch_clause): Comment out
20722         (specific_catch_clauses, specific_catch_clause): Ditto.
20723         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20724         (catch_args, opt_catch_args): New productions.
20725         (catch_clause): Rewrite to use the new productions above
20726         (catch_clauses): Modify accordingly.
20727         (opt_catch_clauses): New production to use in try_statement
20728         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20729         and re-write the code in the actions to extract the specific and
20730         general catch clauses by being a little smart ;-)
20731
20732         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20733         Hooray, try and catch statements parse fine !
20734
20735 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20736
20737         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20738         string from the hashtable of variables.
20739
20740         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20741         I end up making that mistake ;-)
20742         (catch_clauses): Fixed gross error which made Key and Value of the 
20743         DictionaryEntry the same : $1 !!
20744
20745 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20746
20747         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20748
20749         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20750         when the add and remove accessors are specified. 
20751
20752 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20753
20754         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20755         information about indexer_declarator.
20756         (indexer_declarator): Implement actions.
20757         (parsing_indexer): New local boolean used to keep track of whether
20758         we are parsing indexers or properties. This is necessary because 
20759         implicit_parameters come into picture even for the get accessor in the 
20760         case of an indexer.
20761         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20762
20763         * class.cs (Indexer): New class for indexer declarations.
20764         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20765         (TypeContainer::indexers): New member to hold list of indexers for the
20766         type.
20767
20768 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20769
20770         * cs-parser.jay (add_accessor_declaration): Implement action.
20771         (remove_accessor_declaration): Implement action.
20772         (event_accessors_declaration): Implement
20773         (variable_declarators): swap statements for first rule - trivial.
20774
20775         * class.cs (Event): New class to hold information about event
20776         declarations.
20777         (TypeContainer::AddEvent): New method to add an event to a type
20778         (TypeContainer::events): New member to hold list of events.
20779
20780         * cs-parser.jay (event_declaration): Implement actions.
20781
20782 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20783
20784         * cs-parser.jay (dim_separators): Implement. Make it a string
20785         concatenating all the commas together, just as they appear.
20786         (opt_dim_separators): Modify accordingly
20787         (rank_specifiers): Update accordingly. Basically do the same
20788         thing - instead, collect the brackets here.
20789         (opt_rank_sepcifiers): Modify accordingly.
20790         (array_type): Modify to actually return the complete type string
20791         instead of ignoring the rank_specifiers.
20792         (expression_list): Implement to collect the expressions
20793         (variable_initializer): Implement. We make it a list of expressions
20794         essentially so that we can handle the array_initializer case neatly too.
20795         (variable_initializer_list): Implement.
20796         (array_initializer): Make it a list of variable_initializers
20797         (opt_array_initializer): Modify accordingly.
20798
20799         * expression.cs (New::NType): Add enumeration to help us
20800         keep track of whether we have an object/delegate creation
20801         or an array creation.
20802         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20803         members to hold data about array creation.
20804         (New:New): Modify to update NewType
20805         (New:New): New Overloaded contructor for the array creation
20806         case.
20807
20808         * cs-parser.jay (array_creation_expression): Implement to call
20809         the overloaded New constructor.
20810
20811 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20812
20813         * class.cs (TypeContainer::Constructors): Return member
20814         constructors instead of returning null.
20815
20816 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20817
20818         * typemanager.cs (InitCoreTypes): Initialize the various core
20819         types after we have populated the type manager with the user
20820         defined types (this distinction will be important later while
20821         compiling corlib.dll)
20822
20823         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20824         on Expression Classification.  Now all expressions have a method
20825         `Resolve' and a method `Emit'.
20826
20827         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20828         generation from working.     Also add some temporary debugging
20829         code. 
20830
20831 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20832
20833         * codegen.cs: Lots of code generation pieces.  This is only the
20834         beginning, will continue tomorrow with more touches of polish.  We
20835         handle the fundamentals of if, while, do, for, return.  Others are
20836         trickier and I need to start working on invocations soon.
20837
20838         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20839         s.InitStatement. 
20840
20841         * codegen.cs (EmitContext): New struct, used during code
20842         emission to keep a context.   Most of the code generation will be
20843         here. 
20844
20845         * cs-parser.jay: Add embedded blocks to the list of statements of
20846         this block.  So code generation proceeds in a top down fashion.
20847
20848 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20849
20850         * statement.cs: Add support for multiple child blocks.
20851
20852 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20853
20854         * codegen.cs (EmitCode): New function, will emit the code for a
20855         Block of code given a TypeContainer and its ILGenerator. 
20856
20857         * statement.cs (Block): Standard public readonly optimization.
20858         (Block::Block constructors): Link children. 
20859         (Block::Child): Child Linker.
20860         (Block::EmitVariables): Emits IL variable declarations.
20861
20862         * class.cs: Drop support for MethodGroups here, delay until
20863         Semantic Analysis.
20864         (Method::): Applied the same simplification that I did before, and
20865         move from Properties to public readonly fields.
20866         (Method::ParameterTypes): Returns the parameter types for the
20867         function, and implements a cache that will be useful later when I
20868         do error checking and the semantic analysis on the methods is
20869         performed.
20870         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20871         and made a method, optional argument tells whether this is a class
20872         or a structure to apply the `has-this' bit.
20873         (Method::GetCallingConvention): Implement, returns the calling
20874         convention. 
20875         (Method::Define): Defines the type, a second pass is performed
20876         later to populate the methods.
20877
20878         (Constructor::ParameterTypes): implement a cache similar to the
20879         one on Method::ParameterTypes, useful later when we do semantic
20880         analysis. 
20881
20882         (TypeContainer::EmitMethod):  New method.  Emits methods.
20883
20884         * expression.cs: Removed MethodGroup class from here.
20885
20886         * parameter.cs (Parameters::GetCallingConvention): new method.
20887
20888 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20889
20890         * class.cs (TypeContainer::Populate): Drop RootContext from the
20891         argument. 
20892
20893         (Constructor::CallingConvention): Returns the calling convention.
20894         (Constructor::ParameterTypes): Returns the constructor parameter
20895         types. 
20896
20897         (TypeContainer::AddConstructor): Keep track of default constructor
20898         and the default static constructor.
20899
20900         (Constructor::) Another class that starts using `public readonly'
20901         instead of properties. 
20902
20903         (Constructor::IsDefault): Whether this is a default constructor. 
20904
20905         (Field::) use readonly public fields instead of properties also.
20906
20907         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20908         track of static constructors;  If none is used, turn on
20909         BeforeFieldInit in the TypeAttributes. 
20910
20911         * cs-parser.jay (opt_argument_list): now the return can be null
20912         for the cases where there are no arguments. 
20913
20914         (constructor_declarator): If there is no implicit `base' or
20915         `this', then invoke the default parent constructor. 
20916
20917         * modifiers.cs (MethodAttr): New static function maps a set of
20918         modifiers flags into a MethodAttributes enum
20919         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20920         MethodAttr, TypeAttr to represent the various mappings where the
20921         modifiers are used.
20922         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20923
20924 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20925
20926         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20927         method arguments.
20928
20929         * interface.cs (PopulateIndexer): Implemented the code generator
20930         for interface indexers.
20931
20932 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20933
20934         * interface.cs (InterfaceMemberBase): Now we track the new status
20935         here.  
20936
20937         (PopulateProperty): Implement property population.  Woohoo!  Got
20938         Methods and Properties going today. 
20939
20940         Removed all the properties for interfaces, and replaced them with
20941         `public readonly' fields. 
20942
20943 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20944
20945         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20946         initialize their hashtables/arraylists only when they are needed
20947         instead of doing this always.
20948
20949         * parameter.cs: Handle refs and out parameters.
20950
20951         * cs-parser.jay: Use an ArrayList to construct the arguments
20952         instead of the ParameterCollection, and then cast that to a
20953         Parameter[] array.
20954
20955         * parameter.cs: Drop the use of ParameterCollection and use
20956         instead arrays of Parameters.
20957
20958         (GetParameterInfo): Use the Type, not the Name when resolving
20959         types. 
20960
20961 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20962
20963         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20964         and instead use public readonly fields.
20965
20966         * class.cs: Put back walking code for type containers.
20967
20968 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20969
20970         * class.cs (MakeConstant): Code to define constants.
20971
20972         * rootcontext.cs (LookupType): New function.  Used to locate types 
20973
20974
20975 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20976
20977         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20978         this System.Reflection code is.  Kudos to Microsoft
20979
20980         * typemanager.cs: Implement a type cache and avoid loading all
20981         types at boot time.  Wrap in LookupType the internals.  This made
20982         the compiler so much faster.  Wow.  I rule!
20983
20984         * driver.cs: Make sure we always load mscorlib first (for
20985         debugging purposes, nothing really important).
20986
20987         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20988         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20989
20990         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20991         on namespaces that have been imported using the `using' keyword.
20992
20993         * class.cs (TypeContainer::TypeAttr): Virtualize.
20994         (Class::TypeAttr): Return attributes suitable for this bad boy.
20995         (Struct::TypeAttr): ditto.
20996         Handle nested classes.
20997         (TypeContainer::) Remove all the type visiting code, it is now
20998         replaced with the rootcontext.cs code
20999
21000         * rootcontext.cs (GetClassBases): Added support for structs. 
21001
21002 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21003
21004         * interface.cs, statement.cs, class.cs, parameter.cs,
21005         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21006         Drop use of TypeRefs, and use strings instead.
21007
21008 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21009
21010         * rootcontext.cs: 
21011
21012         * class.cs (Struct::Struct): set the SEALED flags after
21013         checking the modifiers.
21014         (TypeContainer::TypeAttr): new property, returns the
21015         TypeAttributes for a class.  
21016
21017         * cs-parser.jay (type_list): Oops, list production was creating a
21018         new list of base types.
21019
21020         * rootcontext.cs (StdLib): New property.
21021         (GetInterfaceTypeByName): returns an interface by type name, and
21022         encapsulates error handling here.
21023         (GetInterfaces): simplified.
21024         (ResolveTree): Encapsulated all the tree resolution here.
21025         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21026         types. 
21027
21028         * driver.cs: Add support for --nostdlib, to avoid loading the
21029         default assemblies.
21030         (Main): Do not put tree resolution here. 
21031
21032         * rootcontext.cs: Beginning of the class resolution.
21033
21034 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21035
21036         * rootcontext.cs: Provide better error reporting. 
21037
21038         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21039
21040         * rootcontext.cs (CreateInterface): Handle the case where there
21041         are no parent interfaces.
21042
21043         (CloseTypes): Routine to flush types at the end.
21044         (CreateInterface): Track types.
21045         (GetInterfaces): Returns an array of Types from the list of
21046         defined interfaces.
21047
21048         * typemanager.c (AddUserType): Mechanism to track user types (puts
21049         the type on the global type hash, and allows us to close it at the
21050         end). 
21051
21052 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21053
21054         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21055         RecordInterface instead.
21056
21057         * cs-parser.jay: Updated to reflect changes above.
21058
21059         * decl.cs (Definition): Keep track of the TypeBuilder type that
21060         represents this type here.  Not sure we will use it in the long
21061         run, but wont hurt for now.
21062
21063         * driver.cs: Smaller changes to accomodate the new code.
21064
21065         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21066         when done. 
21067
21068         * rootcontext.cs (CreateInterface):  New method, used to create
21069         the System.TypeBuilder type for interfaces.
21070         (ResolveInterfaces): new entry point to resolve the interface
21071         hierarchy. 
21072         (CodeGen): Property, used to keep track of the code generator.
21073
21074 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21075
21076         * cs-parser.jay: Add a second production for delegate_declaration
21077         with `VOID'.
21078
21079         (enum_body): Put an opt_comma here instead of putting it on
21080         enum_body or enum_member_declarations so we can handle trailing
21081         commas on enumeration members.  Gets rid of a shift/reduce.
21082
21083         (type_list): Need a COMMA in the middle.
21084
21085         (indexer_declaration): Tell tokenizer to recognize get/set
21086
21087         * Remove old targets.
21088
21089         * Re-add the parser target.
21090
21091 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21092
21093         * cs-parser.jay: Add precendence rules for a number of operators
21094         ot reduce the number of shift/reduce conflicts in the grammar.
21095
21096 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21097
21098         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21099         and put it here.
21100
21101         Get rid of old crufty code.
21102
21103         * rootcontext.cs: Use this to keep track of the parsed
21104         representation and the defined types available to the program. 
21105
21106         * gen-treedump.cs: adjust for new convention.
21107
21108         * type.cs: Split out the type manager, and the assembly builder
21109         from here. 
21110
21111         * typemanager.cs: the type manager will live here now.
21112
21113         * cil-codegen.cs: And the code generator here. 
21114
21115 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21116
21117         * makefile: Fixed up for easy making.
21118
21119 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21120
21121         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21122         the 
21123
21124         (unary_expression): Expand pre_increment_expression and
21125         post_decrement_expression to reduce a shift/reduce.
21126
21127 2001-07-11  Simon Cozens
21128
21129         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21130
21131         Improve allow_keyword_as_indent name.
21132
21133 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21134
21135         * Adjustments for Beta2. 
21136
21137 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21138
21139         * decl.cs: Added `Define' abstract method.
21140         (InTransit): new property, used to catch recursive definitions. 
21141
21142         * interface.cs: Implement `Define'. 
21143
21144         * modifiers.cs: Map Modifiers.constants to
21145         System.Reflection.TypeAttribute flags.
21146
21147         * class.cs: Keep track of types and user-defined types.
21148         (BuilderInit): New method for creating an assembly
21149         (ResolveType): New function to launch the resolution process, only
21150         used by interfaces for now.
21151
21152         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21153         that are inserted into the name space. 
21154
21155 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21156
21157         * ARGH.  I have screwed up my tree so many times due to the use of
21158         rsync rather than using CVS.  Going to fix this at once. 
21159
21160         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21161         load types.
21162
21163 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21164
21165         * Experiment successful: Use System.Type rather that our own
21166         version of Type.  
21167
21168 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21169
21170         * cs-parser.jay: Removed nsAliases from here.
21171
21172         Use new namespaces, handle `using XXX;' 
21173
21174         * namespace.cs: Reimplemented namespace handling, use a recursive
21175         definition of the class.  Now we can keep track of using clauses
21176         and catch invalid using clauses.
21177
21178 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21179
21180         * gen-treedump.cs: Adapted for all the renaming.
21181
21182         * expression.cs (Expression): this class now has a Type property
21183         which returns an expression Type.
21184
21185         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21186         `Type', as this has a different meaning now in the base
21187
21188 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21189
21190         * interface.cs, class.cs: Removed from all the sources the
21191         references to signature computation, as we can not do method
21192         signature computation during the parsing time, as we are not
21193         trying to solve at that point distinguishing:
21194
21195         class X {
21196                 void a (Blah x) {}
21197                 void a (NS.Blah x) {}
21198         }
21199
21200         Which depending on the context might be valid or not, as we do not
21201         know if Blah is the same thing as NS.Blah at that point.
21202
21203         * Redid everything so the code uses TypeRefs now instead of
21204         Types.  TypeRefs are just temporary type placeholders, that need
21205         to be resolved.  They initially have a pointer to a string and the
21206         current scope in which they are used.  This is used later by the
21207         compiler to resolve the reference to an actual Type. 
21208
21209         * DeclSpace is no longer a CIR.Type, and neither are
21210         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21211         are all DeclSpaces, but no Types. 
21212
21213         * type.cs (TypeRefManager): This implements the TypeRef manager,
21214         which keeps track of all the types that need to be resolved after
21215         the parsing has finished. 
21216
21217 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21218
21219         * ARGH.  We are going to have to store `foreach' as a class rather
21220         than resolving it, as we need to verify error 1579 after name
21221         resolution.   *OR* we could keep a flag that says `This request to
21222         IEnumerator comes from a foreach statement' which we can then use
21223         to generate the error.
21224
21225 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21226
21227         * class.cs (TypeContainer.AddMethod): we now add methods to the
21228         MethodGroup instead of the method hashtable.  
21229
21230         * expression.cs: Add MethodGroup abstraction, which gets us one
21231         step closer to the specification in the way we handle method
21232         declarations.  
21233
21234         * cs-parser.jay (primary_expression): qualified_identifier now
21235         tried to match up an identifier to a local variable reference or
21236         to a parameter reference.
21237
21238         current_local_parameters is now a parser global variable that
21239         points to the current parameters for the block, used during name
21240         lookup.
21241
21242         (property_declaration): Now creates an implicit `value' argument to
21243         the set accessor.
21244
21245 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21246
21247         * parameter.cs: Do not use `param' arguments as part of the
21248         signature, per the spec.
21249
21250 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21251
21252         * decl.cs: Base class for classes, structs and interfaces.  This
21253         is the "Declaration Space" 
21254
21255         * cs-parser.jay: Use CheckDef for checking declaration errors
21256         instead of having one on each function.
21257
21258         * class.cs: Factor out some code for handling error handling in
21259         accordance to the "Declarations" section in the "Basic Concepts"
21260         chapter in the ECMA C# spec.
21261
21262         * interface.cs: Make all interface member classes derive from
21263         InterfaceMemberBase.
21264
21265 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21266
21267         * Many things: all interfaces are parsed and generated in
21268         gen-treedump.  Support for member variables, constructors,
21269         destructors, properties, constants is there.
21270
21271         Beginning of the IL backend, but very little done, just there for
21272         testing purposes. 
21273
21274 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21275
21276         * cs-parser.jay: Fix labeled statement.
21277
21278         * cs-tokenizer.cs (escape): Escape " and ' always.
21279         ref_line, ref_name: keep track of the line/filename as instructed
21280         by #line by the compiler.
21281         Parse #line.
21282
21283 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21284
21285         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21286         to match the values in System.CodeDOM.
21287
21288         Divid renamed to Divide.
21289
21290         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21291         statements. 
21292         (Statements.set): remove.
21293
21294         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21295         statements. 
21296
21297         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21298         falseStatements always have valid values. 
21299
21300         * cs-parser.jay: Use System.CodeDOM now.
21301