* mcs/support.cs (SeekableStreamReader.Position): Don't error out when
[mono.git] / mcs / mcs / ChangeLog
1 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2
3         * support.cs (SeekableStreamReader.Position): Don't error out when
4         the requested position is just beyond the end of the current
5         buffered data.
6
7 2005-09-28  Raja R Harinath  <rharinath@novell.com>
8
9         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10         try to keep in sync with the byte count of the underlying Stream.
11         However, this limits us to a window size of 2048 characters: i.e.,
12         the maximum lookahead of our lexer/parser can be 2048 characters.
13
14 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
15
16         Fix #76255.
17         * driver.cs: Fix compilation files with full root path.
18
19 2005-09-25  Miguel de Icaza  <miguel@novell.com>
20
21         * report.cs (SymbolRelatedToPreviousError): Format the output so
22         it does not use an open parenthesis that is never closed. 
23
24         * driver.cs: Follow coding guidelines
25
26 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
27
28         Fix #72930.
29         * const.cs (Const.ResolveValue): Check for assigning non-null
30         value to reference type.
31
32 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
33
34         * anonymous.cs: Implemented ExprClassName.
35         
36         * assign.cs (Assign.DoResolve): Don't chrash when type is not
37         delegate.
38         
39         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
40         check.
41         
42         * class.cs (StaticClass.DefineContainerMembers): Report protected
43         members as error.
44         
45         * codegen.cs: if(ed) PRODUCTION.
46         
47         * convert.cs (Error_CannotImplicitConversion): Better error
48         distinction.
49         
50         * cs-parser.jay: More error checks.
51         
52         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
53         
54         * driver.cs (CSCParseOption): Enabled wrong option check.
55         
56         * ecore.cs (Expression.ExprClassName): Turned to property.
57         (MemberExpr.CheckIntermediateModification): For checking boxed
58         value types     modification.
59         
60         * statement.cs (Fixed.Resolve): Expression type must be
61         convertible to fixed type.
62         (CollectionForeach.GetEnumeratorFilter,TryType):
63         Small refactoring for easier error checking.
64
65 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
66
67         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
68         attributes.
69         
70         * class.cs (GeneratedBaseInitializer): New class for customization
71         compiler generated initializers.
72         (MemberBase.DoDefine): Check Obsolete attribute here.
73         (FieldMember.DoDefine): Ditto.
74         
75         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
76         constants.
77         
78         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
79         (MemberCore.GetObsoleteAttribute): Removed argument.
80         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
81         (MemberCore.CheckObsoleteType): New helper.
82         
83         * delegate.cs,
84         * enum.cs,
85         * statement.cs: Updates after MemberCore changes.
86         
87         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
88         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
89         
90         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
91         obsolete attribute for compiler construct.
92         (As.DoResolve): Cache result.
93         
94         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
95
96 2005-09-26  Raja R Harinath  <rharinath@novell.com>
97
98         Fix #76133.
99         * expression.cs (This.VerifyFixed): In a value type T, the type of
100         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
101         value type R, 'this' is treated as a value parameter.
102
103 2005-09-22  Miguel de Icaza  <miguel@novell.com>
104
105         * statement.cs (Lock): Use the TemporaryVariable class instead of
106         manually using local variables as those do not work when variables
107         are captured.
108
109         * ecore.cs: Moved the TemporaryVariable class from being a nested
110         class inside Foreach to be a public class that can be employed in
111         other places. 
112
113 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
114
115         * cs-parser.jay: interface_accessors replaced by
116         accessor_declarations.
117
118         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
119         location.
120         
121         * statement.cs (GotoCase.Resolve): Convert null constant to
122         null case.
123         (SwitchLabel.ResolveAndReduce): Ditto.
124         (SwitchLabel.NullStringCase): Custom null stamp.
125         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
126         
127         typemanager.cs (CSharpSignature): Don't skip first argument
128         for full names.
129
130 2005-09-18  Miguel de Icaza  <miguel@novell.com>
131
132         * driver.cs: Set InEmacs based on the environment variable EMACS. 
133
134         * location.cs (InEmacs): in this mode, do not report column
135         location as it confuses Emacs.
136
137 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
138
139         * cfold.cs, constant.cs, convert.cs, ecore.cs,
140         expression.cs, iterators.cs, literal.cs: Store constants and
141         literals location.
142         
143         * class.cs (MemberBase.ShortName): Pass location.
144         
145         * cs-parser.jay: Some location fixes.
146         
147         * ecore.cs (Expression.Location): Made virtual.
148
149 2005-09-05  Miguel de Icaza  <miguel@novell.com>
150
151         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
152         if the underlying types are the same, otherwise we need to produce
153         code that will do the proper cast.
154
155         This was exposed by Marek's constant rewrite which produced
156         invalid code for the call site:
157
158         enum X : long { a }
159         void Method (X v) {}
160
161         Method ((X) 5)
162
163         This fixes test-49.cs
164
165 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
166
167         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
168           Type/Object should be allowed as well. Fixed bug #75968.
169
170 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
171
172         * expression.cs : (Binary.DoResolve): when one is enum constant and
173           another is constant 0, then return enum one *as enum type*.
174           Fixed bug 74846.
175
176 2005-09-02  Raja R Harinath  <rharinath@novell.com>
177
178         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
179         internal.
180
181         Fix #75941.
182         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
183         flow-branching for LocalVariableReferences in case we were invoked
184         from a MemberAccess.
185         * expression.cs (LocalVariableReference.VerifyAssigned): New.
186         Carved out of ...
187         (LocalVariableReference.DoResolveBase): ... this.
188         (MemberAccess.Resolve): Do the check that was disabled during
189         SimpleNameResolve.
190
191 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
192
193         * class.cs :
194           (PartialContainer.Create): check abstract/sealed/static strictly
195           but abstract/sealed can exist only at one side. Fixed bug #75883.
196
197 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
198
199         Fix #75945.
200         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
201         specified, don't default to UnmanagedType.I4.
202
203 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
204
205         * expression.cs : conditional operator should check possibly
206           incorrect assign expression. Fixed bug #75946.
207
208 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
209
210         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
211           Reverting the change. gmcs is much complex than mcs on this matter.
212
213 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
214
215         * cs-tokenizer.cs : To read another token ahead of the actual 
216           consumption, use new SavedToken and cache token instead of moving
217           back the stream with SeekableStreamReader (it seemed problematic).
218         * cs-parser.jay,
219           driver.cs : Thus use StreamReader directly.
220         * support.cs : Thus removed SeekableStreamReader.
221
222 2005-08-30  Raja R Harinath  <rharinath@novell.com>
223
224         Fix #75934.
225         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
226         (ScopeInfo.EmitScopeType): Use it to construct field names from
227         names of captured locals.
228
229         Fix #75929.
230         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
231         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
232         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
233         (ExplicitConversion): Remove enum cases already handled by
234         implicit conversion.  Move implicit conversion check to the beginning.
235         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
236         * expression.cs (ArrayCreation.EmitDynamicInitializers):
237         Don't treat System.Enum as a struct.
238
239 2005-08-30  Jb Evain  <jbevain@gmail.com>
240
241         * attribute.cs: handles as expression in parameters.
242
243 2005-08-30  Raja R Harinath  <rharinath@novell.com>
244
245         Fix #75802.
246         * class.cs (TypeContainer.VerifyClsName): Don't use a
247         PartialContainer when verifying CLS compliance.
248         (AbstractPropertyEventMethod): Set Parent here, ...
249         (PropertyMethod): ... not here.
250
251 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
252
253         * attribute.cs : escaped attribute name should not be allowed to be
254           resolved (e.g. @class as classAttribute). Fixed bug #75930.
255
256 2005-08-29  Raja R Harinath  <rharinath@novell.com>
257
258         Fix #75927.
259         * convert.cs (ImplicitStandardConversionExists): Allow zero also
260         when converting a long constant to unsigned long.
261         * expression.cs (Invocation.OverloadResolve): Add sanity check to
262         detect where IsApplicable and VerifyArgumentsCompat disagree.
263
264 2005-08-29  Raja R Harinath  <rharinath@novell.com>
265         and Carlos Alberto Cortez  <carlos@unixmexico.org>
266
267         Fix #75848.
268         * class.cs (TypeContainer.CanElideInitializer): New helper.
269         (TypeContainer.EmitFieldInitializers): Use it to determine if we
270         can safely emitting the initializer of a field.
271
272 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
273
274         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
275           allowed inside a switch (without loop). Fixed bug #75433.
276
277 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
278
279         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
280         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
281
282 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
283
284         * driver.cs : kinda reverting the default encoding changes (not exact 
285           revert since I noticed that "codepage:reset" might not work fine).
286
287 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
288
289         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
290           Location. Now getter and setter store location correctly.
291           (errors/cs0111-12.cs now reports the expected location.)
292
293 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
294
295         * driver.cs : Use default encoding on the environment.
296           Removed (now that) extra parameter for SeekableStreamReader.
297         * support.cs : (SeekableStreamReader) third .ctor() argument for
298           StreamReader is not required (always true). preamble size could
299           be acquired in simpler and safe way.
300
301 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
302
303         * cs-parser.jay: report CS0642 at warning level 3
304           and report CS0642 for an if else statement also
305           fixes bug #74745. Patch by John Luke (and a bit
306           modified by me).
307           Removed extra CS0642 warning check for "while",
308           "for" and "fixed".
309         * statement.cs: In Block.Resolve(), CS0642 check
310           is reimplemented to check a sequence of an empty
311           statement and a block.
312
313           Both fix bug #66777.
314
315 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
316
317         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
318         detection until I fix it.
319         
320         * cs-tokenizer.cs: Changed error message.
321         
322         * cs-parser.jay: Fixed 2 error locations.
323         
324         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
325         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
326         properties.
327         
328         * enum.cs (GetSignatureForError): Fixed.
329         
330         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
331         method detection.
332         
333         * class.cs,
334         * typemanager.cs (RegisterProperty): Removed.
335         
336         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
337
338 2005-08-24  Raja R Harinath  <rharinath@novell.com>
339
340         Fix #75874.
341         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
342         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
343
344 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
345
346         * expression.cs : tiny fix is required for not warning positive ulong.
347           See test-441.cs.
348
349 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
350
351         * expression.cs : add CS0652 check for constant and integral
352           expression. Fixed bug #53974.
353
354 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
355
356         * expression.cs : in DoNumericPromotions(), check if there is implicit
357           conversion overload for string (to check CS0034). Fixed bug #52492.
358
359 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
360
361         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
362
363 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
364
365         * ecore.cs : report location when it is *not* Null.
366
367 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
368
369         * codegen.cs,
370           ecore.cs,
371           flowanalysis.cs,
372           expression.cs:
373           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
374           correctly. Fixed bug #75721.
375
376 2005-08-23  Raja R Harinath  <rharinath@novell.com>
377
378         * support.cs (SeekableStreamReader.Position): Avoid an expensive
379         loop that performs 'min (pos, char_count)'.
380
381         Fix #75862.
382         * expression.cs (Unary.ResolveOperator): Don't discard implicit
383         converted value in Operator.OnesComplement.
384
385 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
386
387         * anonymous.cs: If the anon method is pulled into a helper class,
388         it needs to be `internal' not `private'. Fixes runtime behavior on
389         msft. bug #75704
390
391 2005-08-20  Martin Baulig  <martin@ximian.com>
392
393         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
394         scope if we don't already have it.
395
396         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
397         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
398         fixes #75867.
399
400 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
401
402         Fix #75803
403         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
404         is a partial class.
405
406 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
407
408         The big constants rewrite
409         Fix #75746, #75685 and more
410         As a side effect saved 1MB for MWF ;-)
411         
412         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
413         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
414         enum based for corlib compilation.
415         
416         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
417         subtractions.
418         
419         * class.cs (FixedField.Define): Use ResolveAsConstant.
420         
421         * const.cs (IConstant): Interface constants and enums.
422         (Const.ResolveValue): New method for constant resolvning.
423         (ExternalConstant): Constants from imported assemblies.
424         
425         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
426         conversion; like enums.
427         (Constant.ToType): Converts this constant to different type.
428         (Constant.Increment): Adds 1.
429         
430         * convert.cs (ImplicitConversionRequired): Simplified.
431         
432         * cs-parser.jay: Create EnumMember directly.
433         
434         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
435         
436         * doc.cs (GenerateEnumDocComment): Removed.
437         
438         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
439         (ConvertIntLiteral): Removed.
440         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
441         
442         * enum.cs (EnumMember): Implement IConstant.
443         (Enum.IsValidEnumConstant): Removed.
444         (Enum.GetNextDefaultValue): Removed.
445         (Enum.FindMembers): Updated.
446         (Enum.GenerateDocComment): Iterate enum members.
447         
448         * expression.cs (Cast.TryReduce): Handle enums correctly.
449         (New.Constantify): Made public.
450         (MemberAccess.DoResolve): Removed contant specific if(s).
451         
452         * literal.cs (NullLiteral): Implement new abstract methods.
453         
454         * statement.cs (GotoCase.Resolve): Use new constant methods.
455         (SwitchLabel.ResolveAndReduce): Use new constant methods.
456         
457         * typemanager.cs (LookupEnum): Removed.
458         (IsEnumType): Fixed to work with corlib.
459         (RegisterConstant): Removed.
460         (LookupConstant): Removed.
461         (GetConstant): Changed to work with IConstant.
462
463 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
464
465         * location.cs : Fixed overflown (>255) column number.
466
467 2005-08-03  Raja R Harinath  <rharinath@novell.com>
468
469         First cut of the qualified-alias-member feature.
470         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
471         token.
472         * cs-parser.jay (DOUBLE_COLON): New token.
473         (namespace_or_type_name): Add rule for recognizing
474         qualified-alias-members.
475         (primary_expression): Likewise.
476         (element_access): Allow QualifiedAliasMember as a possible
477         type-bearing expression.
478         (local_variable_type, local_variable_pointer_type): Likewise.
479         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
480         aliases in the current and enclosing namespace declarations.
481         (NamespaceEntry.UsingAlias): Add CS0440 warning.
482         * decl.cs (MemberName.is_double_colon): New.
483         (MemberName.MemberName): Add new constructor for alias-member.
484         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
485         * expression.cs (QualifiedAliasMember): New expression type.
486
487 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
488
489         * location.cs : it borked when no argument was specified.
490
491 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
492
493         * location.cs : tiny ToString() format fix.
494
495 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
496
497         * statement.cs : oops, it was missing.
498
499 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
500
501         A set of fixes for precise line/column location.
502
503         * location.cs :
504           "token" field now holds a file/line "delta", a line number offset 
505           from the segment, and a column number. See also:
506           http://lists.ximian.com/pipermail/mono-devel-list/2004-
507           December/009508.html
508           Removed static IsNull. Use instance IsNull property instead.
509         * cs-tokenizer.cs :
510           For some tokens it stores Location. For Identifier it stores
511           LocatedToken which is a pair of string name and location.
512           Column numbers are adjusted only at getChar().
513         * report.cs :
514           Use Location.ToString() for reporting (it now contains column).
515         * cs-parser.jay :
516           Largely modified to use LocatedToken instead of
517           string (IDENTIFIER), and to acquire Location from some tokens.
518         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
519           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
520           codegen.cs :
521           Now MemberName holds Location. DeclSpace.ctor() receives Location
522           as a parameter. Removed extra parameters to all derived classes.
523           Replaced Location.IsNull() with instance property.
524         * assign.cs, expression.cs :
525           Added .ctor() overload that omits Location.
526         * attribute.cs :
527           Added "nameEscaped" flag that indicates the identifier was escaped
528           in the source file. This fixes bug #57047.
529
530 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
531
532         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
533         New method, looking for lo-case imported cls type.
534
535         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
536         here.
537
538         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
539
540         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
541
542         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
543         all_imported_types.
544         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
545
546         Optimized to save 3.5 MB for SWF compilation.
547
548 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
549
550         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
551         (PartialContainer.Create): Moved logic AddToContainer.
552         (PartialContainer.MarkForDuplicationCheck): Shares name.
553         
554         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
555         place.
556         
557         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
558         initialization.
559         (Namespace.GetSignatureForError): New method.
560         
561         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
562         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
563
564 2005-08-01  Raja R Harinath  <rharinath@novell.com>
565
566         Fix #75669.
567         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
568         member lookup rather than qualifier_type, since qualifier_type can
569         be null.
570
571 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
572
573         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
574         enum member.
575
576 2005-07-31  Miguel de Icaza  <miguel@novell.com>
577
578         * statement.cs: Copy the local exception into the exception
579         captured local.  Fixes 75674
580
581 2005-07-31  Raja R Harinath  <harinath@gmail.com>
582
583         Fix #75658.
584         * expression.cs (Invocation.OverloadResolve): Don't report error
585         CS1501 if error CS1502 has been reported.
586         (New.DoResolve): Delegate CS1501 reporting to
587         Invocation.OverloadResolve.
588
589         Fix #75656.
590         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
591         invariant-meaning-in-block property in an enclosing block if
592         necessary.
593
594 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
595
596         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
597         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
598         (Switch.CheckSwitch): Just save 50kb for SWF.
599
600 2005-07-27  Martin Baulig  <martin@ximian.com>
601
602         * anonymous.cs (CaptureContext.AddField): Added
603         `AnonymousContainer am' argument; compute its toplevel scope if
604         it's not already computed.  Fixes #75649.
605
606 2005-07-26  Raja R Harinath  <rharinath@novell.com>
607
608         Fix #75628.
609         * class.cs (Constructor.Emit): Reset block to null if the block
610         resolve fails.
611
612 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
613
614         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
615
616 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
617
618         * class.cs (MethodData.Define): Check whether accessor implementing
619         interface is public.
620
621         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
622
623 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
624
625         Fix #57245
626         * namespace.cs (LookupType): Moved same type check to...
627         
628         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
629         with the same name.
630
631 2005-07-21  Raja R Harinath  <rharinath@novell.com>
632
633         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
634         already found a typebuilder.
635         * class.cs (MethodCore.IsDuplicateImplementation): Compare
636         MemberNames, not strings.
637
638         * const.cs (Error_ExpressionMustBeConst): 
639         Rename from Error_EpressionMustBeConst.
640         * const.cs, class.cs, statement.cd: Update.
641
642 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
643
644         Fix #65573
645
646         * const.cs (Const.LookupConstantValue): Report missing contant expression
647         everytime.
648         (Error_EpressionMustBeConstant): Only one error method.
649
650         * class.cs, statement.c: Updated.
651
652 2005-07-20  Raja R Harinath  <rharinath@novell.com>
653
654         * statement.cs (Block.Flags): Add back HasVarargs.
655         (Block.flags): Make protected.
656         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
657
658         * typemanager.cs (types, typecontainers, user_types): Remove.
659         (UserTypes, TypeContainers): Likewise.
660         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
661         (CleanUp, Reset): Update.
662         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
663         (GetNestedType): Use Type.GetNestedType.
664         (CoreLookupType): Take two arguments, the namespace and the
665         basename of the type.  Update to use the Namespace.Lookup
666         mechanism.
667         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
668         (RealMemberLookup): Use IsNestedChildOf instead of playing with
669         string concatenation and substring matches.
670         * class.cs, enum.cs, delegate.cs: Update to changes.
671
672 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
673
674         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
675         Expression and made virtual.
676
677         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
678         (ImplicitStandardConversionExists): Fixed `byte' typo ?
679
680         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
681
682         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
683         error message.
684
685         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
686         change.
687
688 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
689
690         Fix #57707
691         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
692         AssemblyCultureAttribute is not used on executable.
693
694         * rootcontext.cs,
695         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
696
697 2005-07-16  Raja R Harinath  <rharinath@novell.com>
698
699         Fix #60638.
700         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
701         New.  Reports CS0252/CS0253.
702         Mostly taken from preliminary patch by Duncak Mak.
703         (Binary.DoResolveOperator): Store results of operator lookup.
704         Use them to detect if we need to warn about unintended reference
705         comparisons.
706
707 2005-07-15  Raja R Harinath  <rharinath@novell.com>
708
709         Fix #72969.
710         * namespace.cs (Namespace.Lookup): Add back location parameter.
711         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
712         * delegate.cs, ecore.cs, expression.cs: Update to changes.
713
714         * codegen.cs (EmitContext.DeclSpace): Make readonly.
715         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
716         (Namespace.LookupType): ... this.
717         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
718         of namespaces.
719         * typemanager.cs (LookupTypeReflection): Remove buggy code that
720         purported to handle pointers.
721         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
722         CoreLookupType.
723
724 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
725
726         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
727         type as namespace.
728
729 2005-07-15  Raja R Harinath  <rharinath@novell.com>
730
731         * namespace.cs (Namespace.Lookup): Drop location parameter.
732         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
733         (NamespaceEntry.Lookup): ... this.
734         (NamespaceEntry.Error_AmbiguousTypeReference):
735         Move here from DeclSpace.
736         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
737         names ...
738         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
739         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
740         Move to NamespaceEntry.
741         * delegate.cs, expression.cs: Update to changes.
742
743 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
744
745         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
746         CheckAttributeType and refactored.
747         (Attribute.ResolvePossibleAttributeType): Changed to reuse
748         ResolveAsTypeTerminal error handling.
749         (ResolveAsTypeTerminal): Introduced because of global attributes extra
750         handling.
751         (GetSignatureForError): Print errors in same way.
752
753         * class.cs,
754         * codegen.cs: Reflect attribute GetSignatureForError change.
755
756         * ecore.cs,
757         * expression.cs: Add silent parameter to ResolveAsTypeStep.
758
759         * namespace.cs (UsingEntry): Refactored to make fields private.
760
761         * assign.cs,
762         statement.cs: Error_UnexpectedKind has extra parameter.
763
764 2005-07-14  Raja R Harinath  <rharinath@novell.com>
765
766         * ecore.cs (IAlias): Remove.
767         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
768         that implement the interface.
769         * namespace.cs (Namespace): Likewise.
770         (Namespace.declspaces): Renamed from 'defined_names'.
771         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
772         DeclSpace instead of an IAlias.
773         * tree.cs (Tree.AddDecl): Update.
774
775 2005-07-12  Raja R Harinath  <rharinath@novell.com>
776
777         * statement.cs (Block.Flags); Remove HasVarargs.
778         (Block.HasVarargs): Move to ToplevelBlock.
779         (Block.ThisVariable, Block.AddThisVariable): Likewise.
780         (Block.Variables): Make protected.  Initialize variable hashtable
781         if necessary.
782         (Block.AddVariable): Update.
783         (Block.Resolve): Update to changes.
784         (ToplevelBlock.HasVarargs): New boolean.
785         (ToplevelBlock.ThisVariable): Move here from Block.
786         (ToplevelBlock.AddThisVariable): Likewise.
787         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
788         * expression.cs (This.ResolveBase): Update to changes.
789         (ArglistAccess.DoResolve): Likewise.
790
791 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
792
793         Fix #75321
794         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
795
796         * class.cs (TypeContainer.VerifyMembers): Distinguish between
797         not used and not used & assigned.
798         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
799
800 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
801
802         Fix #75053
803         * expression.cs (Is.DoResolve): null is never provided type.
804
805 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
806
807         Fix #52496
808         * cs-parser.jay: Less strict event error rule to catch more errors.
809
810 2005-07-08  Martin Baulig  <martin@ximian.com>
811
812         Fix test-iter-10.cs - distinguish whether we `yield' in a property
813         gettter (allowed) or setter (not allowed).
814
815         * class.cs (Accessor): Implement IIteratorContainer.
816         (Accessor.Yields): New public field.
817         (PropertyBase.PropertyMethod.Define): Handle iterators on a
818         per-accessor basis.
819
820         * cs-parser.jay
821         (get_accessor_declaration, set_accessor_declaration): Set the
822         `yields' flag on the accessor, not the property.
823         (property_declaration): Do the iterators check on a per-accessor
824         basis and not for the whole property.
825
826 2005-07-08  Martin Baulig  <martin@ximian.com>
827
828         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
829         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
830
831 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
832
833         Fix #74975
834         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
835         (ExtractSecurityPermissionSet): Cope with self referencing security
836         attributes properly.
837
838         * driver.cs (SetOutputFile): Made public property OutputFile.
839
840 2005-07-07  Raja R Harinath  <rharinath@novell.com>
841
842         Fix #75486.
843         * class.cs (TypeContainer.first_nonstatic_field): Rename from
844         has_nonstatic_fields.  Make into a FieldBase pointer.
845         (TypeContainer.AddField): Add CS0282 check.
846         (TypeContainer.EmitType): Update.
847
848 2005-07-06  Miguel de Icaza  <miguel@novell.com>
849
850         * cs-tokenizer.cs (consume_identifier): Do not create strings to
851         compare if they start with __.
852
853 2005-07-06  Raja R Harinath  <rharinath@novell.com>
854
855         * statement.cs (Switch.SwitchGoverningType): Only look at
856         UserCasts that don't need implicit standard conversions to one of
857         the allowed switch types (Fixes test-322.cs).
858         (LocalInfo.Resolve): Re-enable sanity-test.
859
860 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
861
862         * cs-tokenizer.cs (consume_identifier): Detect double undescores
863         
864         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
865         
866         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
867
868 2005-07-06  Raja R Harinath  <rharinath@novell.com>
869
870         Fix #75472.
871         * ecore.cs (SimpleName.GetSignatureForError): Add.
872         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
873         (MemberAccess.GetSignatureForError): Add.
874
875 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
876  
877         The big error and warning messages review.
878         
879         * anonymous.cs,
880         * assign.cs,
881         * attribute.cs,
882         * class.cs,
883         * codegen.cs,
884         * convert.cs,
885         * cs-parser.jay,
886         * cs-tokenizer.cs,
887         * decl.cs,
888         * delegate.cs,
889         * doc.cs,
890         * driver.cs,
891         * ecore.cs,
892         * enum.cs,
893         * expression.cs,
894         * flowanalysis.cs,
895         * iterators.cs,
896         * literal.cs,
897         * location.cs,
898         * modifiers.cs,
899         * namespace.cs,
900         * parameter.cs,
901         * pending.cs,
902         * report.cs,
903         * rootcontext.cs,
904         * statement.cs,
905         * support.cs,
906         * tree.cs,
907         * typemanager.cs: Updated.
908         
909         * class.cs: (MethodCore.SetYields): Moved here to share.
910         (PropertyMethod.Define): Moved iterator setup here.
911         
912         * iterators.cs: Add orig_method to have full access to parent
913         container.
914
915 2005-07-05  Raja R Harinath  <rharinath@novell.com>
916
917         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
918         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
919         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
920         variable of struct type.
921         * expression.cs (Unary.ResolveOperator): Update to change.
922         (Indirection.VerifyFixed): Likewise.
923         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
924         (ParameterReference.VerifyFixed): Value parameters are fixed.
925         (This.VerifyFixed): Treat 'this' as a value parameter.
926         * statement.cs (LocalInfo.IsFixed): Remove.
927
928 2005-07-01  Martin Baulig  <martin@ximian.com>
929
930         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
931         `ec.EmitThis ()' to get the correct scope.
932
933 2005-07-01  Martin Baulig  <martin@ximian.com>
934
935         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
936         instance is a ParameterReference; fixes #75299.
937
938 2005-07-01  Martin Baulig  <martin@ximian.com>
939
940         Reverted Marek's latest patch (r46725):
941         - it contains structural changes which are neither mentioned in
942           the ChangeLog nor explained anywhere; for example the additional
943           argument of EmitContext's and Iterator's .ctor's and the
944           TypeContainer.DefineMembers() change.
945         - structural changes like this should go in in seperate patches
946           and not be hidden in a huge patch which just seems to affect
947           warnings and errors.
948           a big and hard to understand patch.
949         - it breaks iterators and causes regressions, for instance in
950           test-iter-03.cs.      
951
952 2005-06-30  Raja R Harinath  <rharinath@novell.com>
953
954         Fix #75412.
955         * expression.cs (Indexers.map): Remove.
956         (Indexers.Append): Filter out inaccessible setters and getters.
957         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
958
959         Fix #75283.
960         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
961         Refactored from ...
962         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
963         (FieldExpr.Emit, PropertyExpr.Emit): Update.
964         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
965         * expression.cs (Invocation.EmitCall): Add CS0120 check.
966
967 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
968
969         Fix #75322
970         * class.cs (FieldBase.GetInitializerExpression): One more field
971         for backup.
972
973 2005-06-28  Miguel de Icaza  <miguel@novell.com>
974
975         * pending.cs: Do not define a proxy if the base method is virtual,
976         it will be picked up by the runtime (bug 75270).
977
978 2005-06-08  Martin Baulig  <martin@ximian.com>
979
980         The big Iterators rewrite :-)
981
982         * iterators.cs: Rewrite this to use the anonymous methods framework.
983
984         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
985         before the TypeContainers; see 2test-21.cs.
986
987         * class.cs
988         (TypeContainer.DefineType): Don't create a new EmitContext if we
989         already have one (this only happens if we're an Iterator).
990         (TypeContainer.Define): Also call Define() on all our iterators.
991         (Method.CreateEmitContext): Added support for iterators.
992
993         * anonymous.cs
994         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
995         (AnonymousContainer.CreateMethodHost): Moved here from
996         AnonymousMethod and made abstract.
997         (AnonymousContainer.CreateScopeType): New abstract method.
998         (AnonymousContainer.IsIterator): New public property.
999         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1000         get the ScopeTypeBuilder rather than manually defining it here. 
1001         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1002         iterators here.
1003
1004         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1005         before RootContext.DefineTypes().
1006
1007         * codegen.cs (EmitContext.RemapToProxy): Removed.
1008         (EmitContext.CurrentAnonymousMethod): Changed type from
1009         AnonymousMethod -> AnonymousContainer.
1010         (EmitContext.ResolveTopBlock): Protect from being called twice.
1011         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1012         (EmitContext.EmitThis): Removed the iterators hacks; use the
1013         anonymous methods framework for that.
1014
1015         * statement.cs
1016         (ToplevelBlock.Container): Make this a property, not a field.
1017         (ToplevelBlock.ReParent): New public method; move the
1018         ToplevelBlock into a new container.
1019         (Foreach.TemporaryVariable): Simplify.
1020
1021 2005-06-05  Martin Baulig  <martin@ximian.com>
1022
1023         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1024         (Block.AddTemporaryVariable): New public method; creates a new
1025         `LocalInfo' for a temporary variable.
1026         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1027         variables here.
1028         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1029         non-iterator variables.
1030
1031 2005-06-05  Martin Baulig  <martin@ximian.com>
1032
1033         * statement.cs (Foreach.TemporaryVariable): Create the
1034         LocalBuilder in the Emit phase and not in Resolve since in some
1035         situations, we don't have an ILGenerator during Resolve; see
1036         2test-19.cs for an example.
1037
1038 2005-06-04  Martin Baulig  <martin@ximian.com>
1039
1040         **** Merged r45395 from GCS ****
1041
1042         The big Foreach rewrite - Part II.
1043
1044         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1045         with `PropertyInfo ienumerator_getcurrent'.
1046
1047         * codegen.cs (VariableStorage): Removed.
1048
1049         * statement.cs
1050         (Foreach): Derive from Statement, not ExceptionStatement.
1051         (Foreach.CollectionForeach): New nested class.  Moved all the code
1052         dealing with collection foreach here.
1053         (Foreach.ForeachHelperMethods): Removed.
1054         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1055
1056 2005-05-23  Martin Baulig  <martin@ximian.com>
1057
1058         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1059         don't need to.  Fix #75014.
1060
1061 2005-05-20  Martin Baulig  <martin@ximian.com>
1062
1063         Merged r44808 from GMCS.
1064
1065         * class.cs (TypeContainer.CircularDepException): Removed.
1066         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1067         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1068         (CS0146) and interface (CS0529) dependencies here.
1069
1070 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1071
1072         * expression.cs (Invocation.EmitCall): Fix initialization
1073         'this_call' to reflect current behaviour.  Fix indentation.
1074
1075         * convert.cs (FindMostEncompassedType): Add two trivial special
1076         cases (number_of_types == 0 || number_of_types == 1).
1077         (FindMostEncompasingType): Likewise.
1078
1079 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1080
1081         Some cleanups preparing for the fix of #75283.
1082         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1083         error testing.
1084         (EventExpr.InstanceResolve): Likewise.
1085         (EventExpr.DoResolve): Remove redundant checks.
1086
1087 2005-06-10  Duncan Mak  <duncan@novell.com>
1088
1089         * cs-tokenizer.cs (process_directives): New flag for controlling
1090         the processing of preprocessor directives.
1091         (x_token): After seeing a '#', return Token.NONE instead of going
1092         to handle_preprocessing_directive() when not processing
1093         directives. This avoids unnecessary processing during the token peek in
1094         is_punct().
1095
1096         This fixes #74939.
1097
1098         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1099         the existing error reporting methods instead of Report.Error.
1100
1101         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1102         after Raja's rewrite.
1103
1104 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1105
1106         * class.cs: Small fix.
1107
1108 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1109
1110         Fix #75160.
1111         * class.cs (GetPartialBases): Fix return value check of
1112         part.GetClassBases.
1113
1114 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1115
1116         Ensure that partial classes are registered in their enclosing
1117         namespace.  Initial part of fix of #75160.
1118         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1119         Register declspace with namespace here, not in
1120         DeclSpace.RecordDecl.
1121         * cs-parser.jay: Pass namespace to RecordDecl.
1122         * class.cs (PartialContainer.Create): Likewise.
1123         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1124         called.
1125         * decl.cs (Declspace.RecordDecl): Remove.
1126         * namespace.cs (NamespaceEntry.DefineName): Remove.
1127
1128 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1129
1130         * rootcontext.cs: Reset TargetExt as well.
1131
1132 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1133
1134         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1135         -langversion:ISO-1.
1136
1137 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1138
1139         Fix #75080, cs0119.cs.
1140         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1141         of ...
1142         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1143         allowing ExprClass.Type and ExprClass.Namespace for
1144         ResolveFlags.VariableOrValue.
1145         (Expression.Resolve) [1-argument variant]: Change default resolve
1146         flags based on language version.
1147         (Expression.Error_UnexpectedKind): Use a simple string array
1148         rather than an ArrayList.
1149         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1150         not ExprClass.Type.
1151         (TypeOfVoid.DoResolve): Likewise.
1152         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1153         flags argument -- it always has the same value.
1154
1155 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1156
1157         Fix #75081.
1158         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1159         Use it in the error message.
1160         * assign.cs, expression.cs, statement.cs: Update.
1161
1162 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1163
1164         Fix #75088.
1165         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1166         the "almostMatchedMember" case too.
1167         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1168         that failed the accessibility checks to 'almost_match'.
1169
1170 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1171
1172         * attribute.cs: Use internal MethodBuilder methods to set
1173         ExactSpelling and SetLastError on PInvoke methods, instead
1174         of passing them via charset.  Fixes #75060.
1175
1176 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1177
1178         * parameter.cs (Parameter): Remove TODO comment.
1179         (Parameter.DefineParameter): Remove Location parameter.
1180         (Parameters.LabelParameters): Likewise.
1181         * class.cs (Constructor.Emit): Update to change.
1182         (MethodData.Emit): Likewise.
1183         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1184         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1185
1186 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1187
1188         * parameter.cs,
1189           Removed Parameters.Location and added Parameter.Location instead.
1190           Removed Location parameter from Emit() and GetSignature().
1191         * anonymous.cs,
1192           class.cs,
1193           cs-parser.jay,
1194           delegate.cs,
1195           iterators.cs,
1196           statement.cs :
1197           Modified all related calls.
1198
1199 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1200
1201         Improve user-defined conversion handling.
1202         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1203         applicable operators.
1204         (AddConversionOperators): New.  Helper for GetConversionOperators.
1205         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1206         there is only one most encompassed/encompassing type.
1207         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1208         "applicable operator" handling.
1209         (UserConversion): Move cache here from GetConversionOperators.
1210         Directly cache the chosen operator, rather than the whole
1211         MethodGroup.
1212         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1213         case.  Allow conversion of decimal to sbyte and byte too.
1214         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1215         New static methods.  Used to avoid allocating EmptyExpressions in
1216         convert.cs.
1217
1218 2005-05-24  Duncan Mak  <duncan@novell.com>
1219
1220         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1221         another class, used in Convert.ExplicitNumericConversion.
1222         (CastToDecimal): New class, similar to above, but casts to
1223         System.Decimal, used in Convert.ImplicitNumericConversion and also
1224         in explicit convesion from double/float to decimal.
1225
1226         * convert.cs (ImplicitNumericConversion): Handle implicit
1227         conversions to System.Decimal.
1228         (ExplicitNumericConversion): handle explicit conversions to
1229         System.Decimal.
1230
1231         This fixes #68711.
1232         
1233 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1234
1235         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1236         know the type at this stage, just break through.   Fixes #75008 
1237
1238 2005-05-19  Martin Baulig  <martin@ximian.com>
1239
1240         * delegate.cs
1241         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1242         to disable error reporting.
1243
1244         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1245         here since we don't want to report an error; see the new test-336.cs.
1246
1247 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1248
1249         * statement.cs (ToplevelBlock.GetParameterReference)
1250         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1251         Move here from class Block.
1252         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1253         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1254
1255 2005-05-18  Martin Baulig  <martin@ximian.com>
1256
1257         Fix #74978.
1258
1259         * flowanalysis.cs
1260         (FlowBranching.Reachability): Add non-static public And() and Or()
1261         methods.
1262         (FlowBranchingSwitch): New class; do the `break_origins' thing
1263         like in FlowBranchingLoop.
1264         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1265         reachability, not just locals and parameters.
1266         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1267         switch; MergeBreakOrigins() now takes care of that.
1268
1269 2005-05-18  Martin Baulig  <martin@ximian.com>
1270
1271         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1272         a loop and may leave it, reset the barrier; fixes #74974.
1273
1274 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1275         
1276         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1277         is back.
1278         
1279         * cs-parser.jay: Catch more lexical errors.
1280         
1281         * report.cs: Add one more Error method.
1282         
1283         * rootcontext.cs,
1284         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1285
1286 2005-05-17  Martin Baulig  <martin@ximian.com>
1287
1288         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1289         #70970. 
1290
1291 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1292
1293         Fix test-382.cs.  Emit values of decimal constants.
1294         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1295         Carved out of ...
1296         (TypeContainer.AddField): ... this.
1297         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1298         with initializers to include 'Const's.
1299         (ClassPart.RegisterFieldForInitialization): Forward to
1300         PartialContainer.
1301         * const.cs (Const.Const): Pass initializer to base class.
1302         (Const.Define): In case of decimal constants, register them for
1303         initialization in a static constructor.
1304
1305 2005-05-14  Martin Baulig  <martin@ximian.com>
1306
1307         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1308         do not call ResolveUnreachable() on unreachable statements in
1309         here, see the comment in the source code.
1310
1311 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1312
1313         Fix #74934.
1314         * expression.cs (BinaryResolveOperator): If one of the operands of
1315         an equality comparison is 'null' and the other is a pointer type,
1316         convert the null to a NullPointer.
1317         * convert.cs (ImplicitReferenceConversion): If the expression is a
1318         NullLiteral and the target type is a pointer type, return a
1319         NullPointer instead.
1320         (ImplicitConversionStandard): Likewise.
1321
1322 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1323         
1324         * cs-parser.jay: Set readonly context based on special constructs.
1325         
1326         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1327         readonly variable error handling.
1328         
1329         * rootcontext.cs (EmitCode): Don't verify members when error
1330         occurred.
1331         
1332         * statement.cs (LocalInfo): Add reaodnly context information.
1333         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1334
1335 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1336
1337         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1338         for #74041 to initialize 'resolved' to false only for explicit
1339         blocks.  Fixes #74873.
1340
1341 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1342
1343         Fix #74920.
1344         * typemanager.cs (unmanaged_enclosing_types): New.
1345         (IsUnmanagedType): Avoid infloops by using
1346         'unmanaged_enclosing_types' to talk with recursive invocations.
1347
1348 2005-05-13  Martin Baulig  <martin@ximian.com>
1349
1350         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1351         instance variable, not a local.  Fix #74873.
1352         (Block.ResolveUnreachable): Set it to true here.
1353
1354 2005-05-11  Duncan Mak  <duncan@novell.com>
1355
1356         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1357         continuing to process for 'arg'.
1358         (handle_preprocessing_directive): Check the argument of the #endif
1359         directive and report error CS1025 if there are any trailing
1360         characters.
1361
1362         According to the C# spec, having even whitespace after the #endif
1363         directive is illegal; however, because we call arg.TrimEnd ()
1364         beforehand, we have the same behavior as csc, allowing whitespace
1365         after the directive.
1366
1367         Fixes #74892.
1368
1369 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1370
1371         Fix #74863.
1372         
1373         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1374         (Constructor.GetObsoleteAttribute): Implemented correctly.
1375
1376 2005-05-10  Martin Baulig  <martin@ximian.com>
1377
1378         * support.cs (ReflectionParameters.ParameterModifier): Use
1379         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1380         and `ParameterAttributes.In'.  Fixes #74884.
1381
1382 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1383
1384         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1385         
1386         * expression.cs (Argument.GetParameterModifier): Turned to property.
1387         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1388         
1389         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1390         its C# equivalent.
1391         
1392 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1393
1394         Fix #74852.
1395         * decl.cs (MemberCache.AddMethods): Register override methods,
1396         rather than non-override methods.
1397         * typemanager.cs (RegisterOverride): New.
1398         (IsOverride): Update.
1399
1400 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1401
1402         Fix #73105.
1403         
1404         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1405         recursive declaration.
1406         
1407         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1408         
1409 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1410
1411         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1412         
1413         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1414
1415 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1416
1417         Fix #74797.
1418         * decl.cs (DeclSpace.FamilyAccessible): 
1419         Use TypeManager.IsNestedFamilyAccessible.
1420
1421         Fix reopened #64812.
1422         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1423         internal'.
1424
1425 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1426             Abin Thomas  <projectmonokochi@rediffmail.com>
1427             Anoob V E  <projectmonokochi@rediffmail.com>
1428             Harilal P R  <projectmonokochi@rediffmail.com>
1429
1430         Fix #64812.
1431         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1432         allow access to all static members.
1433
1434 2005-05-04  Martin Baulig  <martin@ximian.com>
1435
1436         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1437
1438 2005-05-04  Martin Baulig  <martin@ximian.com>
1439
1440         Fix #74655.
1441
1442         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1443         section at the end; make things work if `default' is not the last
1444         section.        
1445
1446 2005-05-04  Martin Baulig  <martin@ximian.com>
1447
1448         Fix #70400.
1449
1450         * statement.cs (Switch): Replaced the `got_default' field with a
1451         `default_section' one.
1452         (Switch.CheckSwitch): Set `default_section' here.
1453         (Switch.Resolve): If we're a constant switch and the constant is
1454         not found, use the default section.
1455
1456 2005-05-03  Martin Baulig  <martin@ximian.com>
1457
1458         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1459
1460         * statement.cs (Foreach.ArrayForeach): New nested class.
1461         (Foreach.TemporaryVariable): New nested class.
1462         (Foreach.EmitArrayForeach): Removed; this is now in the new
1463         ArrayForeach class.
1464
1465 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1466
1467         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1468         more conservative.
1469         (VerifyPendingMethods): Revert change below.
1470
1471         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1472         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1473         that used to trigger warning -28.  Remove warning -28.
1474         * expression.cs (Invocation.OverloadResolve): Use
1475         TypeManager.IsOverride to distinguish override methods.
1476
1477         Fix #74773.
1478         * pending.cs (VerifyPendingMethods): If a base type implements the
1479         requested interface, don't bother checking individual methods of
1480         the base type.  As a side-effect, this prevents the creation of
1481         unnecessary proxies.
1482
1483 2005-05-02  Martin Baulig  <martin@ximian.com>
1484
1485         Fix #70182.
1486
1487         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1488         Also `And' the locals if the old vector is null.
1489         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1490         null; in this case we basically reset all the variables.        
1491
1492 2005-05-02  Martin Baulig  <martin@ximian.com>
1493
1494         Fix #74529.
1495
1496         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1497         Added `FlowBranching branching' argument; always `and' the
1498         variables instead of `or'ing them unless we're an infinite loop.
1499
1500         * statement.cs (While.Resolve): Create a new sibling unless we're
1501         infinite.       
1502
1503 2005-05-02  Martin Baulig  <martin@ximian.com>
1504
1505         Fix #70140.
1506
1507         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1508         arguments; use it instead of creating a new TopLevelBlock.
1509         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1510         our ConstructorInitializer.
1511
1512         * statement.cs
1513         (TopLevelBlock.TopLevelBranching): New public property.
1514         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1515         and create our `TopLevelBranching'.
1516
1517         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1518         anonymous method host, use `block.TopLevelBranching' rather than
1519         creating a new branching.
1520
1521 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1522
1523         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1524         a ScopeInfo, if any of the current children is a child of the new
1525         entry, move those children there.
1526
1527 2005-04-30  Martin Baulig  <martin@ximian.com>
1528
1529         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1530         at the beginning of a SwitchSection.  Fix #73335.
1531
1532 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1533
1534         Fix #74378
1535         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1536         
1537         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1538         (FieldExpr.DoResolve): Obsolete members are ignored for field
1539         initializers.
1540         
1541 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1542
1543         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1544         of arrays detection.
1545
1546         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1547         verification.
1548         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1549
1550         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1551         arrays report.
1552
1553 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1554
1555         * cs-parser.jay: Use the prefered version of -unsafe in error
1556         message.
1557
1558 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1559
1560         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1561         circumstances.
1562
1563 2005-04-20  John Luke  <john.luke@gmail.com>
1564
1565         * driver.cs: fix typo in error message, --outout to --output
1566
1567 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1568
1569         * codegen.cs (InRefOutArgumentResolving): New field.
1570         
1571         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1572         fields outside contructor.
1573         
1574         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1575         
1576 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1577
1578         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1579         parameter code was not completed ever, so it was not as up-to-date
1580         as local variables.  Must finish it.
1581
1582         The bug fix was to compare the Toplevel of the block, not the
1583         current block.  Thanks for Ben for pointing this out. 
1584
1585 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1586
1587         * decl.cs (AddMethods): Use the declaring type of the problem
1588         method to determine if we want to squash a warning.
1589
1590 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1591
1592         * attribute.cs: Removed debug output.
1593
1594         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1595         
1596         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1597         Report.Stderr.
1598         
1599 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1600
1601         Fix #74481.
1602         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1603         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1604         all null comparisons against reference types.
1605
1606 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1607
1608         Fix# 74565
1609         * class.cs (TypeContainer.CircularDepException) New nested
1610         exception class.
1611         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1612         (TypeContainer.DefineType): Removed error, reset InTransit before
1613         exit.
1614         (Class.DefineType): Throw exception when is in Transit.
1615         Catch exception and report error.
1616         (Struct.DefineType): Throw exception when is in Transit.
1617         Catch exception and report error.
1618         (Interface.DefineType): Throw exception when is in Transit.
1619         Catch exception and report error.
1620
1621         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1622         handle nested exception handlers.
1623
1624         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1625         a catch.
1626
1627         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1628         InFinally and InCatch storage.
1629
1630         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1631         (Catch.Resolve): Set and Restore ec.InCatch.
1632         (Try.Resolve): Set and Restore ec.InFinally.
1633         (Try.HasCatch): True when try has catch.
1634
1635 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1636
1637         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1638           for the same event member, so exclude such cases from warning 419.
1639           Fixed bug #74633.
1640
1641 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1642
1643         * expression.cs (Binary.ResolveOperator): Apply patch from John
1644         Luke to fix bug 59864: operators &, | and ^ on enumerations
1645         require that the same enum type on both sides.
1646
1647         * driver.cs: Add warnings to old flag usage, this is to assist
1648         people who produce Makefiles and hope that the Makefiles will be
1649         used on Windows.
1650
1651         * class.cs (TypeContainer.EmitType): Moved the definition of the
1652         special $PRIVATE$ field from the resolve phase to the Emit phase.
1653         During resolve we do not know if we are a struct with
1654         HasExplicitLayout, we know this only after the attributes for the
1655         type are emitted.
1656
1657         Set the FieldOffset to zero on the dummy field that we create for
1658         the class.   Fixes 74590.
1659
1660 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1661
1662         Fix #73834.
1663         * ecore.cs (PropertyExpr.resolved): New.
1664         (DoResolve): Use it to handle a case of double resolution here.
1665         Handle a case of identical-name-and-type-name.
1666         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1667         resolution by storing the results of expression resolution back
1668         into the "probes" array.
1669
1670 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1671
1672         Fix cs0208-7.cs and cs0208-8.cs.
1673         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1674         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1675         error reporting to point out the reason a struct is not unmanaged.
1676
1677 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1678
1679         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1680           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1681
1682 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1683
1684         Fix #74528.
1685         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1686         IdenticalNameAndTypeName here.
1687         (EventExpr.InstanceResolve): Likewise.
1688
1689 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1690
1691         C# 2.0 DefaultCharSetAttribute implementation
1692         
1693         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1694         which allows us to set GlobalNamespace for every resolve.
1695         (Attribute.ResolveArguments): Cut from Resolve.
1696         (Attribute.GetCharSetValue): Returns CharSet named argument.
1697         (Attribute.DefinePInvokeMethod): Gets default charset from
1698         module settings.
1699         (GlobalAttribute.ResolveAsTypeStep): Override.
1700         (GlobalAttribute.ResolveArguments): Override.
1701         
1702         * class.cs (TypeAttr): Is protected.
1703         
1704         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1705         (ModuleClass.DefaultCharSetType): New memeber.
1706         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1707         
1708         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1709         charset from module.
1710         
1711         * delegate.cs (TypeAttr): Override.
1712         (Delegate.DefineType): Use this TypeAttr.
1713         
1714         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1715         at very early stage (before types are defined) to resolve model
1716         module attributes. It will probably not work with corlib but it
1717         should be ok.
1718         
1719         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1720         charset from module.
1721         
1722         * typemanager.cs (default_charset_type): New type.
1723
1724 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1725
1726         * decl.cs (MemberCache.AddMethods): Don't warn if
1727         System.Object.Finalize has buggy MethodAttributes.
1728
1729         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1730         removed below.
1731
1732 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1733
1734         * doc.cs : detect ambiguous reference to overloaded members.
1735           Fixed bug #71603. MS 1.1 csc does not detect it.
1736
1737 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1738
1739         * doc.cs : delegates must not be referenced with parameters.
1740           Fixed bug #71605.
1741
1742 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1743
1744         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1745
1746 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1747
1748         * driver.cs (MainDriver): Stop processing if the CLS stage found
1749         errors. 
1750
1751         (CompilerCallableEntryPoint.InvokeCompiler): Always
1752         reset after execution;   Take a TextWriter argument for the
1753         output.
1754
1755         * report.cs: Use the error stream instead of hardcoding stderr. 
1756
1757 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1758
1759         * class.cs: Reduce code paths to test, too small of an
1760         optimization to make it worth the extra testing.  Always perform
1761         it. 
1762
1763 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1764
1765         Fix #74510.
1766         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1767         operators that had errors reported on them.
1768
1769 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1770
1771         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1772         argument types.
1773         (Attribute.Resolve): Add named argument type checking.
1774         
1775         * class.cs (FixedField.Define): Use IsPrimitiveType
1776         
1777         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1778         
1779         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1780         unsafe parameter types.
1781         
1782         * statement.cs (Using.ResolveExpression): Add better error description.
1783         
1784         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1785         
1786 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1787
1788         Fix #74484.
1789         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1790         AttributeUsageAttribute in the emitcontext of the attribute class,
1791         not in the emitcontext of the attributable entity it was attached to.
1792         * cs-parser.jay: Use 'current_class', not 'current_container',
1793         when creating a GlobalAttribute.
1794
1795 2005-04-08  Alp Toker  <alp@atoker.com>
1796
1797         * pending.cs: The fix to #58413 failed to compile methods implementing
1798         interfaces with/without params modifiers and vice versa, even though
1799         params modifiers aren't part of the signature. Make the modifier check
1800         less strict as in csc.
1801
1802 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1803             Anoob V E  <projectmonokochi@rediffmail.com>
1804             Harilal P R  <projectmonokochi@rediffmail.com>
1805
1806         Fix #58413.
1807         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1808         modifiers of pending methods.
1809         (PendingImplementation.PendingImplementation): Initialize it.
1810         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1811         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1812         with ParameterData.  Add check for modifiers.
1813         * class.cs (MethodData.Define): Update to changes.
1814
1815 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1816
1817         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1818
1819 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1820
1821         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1822         property.
1823         
1824         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1825         
1826         * rootcontext.cs,
1827         * typemanager.cs: Registered RequiredAttributeAttribute.
1828         
1829 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1830
1831         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1832         Warning CS0169 is back at level 3.
1833         (IMethodData.SetMemberIsUsed): New method.
1834         
1835         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1836         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1837         
1838         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1839
1840         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1841         contants.
1842         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1843         is used.
1844         
1845         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1846         is used.
1847         
1848         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1849         to avoid the problems with nested types.
1850
1851 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1852             Anoob V.E  <projectmonokochi@rediffmail.com>
1853             Harilal P.R  <projectmonokochi@rediffmail.com>
1854             Raja R Harinath  <rharinath@novell.com>
1855
1856         Fix #73820.
1857         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1858         attribute.
1859         * typemanager (GetConstructor): Make public.
1860
1861 2005-04-05  John Luke  <john.luke@gmail.com>
1862             Raja R Harinath  <rharinath@novell.com>
1863
1864         Fix #62232.
1865         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1866         struct too.  Return false quicker in a few cases.
1867         (VerifyUnManaged): Use it.
1868
1869 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1870
1871         Fix #74041.
1872         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1873         not 'unreachable_seen'.
1874
1875 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1876
1877         * attribute.cs (Attribute.GetValue): Removed unused.
1878         
1879         * codegen.cs (CodeGen.TrimExt): Removed unused.
1880         
1881         * cs-parser.jay (output): Removed unused.
1882         
1883         * cs-tokenizer.cs (hex_digits): Removed unused.
1884         
1885         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1886         
1887         * expression.cs (Indirection.LoadExprValue): Removed unused.
1888         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1889         
1890         * iterators.cs (Iterator.param_types): Removed unused.
1891         
1892         * statement.cs (Goto.block): Removed unused.
1893         (ToplevelBlock.did): Removed unused.
1894         (Switch.ResolveConstantSwitch): Removed unused.
1895
1896 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1897
1898         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1899         resetting thingy.
1900
1901 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1902
1903         Fix #74232 and cs0208-3.cs.
1904         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1905         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1906         unmanaged type.  Don't use FieldBuilders when 't' is a
1907         TypeBuilder.  Use ModFlags and MemberType fields.
1908         * class.cs (MemberBase.member_type): Rename from MemberType.
1909         (MemberBase.MemberType): New property.  Determines member_type on
1910         demand.
1911         (MemberBase.DoDefine): Don't initialize MemberType here.
1912         (FieldMember.Define): Likewise.
1913
1914 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1915
1916         Fix #74241
1917         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1918         Attributes are emitted there.
1919         
1920 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1921
1922         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1923         keyword in 'partial enum' too.
1924         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1925         is not allowed).
1926         Report from Kamil Skalski <nazgul@omega.pl>.
1927
1928         Fix #74309.
1929         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1930         have partial containers too.
1931
1932         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1933         in block' checks to Block.CheckInvariantMeaningInBlock.
1934         * statement.cs (Block.GetKnownVariableInfo): Make private.
1935         (Block.IsVariableUsedInChildBlock): Remove.
1936         (Block.IsVariableUsedInBlock): Likewise.
1937         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1938         conflicting declaration.
1939         (Block.AddVariable): Make error messages less long-winded and more
1940         specific.  Show location of conflicting declaration.
1941         * parameter.cs (Parameters.Location): New readonly property.
1942
1943 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1944
1945         Clean up semantics of invoking ResolveMemberAccess.
1946         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1947         can have an instance, ensure that we pass in a non-TypeExpression
1948         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1949         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1950         argument.  Update to changes and simplify.
1951         (FieldExpr.Emitinstance): Remove CS0120 check.
1952         (PropertyExpr.EmitInstance): Likewise.
1953         * expression.cs (Argument.Resolve): Likewise.
1954         (Invocation.DoResolve): Update to changes in semantics of
1955         InstanceExpression.
1956
1957 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1958
1959         Fix #74241
1960         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1961         customization.
1962         
1963         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1964
1965 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1966
1967         Fix difference in behaviour with commandline invocation.
1968         * driver.cs (Driver.Reset): New.
1969         (CompilerCallableEntryPoint): Call it.
1970
1971         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1972         variable" warnings if the boolean expression failed to resolve.
1973
1974 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1975
1976         * attribute.cs: Fix the union of several permissions when some of them
1977         are unrestricted (so the result isn't an unrestricted permission set).
1978         Fix #74036.
1979
1980 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1981
1982         * ecore.cs (MemberExpr): New class.  Convert from interface
1983         IMemberExpr.
1984         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1985         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1986         error checks.
1987         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1988         (MethodGroupExpr.IsExplicitImpl): Remove.
1989         (Expression.GetFieldFromEvent): Remove.
1990         (SimpleName.MemberStaticCheck): Remove.
1991         (SimpleName.DoSimpleNameResolve): Update to changes.
1992         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1993         (MemberAccess.IdenticalNameAndTypeName): Remove.
1994         (MemberAccess.error176): Move to MemberExpr.
1995         (MemberAccess.DoResolve): Update to changes.
1996         (BaseAccess.DoResolve): Likewise.
1997
1998 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1999
2000         C# 2.0 Conditional attribute class implementation
2001         
2002         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2003         Analyzes class whether it has attribute which has ConditionalAttribute
2004         and its condition is not defined.
2005         
2006         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2007         (Class.IsExcluded): New method. Search for at least one defined
2008         condition in ConditionalAttribute of attribute class.
2009
2010 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2011
2012         * ecore.cs (PropertyExpr): Derive from Expression, not
2013         ExpressionStatement.
2014         (PropertyExpr.EmitStatement): Remove.
2015
2016 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2017
2018         Fix #74060.
2019         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2020         internal field "value__" of an enum be private.  The examples for
2021         "value__" that I found on MSDN all used FieldAttributes.Private.
2022
2023         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2024         Don't mention IL method attribute names.
2025
2026         Fix #47991.  Remove a TODO.
2027         * statement.cs (Block.Toplevel): Make into a field.
2028         (Block.Parameters): Move into ToplevelBlock.
2029         (Block.known_variables): Rename from child_variable_names.
2030         (Block.Block): Remove variants that take Parameters.  Initialize
2031         'Toplevel' with the immediately surrounding toplevel block.
2032         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2033         LocalInfo parameter.
2034         (Block.GetKnownVariableInfo): New.
2035         (Block.IsVariableNameUsedInChildBlock): Update.
2036         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2037         the block, even though it may not be in scope.
2038         (Block.AddVariable): Remove Parameters parameter.  Use
2039         Toplevel.Parameters instead.
2040         (Block.AddConstant): Remove Parameters parameter.
2041         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2042         (Block.IsParamaterReference): Likewise.
2043         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2044         (ToplevelBlock.Parameters): New.  Moved from Block.
2045         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2046         initialize Parameters to a non-null value.
2047         * cs-parser.jay: Update to changes.
2048         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2049         simple names that mean different things in the same block.  Use
2050         Block.IsVariableNameUsedInBlock.
2051
2052 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2053
2054         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2055         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2056         GetTypeHandle.  It is possible for a reflected type to derive from
2057         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2058         System.Array during mscorlib compilation).
2059         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2060         contain a method_hash, don't create one either.  Don't create a
2061         deep copy of the base cache's method_hash.
2062         (MemberCache.SetupCache): Rename back from DeepCopy.
2063         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2064         already initialized.  If we see an override function, add its
2065         underlying base virtual function to the member_hash too.
2066
2067         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2068
2069 2005-03-26  Raja R Harinath  <harinath@acm.org>
2070
2071         Fix #73038.
2072         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2073         fails to resolve, ensure that the LHS is still resolved as an
2074         lvalue.
2075
2076 2005-03-25  Raja R Harinath  <harinath@acm.org>
2077
2078         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2079         ec.ContainerType.
2080         (Enum.current_ec): Remove.
2081         (Enum.LookupEnumValue): Remove EmitContext argument.
2082         Just uses the one created during DefineType.
2083         (Enum.FindMembers): Update.
2084         * expression.cs (MemberAccess.DoResolve): Update.
2085
2086 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2087
2088         * assign.cs (Assign.DoResolve): Check for CS1717 when
2089         source and target are same (uses Equals).
2090
2091         * expression.cs (LocalVariableReference, ParameterReference,
2092         This): Implemented Equals, GetHashCode.
2093
2094         * statement.cs (Block.GetParameterReference): Removed useless
2095         local variable.
2096
2097 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2098
2099         Fix cs0128.cs
2100         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2101         blocks before deciding whether the error is cs0136 or cs0128.
2102
2103         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2104         (using_alias_directive, using_namespace_directive): Pass
2105         MemberName, not an expression to Namespace.UsingAlias and
2106         Namespace.Using.
2107         (MakeName): Use the MemberName of the namespace.
2108         * namespace.cs (Namespace.MemberName): New.
2109         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2110         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2111         Likewise.
2112         * decl.cs (MemberName.Name): Make readonly.
2113         (MemberName.FromDotted): New "constructor".
2114         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2115         (MemberCore.Name): Compute from MemberName on demand.
2116         (MemberCore.SetMemberName): Provide a way to change the
2117         MemberName.
2118         (MemberCore.AddToContainer): Don't take a fullname parameter.
2119         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2120         fully qualified name of the container to the member name.
2121         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2122         only if the type is a member of the root container.
2123         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2124         MemberName.Left rather than searching for an embedded ".".
2125         (PartialContainer.CreatePart): Update to changes in RootContext.
2126         (MemberBase.ShortName): Turn into a property.  Use
2127         MemberCore.SetMemberName.
2128         (MemberBase.ExplicitInterfaceName): Remove.
2129         (MemberBase.UpdateMemberName): Remove.
2130         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2131         (PropertyBase.SetMemberName): New override.
2132         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2133         (Tree.GetDecl): New.
2134         (Tree.AllDecls): Rename from Decls.
2135         * attribute.cs, enum.cs, report.cs: Update to changes.
2136         * driver.cs (MainDriver): Use MemberName.FromDotted on
2137         RootContext.MainClass.
2138
2139 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2140
2141         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2142         checks.
2143
2144         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2145
2146 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2147
2148         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2149         property accessor modifiers.
2150
2151         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2152         fixed buffer attribute (CS1716).
2153         (PropertyMethod.HasCustomAccessModifier): When property accessor
2154         has custom modifier.
2155
2156         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2157         modifiers.
2158         (PropertyExpr.DoResolveLValue): Add CS0272.
2159
2160 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2161
2162         * convert.cs: When converting to a pointer, use the proper Conv.U
2163         or Conv.I depending on the source data type.
2164
2165         * cs-tokenizer.cs: Make the size for large decimal constants,
2166         fixes #72957.
2167
2168 2005-03-17  Martin Baulig  <martin@ximian.com>
2169
2170         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2171         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2172
2173 2005-03-17  Martin Baulig  <martin@ximian.com>
2174
2175         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2176         to bool so we can return an error condition.
2177         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2178         returned an error.
2179
2180 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2181
2182         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2183         attributes.
2184
2185 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2186
2187         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2188         Refactor to avoid traversing the list of assemblies, and to avoid
2189         string concatenation.
2190         * typemanager.cs (guid_attr_type): Remove.
2191         (negative_hits, pointers, references): Remove hashes.
2192         (type_hash): New.
2193         (GetConstructedType): New.  Uses type_hash to handle constructed
2194         types (arrays, references, pointers).
2195         (GetReferenceType, GetPointerType): Use it.
2196         (GetNestedType): New.  Uses type_hash to handle nested types of
2197         reflected types.
2198         (LookupType, LookupTypeDirect): Remove.
2199         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2200         'types' hash and LookupTypeReflection directly.
2201         (params_string, params_object): Use GetConstructedType.
2202         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2203         top-level types.
2204         (Namespace.Lookup): Use cached_types.
2205         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2206         provided by old TypeManager.LookupType.
2207         * rootcontext.cs (MakeFQN): Remove.
2208         * decl.cs (DeclSpace.MakeFQN): Likewise.
2209         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2210         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2211         TypeManager.GetConstructedType.
2212         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2213
2214 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2215
2216         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2217         indexers.
2218
2219         * cs-parser.jay: Reports CS1527 for any namespace element.
2220
2221         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2222         Added CS0407.
2223
2224         * expression.cs (ParameterReference.IsAssigned): Changed error to
2225         CS0269.
2226         (Error_WrongNumArguments): Moved CS0245 detection here.
2227
2228         * statement.cs (Return.Resolve): Add CS1622 report.
2229
2230 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2233
2234 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2235
2236         * attribute.cs expression.cs: Get rid of some allocations.
2237
2238 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2239
2240         * doc.cs : just eliminate the latest change.
2241
2242 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2243
2244         * doc.cs : commented out the latest change. It breaks xml-030.cs
2245
2246 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2247
2248         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2249           fail. So invoke CreateType() in FindDocumentedType().
2250
2251 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2252
2253         * cs-tokenizer.cs : added IsKeyword().
2254         * doc.cs : Detect keyword incorrectly used as identifier.
2255           Allow identifiers prefixed by @.
2256
2257 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2258
2259         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2260         It caused exception in namespace resolving (again!).
2261         
2262         * class.cs (Class.ctor): Removed exit.
2263         (PropertyMethod.ctor): ditto.
2264         
2265         * codegen.cs (Codegen.Reset): Reset static data.
2266         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2267         
2268         * cs-tokenizer.cs (Cleanup): Removed.
2269         
2270         * driver.cs (GetSystemDir): Rewrote to one line command.
2271         It caused problem with unloaded dynamic modules.
2272         (UnixParseOption): Removed Exit.
2273         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2274         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2275         Now can be mcs used as library.
2276         
2277         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2278         empty location.
2279         
2280         * location.cs (Reset): Reset static data.
2281         
2282         * namespace.cs (Reset): Reset static data.
2283         
2284         * report.cs (Report.Reset): Reset static data.
2285         
2286         * rootcontext.cs (RootContext.Reset): Reset static data.
2287         
2288         * tree.cs (RootTypes.ctor): Use Location.Null
2289         
2290         * typemanager.cs (TypeManager.Reset): Reset static data.
2291         (CoreLookupType): Removed Exit.
2292         (TypeHandle.Reset): Reset static data.
2293         
2294 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2295
2296         Fix #73516.
2297         * typemanager.cs (ComputeNamespaces): Import namespaces from
2298         referenced modules too.
2299
2300 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2301
2302         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2303         than '.'.
2304
2305 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2306
2307         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2308         enclosing DeclSpace.  This ensures that a name-lookup populates
2309         more caches and there are fewer 'TypeExpression's.  Carve out
2310         nested type lookup into ...
2311         (LookupNestedTypeInHierarchy): ... this.
2312
2313 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2314
2315         Clean up a few partial-class semantics.  
2316         Fixes test-357.cs and cs1618-2.cs.
2317         * cs-parser.jay (struct_declaration): Use 'current_class' as
2318         parent of newly-created struct.  Remove call to Register ().
2319         Use 'pop_current_class' to complete handing the current struct.
2320         (interface_declaration): Likewise.
2321         (class_declaration): Likewise.
2322         (enum_declaration): Use 'current_class' as parent of newly created
2323         enum.
2324         (delegate_declaration): Likewise.
2325         (pop_current_class): New function.  This is used to handle closing
2326         up the 'current_class' and 'current_container', and pointing them
2327         to the enclosing class/container.
2328         (CSharpParser): Initialize 'current_class' too.
2329         * decl.cs (MemberCore): Add check for invariant: a partial
2330         container is not a parsed entity, and thus does not enclose any
2331         parsed members.
2332         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2333         (DeclSpace.BaseTypeExpr): Use it.
2334         (DeclSpace.LookupType): Add check for invariant.
2335         * class.cs (TypeContainer): Add check for invariant: a nested
2336         class should have the same NamespaceEntry as its enclosing class.
2337         (TypeContainer.EmitFieldInitializers): Make virtual.
2338         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2339         MemberCore.
2340         (TypeContainer.Register): Remove.
2341         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2342         null.  Use TypeResolveEmitContext for resolving base types and
2343         interfaces.  Move initialization of Parts.TypeBuilder here from
2344         ...
2345         (TypeContainer.DefineNestedTypes): ... here.
2346         (PartialContainer): Take a Namespace not a NamespaceEntry.
2347         (PartialContainer.Create): Don't use Register.  Call the
2348         appropriate Add... function directly.
2349         (ClassPart): Take both the PartialContainer and the enclosing
2350         class as constructor arguments.
2351         (ClassPart.EmitFieldInitializers): Override.
2352         (ClassPart.PartFindNestedTypes): Remove.
2353         (FieldBase.GetInitializerExpression): Resolve the initializer
2354         expression in the emit context of the enclosing class.
2355         * tree.cs (RootTypes): Remove Register ().
2356         
2357 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2358
2359         * cs-parser.jay: Removed CS0134.
2360         
2361         * driver.cs: Removed CS1901.
2362         
2363         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2364         for predefined types.
2365
2366 2005-03-07  Duncan Mak  <duncan@novell.com>
2367
2368         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2369         well. Fixes bug #73454.
2370
2371 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2372
2373         * cs-tokenizer.cs (xtoken): Add CS1035.
2374         
2375         * class.cs (MethodData.Define): Add CS0683.
2376         (FieldMember.ctor): Add CS0681.
2377
2378 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2379
2380         * ecore.cs (SimpleName.DoResolve): Rename from
2381         SimpleName.DoResolveAllowStatic.
2382         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2383         Pass 'intermediate' flag to MemberStaticCheck.
2384         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2385         of "intermediate" lookups via MemberAccess.
2386         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2387         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2388
2389 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2390
2391         Fix #73394.
2392         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2393         slipped in because of variable names that are identical to a
2394         builtin type's BCL equivalent ('string String;', 'int Int32;').
2395         (PropertyExpr.EmitInstance): Likewise.
2396
2397 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2398
2399         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2400         
2401         * report.cs (warning_ignore_table): Made public.
2402
2403 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2404
2405         Fix #73282.
2406         * class.cs (MethodData.Emit): Pass 'container' to
2407         container.GetObsoleteAttribute instead of 'container.Parent'.
2408
2409 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2410
2411         * cs-parser.jay: Add 1534 error test.
2412
2413         * iterators.cs (Yield.CheckContext): Add error 1629.
2414         (Iterator.ctor): Save unsafe modifier.
2415         (MoveNextMethod.DoEmit): Restore unsafe context.
2416
2417         * namespace.cs (UsingAlias): Better error message.
2418
2419 2005-03-03  Dan Winship  <danw@novell.com>
2420
2421         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2422         the warning message [#73219]
2423
2424 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2425
2426         Fix compile with MCS 1.0.0.0.
2427         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2428         w_restore to not depend on string constant folding.
2429
2430 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2431
2432         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2433         CS0246 check to users who passed 'silent = false'.
2434         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2435         check.
2436         (SimpleName.SimpleNameResolve): Update.
2437         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2438         (MemberAccess.IdenticalNameAndTypeName): Update.
2439         * doc.cs (FindDocumentedTypeNonArray): Update.
2440
2441 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2442
2443         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2444         * parameters.cs (ComputeAndDefineParameters): Remove.
2445         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2446         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2447         Use GetParameterInfo.
2448
2449 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2450
2451         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2452
2453 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2454
2455         Unify DeclSpace.LookupType and DeclSpace.FindType.
2456         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2457         is in charge of defining nested types on demand.
2458         (DeclSpace.LookupType): Use it when the current_type is a
2459         TypeBuilder.  Use LookupTypeDirect for reflected types.
2460         (DeclSpace.FindType): Remove.
2461         (DeclSpace.LookupInterfaceOrClass): Likewise.
2462         (DeclSpace.DefineTypeAndParents): Likewise.
2463         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2464         DeclSpace.LookupType.
2465         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2466         * typemanager.cs (LookupType): Simplify.
2467         (AddUserType): Remove type from negative_hits.
2468         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2469         * class.cs (TypeContainer.FindMembers): Move handling of nested
2470         types ...
2471         (TypeContainer.FindMembers_NestedTypes): ... here.
2472         (TypeContainer.FindNestedType): Implement override.
2473         (ClassPart.FindNestedType): Delegate to PartialContainer.
2474         (ClassPart.PartFindNestedType): Looks up the nested types of the
2475         part alone.
2476
2477 2005-03-02  Martin Baulig  <martin@ximian.com>
2478
2479         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2480         static constructor in static classes.
2481
2482 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2483
2484         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2485         sizeParamIndex is not specified.
2486
2487 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2488
2489         Fix #73117
2490         * report.cs (WarningMessage.IsEnabled): Missing null check.
2491
2492 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2493
2494         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2495         in the fields and not in the properties.
2496
2497 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2498
2499         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2500         fields as well.
2501
2502 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2503
2504         * attribute.cs: Small refactoring (improved robustness).
2505         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2506         (ValidateGuid): Removed.
2507         (Resolve): Removed referenced to above mentioned.
2508         (GetAttributeUsage): Made private and changed to work without
2509         class assistance.
2510         (GetIndexerAttributeValue): Don't crash.
2511         (GetConditionalAttributeValue): Ditto.
2512         (GetClsCompliantAttributeValue): Ditto.
2513         (ExtractSecurityPermissionSet): All attributes exceptions are
2514         error 648.
2515         (GetPropertyValue): New helper.
2516         (GetMethodImplOptions): New method.
2517         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2518         some missing properties.
2519         
2520         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2521         (Method.ApplyAttributeBuilder): Updated.
2522         
2523         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2524         exception.
2525
2526 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2527
2528         Fix #73052.
2529         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2530         non-simple types (array, pointer, reference).
2531
2532 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2533
2534         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2535
2536         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2537         for operators.
2538         (Method.CheckBase): Catch wrong destructor here.
2539         (MethodData.Define): Add errors 550, 668.
2540
2541         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2542
2543         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2544
2545         * pending.cs (VerifyPendingMethods): Add error 551.
2546
2547         * typemanager.cs (CSharpName): Next error report helper.
2548
2549 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2550
2551         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2552         attributes. Removed useless attribute double check.
2553         It saves almost 2MBs for corlib.
2554
2555 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2556
2557         Fix #72924.
2558         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2559         called twice in case of error.
2560
2561 2005-02-23  Chris Toshok  <toshok@ximian.com>
2562
2563         Fix compiler portions of #72827.
2564         * statement.cs (Block.Emit): call Begin/EndScope on the
2565         EmitContext instead of the ILGenerator.
2566
2567         * codegen.cs (EmitContext.BeginScope): new method, call
2568         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2569         we have one.)
2570         (EmitContext.BeginScope): same, but EndScope and CloseScope
2571
2572         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2573         offset and call the superclass's OpenScope(int) with it.
2574         (SymbolWriter.CloseScope): get the current il
2575         offset and call superclass's CloseScope(int) with it.
2576
2577 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2578
2579         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2580         CS1677 for out and ref as well.
2581
2582         * class.cs (Method.Define): Add error CS1599 detection.
2583         
2584         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2585         
2586         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2587         
2588         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2589         
2590         * support.cs.cs (ModifierDesc): New helper method.
2591
2592 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2593             Abin Thomas  <projectmonokochi@rediffmail.com>
2594             Anoob V E  <projectmonokochi@rediffmail.com>
2595             Harilal P R  <projectmonokochi@rediffmail.com>
2596
2597         Fix #57851, #72718.
2598         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2599         MemberLookup (used for error reporting) actually returns a result.
2600         Fix error report number (122, not 112).
2601
2602 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2603             Anoob V E  <projectmonokochi@rediffmail.com>
2604             Harilal P R  <projectmonokochi@rediffmail.com>
2605
2606         Fix #71134.
2607         * pending.cs (PendingImplementation.GetAbstractMethods):
2608         Find NonPublic members too.
2609
2610 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2611
2612         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2613         Fixed error 217.
2614         
2615         * class.cs (MethodCore.CheckMethodAgainstBase):
2616         Add error 239 report.
2617
2618 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2619
2620         Fix #68955.
2621         * expression.cs (Invocation.IsApplicable): Make public.
2622         (Invocation.IsParamsMethodApplicable): Likewise.
2623         * delegate.cs (Delegate.VerifyApplicability): Don't use
2624         Invocation.VerifyArgumentCompat for parameter applicability
2625         testing.  Use Invocation.IsApplicable and
2626         Invocation.IsParamsMethodApplicable.
2627
2628 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2629
2630         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2631         
2632         * class.cs (Operator.Define): Add error 217 report.
2633         
2634 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2635
2636         * namespace.cs (UsingEntry.Resolve): Undo change below.
2637
2638 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2639
2640         Fix #72756.
2641         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2642         disable the error message when the extended MemberLookup also
2643         fails.
2644         (Expression.MemberLookupFinal): Update.
2645         (SimpleName.DoSimpleNameResolve): Update.
2646         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2647         Don't use MemberLookupFinal.
2648         (New.DoResolve): Update.
2649         (BaseAccess.CommonResolve): Update.
2650
2651 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2652
2653         Fix #72732.
2654         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2655         occured previously, don't resolve again.
2656
2657 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2658
2659         Fix #69949
2660         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2661         argument. Call ResolveAttributeUsage for unresolved.
2662         when types doesn't match ctor arguments.
2663         
2664         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2665         for nested attribute classes.
2666         (Class.attribute_usage): Removed.
2667         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2668         for attribute class.
2669         
2670         * ecore.cs (IsAttribute): Removed.
2671         
2672         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2673         
2674         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2675         now normal types.
2676         (attribute_types): Removed.
2677         (EmitCode): Global attributes are emited as the latest.
2678
2679 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2680
2681         * class.cs (EmitFieldInitializers): Don't emit field initializer
2682         for default values when optimilization is on.
2683         
2684         * constant.cs (Constant.IsDefaultValue): New property.
2685         
2686         * driver.cs: Add /optimize handling.
2687         
2688         * constant.cs,
2689         * ecore.cs,
2690         * literal.cs: Implement new IsDefaultValue property.
2691         
2692         * rootcontext.cs (Optimize): New field, holds /optimize option.
2693
2694 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2695
2696         Fix crasher in re-opened #72347.
2697         * namespace.cs (Namespace.Lookup): Return null if
2698         DeclSpace.DefineType returns null.
2699
2700         Fix #72678.
2701         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2702
2703 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2704
2705         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2706         now returns null if it cannot resolve to an lvalue.
2707         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2708         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2709         returned null.  Remove check for SimpleName.
2710         (EventExpr.DoResolveLValue): New.
2711         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2712         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2713         error from ...
2714         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2715         avoid CS0131 error.
2716         (Unary.ResolveOperator): Move CS0211 check ...
2717         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2718         CS0131 error.
2719         (Unary.DoResolveLValue): Simplify.
2720         (AddressOf.DoResolveLValue): New.
2721         (ArrayAccess.DoResolveLValue): New.
2722
2723 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2724
2725         * attribute.cs (Attribute.Resolve): Add arguments casting for
2726         when types doesn't match ctor arguments.
2727
2728 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2729
2730         Fix parts of #63202.
2731         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2732         lookup of operator in base type.  Ensure that all checks happen
2733         when the operator resolves to an "op_..." method.
2734
2735 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2736
2737         Fix #71992.
2738         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2739         'ignore_cs0104' parameter.  Pass it to ...
2740         (NamespaceEntry.Lookup): ... this.
2741         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2742         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2743         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2744         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2745         Update.  Request that cs0104 errors be ignored.
2746         (ComposedCast.ResolveAsTypeStep): Update.
2747
2748 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2749
2750         Fix #59209.
2751         * expression.cs (Invocation.BetterFunction): Remove support for
2752         comparing virtual functions and their overrides.
2753         (Invocation.IsOverride): New.
2754         (Invocation.OverloadResolve): Don't consider 'override' functions
2755         during candidate selection.  Store them in a lookaside list.
2756         If the selected method is a 'virtual' function, use the list to
2757         find any overrides that are closer to the LHS type.
2758
2759 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2760
2761         * expression.cs (New.DoResolve): Add complex core type reduction.
2762         (New.Constantify): Converts complex core type syntax like 'new int ()'
2763         to simple constant.
2764         
2765 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2766
2767         * decl.cs (EntryType.EntryType): New constructor to create an
2768         updated copy of a cache entry.
2769         (MemberCache.AddMethods): Use it.
2770         (MemberCache.ClearDeclaredOnly): Remove.
2771         (MemberCache.MemberCache): Update.
2772
2773 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2774
2775         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2776         variable.  This one is represents the actual low-level declaration
2777         of the method, as opposed to the semantic level `IsStatic'.   
2778
2779         An anonymous method which is hosted into a static method might be
2780         actually an instance method.  IsStatic would reflect the
2781         container, while MethodIsStatic represents the actual code
2782         generated.
2783
2784         * expression.cs (ParameterReference): Use the new MethodIsStatic
2785         instead of IsStatic.
2786
2787         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2788         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2789         set on the current EmitContext. 
2790
2791         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2792         resolve our casted expression as an LValue.  This triggers the
2793         proper LValue processing that is later required by Assign.
2794
2795         This fixes 72347.
2796
2797         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2798
2799 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2800
2801         C# 2.0 Fixed buffer implementation
2802
2803         * anonymous.cs: Update after RegisterHelperClass renaming.
2804
2805         * attribute.cs (AttributeTester.fixed_buffer_cache):
2806         Cache of external fixed buffers.
2807         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2808         implementation if field is fixed buffer else null.
2809
2810         * class.cs
2811         (TypeContainer.AddField): Accept FieldMember instead of Field.
2812         (FieldBase.IsFieldClsCompliant): Extracted code from
2813         VerifyClsCompliance descendant customization.
2814         (FixedField): New class handles fixed buffer fields.
2815         (FixedFieldExternal): Keeps information about imported fixed
2816         buffer.
2817         (IFixedField): Make access to internal or external fixed buffer
2818         same.
2819
2820         * cs-parser.jay: Add fixed buffer parsing.
2821
2822         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2823         buffer.
2824
2825         * expression.cs (Indirection): Extended implementation to accept
2826         fixed buffer field.
2827         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2828         (ElementAccess.MakePointerAccess): Get type as parameter.
2829         (DoResolve): Add fixed buffer field expression conversion.
2830         (DoResolveLValue): Ditto.
2831         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2832         (ArrayPtr): Derives from FixedBufferPtr.
2833         (ArrayPtr.Emit): Add extra emit for array elements.
2834
2835         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2836
2837         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2838         for compiler generated types.
2839         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2840
2841         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2842         and consume less memory.
2843         (Fixed.Resolve): Add fixed buffer case.
2844
2845         * typemanager.cs (compiler_generated_attr_ctor,
2846         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2847         (HasElementType): Add our own implementation to work on every
2848         runtime.
2849
2850 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2851
2852         * anonymous.cs (CaptureContext): Track whether `this' has been
2853         referenced.   
2854
2855         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2856         only captured `this' if it was implicitly done (instance
2857         methods/variables were used). 
2858
2859         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2860         `this' must be captured.
2861
2862 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2863  
2864         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2865         is null it means that there has been no need to capture anything,
2866         so we just create a sibling.
2867
2868         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2869
2870         Just a partial fix.  The other half is fairly elusive.
2871         
2872 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2873
2874         Fix #52586, cs0121-4.cs.
2875         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2876         and return a hashtable.
2877         (MemberCache.ClearDeclaredOnly): New.
2878         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2879         the method_hash of a base type too.
2880         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2881         type methods.  Overwrite entries with the same MethodHandle so
2882         that the ReflectedType is correct.  The process leaves in base
2883         virtual functions and their overrides as distinct entries.
2884         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2885         matters since it was boxed in a ArrayList before.
2886         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2887         modifier.
2888         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2889         case of a virtual function and its override (choose the overload
2890         as better).
2891         (Invocation.OverloadResolve): Avoid 'override' members during
2892         'applicable_type' calculation.
2893
2894 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2895
2896         Combine two near-redundant caches.
2897         * typemanager.cs (method_params): Rename from method_internal_params.
2898         (TypeManager.GetParameterData): New.  Replace
2899         Invocation.GetParameterData.
2900         (TypeManager.LookupParametersByBuilder): Remove.
2901         * expression.cs (Invocation.method_parameter_cache): Remove.
2902         (Invocation.GetParameterData): Remove.
2903         Update to changes.
2904         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2905         Update to changes.
2906
2907 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2908
2909         Fix #72015.
2910         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2911         TypeManager.multicast_delegate_type is null, resolve it by looking
2912         up "System.MulticastDelegate".
2913         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2914
2915 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2916             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2917             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2918
2919         Fix cs0164.cs.
2920         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2921         (LabeledStatement.AddReference): New.  Set 'referenced'.
2922         (Goto.Resolve): Use it.
2923
2924 2005-02-05  John Luke  <john.luke@gmail.com>
2925
2926         * driver.cs: remove duplicate -doc line in Usage ()
2927
2928 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2929
2930         * location.cs (Location.AddFile): Fix CS2002 error report.
2931
2932 2005-02-02  Martin Baulig  <martin@ximian.com>
2933
2934         * delegate.cs (Delegate.DefineType): Report an internal error if
2935         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2936         details.        
2937
2938 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2939
2940         Fix a crasher in a variant of #31984.
2941         * const.cs (Constant.CheckBase): New override that defers the
2942         new-or-override check in case the base type hasn't been populated
2943         yet.
2944         (Constant.Define): Ensure the new-or-override check is performed.
2945
2946 2005-02-01  Duncan Mak  <duncan@ximian.com>
2947
2948         * const.cs (LookupConstantValue): Check that `ce' is not null
2949         before calling GetValue ().
2950
2951 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2952
2953         Fix test-334.cs (#69519).
2954         * cs-parser.jay (using_alias_directive): Pass in an expression to
2955         NamespaceEntry.UsingAlias.
2956         (using_namespace_directive): Pass in an expression to
2957         NamespaceEntry.Using.
2958         (namespace_name): Don't flatten to a string.
2959         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2960         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2961         ResolveAsTypeStep.
2962         (NamespaceEntry.UsingEntry): Likewise.
2963         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2964         changes.
2965         (NamespaceEntry.LookupForUsing): Remove.
2966         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2967         names.
2968         (NamespaceEntry.Lookup): Remove support for dotted names.
2969
2970 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2971
2972         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2973         split into two.
2974         (NamespaceEntry.ImplicitParent): Compute on demand.
2975         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2976         parallels the current.
2977         (NamespaceEntry.LookupForUsing): Use it.
2978         (NamespaceEntry.Lookup): If the current namespace-entry is
2979         implicit, don't search aliases and using tables.
2980
2981 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2982
2983         Fix #31984.
2984         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2985         BaseCache here.
2986         (TypeContainer.BaseCache): Compute on demand.
2987         (TypeContainer.FindMembers): Define constants and types if they're
2988         not already created.
2989         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2990         check.
2991         * const.cs (Constant.Define): Make idempotent.
2992
2993 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2994
2995         * pending.cs: Produce better code (no nops produced by using Ldarg
2996         + value).
2997         
2998         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2999         i - 1' it should be arg + 1.
3000
3001         Fixes bug #71819.
3002
3003 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3004
3005         * attribute.cs (Attribute.CheckAttributeType): Make private
3006         non-virtual.
3007         (Attribute.ResolveType): Make virtual.
3008         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3009         handling of RootContext.Tree.Types.
3010
3011 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3012
3013         Update attribute-handling to use the SimpleName/MemberAccess
3014         mechanisms.
3015         * cs-parser.jay (attribute): Pass in an expression to the
3016         constructors of Attribute and GlobalAttribute.
3017         * attribute.cs (Attribute): Take an expression for the name.
3018         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3019         passed in attribute name expression.
3020         (Attribute.CheckAttributeType): Use it.
3021         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3022         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3023         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3024         argument to prevent error messages if the lookup fails.
3025
3026 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3027
3028         * expression.cs (Indirection): Implemented IVariable interface
3029         to support indirection in AddressOf operator.
3030         (PointerArithmetic.Emit): Add optimalization for case where
3031         result can be precomputed.
3032
3033 2005-01-26  Martin Baulig  <martin@ximian.com>
3034
3035         * class.cs (TypeContainer.AttributeTargets): Return the correct
3036         AttributeTargets depending on our `Kind' instead of throwing an
3037         exception; fixes #71632.
3038
3039 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3040
3041         Fix #71257
3042         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3043         constant members.
3044
3045 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3046
3047         Fix #71602.
3048         * expression.cs (MemberAccess.DoResolve): Don't complain with
3049         cs0572 when the LHS of a member access has identical name and type
3050         name.
3051
3052 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3053
3054         Fix #71651, #71675
3055         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3056         CreatePermission.
3057         Create custom PermissionSet only for PermissionSetAttribute.
3058
3059 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3060
3061         Fix #71649
3062         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3063         delegates in static class.
3064
3065 2005-01-24  Martin Baulig  <martin@ximian.com>
3066
3067         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3068         merging an implicit block, just use its reachability.
3069
3070         * statement.cs (Block.Resolve): Make the unreachable code check
3071         work wrt. implicit blocks; see test-337 from #63842.
3072
3073 2005-01-21  Alp Toker  <alp@atoker.com>
3074  
3075         * cs-parser.jay: destructor_declaration's container is PartialContainer
3076         not Class when partial types are used, so use Kind prop instead of
3077         'is'.
3078         
3079 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3080
3081         * cs-parser.jay: Improve error reporting when an interface
3082         declares new types.
3083
3084 2005-01-20  Dick Porter  <dick@ximian.com>
3085
3086         * support.cs: SeekableStreamReader fix from Sandor Dobos
3087         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3088         chars are read.  Fixes bug 70369.
3089
3090 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3091
3092         * cs-parser.jay (catch_clause): Simplify current_block handling
3093         somewhat.
3094
3095 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3096
3097         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3098         code with ImplicitStandardConversion to handle the implicit
3099         conversion of method groups into valid delegate invocations. 
3100
3101         The problem is that in parameter handling we were using this code
3102         path.  Fixes bug #64698
3103
3104 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3105
3106         * cs-parser.jay: Fix several infelicities.
3107         - Avoid assigning to the parser value stack.  Code like 
3108           '$3 = null' is unclean.  Synthesize a value for the code block
3109           instead. 
3110         - Avoid using oob_stack for storing location information.  Use ...
3111         (_mark_): ... this.  New (empty) rule.  Saves the current location
3112         in $$.
3113         (foreach_statement): Avoid using oob_stack for current_block
3114         handling.  Use technique used in for_statement and
3115         using_statement.  Synthesize a value for the code block to store
3116         additional intermediate information.
3117
3118 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3119
3120         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3121         of a different type is only allowed to private fields of a
3122         containing type, not on fields of a base class.
3123
3124         See test-174.cs and error cs0122-9.cs
3125
3126 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3127
3128         Fix test-335.cs (bug #58126).
3129         * cs-parser.jay (argument): Split out non-expression parts of the
3130         rule into 'non_simple_argument'.
3131         (invocation_expression): Support parenthesized invocations with
3132         multiple arguments, and with single non-simple arguments.
3133
3134 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3135
3136         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3137         places.
3138
3139 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3140
3141         Fix cs0038-1.cs, cs1640-6.cs.
3142         * ecore.cs (Expression.Resolve): Remove special-case for
3143         SimpleName in error-handling.
3144         (Expression.almostMatchedMembers): Relax access permission to
3145         protected.
3146         (Expression.MemberLookupFailed): Handle duplicates in
3147         almostMatchedMembers list.
3148         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3149         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3150         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3151         overload if the passed in MemberInfo is a MethodBase.
3152
3153 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3154
3155         Fix #70749
3156         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3157         for non-CAS & merge permission sets properly.
3158
3159 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3160
3161         Improve standard-compliance of simple name and member access 
3162         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3163         * ecore.cs (FullNamedExpression): New abstract base class 
3164         for Namespaces and TypeExpressions.
3165         (ResolveFlags.SimpleName): Remove.
3166         (SimpleName): Remove support for dotted names.
3167         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3168         DeclSpace.FindType and DeclSpace.LookupType.
3169         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3170         (Expression.ExprClassName): Make member function.
3171         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3172         a namespace.  Remove creation of dotted "SimpleName"s.
3173         (MemberAccess.DoResolve): Likewise.
3174         * decl.cs (DeclSpace.Cache): Make private.
3175         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3176         (DeclSpace.FindType): Update.
3177         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3178         FullNamedExpression.
3179         * namespace.cs (Namespace): Derive from FullNamedExpression
3180         so that it can be part of expression resolution.
3181         (Namespace.Lookup): Return an FullNamedExpression.
3182         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3183         namespace.
3184         * rootcontext.cs (NamespaceLookup): Remove.
3185         (LookupType): Move to DeclSpace.
3186         * attribute.cs (CheckAttributeType): Update.
3187         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3188         (FindDocumentedTypeNonArray): Likewise.
3189
3190 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3191
3192         Fix cs0509.cs, cs1632.cs.
3193         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3194         is the same as IsInterface.
3195         (TypeContainer.GetClassBases): Likewise.
3196         * statement.cs (LabeledStatement.ig): New field.
3197         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3198         label.
3199         (LabeledStatement.DoEmit): Check that the label was created with
3200         the same ILGenerator.
3201
3202 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3203
3204         Fix #71058
3205         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3206         accessors to its properties.
3207
3208         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3209         from accessors to property.
3210         
3211 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3212
3213         Fix #70722
3214         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3215         only for overrides.
3216         
3217 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3218
3219         * attribute.cs: Check for null and empty strings.  
3220
3221         I have lost another battle to Paolo.
3222
3223 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3224
3225         Fix #70942
3226         * class.cs (PropertyMethod): Set Parent field in ctors.
3227         (SetMethod.InternalParameters): Add unsafe switch hack.
3228         Override MarkForDuplicationCheck where it is appropriate.
3229
3230         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3231         It says whether container allows members with the same name.
3232         Base default is no.
3233         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3234         Removed is_method parameter.
3235
3236 2005-01-06  Duncan Mak  <duncan@ximian.com>
3237
3238         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3239         because the previous change led to incorrect reporting of CS1032
3240         ("Cannot define/undefine preprocessor symbols after first token in
3241         file"). Instead of using `tokens_seen' as the only flag that
3242         triggers CS1040, introduce `comments_seen'. This new flag is used
3243         to signify having seen comments on the current line, so it is
3244         unset after a newline.
3245
3246 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3247
3248         * doc.cs : When searching for a type, find nested type too.
3249           This fixes bug #71040.
3250
3251 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3252
3253         * doc.cs :
3254           - Warn missing member comment on those classes which also does not
3255             have doc comments. Fixed bug #71041.
3256           - Don't warn missing doc comment on default constructor.
3257             Fixed bug #71042.
3258
3259 2005-01-06  Duncan Mak  <duncan@ximian.com>
3260
3261         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3262         comments, set `tokens_seen' to true. This allows us to detect
3263         misplaced preprocessor directives (i.e. not at the beginning of
3264         the a line, nor after whitespaces). In that case, report error
3265         CS1040. This fixes bug #56460.
3266
3267         * cs-parser.jay (interface_member_declaration): Add checks for
3268         IsExplicitImpl, and report CS0541 error if an interface member is
3269         defined as an explicit interface declaration.
3270
3271 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3272
3273         Fix #70817
3274         * class.cs (PropertyMethod): Set Parent field in ctors.
3275         (SetMethod.InternalParameters): Add unsafe switch hack.
3276         
3277         * decl.cs (MemberCore.Parent): Cannot be readonly.
3278
3279 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3280
3281         * decl.cs (DeclSpace.ResolveType): Remove.
3282         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3283         Merge in code from ...
3284         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3285         * class.cs, enum.cs: Update to changes.
3286
3287 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3288
3289         * anonymous.cs: Ensure that we init the scope of our parent if it
3290         has not been initialized yet.
3291
3292 2004-12-30  Duncan Mak  <duncan@ximian.com>
3293
3294         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3295         if field.FieldBuilder is null. Fixes #70758.
3296
3297         * convert.cs: Fixed some typos and updated some of the comments.
3298         (ImplicitStandardConversionExists):
3299         (TryImplicitIntConversion): If `target_type' is an interface and
3300         the type of `ic' implements this interface, return true or a new
3301         BoxedCast instead of null. This fixes #70468.
3302
3303 2004-12-29  Duncan Mak  <duncan@ximian.com>
3304
3305         * expression.cs (Argument.Emit): Check that Expr is
3306         IMemoryLocation before casting to it, and report CS1510 otherwise.
3307
3308         This fixes #70402.
3309
3310 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3311
3312         * statement.cs (Block.ThisVariable): remove the recursion here, to
3313         make the --profile more sane.
3314
3315 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3316
3317         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3318         assembly, by JB Evain.
3319
3320 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3321
3322         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3323           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3324         "parent" refers to enclosing type/class.  "base" refers to superclass.
3325
3326 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3327
3328         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3329         Ensure that we only have GlobalAttributes.
3330         * attribute.cs (Attribute.Emit): Make non-virtual.
3331         (GlobalAttribute.Emit): Remove.
3332         (Attribute.Resolve): Make virtual.
3333         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3334         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3335         the argument. Don't create one.
3336         (Attribute.GetObsoleteAttribute): Likewise.
3337         (Attribute.GetClsCompliantAttributeValue): Likewise.
3338         * class.cs, decl.cs: Update to changes.
3339
3340 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3341
3342         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3343         
3344         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3345         
3346         * statement.cs (Foreach.Resolve): Add error 186 report.
3347
3348 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3349
3350         * expression.cs (Conditional.DoResolve): Add warning 429.
3351         
3352         * statement.cs (If.Resolve): Add warning 665.
3353
3354 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3355
3356         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3357         except when in the parser, and in GlobalAttribute.
3358         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3359         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3360         RootContext.Tree.Types.NamespaceEntry once work is done.
3361         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3362         and resets RootContext.Tree.Types.NamespaceEntry.
3363
3364 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3365
3366         * cs-parser.jay: Don't create a block for every variable.
3367
3368 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3369
3370         * location.cs: Provide extra information.
3371
3372         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3373         variables from the captured environment, it is the ldarg_0.
3374
3375 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3376
3377         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3378         find a conclusion.
3379         
3380         * class.cs: Changed warning level for 169 to avoid developer
3381         displeasure from warning flooding. It will be changed back when they
3382         fix most of current BCL warnings.
3383         
3384         * RootContext.cs: Pushed default WarningLevel to 3.
3385         
3386         * statement.cs: Removed unused variable.
3387
3388 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3389
3390         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3391         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3392         Add error 502 report.
3393         (StaticClass.DefineType): Add error 441 report.
3394         (Class.AllowedModifiersProp): New virtual property as temporary
3395         extension to AllowedModifiers.
3396         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3397         to share implementation with StaticClass and don't call virtual
3398         methods from ctor.
3399         
3400         * driver.cs (MainDriver): Add error 1558 test.
3401
3402         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3403         report. Moved error 36 test here.
3404
3405         * statement.cs (Throw.Resolve): Add error 724 report.
3406
3407         * typemanager.cs: Add out_attribute_type core type.
3408         
3409 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3410
3411         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3412         3018 report.
3413         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3414
3415         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3416         3017 report.
3417         
3418         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3419
3420         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3421         Add error 3023 report.
3422         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3423
3424         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3425         implementation.
3426
3427 2004-12-12  John Luke  <john.luke@gmail.com>
3428
3429         * driver.cs (AddArgs): take -- into account when
3430         adding arguments, fixes bug 65710 
3431
3432 2004-12-12  Martin Baulig  <martin@ximian.com>
3433
3434         * expression.cs (Unary.TryReduceNegative): Added support for
3435         SByteConstant and ByteConstant.
3436         (Unary.Reduce): Check error values from TryReduceNegative().
3437
3438 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3439
3440         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3441         and report exception as error 182.
3442
3443 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3444
3445         * driver.cs (Main): Fix message when there are warnings.
3446
3447 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3448
3449         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3450
3451 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3452
3453         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3454         Reduced number of warnings.
3455         
3456         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3457
3458 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3459
3460         * driver.cs: Removed message.
3461
3462         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3463
3464 2004-12-08    <vargaz@freemail.hu>
3465
3466         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3467
3468 2004-12-08  Martin Baulig  <martin@ximian.com>
3469
3470         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3471         instead of a CS3002 for properties and indexer.
3472
3473 2004-12-08  Martin Baulig  <martin@ximian.com>
3474
3475         * decl.cs (MemberName.ToString): Make this work again.
3476
3477 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3478
3479         * attribute.cs (Resolve): Add error 591 detection.
3480
3481         * class.cs (FieldMember.Define): Add error 1547 detection.
3482         (Indexer.Define): Add error 620 detection.
3483         (Operator.Define): Add error 590 detection.
3484
3485         * ecore.cs: Missing argument for error 79.
3486
3487         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3488         detection.
3489
3490 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3491
3492         Fix #70106
3493         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3494         only.
3495
3496 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3497
3498         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3499           Some operator comments were suppressed.
3500         * doc.cs : Implicit/explicit operator name in doc comments are like
3501           "op_Explicit(type)~returnType", so added suffix handling.
3502
3503 2004-12-07  Martin Baulig  <martin@ximian.com>
3504
3505         * decl.cs
3506         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3507         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3508         (DeclSpace.ec): New protected field; store the EmitContext here.
3509         (DeclSpace.EmitContext): New public property; moved here from
3510         `TypeContainer'.
3511         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3512         EmitContext.
3513
3514         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3515         (Enum.Emit): Don't create a new EmitContext.
3516
3517         * delegate.cs (Delegate.DefineType): Always create the
3518         EmitContext.
3519
3520         * iterators.cs (Iterators.DefineIterator): Create a new
3521         EmitContext and store it in `ec'.
3522
3523 2004-08-24  Martin Baulig  <martin@ximian.com>
3524
3525         * typemanager.cs
3526         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3527         this for accessibility checks.
3528         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3529         IsNestedFamilyAccessible.
3530         (TypeManager.IsSubclassOf): New method, do what the name actually
3531         says.   
3532
3533 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3534
3535         Fix crash on cs0657-17.cs.
3536         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3537         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3538         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3539         the case where the NamespaceEntry gets overwritten.
3540
3541 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3542
3543         Fixed #69195, #56821
3544         * ecore.cs (ResolveBoolean): Tiny refactoring.
3545
3546         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3547         of right expression resolving when left is false constant and
3548         operator is LogicalAnd OR true constant and operator is LogicalOr.
3549
3550         * statement.cs (ResolveUnreachable): Always reports warning.
3551
3552 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3553
3554         * class.cs: Distinguish between 1721 and 1722 (just a little help
3555         for the programmer).
3556
3557 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3558
3559         * delegate.cs: Only allow this on new versions of the language. 
3560
3561 2004-12-02  Duncan Mak  <duncan@ximian.com>
3562
3563         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3564         Expression class.
3565         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3566         here as a static method. Take an additional bool out parameter
3567         `must_do_cs1540_check' for signaling to InstanceResolve.
3568         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3569         member field from PropertyExpr class and made it an argument of
3570         the method instead.
3571         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3572         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3573         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3574         and `remove_accessor' as well as InstanceResolve: report CS0122
3575         where applicable.
3576
3577         Fixes #70129.
3578
3579 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3580
3581         Fix test-327.cs, test-328.cs, and put in early infrastructure
3582         for eventually fixing #52697.
3583         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3584         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3585         from other methods.
3586         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3587         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3588         (VerifyUsing, error246): Update.
3589         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3590         'NamespaceEntry.LookupNamespaceOrType'.
3591
3592 2004-12-03  Martin Baulig  <martin@ximian.com>
3593
3594         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3595         method as our child, call AnonymousMethod.Compatible() on it.
3596
3597 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3598
3599         Disable XML documentation support in 'basic' profile.
3600         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3601         Redirect XmlElement to System.Object.
3602         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3603         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3604         * mcs.exe.sources: Add doc-bootstrap.cs.
3605         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3606         of doc.cs.
3607
3608 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3609
3610         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3611           comments are allowed.
3612
3613 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3614
3615         * delegate.cs: Add checks for subtypes in paramaters and return values
3616         in VerifyMethod () to add support for Covariance/Contravariance
3617         in delegates.
3618         
3619 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3620
3621         * report.cs: Remove extra closing parenthesis.
3622
3623         * convert.cs (Error_CannotImplicitConversion): If the name of the
3624         types are the same, provide some extra information.
3625
3626         * class.cs (FieldBase): Use an unused bit field from the field to
3627         encode the `has_offset' property from the FieldMember.  This saves
3628         a couple of Ks on bootstrap compilation.
3629
3630         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3631         method as our child, return the AnonymousMethod resolved
3632         expression.
3633
3634         * expression.cs (New.DoResolve): Allow return values from
3635         NewDelegate to also include AnonymousMethods.
3636
3637         Fixes #70150.
3638
3639 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3640
3641         Fix bug #70102
3642         * attribute.cs (Resolve): Improved implementation of params
3643         attribute arguments.
3644
3645         * support.cs (ParameterData): Add HasParams to be faster.
3646
3647 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3648
3649         all things are for /doc support:
3650
3651         * doc.cs: new file that supports XML documentation generation.
3652         * mcs.exe.sources: added doc.cs.
3653         * driver.cs:
3654           Handle /doc command line option.
3655           Report error 2006 instead of 5 for missing file name for /doc.
3656           Generate XML documentation when required, after type resolution.
3657         * cs-tokenizer.cs:
3658           Added support for picking up documentation (/// and /** ... */),
3659           including a new XmlCommentState enumeration.
3660         * cs-parser.jay:
3661           Added lines to fill Documentation element for field, constant,
3662           property, indexer, method, constructor, destructor, operator, event
3663           and class, struct, interface, delegate, enum.
3664           Added lines to warn incorrect comment.
3665         * rootcontext.cs :
3666           Added Documentation field (passed only when /doc was specified).
3667         * decl.cs:
3668           Added DocComment, DocCommentHeader, GenerateDocComment() and
3669           OnGenerateDocComment() and some supporting private members for
3670           /doc feature to MemberCore.
3671         * class.cs:
3672           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3673         * delegate.cs:
3674           Added overriden DocCommentHeader.
3675         * enum.cs:
3676           Added overriden DocCommentHeader and GenerateDocComment().
3677
3678 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3679
3680         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3681         unwrapping the enumeration values, chain to
3682         DoConstantNumericPromotions again, so we can promote things to the
3683         fundamental types (takes care of enums that are bytes, sbytes).
3684
3685         Fixes bug #62054.
3686
3687 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3688
3689         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3690         Fix long-standing bug in type-lookup.  Use FindType instead of
3691         LookupType when ec.ResolvingTypeTree.
3692         (Attribute.ResolveType, Attribute.Resolve)
3693         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3694         Update to changes.
3695         (Attributes.Search): Remove internal version.  Update.
3696         (Attributes.SearchMulti): Update.
3697         (Attributes.GetClsCompliantAttribute): Remove.
3698         (Attributes.GetIndexerNameAttribute): Remove.
3699         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3700         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3701         * class.cs (Indexer.Define): Likewise.
3702
3703 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3704
3705         Fix bug #68790
3706         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3707         MarshallByReference members access.
3708
3709         * expression.cs: Use CheckMarshallByRefAccess;
3710         Better error CS0197 message.
3711
3712         * report.cs: Print whole related error message.
3713
3714 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3715
3716         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3717         the current directory to help debugging.
3718
3719 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3720
3721         * class (GetClassBases): Better error 60 report.
3722         (EventProperty): Disabled warning 67 detection.
3723
3724 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3725
3726         Fix bug #60324
3727         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3728
3729         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3730         precise values.
3731
3732 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3733
3734         Fix bug #49488
3735         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3736
3737         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3738
3739 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3740
3741         * attribute.cs (Attribute.Resolve): Refine error reporting and
3742         report a cs0117 if the identifier does not exist, to distinguish
3743         from 0617 which is a miss-use of the actual identifier.
3744
3745         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3746         between cs0070 and cs0079.
3747
3748         * class.cs (MemberBase.DoDefine): When reporting a wrong
3749         accessibility level, we use MethodCore to compare instead of
3750         Method (this was a regression in some refactoring effort).
3751
3752         So now we correctly report cs0056 again.
3753
3754         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3755         testing the target_type (which was known to be object_type) and
3756         not the source type (which is anonymous_method).
3757
3758         Fixed reporting of error cs1660.
3759
3760         * expression.cs (UserCast.Source): Expose the underlying cast.
3761
3762         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3763         allowed types to find a match to int32 first (most common).
3764
3765         In addition, it ignores any ImplicitUserConversions that did an
3766         internal implicit conversion (as the switch statement allows only
3767         one integral conversion to exist).
3768
3769         * class.cs (PartialContainer.Create): rename `name' to
3770         `member_name' for clarity.  Then replace the string calls with a
3771         call to MemberName.GetPartialName, as now using
3772         MemberName.ToString is an error (this is due to the side effects
3773         it had, that were fixed in the past).
3774
3775         This will restore the error reporting on a number of partial class
3776         errors that were missusing this (and getting an exception as a
3777         results, which is now just a plain textual warning, because
3778         yyparse debug output would crash otherwise).
3779
3780 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3781
3782         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3783
3784 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3785
3786         * rootcontext.cs (LookupType): Make sure to cache lookups that
3787         don't give us a negative result. This saves about 5% of corlib
3788         compilation time.
3789
3790 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3791
3792         * report.cs (AbstractMessage.Print): messages are sent to stderr
3793
3794         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3795         non-interface in the list of interfaces (at this point, either
3796         parent was properly set, or a base class is being listed in the
3797         interfaces section).
3798
3799         This flags error 1722, and resolves the crash from bug 69259.
3800
3801 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3802
3803         * statement.cs (Using.EmitExpressionFinally): make this work right
3804         for valuetypes. Fixes 69926.
3805
3806 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3807
3808         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3809         converted to an enum" here, before we try to change the underlying
3810         type.  This code exists, but it is a different code path than the
3811         one used while encoding constants.
3812
3813         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3814         old bug: when converting from the null literal to a pointer,
3815         return an EmptyCast, not the NullLiteral.
3816
3817         This fixes #69921, the recent null_type changes probably made this
3818         bug more prominent.
3819
3820         (ImplicitReferenceConversionExists): In addition, resynchronized
3821         the code here, so it matches the same code in
3822         ImplicitReferenceConversionExists for the `from any class-type S
3823         to any interface-type T'.
3824         
3825
3826 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3827
3828         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3829
3830 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3831
3832         * cs-parser.jay: Use verbosity accordingly. 
3833
3834 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3835
3836         * expression.cs (Unary.ResolveOperator): Do not report warning;
3837         AddressOf reads from variable.
3838         
3839         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3840
3841 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3842
3843         Fix bug #69462
3844
3845         * attribute.cs (Attributable): Removed CheckTargets.
3846         (Attributes.Emit): Explicit attribute targets are tested here.
3847
3848         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3849         not enabled for interfaces.
3850
3851         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3852         (GetAssemblyName): Ouch next bug there.
3853
3854 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3855
3856         * expression.cs: Error 275 added.
3857         
3858 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3859
3860         Fix bug #69177 (Implemented decimal constant support)
3861
3862         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3863         (BinaryFold): Add DecimalConstant.
3864
3865         * const.cs (Define): Decimal constant 
3866         (is not constant.
3867         (ChangeType): Add decimal type handling.
3868         (LookupConstantValue): Don't set value for decimal type but
3869         emit DecimalConstantAttribute. Needed for constant optimization.
3870
3871         * constant.cs (ToDecimal): New method.
3872         (ConvertToDecimal): New method.
3873         (IntConstant): Implemented ConvertToDecimal.
3874         (DecimalConstant.Emit): Emit optimized version for decimals in
3875         int range.
3876
3877         * expression.cs (ResolveOperator): Changed order of constant
3878         reduction to work correctly with native types which have
3879         overloaded operators.
3880         (ResolveMemberAccess): Extract constant value from attribute
3881         for decimal type.
3882
3883         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3884
3885         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3886         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3887         (ChangeType): Decimal is special.
3888         (TypeToCoreType): Add decimal type.
3889
3890 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3891
3892         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3893         decimal types.
3894
3895 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3896
3897         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3898         test cs1667-5.cs.
3899
3900 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3901
3902         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3903
3904         * pending.cs (PendingImplementation): Grab only interfaces.
3905
3906 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3907
3908         * statement.cs (ForeachHelperMethods): Add location member and
3909         error 202 detection.
3910
3911 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3912
3913         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3914         automatically handled by executable.make.
3915         (PROGRAM): Make profile-specific.
3916
3917 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3918
3919         * expression.cs (DoResolveBase): Fixed wrong warning for out
3920         variables.
3921
3922 2004-11-18  Martin Baulig  <martin@ximian.com>
3923
3924         Merged latest changes into gmcs.  Please keep this comment in
3925         here, it makes it easier for me to see what changed in MCS since
3926         the last time I merged.
3927
3928 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3929
3930         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3931         (TypeHandle.GetMemberCache): New.
3932         (TypeHandle.TypeHandle): Update.
3933         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3934         (TypeManager.LookupParentInterfacesCache):
3935         Rename from LookupInterfaceCache.  Optimize slightly.
3936         (TypeManager.MemberLookup_FindMembers): Update.
3937         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3938         multi-type variant.
3939         (AddCacheContents): Rename from AddHashtable.
3940         * class.cs (TypeContainer.parent_container): Remove.
3941         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3942         (TypeContainer.DoDefineMembers): Don't initialize it.
3943         Update to name changes.
3944         
3945 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3946
3947         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3948         that factors the code to check access modifiers on override.  
3949
3950         (PropertyBase): Use the code here.
3951
3952         Patch from Lluis S'anchez, fixes bug #69361.
3953
3954 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3955
3956         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3957         routine that is used to report the use of a captured variable
3958         whose address has been taken.
3959
3960         There are two checks: one when variables are being captured and
3961         the other check is when the address of a variable is taken. 
3962         
3963         (because an anonymous methods might be resolved before *or* after
3964         the address has been taken) and 
3965
3966         * expression.cs (Conditional.DoResolve): Remove the special
3967         casing that Martin added to trueExpr and falseExpr being both
3968         NullLiteral.  We get the right behavior now just by introducing
3969         the null_type into the compiler. 
3970
3971         * convert.cs (ExplicitConversion): Change the code to use
3972         null_type instead of testing `expr is NullLiteral'.
3973         (ImplicitConversionStandard): use null_type too.
3974         (ImplicitReferenceConversionExists): use null_type too.
3975         (ImplicitReferenceConversion): use null_type too.
3976
3977         * literal.cs: The type of `NullLiteral' is now null_type instead
3978         of object_type. 
3979         (Resolve): Set the type here.
3980
3981         * typemanager.cs: Introduce null_type.
3982
3983 2004-11-17  Martin Baulig  <martin@ximian.com>
3984
3985         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3986         direction, like FindMembers() does.  Fixes #69546, testcase is in
3987         test-315.cs.    
3988
3989 2004-11-16  Martin Baulig  <martin@ximian.com>
3990
3991         This is based on a patch from Marek Safar, see bug #69082.
3992         Fixes bugs #63705 and #67130.
3993
3994         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3995         method; create a MemberCache for an interface type and cache the
3996         result.
3997
3998         * decl.cs (IMemberContainer.ParentContainer): Removed.
3999         (IMemberContainer.ParentCache): New property.
4000         (MemberCache.SetupCacheForInterface): Removed.
4001         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4002         to create a cache for an interface's "parent".
4003
4004         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4005         interfaces too.
4006
4007 2004-11-16  Martin Baulig  <martin@ximian.com>
4008
4009         Merged back from gmcs; these changes already went into gmcs a
4010         couple of weeks ago.
4011
4012         * typemanager.cs
4013         (TypeManager.AddUserType): Removed the `ifaces' argument.
4014         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4015         `TypeExpr []'.
4016         (TypeManager.AddUserInterface): Removed.
4017         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4018         `TypeExpr []'.
4019         (TypeManager.GetInterfaces): Likewise.
4020         (TypeManager.GetExplicitInterfaces): Likewise.
4021
4022         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4023
4024         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4025         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4026
4027 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4028
4029         * statement.cs: Avoid adding bools to a hashtable.
4030
4031 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4032
4033         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4034         calling an unsafe method from a safe location.
4035
4036 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4037
4038         Fix #69167
4039         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4040
4041 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4042
4043         * namespace.cs (VerifyUsing): use GetPartialName instead of
4044         ToString. 
4045
4046 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4047
4048         * statement.cs (Return.Resolve): Fix regression in typo: if
4049         `in_exc', we have to request a NeedReturnLabel, this was a typo
4050         introduced in the anonymous method check-in.  Fixes #69131.
4051
4052         * Indexers were using the ShortName when defining themselves,
4053         causing a regression in the compiler bootstrap when applying the
4054         patch from 2004-11-02 (first part), now they use their full name
4055         and the bug is gone.
4056
4057 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4058
4059         * driver.cs: Strip the path from the names of embedded resources. Fixes
4060         #68519.
4061
4062 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4063
4064         Fix error message regression: cs0104-2.cs.
4065         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4066         (AliasEntry.Resolve): Update.
4067         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4068         'silent' flag.
4069         (RootContext.LookupType): Update.
4070
4071 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4072
4073         * cs-parser.jay: Add support for handling accessor modifiers
4074         * class: Add support port accessor modifiers and error checking,
4075         define PropertyMethod.Define as virtual (not abstract anymore)
4076         * ecore.cs: Add checking for proeprties access with access modifiers
4077         * iterators.cs: Modify Accessor constructor call based in the modified
4078         constructor
4079 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4080
4081         * expression.cs (StringConcat): Handle being called twice,
4082         as when we have a concat in a field init with more than two
4083         ctors in the class
4084
4085 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4086
4087         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4088         special case explicit implementations, we should always produce
4089         the .property or .event declaration.
4090         
4091         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4092         since it will not return correct data if people use this
4093         unresolved in the presence of using statements (see test-313).
4094
4095         * class.cs (MethodData.Define): If we are an explicit interface
4096         implementation, set the method name to the full name of the
4097         interface plus the name of the method.  
4098
4099         Notice that using the method.MethodName.GetFullName() does not
4100         work, as it will only contain the name as declared on the source
4101         file (it can be a shorthand in the presence of using statements)
4102         and not the fully qualifed type name, for example:
4103
4104         using System;
4105
4106         class D : ICloneable {
4107                 object ICloneable.Clone ()  {
4108                 }
4109         }
4110
4111         Would produce a method called `ICloneable.Clone' instead of
4112         `System.ICloneable.Clone'.
4113
4114         * namespace.cs (Alias.Resolve): Use GetPartialName.
4115         
4116 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4117
4118         * cs-parser.jay: Add error 1055 report.
4119
4120 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4121
4122         * assign.cs (Assign.DoResolve): Only do the transform of
4123         assignment into a New if the types are compatible, if not, fall
4124         through and let the implicit code deal with the errors and with
4125         the necessary conversions. 
4126
4127 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4128
4129         * cs-parser.jay: Add error 1031 report.
4130
4131         * cs-tokenizer.cs: Add location for error 1038.
4132
4133 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4134
4135         * cs-parser.jay: Add error 1016 report.
4136
4137 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * cs-parser.jay: Add errors 1575,1611 report.
4140
4141 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4142
4143         * cs-parser.jay: Add error 1001 report.
4144
4145 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4146
4147         Fix #68850
4148         * attribute.cs (GetMarshal): Add method argument for
4149         caller identification.
4150
4151         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4152         agument for GetMarshal and RuntimeMissingSupport.
4153
4154 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4155
4156         * attribute.cs (ExtractSecurityPermissionSet): Removed
4157         TypeManager.code_access_permission_type.
4158
4159         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4160
4161 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4162
4163         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4164         for obsolete use of a variable here.   Fixes regression on errors
4165         cs0619-25 and cs0619-26.
4166
4167 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4168
4169         Fix #62358, implemented security attribute encoding.
4170
4171         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4172         Tests permitted SecurityAction for assembly or other types.
4173         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4174         data from SecurityPermissionAttribute to PermisionSet class.
4175
4176         * class.cs (ApplyAttributeBuilder): Added special handling
4177         for System.Security.Permissions.SecurityAttribute based types.
4178
4179         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4180         special handling for System.Security.Permissions.SecurityAttribute
4181         based types.
4182
4183         * enum.cs (ApplyAttributeBuilder): Added special handling
4184         for System.Security.Permissions.SecurityAttribute based types.
4185
4186         * parameter.cs (ApplyAttributeBuilder): Added special handling
4187         for System.Security.Permissions.SecurityAttribute based types.
4188
4189         * rootcontext.cs: Next 2 core types.
4190
4191         * typemanager.cs (TypeManager.security_permission_attr_type):
4192         Built in type for the SecurityPermission Attribute.
4193         (code_access_permission_type): Build in type.
4194
4195 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4196
4197         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4198         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4199         all of this information into
4200         EmitContext.EmitCapturedVariableInstance.
4201         
4202         * codegen.cs (EmitCapturedVariableInstance): move here the
4203         funcionality of emitting an ldarg.0 in the presence of a
4204         remapping.   This centralizes the instance emit code.
4205
4206         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4207         then emit a load of this: it means that we have reached the
4208         topmost ScopeInfo: the one that contains the pointer to the
4209         instance of the class hosting the anonymous method.
4210
4211         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4212         captures to the topmost CaptureContext.
4213
4214 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4215
4216         * expression.cs (LocalVariableReference): Move the knowledge about
4217         the iterators into codegen's EmitCapturedVariableInstance.
4218
4219 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4220
4221         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4222         all code paths return a value from an anonymous method (it is the
4223         same as the 161 error, but for anonymous methods).
4224
4225 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4226
4227         The introduction of anonymous methods in the compiler changed
4228         various ways of doing things in the compiler.  The most
4229         significant one is the hard split between the resolution phase
4230         and the emission phases of the compiler.
4231
4232         For instance, routines that referenced local variables no
4233         longer can safely create temporary variables during the
4234         resolution phase: they must do so from the emission phase,
4235         since the variable might have been "captured", hence access to
4236         it can not be done with the local-variable operations from the runtime.
4237         
4238         * statement.cs 
4239
4240         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4241         is a toplevel block.
4242
4243         (ToplevelBlock): A new kind of Block, these are the blocks that
4244         are created by the parser for all toplevel method bodies.  These
4245         include methods, accessors and anonymous methods.
4246
4247         These contain some extra information not found in regular blocks:
4248         A pointer to an optional CaptureContext (for tracking captured
4249         local variables and parameters).  A pointer to the parent
4250         ToplevelBlock.
4251         
4252         (Return.Resolve): Catch missmatches when returning a value from an
4253         anonymous method (error 1662).
4254         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4255         phase.
4256
4257         (Break.Resolve): ditto.
4258
4259         (SwitchLabel): instead of defining the labels during the
4260         resolution phase, we now turned the public ILLabel and ILLabelCode
4261         labels into methods called GetILLabelCode() and GetILLabel() that
4262         only define the label during the Emit phase.
4263
4264         (GotoCase): Track the SwitchLabel instead of the computed label
4265         (its contained therein).  Emit the code by using
4266         SwitchLabel.GetILLabelCode ().
4267
4268         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4269         whether the Local has been captured or not.
4270
4271         (LocalInfo.IsCaptured): New property, used to tell whether the
4272         local has been captured.
4273         
4274         * anonymous.cs: Vastly updated to contain the anonymous method
4275         support.
4276
4277         The main classes here are: CaptureContext which tracks any
4278         captured information for a toplevel block and ScopeInfo used to
4279         track the activation frames for various local variables.   
4280
4281         Each toplevel block has an optional capture context associated
4282         with it.  When a method contains an anonymous method both the
4283         toplevel method and the anonymous method will create a capture
4284         context.   When variables or parameters are captured, they are
4285         recorded on the CaptureContext that owns them, for example:
4286
4287         void Demo () {
4288              int a;
4289              MyDelegate d = delegate {
4290                  a = 1;
4291              }
4292         }
4293
4294         Here `a' will be recorded as captured on the toplevel
4295         CapturedContext, the inner captured context will not have anything
4296         (it will only have data if local variables or parameters from it
4297         are captured in a nested anonymous method.
4298
4299         The ScopeInfo is used to track the activation frames for local
4300         variables, for example:
4301
4302         for (int i = 0; i < 10; i++)
4303                 for (int j = 0; j < 10; j++){
4304                    MyDelegate d = delegate {
4305                         call (i, j);
4306                    }
4307                 }
4308
4309         At runtime this captures a single captured variable `i', but it
4310         captures 10 different versions of the variable `j'.  The variable
4311         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4312         recorded on a child.  
4313
4314         The toplevel ScopeInfo will also track information like the `this'
4315         pointer if instance variables were referenced (this is necessary
4316         as the anonymous method lives inside a nested class in the host
4317         type of the method). 
4318
4319         (AnonymousMethod): Expanded to track the Toplevel, implement
4320         `AnonymousMethod.Compatible' to tell whether an anonymous method
4321         can be converted to a target delegate type. 
4322
4323         The routine now also produces the anonymous method content
4324
4325         (AnonymousDelegate): A helper class that derives from
4326         DelegateCreation, this is used to generate the code necessary to
4327         produce the delegate for the anonymous method that was created. 
4328
4329         * assign.cs: API adjustments for new changes in
4330         Convert.ImplicitStandardConversionExists.
4331
4332         * class.cs: Adjustments to cope with the fact that now toplevel
4333         blocks are of type `ToplevelBlock'. 
4334
4335         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4336         insteda of standard blocks.
4337
4338         Flag errors if params arguments are passed to anonymous methods.
4339
4340         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4341         `CurrentAnonymousMethod' which points to the current Anonymous
4342         Method.  The variable points to the AnonymousMethod class that
4343         holds the code being compiled.  It is set in the new EmitContext
4344         created for the anonymous method.
4345
4346         (EmitContext.Phase): Introduce a variable and an enumeration to
4347         assist in enforcing some rules about when and where we are allowed
4348         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4349         only one that enfonces this right now).
4350
4351         (EmitContext.HaveCaptureInfo): new helper method that returns
4352         whether we have a CapturedContext initialized.
4353
4354         (EmitContext.CaptureVariable): New method used to register that a
4355         LocalInfo must be flagged for capturing. 
4356
4357         (EmitContext.CapturedParameter): New method used to register that a
4358         parameters must be flagged for capturing. 
4359         
4360         (EmitContext.CapturedField): New method used to register that a
4361         field must be flagged for capturing. 
4362
4363         (EmitContext.HaveCapturedVariables,
4364         EmitContext.HaveCapturedFields): Return whether there are captured
4365         variables or fields. 
4366
4367         (EmitContext.EmitMethodHostInstance): This is used to emit the
4368         instance for the anonymous method.  The instance might be null
4369         (static methods), this (for anonymous methods that capture nothing
4370         and happen to live side-by-side with the current method body) or a
4371         more complicated expression if the method has a CaptureContext.
4372
4373         (EmitContext.EmitTopBlock): Routine that drives the emission of
4374         code: it will first resolve the top block, then emit any metadata
4375         and then emit the code.  The split is done so that we can extract
4376         any anonymous methods and flag any captured variables/parameters.
4377         
4378         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4379         during this phase, the ILGenerator should not be used as labels
4380         and local variables declared here might not be accessible to any
4381         code that is part of an anonymous method.  
4382
4383         Exceptions to this include the temporary variables that are
4384         created by some statements internally for holding temporary
4385         variables. 
4386         
4387         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4388         metadata for a cb
4389
4390         (EmitContext.TemporaryReturn): This method is typically called
4391         from the Emit phase, and its the only place where we allow the
4392         ReturnLabel to be defined other than the EmitMeta.  The reason is
4393         that otherwise we would have to duplicate a lot of logic in the
4394         Resolve phases of various methods that today is on the Emit
4395         phase. 
4396
4397         (EmitContext.NeedReturnLabel): This no longer creates the label,
4398         as the ILGenerator is not valid during the resolve phase.
4399
4400         (EmitContext.EmitThis): Extended the knowledge in this class to
4401         work in anonymous methods in addition to iterators. 
4402
4403         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4404         code is necessary on the stack to access the instance to a local
4405         variable (the variable will be accessed as a field).
4406
4407         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4408         EmitContext.EmitAddressOfParameter): Routines to support
4409         parameters (not completed at this point). 
4410         
4411         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4412         will also remove the parameters.
4413
4414         * convert.cs (Convert): Define a `ConstantEC' which points to a
4415         null.  This is just to prefity some code that uses
4416         ImplicitStandardConversion code and do not have an EmitContext
4417         handy.
4418
4419         The idea is to flag explicitly that at that point in time, it is
4420         known that the conversion will not trigger the delegate checking
4421         code in implicit conversions (which requires a valid
4422         EmitContext). 
4423
4424         Everywhere: pass new EmitContext parameter since
4425         ImplicitStandardConversionExists now requires it to check for
4426         anonymous method conversions. 
4427
4428         (Convert.ImplicitStandardConversionExists): If the type of an
4429         expression is the anonymous_method_type, and the type is a
4430         delegate, we invoke the AnonymousMethod.Compatible method to check
4431         whether an implicit conversion is possible. 
4432
4433         (Convert.ImplicitConversionStandard): Only do implicit method
4434         group conversions if the language level is not ISO_1.
4435
4436         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4437         MethodInfo for the Invoke method.  used by Delegate and
4438         AnonymousDelegate.
4439
4440         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4441         method conversions if the target type is a delegate.
4442
4443         Removed extra debugging nops.
4444
4445         (LocalVariableReference): Turn the `local_info' into a public
4446         field. 
4447
4448         Add `prepared' field, the same hack used for FieldExprs to cope
4449         with composed assignments, as Local variables do not necessarily
4450         operate purely on the stack as they used to: they can be captured
4451         fields. 
4452
4453         Add `temp' for a temporary result, like fields.
4454
4455         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4456
4457         It now copes with Local variables that are captured and emits the
4458         proper instance variable to load it from a field in the captured
4459         case. 
4460
4461         (ParameterReference.DoResolveBase): During the resolve phase,
4462         capture parameters if we are in an anonymous method.
4463
4464         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4465         anonymous method, use the EmitContext helper routines to emit the
4466         parameter reference.
4467
4468         * iterators.cs: Set RemapToProxy to true/false during the
4469         EmitDispose class.
4470
4471         * parameters.cs (GetParameterByName): New helper method. 
4472
4473         * typemanager.cs (anonymous_method_type) a new type that
4474         represents an anonyous method.  This is always an internal type,
4475         used as a fencepost to test against the anonymous-methodness of an
4476         expression. 
4477         
4478 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4479
4480         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4481         561 report.
4482         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4483
4484 2004-10-18  Martin Baulig  <martin@ximian.com>
4485
4486         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4487         `Type' directly, but call ResolveType() on it.
4488         (Catch.Resolve): Likewise.
4489         (Foreach.Resolve): Likewise.
4490
4491 2004-10-18  Martin Baulig  <martin@ximian.com>
4492
4493         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4494         `Type' directly, but call ResolveType() on it.
4495         (Probe.DoResolve): Likewise.
4496         (ArrayCreation.LookupType): Likewise.
4497         (TypeOf.DoResolve): Likewise.
4498         (SizeOf.DoResolve): Likewise.
4499
4500 2004-10-18  Martin Baulig  <martin@ximian.com>
4501
4502         * expression.cs (Invocation.BetterFunction): Put back
4503         TypeManager.TypeToCoreType().
4504
4505 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4506
4507         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4508         the ResolveType.
4509
4510 2004-10-18  Martin Baulig  <martin@ximian.com>
4511
4512         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4513         `Type' directly, but call ResolveType() on it.
4514
4515 2004-10-18  Martin Baulig  <martin@ximian.com>
4516
4517         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4518         `Type' directly, but call ResolveType() on it.
4519         (MemberBase.DoDefine): Likewise.
4520
4521         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4522         `Type' directly, but call ResolveType() on it.
4523         (ComposedCast.DoResolveAsTypeStep): Likewise.
4524
4525         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4526         `Type' directly, but call ResolveType() on it.
4527
4528 2004-10-17  John Luke  <john.luke@gmail.com>
4529
4530         * class.cs (Operator.GetSignatureForError): use CSharpName
4531
4532         * parameter.cs (Parameter.GetSignatureForError): Returns
4533         correct name even if was not defined.
4534
4535 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4536
4537         Fix #65816.
4538         * class.cs (TypeContainer.EmitContext): New property.
4539         (DefineNestedTypes): Create an emitcontext for each part.
4540         (MethodCore.DoDefineParameters): Use container's emitcontext.
4541         Pass type array to InternalParameters.
4542         (MemberBase.DoDefine): Use container's emitcontext.
4543         (FieldMember.Define): Likewise.
4544         (Event.Define): Likewise.
4545         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4546         Pass type array to InternalParameters.
4547         (SetIndexerMethod.GetParameterInfo): Likewise.
4548         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4549         * delegate.cs (Define): Pass emitcontext to
4550         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4551         array to InternalParameters.
4552         * expression.cs (ParameterReference.DoResolveBase): Pass
4553         emitcontext to GetParameterInfo.
4554         (ComposedCast.DoResolveAsTypeStep): Remove check on
4555         ec.ResolvingTypeTree.
4556         * parameter.cs (Parameter.Resolve): Change argument to
4557         EmitContext.  Use ResolveAsTypeTerminal.
4558         (Parameter.GetSignature): Change argument to EmitContext.
4559         (Parameters.ComputeSignature): Likewise.
4560         (Parameters.ComputeParameterTypes): Likewise.
4561         (Parameters.GetParameterInfo): Likewise.
4562         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4563         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4564         * support.cs (InternalParameters..ctor): Remove variant that takes
4565         a DeclSpace.
4566         * typemanager.cs (system_intptr_expr): New.
4567         (InitExpressionTypes): Initialize it.
4568
4569 2004-10-12  Chris Toshok  <toshok@ximian.com>
4570
4571         * cs-parser.jay: fix location for try_statement and catch_clause.
4572
4573 2004-10-11  Martin Baulig  <martin@ximian.com>
4574
4575         * report.cs: Don't make --fatal abort on warnings, we have
4576         -warnaserror for that.
4577
4578 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4579
4580         More DeclSpace.ResolveType avoidance.
4581         * decl.cs (MemberCore.InUnsafe): New property.
4582         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4583         with newly created EmitContext.
4584         (FieldMember.Define): Likewise.
4585         * delegate.cs (Delegate.Define): Likewise.
4586         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4587         only if normal name-lookup fails.
4588         (TypeExpr.DoResolve): Enable error-checking.
4589         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4590         (SizeOf.DoResolve): Likewise.
4591         (ComposedCast.DoResolveAsTypeStep): Likewise.
4592         (StackAlloc.DoResolve): Likewise.
4593         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4594         (Block.Unsafe): New property.
4595         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4596         (Unsafe): Set 'unsafe' flag of contained block.
4597         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4598         (Fixed.Resolve): Likewise.
4599         (Catch.Resolve): Likewise.
4600         (Using.ResolveLocalVariableDecls): Likewise.
4601         (Foreach.Resolve): Likewise.
4602
4603 2004-10-05  John Luke <john.luke@gmail.com>
4604
4605         * cs-parser.jay: add location to error CS0175
4606
4607 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4608
4609         * ecore.cs (Expression.Constantity): Add support for turning null
4610         into a constant.
4611
4612         * const.cs (Const.Define): Allow constants to be reference types
4613         as long as the value is Null.
4614
4615 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4616
4617         * namespace.cs (NamespaceEntry.Using): No matter which warning
4618         level is set, check if this namespace name has already been added.
4619
4620 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4621
4622         * expression.cs: reftype [!=]= null should always use br[true,false].
4623         # 67410
4624
4625 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4626
4627         Fix #67108
4628         * attribute.cs: Enum conversion moved to 
4629         GetAttributeArgumentExpression to be applied to the all
4630         expressions.
4631
4632 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4633
4634         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4635         * class.c (TypeContainer.DefineType): Flag error if
4636         base types aren't accessible due to access permissions.
4637         * decl.cs (DeclSpace.ResolveType): Move logic to
4638         Expression.ResolveAsTypeTerminal.
4639         (DeclSpace.ResolveTypeExpr): Thin layer over
4640         Expression.ResolveAsTypeTerminal.
4641         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4642         Refactor code into NestedAccess.  Use it.
4643         (DeclSpace.NestedAccess): New.
4644         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4645         argument to silence errors.  Check access permissions.
4646         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4647         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4648         (Cast.DoResolve): Likewise.
4649         (New.DoResolve): Likewise.
4650         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4651         (TypeOf.DoResolve): Likewise.
4652
4653         * expression.cs (Invocation.BetterConversion): Return the Type of
4654         the better conversion.  Implement section 14.4.2.3 more faithfully.
4655         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4656         section 14.4.2.2 explicit.
4657         (Invocation.OverloadResolve): Update.
4658         (Invocation): Remove is_base field.
4659         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4660         (Invocation.Emit): Likewise.
4661
4662 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4663
4664         * README: Update to changes.
4665
4666 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4667
4668         * cs-parser.jay: Reverted 642 warning fix.
4669
4670 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4671
4672         Fix bug #66615
4673         * decl.cs (FindMemberWithSameName): Indexer can have more than
4674         1 argument.
4675
4676 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4677
4678         * expression.cs (LocalVariableReference.DoResolveLValue):
4679         Do not report warning 219 for out values.
4680         (EmptyExpression.Null): New member to avoid extra allocations.
4681
4682 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4683
4684         * cs-parser.jay: Fix wrong warning 642 report.
4685
4686         * cs-tokenizer.cs (CheckNextToken): New helper;
4687         Inspect next character if is same as expected.
4688
4689 2004-09-23  Martin Baulig  <martin@ximian.com>
4690
4691         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4692         (Convert.ImplicitReferenceConversionExists): Likewise.
4693
4694 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4695
4696         * class.cs (Operator.Define): Add error 448 and 559 report.
4697
4698 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4699
4700         * class.cs (MemberBase.IsTypePermitted): New protected
4701         method for checking error CS0610.
4702
4703 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4704
4705         * class.cs (TypeContainer.HasExplicitLayout): New property
4706         Returns whether container has StructLayout attribute set Explicit.
4707         (FieldMember): New abstract class for consts and fields.
4708         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4709         (Field): Reuse FieldMember.
4710
4711         * const.cs (Const): Reuse FieldMember.
4712
4713         * rootcontext.cs: EmitConstants call moved to class.
4714
4715 2004-09-22  Martin Baulig  <martin@ximian.com>
4716
4717         Thanks to Peter Sestoft for this bug report.
4718
4719         * expression.cs (Conditional): If both the `trueExpr' and the
4720         `falseExpr' is a NullLiteral, return a NullLiteral.
4721
4722 2004-09-22  Martin Baulig  <martin@ximian.com>
4723
4724         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4725         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4726         for the "get_Current" call.
4727
4728 2004-09-22  Martin Baulig  <martin@ximian.com>
4729
4730         Marek and me just fixed one of our oldest bugs: #28562 :-)
4731
4732         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4733
4734         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4735         we're an EnumConstant, just return that.
4736         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4737         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4738         to get the value which'll actually be written into the attribute.
4739         However, we have to use GetValue() to access the attribute's value
4740         in the compiler.        
4741
4742 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4743
4744         * constant.cs (Constant.IsNegative): New abstract property
4745         IsNegative.
4746
4747         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4748         (StackAlloc.DoResolve): Reused IsNegative.
4749
4750 2004-09-21  Martin Baulig  <martin@ximian.com>
4751
4752         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4753         if we're used in an iterator, we may be called from different
4754         methods.
4755
4756         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4757         we actually have an exception block.
4758
4759 2004-09-20  John Luke <jluke@cfl.rr.com>
4760
4761         * class.cs, cs-parser.jay: Improve the error report for 1520:
4762         report the actual line where the error happens, not where the
4763         class was declared.
4764
4765         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4766         Pass location information that was available elsewhere.
4767
4768 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4769
4770         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4771         runtime to delay sign assemblies.
4772
4773 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4774
4775         * cs-parser.jay: Do not report the stack trace, this is barely
4776         used nowadays.
4777
4778 2004-08-22  John Luke  <john.luke@gmail.com>
4779  
4780         * driver.cs : check that a resource id is not already used
4781         before adding it, report CS1508 if it is, bug #63637
4782
4783 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4784
4785         * ecore.cs: Removed dead code.
4786
4787 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4788
4789         * class.cs: Do not report warning CS0067 on the interfaces.
4790
4791 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4792
4793         * cs-parser.jay: Add error 504 report.
4794
4795 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4796
4797         * rootcontext.cs: WarningLevel is 4 by default now.
4798
4799         * statement.cs (Fixed.Resolve): Do not null
4800         VariableInfo.
4801
4802 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4803
4804         Fixed bug #55780
4805         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4806         deep search when property is not virtual.
4807         (PropertyExpr.ResolveAccessors): Make one call for both
4808         accessors.
4809
4810 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4811
4812         Fixed bug #65766
4813         * statement.cs: Error 152 report constains also location.
4814
4815 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4816
4817         Fixed bug #65766
4818         * const.cs: Explicitly set constant as static.
4819
4820 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4821
4822         Fixed bug #64226
4823         * cs-parser.jay: Add error 1017 report.
4824
4825 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4826
4827         Fixed bug #59980, #64224
4828         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4829
4830         * typemanager.cs (IsSpecialMethod): Simplified
4831
4832 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4833
4834         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4835         condition with better params.
4836
4837 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4838
4839         Fixed bug #65238
4840         * attribute.cs (Resolve): Property has to have both
4841         accessors.
4842
4843 2004-09-14  Martin Baulig  <martin@ximian.com>
4844
4845         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4846
4847 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4848
4849         Fixed bug #61902
4850         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4851         called and is obsolete then this member suppress message
4852         when call is inside next [Obsolete] method or type.
4853
4854         * expression.cs: Use TestObsoleteMethodUsage member.
4855
4856 2004-09-14  Martin Baulig  <martin@ximian.com>
4857
4858         * cs-parser.jay: Sync a bit with the GMCS version.
4859
4860 2004-09-14  Martin Baulig  <martin@ximian.com>
4861
4862         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4863         (CSharpParser.yacc_verbose_flag): New public field.
4864
4865         * genericparser.cs: Removed.
4866
4867 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4868
4869         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4870
4871 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4872
4873         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4874
4875 2004-09-10  Martin Baulig  <martin@ximian.com>
4876
4877         Backported my MemberName changes from GMCS into MCS.
4878
4879         - we are now using a special `MemberName' class instead of using
4880         strings; in GMCS, the `MemberName' also contains the type
4881         arguments.
4882
4883         - changed the grammar rules a bit:
4884           * the old `member_name' is now a `namespace_or_type_name':
4885             The rule is that we use `namespace_or_type_name' everywhere
4886             where we expect either a "member name" (GetEnumerator) or a
4887             "member name" with an explicit interface name
4888             (IEnumerable.GetEnumerator).
4889             In GMCS, the explicit interface name may include type arguments
4890             (IEnumerable<T>.GetEnumerator).
4891           * we use `member_name' instead of just `IDENTIFIER' for
4892             "member names":
4893             The rule is that we use `member_name' wherever a member may
4894             have type parameters in GMCS.       
4895
4896         * decl.cs (MemberName): New public class.
4897         (MemberCore.MemberName): New public readonly field.
4898         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4899         (DeclSpace): Likewise.
4900
4901         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4902         * enum.cs (Enum.ctor): Likewise.
4903
4904         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4905         MemberName.     
4906         (AliasEntry.ctor): Take a MemberName, not an Expression.
4907         (AliasEntry.UsingAlias): Likewise.
4908
4909         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4910         (IMethodData.MemberName): Changed type from string to MemberName.
4911         (MemberBase.ExplicitInterfaceName): Likewise.
4912         (AbstractPropertyEventMethod.SetupName): Make this private.
4913         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4914         argument; compute the member name here.
4915         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4916         on the `member.MemberName' and the `prefix'.
4917
4918         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4919         not `type_name'.
4920         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4921         thus, we get a `MemberName' instead of a `string'.  These
4922         declarations may have type parameters in GMCS.
4923         (interface_method_declaration, delegate_declaration): Likewise.
4924         (class_declaration, interface_declaration): Likewise.
4925         (method_header): Use `namespace_or_type_name' instead of
4926         `member_name'.  We may be an explicit interface implementation.
4927         (property_declaration, event_declaration): Likewise.
4928         (member_name): This is now just an `IDENTIFIER', not a
4929         `namespace_or_type_name'.
4930         (type_name, interface_type): Removed.
4931         (namespace_or_type_name): Return a MemberName, not an Expression.
4932         (primary_expression): Use `member_name' instead of `IDENTIFIER';
4933         call GetTypeExpression() on the MemberName to get an expression.
4934         (IndexerDeclaration.interface_type): Changed type from string to
4935         MemberName.
4936         (MakeName): Operate on MemberName's instead of string's.
4937
4938 2004-09-13  Raja R Harinath  <rharinath@novell.com>
4939
4940         Fix bug #55770.
4941         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
4942         (NamespaceEntry.Lookup): Add new argument to flag if we want the
4943         lookup to avoid symbols introduced by 'using'.
4944         * rootcontext.cs (NamespaceLookup): Update.
4945
4946 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4947
4948         * class.cs (TypeContainer.DoDefineMembers): Do not call
4949         DefineDefaultConstructor for static classes.
4950
4951 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4952
4953         * attribute.cs (Attribute.Resolve): Add error 653 report.
4954
4955         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4956         report.
4957         (Method.ApplyAttributeBuilder): Add error 685 report.
4958         (Operator.Define): Add error 564 report.
4959
4960         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4961
4962         * expression.cs (Invocation.DoResolve): Add error
4963         245 and 250 report.
4964
4965         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4966         error 674 report.
4967
4968 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4969
4970         * class.cs (ConstructorInitializer.Resolve):
4971         Wrong error number (515->516).
4972
4973 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4974
4975         * class.cs (Indexer.Define): Add error 631 report.
4976
4977 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4978
4979         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4980
4981 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4982
4983         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4984
4985 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4986
4987         * cs-parser.jay: Added error CS0241 report.
4988
4989 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4990
4991         * cs-parser.jay (fixed_statement): Introduce a scope for the
4992         declaration in the 'fixed' statement.
4993
4994 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4995
4996         * cs-parser.jay: Added CS0230 error report.
4997
4998 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4999
5000         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5001
5002 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5003
5004         * expression.cs (Argument.Resolve): Added error CS0192 and
5005         CS0199 report.
5006
5007 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5008
5009         C# 2.0 #pragma warning feature
5010
5011         * cs-tokenizer.cs (PreProcessPragma): New method; 
5012         Handles #pragma directive.
5013
5014         * report.cs (WarningRegions): New class; Support
5015         class for #pragma warning directive. It tests whether
5016         warning is enabled for a given line.
5017
5018 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5019
5020         * const.cs: Add more descriptive error report, tahnks to
5021         Sebastien. 
5022
5023 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5024
5025         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5026
5027 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5028
5029         * expression.cs: Apply patch from Ben: Remove dead code from
5030         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5031         as that code just threw an exception anwyays.
5032
5033         * const.cs: Remove the call to the turnintoconstant, for details
5034         see bug: #63144
5035         
5036         * literal.cs: The type of the null-literal is the null type;  So
5037         we use a placeholder type (literal.cs:System.Null, defined here)
5038         for it.
5039
5040         * expression.cs (Conditional.DoResolve): Remove some old code that
5041         is no longer needed, conversions have been fixed.
5042
5043         (ArrayCreationExpression.DoResolve): Return false if we fail to
5044         resolve the inner expression.
5045
5046 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5047
5048         Fix test-290.cs.
5049         * cs-parser.jay (delegate_declaration): Record a delegate
5050         declaration as a type declaration.
5051         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5052
5053 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5054
5055         * parameter.cs: Do not crash if the type can not be resolved. 
5056
5057         * expression.cs: Report errors with unsafe pointers, fixes #64896
5058
5059 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5060
5061         * expression.cs: Pointer arith always needs to do a conv.i
5062         if the operand is a long. fix 65320
5063
5064 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5065
5066         Fixed cs0619-37.cs, cs0619-38.cs
5067
5068         * enum.cs (GetObsoleteAttribute): Removed.
5069
5070         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5071         on Enum member is double staged. The first is tested member
5072         and then enum.
5073
5074 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5075
5076         Fixed #56986, #63631, #65231
5077
5078         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5079         adds member to name container.
5080         (TypeContainer.AddToTypeContainer): New method, adds type to
5081         name container.
5082         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5083         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5084         AddOperator): Simplified by reusing AddToMemberContainer.
5085         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5086         instead of field.
5087         (Method.CheckForDuplications): Fixed implementation to test all
5088         possibilities.
5089         (MemberBase): Detection whether member is explicit interface
5090         implementation is now in constructor.
5091         (MemberBase.UpdateMemberName): Handles IndexerName.
5092         (Accessor): Changed to keep also location information.
5093         (AbstractPropertyEventMethod): Is derived from MemberCore.
5094         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5095         will be emited or not.
5096         (PropertyBase.AreAccessorsDuplicateImplementation):
5097         Tests whether accessors are not in collision with some method.
5098         (Operator): Is derived from MethodCore to simplify common
5099         operations.
5100
5101         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5102         must be performed.
5103         (DeclSpace.AddToContainer): Adds the member to defined_names
5104         table. It tests for duplications and enclosing name conflicts.
5105
5106         * enum.cs (EnumMember): Clean up to reuse the base structures
5107
5108 2004-09-03  Martin Baulig  <martin@ximian.com>
5109
5110         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5111         into TypeContainer, to make partial classes work again.
5112
5113 2004-09-03  Martin Baulig  <martin@ximian.com>
5114
5115         * rootcontext.cs (RootContext.V2): Removed.
5116
5117 2004-03-23  Martin Baulig  <martin@ximian.com>
5118
5119         * expression.cs (Invocation.OverloadResolve): Added `bool
5120         may_fail' argument and use it instead of the Location.IsNull() hack.
5121
5122 2004-09-03  Martin Baulig  <martin@ximian.com>
5123
5124         Merged latest changes into gmcs.  Please keep this comment in
5125         here, it makes it easier for me to see what changed in MCS since
5126         the last time I merged.
5127
5128 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5129
5130         Fix #61128.
5131         * expression.cs (BetterConversion): Don't allow either conversion 
5132         to be null.  Remove redundant implicit conversion test when 'q ==
5133         null' -- when this function is invoked, we already know that the
5134         implicit conversion exists.
5135         (BetterFunction): Assume that 'best' is non-null.  Remove
5136         redundant reimplementation of IsApplicable when 'best' is null.
5137         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5138         number of arguments.
5139         (IsAncestralType): Extract from OverloadResolve.
5140         (OverloadResolve): Make robust to the MethodGroupExpr being
5141         unsorted.  Implement all the logic of Section 14.5.5.1, and
5142         support overloading of methods from multiple applicable types.
5143         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5144
5145         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5146         (RealError, Warning): Append type of report to related symbol.
5147
5148 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5149
5150         * enum.cs: Fixed CLS-Compliance checks for enum members.
5151         Error tests cs3008-8.cs, cs3014-8.cs
5152
5153 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5154
5155         Fixed bug #62342, #63102
5156         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5157         like ImplementMethod.
5158
5159 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5160
5161         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5162         Fixed bug #65170.
5163
5164 2004-09-02  Martin Baulig  <martin@ximian.com>
5165
5166         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5167         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5168         on the MethodBase.
5169
5170 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5171
5172         C# 2.0 Static classes implemented
5173
5174         * class.cs (TypeContainer): instance_constructors,
5175         initialized_fields, initialized_static_fields,
5176         default_constructor, base_inteface_types are protected to be
5177         accessible from StaticClass.
5178         (TypeContainer.DefineDefaultConstructor): New virtual method
5179         for custom default constructor generating
5180         (StaticClass): New class to handle "Static classes" feature.
5181
5182         * cs-parser.jay: Handle static keyword on class like instance
5183         of StaticClass.
5184
5185         * driver.cs: Added "/langversion" command line switch with two
5186         options (iso-1, default).
5187
5188 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5189
5190         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5191
5192 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5193
5194         * delegate.cs: Style.
5195
5196 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5197
5198         * delegate.cs: Add seperate instance expr field for miguel.
5199
5200 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5201
5202         * PointerArithmetic (Resolve): make sure we are not doing
5203         pointer arith on void*. Also, make sure we are resolved
5204         by not setting eclass until resolve.
5205
5206         All callers: Make sure that PointerArithmetic gets resolved.
5207
5208 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5209
5210         * ArrayCreation (LookupType): If the type does not resolve 
5211         to an array, give an error.
5212
5213 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5214
5215         * statement.cs (Try.Resolve): Fixed bug #64222
5216
5217 2004-08-27  Martin Baulig  <martin@ximian.com>
5218
5219         * class.cs
5220         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5221         crash here.     
5222
5223 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5224
5225         * ecore.cs (Constantify): Get underlying type via
5226         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5227         Windows in special cases.
5228
5229 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5230
5231         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5232         for obtaining also private methods.
5233         (GetRemoveMethod): Used GetRemoveMethod (true)
5234         for obtaining also private methods.
5235
5236 2004-08-24  Martin Baulig  <martin@ximian.com>
5237
5238         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5239         MethodAttributes.HideBySig for operators.
5240
5241 2004-08-23  Martin Baulig  <martin@ximian.com>
5242
5243         Back to the old error reporting system :-)
5244
5245         * report.cs (Message): Removed.
5246         (Report.MessageData, ErrorData, WarningData): Removed.
5247         (Report.Error, Warning): Back to the old system.
5248
5249 2004-08-23  Martin Baulig  <martin@ximian.com>
5250
5251         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5252
5253         * class.cs (TypeContainer.ParentContainer): New public virtual
5254         method; replaces the explicit interface implementation.
5255         (ClassPart.ParentContainer): Override.
5256
5257 2004-08-23  Martin Baulig  <martin@ximian.com>
5258
5259         * statement.cs (Switch): Added support for constant switches; see
5260         #59428 or test-285.cs.
5261
5262 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5263
5264         Fixed bug #62740.
5265         * statement.cs (GetEnumeratorFilter): Removed useless
5266         logic because C# specs is strict. GetEnumerator must be
5267         public.
5268
5269 2004-08-22  Martin Baulig  <martin@ximian.com>
5270
5271         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5272         a switch and may break, reset the barrier.  Fixes #59867.
5273
5274 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5275
5276         CLS-Compliance speed up (~5% for corlib)
5277
5278         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5279         New method. Tests container for CLS-Compliant names
5280
5281         * class.cs (TypeContainer.VerifyClsName): New method.
5282         Checks whether container name is CLS Compliant.
5283         (Constructor): Implements IMethodData.
5284
5285         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5286         low-case table for CLS Compliance test.
5287         (MemberCache.VerifyClsParameterConflict): New method.
5288         Checks method parameters for CS3006 error.
5289
5290         * enum.cs (EnumMember): Is derived from MemberCore.
5291         (Enum.VerifyClsName): Optimized for better performance.
5292
5293 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5294
5295         * report.cs: Renamed Error_T to Error and changed all
5296         references.
5297
5298 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5299
5300         * class.cs (TypeContainer.IndexerArrayList): New inner class
5301         container for indexers.
5302         (TypeContainer.DefaultIndexerName): New constant for default
5303         indexer name. Replaced all "Item" with this constant.
5304         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5305
5306         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5307         DefaultMemberAttribute constructor.
5308
5309 2004-08-05  Martin Baulig  <martin@ximian.com>
5310
5311         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5312         Fix bug #59429.
5313
5314 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5315
5316         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5317         multi platforms problem.
5318
5319         * compiler.csproj: Included shared files.
5320
5321 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5322
5323         Fix bug 60333, 55971 in the more general way
5324         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5325         Added arg_type argument for constant conversion.
5326         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5327
5328 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5329
5330         Fix bug #59760
5331         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5332         OperatorArrayList, MethodCoreArrayList for typecontainer
5333         containers. Changed class member types to these new types.
5334         (MethodArrayList.DefineMembers): Added test for CS0659.
5335
5336 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5337
5338         * cfold.cs: Synchronize the folding with the code in expression.cs
5339         Binary.DoNumericPromotions for uint operands.
5340
5341         * attribute.cs: Revert patch from Raja, it introduced a regression
5342         while building Blam-1.2.1 (hard to isolate a test case).
5343
5344 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5345
5346         Fix for #55382
5347         * class.cs:
5348         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5349         name collision.
5350         (MethodCore.parent_method): New member. The method we're overriding
5351         if this is an override method.
5352         (MethodCore.CheckBase): Moved from Method class and made common.
5353         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5354         private.
5355         (MethodCore.CheckForDuplications): New abstract method. For custom
5356         member duplication search in a container
5357         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5358         method and its return type.
5359         (Event.conflict_symbol): New member. Symbol with same name in the
5360         parent class.
5361
5362         * decl.cs:
5363         (MemberCache.FindMemberWithSameName): New method. The method
5364         is looking for conflict with inherited symbols.
5365
5366 2004-08-04  Martin Baulig  <martin@ximian.com>
5367
5368         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5369
5370         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5371
5372 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5373
5374         * report.cs (Message): New enum for better error, warning reference in
5375         the code.
5376         (MessageData): New inner abstract class. It generally handles printing of
5377         error and warning messages.
5378         Removed unused Error, Warning, Message methods.
5379
5380 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5381
5382         Fix for cs0592-8.cs test
5383         * attribute.cs
5384         (Attributable.ValidAttributeTargets): Made public.
5385         (Attribute.ExplicitTarget): New member for explicit target value.
5386         (Attribute.CheckTargets): Now we translate explicit attribute
5387         target to Target here.
5388
5389 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5390
5391         * ecore.cs (MethodGroupExpr): new IsBase property.
5392
5393         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5394
5395         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5396         rather than an instance expr.
5397
5398         (DelegateCreation.Emit): Use the method group rather than
5399         the instance expression. Also, if you have base.Foo as the
5400         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5401
5402         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5403
5404         (NewDelegate.DoResolve): Only check for the existance of Invoke
5405         if the method is going to be needed. Use MethodGroupExpr.
5406
5407         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5408
5409         * expression.cs: For pointer arith., make sure to use
5410         the size of the type, not the size of the pointer to
5411         the type.
5412
5413 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5414
5415         Fix for #60722
5416         * class.cs (Class): Added error CS0502 test.
5417
5418 2004-08-03  John Luke  <jluke@cfl.rr.com>
5419             Raja R Harinath  <rharinath@novell.com>
5420
5421         Fix for #60997.
5422         * attribute.cs (Attribute.complained_before): New flag.
5423         (Attribute.ResolveType, Attribute.Resolve),
5424         (Attribute.DefinePInvokeMethod): Set it.
5425         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5426         
5427 2004-08-03  Martin Baulig  <martin@ximian.com>
5428
5429         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5430         use a user-defined operator; we still need to do numeric
5431         promotions in case one argument is a builtin type and the other
5432         one has an implicit conversion to that type.  Fixes #62322.
5433
5434 2004-08-02  Martin Baulig  <martin@ximian.com>
5435
5436         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5437         (LocalInfo.IsThis): New public property.
5438         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5439
5440 2004-08-01  Martin Baulig  <martin@ximian.com>
5441
5442         * class.cs (TypeContainer.GetClassBases): Don't set the default
5443         here since we may get called from GetPartialBases().
5444         (TypeContainer.DefineType): If GetClassBases() didn't return a
5445         parent, use the default one.
5446
5447 2004-07-30  Duncan Mak  <duncan@ximian.com>
5448
5449         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5450
5451 2004-07-30  Martin Baulig  <martin@ximian.com>
5452
5453         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5454
5455         * class.cs (SourceMethod): New public class, derive from the
5456         symbol writer's ISourceMethod.
5457         (Method): Use the new symbol writer API.
5458
5459         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5460         as argument and use the new symbol writer.
5461
5462         * location.cs
5463         (SourceFile): Implement the symbol writer's ISourceFile.
5464         (Location.SymbolDocument): Removed.
5465         (Location.SourceFile): New public property.
5466
5467         * symbolwriter.cs: Use the new symbol writer API.
5468
5469 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5470
5471         * Makefile (install-local): Remove.  Functionality moved to
5472         executable.make.
5473
5474 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5475
5476         * Makefile: Install mcs.exe.config file together with mcs.exe.
5477         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5478         correct runtime version.
5479         
5480 2004-07-25  Martin Baulig  <martin@ximian.com>
5481
5482         * class.cs
5483         (TypeContainer.RegisterOrder): Removed, this was unused.
5484         (TypeContainer, interface_order): Removed.
5485         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5486         TypeContainer as argument since we can also be called with a
5487         `PartialContainer' for a partial class/struct/interface.
5488         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5489         of checking whether we're an `Interface' - we could be a
5490         `PartialContainer'.
5491         (PartialContainer.Register): Override; call
5492         AddClass()/AddStruct()/AddInterface() on our parent.
5493
5494         * cs-parser.jay (interface_member_declaration): Add things to the
5495         `current_container', not the `current_class'.
5496
5497         * rootcontext.cs (RegisterOrder): The overloaded version which
5498         takes an `Interface' was unused, removed.
5499
5500         * typemanager.cs (TypeManager.LookupInterface): Return a
5501         `TypeContainer', not an `Interface'.
5502         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5503         contain a `PartialContainer' for an interface, so check it's
5504         `Kind' to figure out what it is.
5505
5506 2004-07-25  Martin Baulig  <martin@ximian.com>
5507
5508         * class.cs (Class.DefaultTypeAttributes): New public constant.
5509         (Struct.DefaultTypeAttributes): Likewise.
5510         (Interface.DefaultTypeAttributes): Likewise.
5511         (PartialContainer.TypeAttr): Override this and add the
5512         DefaultTypeAttributes.
5513
5514 2004-07-25  Martin Baulig  <martin@ximian.com>
5515
5516         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5517         we can just use the `Parent' field instead.
5518
5519 2004-07-25  Martin Baulig  <martin@ximian.com>
5520
5521         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5522
5523 2004-07-25  Martin Baulig  <martin@ximian.com>
5524
5525         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5526         our parts before defining any methods.
5527         (TypeContainer.VerifyImplements): Make this virtual.
5528         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5529         on our PartialContainer.
5530
5531 2004-07-25  Martin Baulig  <martin@ximian.com>
5532
5533         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5534
5535         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5536         argument, we can just use the `Parent' field instead.
5537
5538         * class.cs
5539         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5540         (MemberBase.DoDefine): Likewise.
5541
5542 2004-07-24  Martin Baulig  <martin@ximian.com>
5543
5544         * decl.cs (MemberCore.Parent): New public field.
5545         (DeclSpace.Parent): Moved to MemberCore.
5546
5547         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5548         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5549         parent's .ctor.
5550         (FieldBase, Field, Operator): Likewise.
5551         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5552         (EventField, Event): Likewise.
5553
5554 2004-07-23  Martin Baulig  <martin@ximian.com>
5555
5556         * class.cs (PartialContainer): New public class.
5557         (ClassPart): New public class.
5558         (TypeContainer): Added support for partial classes.
5559         (TypeContainer.GetClassBases): Splitted some of the functionality
5560         out into GetNormalBases() and GetPartialBases().
5561
5562         * cs-tokenizer.cs (Token.PARTIAL): New token.
5563         (Tokenizer.consume_identifier): Added some hacks to recognize
5564         `partial', but only if it's immediately followed by `class',
5565         `struct' or `interface'.
5566
5567         * cs-parser.jay: Added support for partial clases.
5568
5569 2004-07-23  Martin Baulig  <martin@ximian.com>
5570
5571         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5572         a `DeclSpace' and also made it readonly.
5573         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5574         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5575         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5576
5577         * cs-parser.jay: Pass the `current_class', not the
5578         `current_container' (at the moment, this is still the same thing)
5579         to a new Method, Property, Event, Indexer or Constructor.
5580
5581 2004-07-23  Martin Baulig  <martin@ximian.com>
5582
5583         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5584         and removed the `current_interface' one.
5585         (struct_declaration, class_declaration, interface_declaration):
5586         Set `current_class' to the newly created class/struct/interface;
5587         set their `Bases' and call Register() before parsing their body.
5588
5589 2004-07-23  Martin Baulig  <martin@ximian.com>
5590
5591         * class.cs (Kind): New public enum.
5592         (TypeContainer): Made this class abstract.
5593         (TypeContainer.Kind): New public readonly field.
5594         (TypeContainer.CheckDef): New public method; moved here from
5595         cs-parser.jay.
5596         (TypeContainer.Register): New public abstract method.
5597         (TypeContainer.GetPendingImplementations): New public abstract
5598         method.
5599         (TypeContainer.GetClassBases): Removed the `is_class' and
5600         `is_iface' parameters.
5601         (TypeContainer.DefineNestedTypes): Formerly known as
5602         DoDefineType().
5603         (ClassOrStruct): Made this class abstract.
5604
5605         * tree.cs (RootTypes): New public type. 
5606
5607 2004-07-20  Martin Baulig  <martin@ximian.com>
5608
5609         * tree.cs (Tree.RecordNamespace): Removed.
5610         (Tree.Namespaces): Removed.
5611
5612         * rootcontext.cs (RootContext.IsNamespace): Removed.
5613
5614         * cs-parser.jay (namespace_declaration): Just create a new
5615         NamespaceEntry here.
5616
5617 2004-07-20  Martin Baulig  <martin@ximian.com>
5618
5619         * statement.cs (ExceptionStatement): New abstract class.  This is
5620         now used as a base class for everyone who's using `finally'.
5621         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5622         our local variables before using them.
5623
5624         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5625         virtual method.  This is used by Yield.Resolve() to "steal" an
5626         outer block's `finally' clauses.
5627         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5628         argument.
5629
5630         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5631         version which takes an ExceptionStatement.  This version must be
5632         used to create exception branchings.
5633
5634         * iterator.cs
5635         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5636         (Iterator.EmitMoveNext): Added exception support; protect the
5637         block with a `fault' clause, properly handle 'finally' clauses.
5638         (Iterator.EmitDispose): Run all the `finally' clauses here.
5639
5640 2004-07-20  Martin Baulig  <martin@ximian.com>
5641
5642         * iterator.cs: This is the first of a set of changes in the
5643         iterator code.  Match the spec more closely: if we're an
5644         IEnumerable, then GetEnumerator() must be called.  The first time
5645         GetEnumerator() is called, it returns the current instance; all
5646         subsequent invocations (if any) must create a copy.
5647
5648 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5649
5650         * expression.cs: Resolve the constant expression before returning
5651         it. 
5652
5653 2004-07-19  Martin Baulig  <martin@ximian.com>
5654
5655         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5656         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5657         the return type of the new EmitContext.
5658
5659 2004-07-18  Martin Baulig  <martin@ximian.com>
5660
5661         * class.cs (Property.Define): Fix iterators.
5662
5663         * iterators.cs (Iterator.Define): Moved the
5664         `container.AddInterator (this)' call here from the .ctor; only do
5665         it if we resolved successfully.
5666
5667 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5668
5669         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5670         `true' for preprocessing directives that we parse.  The return
5671         value indicates whether we should return to regular tokenizing or
5672         not, not whether it was parsed successfully.
5673
5674         In the past if we were in: #if false ... #line #endif, we would
5675         resume parsing after `#line'.  See bug 61604.
5676
5677         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5678         building: IsEnumType should return true only for enums, not for
5679         enums or System.Enum itself.  This fixes #61593.
5680
5681         Likely what happened is that corlib was wrong: mcs depended on
5682         this bug in some places.  The bug got fixed, we had to add the
5683         hack, which caused bug 61593.
5684
5685         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5686         that was a workaround for the older conditions.
5687
5688 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5689
5690         * assign.cs: IAssignMethod has a new interface, as documented
5691         inline. All assignment code now uses this new api.
5692
5693         * ecore.cs, expression.cs: All classes which implement
5694         IAssignMethod now use the new interface.
5695
5696         * expression.cs (Invocation): add a hack to EmitCall so that
5697         IndexerAccess can be the target of a compound assignment without
5698         evaluating its arguments twice.
5699
5700         * statement.cs: Handle changes in Invocation api.
5701
5702 2004-07-16  Martin Baulig  <martin@ximian.com>
5703
5704         * iterators.cs: Rewrote this.  We're now using one single Proxy
5705         class for both the IEnumerable and the IEnumerator interface and
5706         `Iterator' derives from Class so we can use the high-level API.
5707
5708         * class.cs (TypeContainer.AddIterator): New method.
5709         (TypeContainer.DoDefineType): New protected virtual method, which
5710         is called from DefineType().
5711         (TypeContainer.DoDefineMembers): Call DefineType() and
5712         DefineMembers() on all our iterators.
5713         (TypeContainer.Emit): Call Emit() on all our iterators.
5714         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5715
5716         * codegen.cs (EmitContext.CurrentIterator): New public field.
5717
5718 2004-07-15  Martin Baulig  <martin@ximian.com>
5719
5720         * typemanager.cs
5721         (TypeManager.not_supported_exception_type): New type.   
5722
5723 2004-07-14  Martin Baulig  <martin@ximian.com>
5724
5725         * iterators.cs: Use real error numbers.
5726
5727 2004-07-14  Martin Baulig  <martin@ximian.com>
5728
5729         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5730         requires this to be a System.Collection.IEnumerable and not a
5731         class implementing that interface.
5732         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5733
5734 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5735
5736         * class.cs: Fixed previous fix, it broke some error tests.
5737
5738 2004-07-12  Martin Baulig  <martin@ximian.com>
5739
5740         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5741         Fixes #61293.
5742
5743 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5744
5745         * assign.cs (LocalTemporary): Add new argument: is_address,If
5746         `is_address' is true, then the value that we store is the address
5747         to the real value, and not the value itself.
5748         
5749         * ecore.cs (PropertyExpr): use the new local temporary
5750         stuff to allow us to handle X.Y += z (where X is a struct)
5751
5752 2004-07-08  Martin Baulig  <martin@ximian.com>
5753
5754         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5755         not always return, just like we're doing in Using.Resolve().
5756
5757 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5758
5759         * cs-parser.jay (fixed_statement): flag this as Pinned.
5760
5761 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5762
5763         * typemanager.cs (TypeManager): Removed MakePinned method, this
5764         mechanism is replaced with the .NET 2.x compatible mechanism of
5765         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5766
5767         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5768         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5769         `IsFixed' property which has a different meaning.
5770
5771 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5772
5773         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5774         visible from inside a nested class, not just the names of the
5775         immediately enclosing class.
5776         Fix for bug #60730.
5777
5778 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5779
5780         * expression.cs (BetterConversion): Remove buggy special-case
5781         handling of "implicit constant expression conversions".  At this
5782         point, we already know that the conversion is possible -- we're
5783         only checking to see which is better.
5784
5785 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5786
5787         * cs-parser.jay: Added error CS0210 test.
5788
5789 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5790
5791         * cs-parser.jay: Added error CS0134 test.
5792
5793 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5794
5795         Fix bug #52507
5796         * cs-parser.jay: Added error CS0145 test.
5797
5798 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5799
5800         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5801
5802 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5803         
5804         * expression.cs (StackAlloc.Resolve): The argument may not
5805         be a constant; deal with this case.
5806         
5807 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5808
5809         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5810         GetIndexerAttributeValue.
5811         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5812
5813         * class.cs (Indexer.Define): Added error tests for CS0415,
5814         CS0609.
5815
5816 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5817
5818         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5819         property code.
5820
5821 2004-06-23  Martin Baulig  <martin@ximian.com>
5822
5823         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5824         neither return nor throw, reset the barrier as well.  Fixes #60457.
5825
5826 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5827
5828         * class.cs : EventAttributes is now set to None by default.
5829           This fixes bug #60459.
5830
5831 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5832
5833         Fix bug #60219
5834         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5835         Don't throw exception but return null (it's sufficient now).
5836
5837 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5838
5839         * typemanager.cs (GetArgumentTypes): Faster implementation.
5840
5841 2004-06-18  Martin Baulig  <martin@ximian.com>
5842
5843         * attribute.cs (Attribute.Resolve): Check whether we're an
5844         EmptyCast which a Constant child.  Fixes #60333.
5845
5846 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5847
5848         * statement.cs (EmitCollectionForeach): Account for the fact that
5849         not all valuetypes are in areas which we can take the address of.
5850         For these variables, we store to a temporary variable. Also, make
5851         sure that we dont emit a `callvirt' on a valuetype method.
5852
5853 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5854
5855         * expression.cs (StackAlloc.DoReSolve): Added test for
5856         negative parameter (CS0247).
5857
5858 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5859
5860         Fix bug #59792
5861         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5862
5863 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5864
5865         Fix bug #59781
5866         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5867         ulong.
5868
5869 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5870
5871         Fix bug #58254 & cs1555.cs, cs1556.cs
5872         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5873
5874 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5875
5876         * cs-parser.jay: Added error CS1669 test for indexers.
5877
5878 2004-06-11  Martin Baulig  <martin@ximian.com>
5879
5880         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5881         call this twice: for params and varargs methods.
5882
5883 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5884
5885         * class.cs:
5886         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5887
5888 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5889
5890         * attribute.cs (Attribute.GetValidTargets): Made public.
5891
5892         * class.cs: 
5893         (AbstractPropertyEventMethod): New class for better code sharing.
5894         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5895         CS1667 report.
5896         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5897
5898 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5899
5900         Fix bug #59477.
5901         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5902         that the call to Resolve is part of a MemberAccess.
5903         (Expression.Resolve): Use it for SimpleName resolution.
5904         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5905         Add 'intermediate' boolean argument.
5906         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5907         error message when the SimpleName can be resolved ambiguously
5908         between an expression and a type.
5909         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5910         public.
5911         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5912         call on the left-side.
5913
5914 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5915
5916         * class.cs:
5917         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5918
5919 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5920
5921         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5922
5923 2004-06-11  Martin Baulig  <martin@ximian.com>
5924
5925         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5926         varargs methods if applicable.
5927
5928 2004-06-11  Martin Baulig  <martin@ximian.com>
5929
5930         * expression.cs (Invocation.EmitCall): Don't use
5931         `method.CallingConvention == CallingConventions.VarArgs' since the
5932         method could also have `CallingConventions.HasThis'.
5933
5934 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5935
5936         * class.cs (Event.GetSignatureForError): Implemented.
5937         Fixed crash in error test cs3010.cs
5938
5939 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
5940
5941         * cs-tokenizer.cs: Change the way we track __arglist to be
5942         consistent with the other keywords.
5943
5944 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
5945
5946         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
5947         tomorrow.
5948
5949 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
5950
5951         * codegen.cs: Check that all referenced assemblies have a strongname
5952         before strongnaming the compiled assembly. If not report error CS1577.
5953         Fix bug #56563. Patch by Jackson Harper.
5954         * typemanager.cs: Added a method to return all referenced assemblies.
5955         Fix bug #56563. Patch by Jackson Harper.
5956
5957 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5958
5959         * class.cs:
5960         (Method.ApplyAttributeBuilder): Moved and added conditional
5961         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
5962
5963         * delegate.cs:
5964         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
5965
5966 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
5967
5968         Fixed #59640
5969         * class.cs: (EventField.attribute_targets): Changed default target.
5970
5971 2004-06-08  Martin Baulig  <martin@ximian.com>
5972
5973         * expression.cs (Invocation.EmitCall): Enable varargs methods.
5974
5975 2004-06-08  Martin Baulig  <martin@ximian.com>
5976
5977         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
5978
5979 2004-06-07  Martin Baulig  <martin@ximian.com>
5980
5981         Added support for varargs methods.
5982
5983         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
5984         keyword.
5985
5986         * cs-parser.jay: Added support for `__arglist'.
5987
5988         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
5989
5990         * expression.cs (Argument.AType): Added `ArgList'.
5991         (Invocation): Added support for varargs methods.
5992         (ArglistAccess): New public class.
5993         (Arglist): New public class.
5994
5995         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
5996
5997         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
5998         a method's top-level block if the method has varargs.
5999
6000         * support.cs (ReflectionParameters, InternalParameters): Added
6001         support for varargs methods.    
6002
6003 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6004
6005         * class.cs: Provide location in indexer error report.
6006
6007         * driver.cs: Use standard names.
6008
6009         * namespace.cs: Catch the use of using after a namespace has been
6010         declared also on using aliases.
6011
6012 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6013
6014         Bug #50820.
6015         * typemanager.cs (closure_private_ok, closure_invocation_type)
6016         (closure_qualifier_type, closure_invocation_assembly)
6017         (FilterWithClosure): Move to ...
6018         (Closure): New internal nested class.
6019         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6020         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6021         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6022         (MemberLookup, MemberLookupFailed): Use it.
6023         * expression.cs (New.DoResolve): Treat the lookup for the
6024         constructor as being qualified by the 'new'ed type.
6025         (Indexers.GetIndexersForTypeOrInterface): Update.
6026
6027 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6028
6029         * attribute.cs
6030         (GetConditionalAttributeValue): New method. Returns
6031         condition of ConditionalAttribute.
6032         (SearchMulti): New method.  Returns all attributes of type 't'.
6033         Use it when attribute is AllowMultiple = true.
6034         (IsConditionalMethodExcluded): New method.
6035
6036         * class.cs
6037         (Method.IsExcluded): Implemented. Returns true if method has conditional
6038         attribute and the conditions is not defined (method is excluded).
6039         (IMethodData): Extended interface for ConditionalAttribute support.
6040         (PropertyMethod.IsExcluded): Implemented.
6041
6042         * decl.cs
6043         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6044
6045         * expression.cs
6046         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6047         on the method.
6048
6049 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6050
6051         * expression.cs (ArrayCreationExpression): Make this just an
6052         `expression'. It can't be a statement, so the code here was
6053         dead.
6054
6055 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6056
6057         Fixed #59072
6058         * typemanager.cs (GetFullNameSignature): New method for
6059         MethodBase types.
6060
6061 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6062
6063         Fixed #56452
6064         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6065         Use this method when MethodBuilder is null.
6066         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6067         Added test for error CS0626 (MONO reports error for this situation).
6068         (IMethodData.GetSignatureForError): Extended interface.
6069
6070 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6071
6072         * attribute.cs
6073         (AttributeTester.GetObsoleteAttribute): Returns instance of
6074         ObsoleteAttribute when type is obsolete.
6075
6076         * class.cs
6077         (TypeContainer.VerifyObsoleteAttribute): Override.
6078         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6079         (MethodCode.VerifyObsoleteAttribute): Override.
6080         (MemberBase.VerifyObsoleteAttribute): Override.
6081
6082         * decl.cs
6083         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6084         and report proper error.
6085
6086         *delegate.cs
6087         Delegate.VerifyObsoleteAttribute): Override.
6088
6089         * ecore.cs
6090         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6091         and report proper error.
6092         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6093
6094         * enum.cs
6095         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6096         and enum member.
6097
6098         * expression.cs
6099         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6100         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6101         Added test for ObsoleteAttribute.
6102
6103         * statement.cs
6104         (Catch): Derived from Statement.
6105
6106 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6107  
6108         Fixed bug #59071 & cs0160.cs
6109  
6110         * statement.cs (Try.Resolve): Check here whether order of catch
6111         clauses matches their dependencies.
6112
6113 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6114
6115         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6116         caused a regression: #59343.  Referencing nested classes from an
6117         assembly stopped working.
6118
6119 2004-05-31  Martin Baulig  <martin@ximian.com>
6120
6121         MCS is now frozen for beta 2.
6122
6123 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6124
6125         * convert.cs: add a trivial cache for overload operator resolution.
6126
6127 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6128
6129         * decl.cs: If possible, use lookuptypedirect here. We can only do
6130         this if there is no `.' after the namespace. Avoids using
6131         LookupType, which does lots of slow processing.
6132         (FindNestedType) New method, does what it says :-).
6133         * namespace.cs: use LookupTypeDirect.
6134         * rootcontext.cs: use membercache, if possible.
6135         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6136
6137 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6138
6139         * expression.cs:
6140         According to the spec, 
6141
6142         In a member access of the form E.I, if E is a single identifier,
6143         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6144         field, property, localvariable, or parameter with the same type as
6145         the meaning of E as a type-name (§3.8), then both possible
6146         meanings of E are permitted.
6147
6148         We did not check that E as a simple-name had the same type as E as
6149         a type name.
6150
6151         This trivial check gives us 5-7% on bootstrap time.
6152
6153 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6154
6155         * expression.cs (Invocation.OverloadResolve): Avoid the
6156         use of hashtables and boxing here by allocating on demand.
6157
6158 2004-05-30  Martin Baulig  <martin@ximian.com>
6159
6160         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6161         we're doing a silent lookup.  Don't try to lookup nested types in
6162         TypeManager.object_type (thanks to Ben Maurer).
6163
6164 2004-05-30  Martin Baulig  <martin@ximian.com>
6165
6166         Committing a patch from Ben Maurer.
6167
6168         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6169
6170 2004-05-29  Martin Baulig  <martin@ximian.com>
6171
6172         * class.cs (IMethodData.ShouldIgnore): New method.
6173
6174         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6175         `Location' argument, we don't need it anywhere.  Use
6176         `IMethodData.ShouldIgnore ()' instead of
6177         `MethodData.GetMethodFlags ()'.
6178         (TypeManager.AddMethod): Removed.
6179         (TypeManager.AddMethod2): Renamed to AddMethod.
6180
6181 2004-05-29  Martin Baulig  <martin@ximian.com>
6182
6183         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6184
6185         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6186         converting from a class type S to an interface type and we already
6187         have an object on the stack, don't box it again.  Fixes #52578.
6188
6189 2004-05-29  Martin Baulig  <martin@ximian.com>
6190
6191         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6192         Added support for `params' parameters.  Fixes #59267.
6193
6194 2004-05-29  Martin Baulig  <martin@ximian.com>
6195
6196         * literal.cs (NullPointer): Provide a private .ctor which sets
6197         `type' to TypeManager.object_type.  Fixes #59048.
6198
6199 2004-05-29  Martin Baulig  <martin@ximian.com>
6200
6201         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6202         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6203
6204         * ecore.cs (EventExpr.instance_expr): Make the field private.
6205
6206 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6207
6208         Fixed bug #50080 & cs0214-2.cs
6209         * expression.cs (Cast.DoResolve): Check unsafe context here.
6210         
6211         * statement.cs (Resolve.DoResolve): Likewise.
6212
6213 2004-05-26  Martin Baulig  <martin@ximian.com>
6214
6215         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6216
6217         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6218         (RootContext.LookupType): Pass down the `silent' flag.
6219
6220 2004-05-25  Martin Baulig  <martin@ximian.com>
6221
6222         * expression.cs
6223         (MethodGroupExpr.IdenticalTypeName): New public property.
6224         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6225         expression actually refers to a type.
6226
6227 2004-05-25  Martin Baulig  <martin@ximian.com>
6228
6229         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6230         for #56176 and made it actually work.
6231
6232 2004-05-25  Martin Baulig  <martin@ximian.com>
6233
6234         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6235         (FieldExpr, PropertyExpr): Override and implement
6236         CacheTemporaries.  Fixes #52279.
6237
6238 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6239
6240         * location.cs: In the new compiler listing a file twice is a
6241         warning, not an error.
6242
6243 2004-05-24  Martin Baulig  <martin@ximian.com>
6244
6245         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6246         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6247
6248 2004-05-24  Martin Baulig  <martin@ximian.com>
6249
6250         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6251         walking the `using' list.  Fixes #53921.
6252
6253 2004-05-24  Martin Baulig  <martin@ximian.com>
6254
6255         * const.cs (Const.LookupConstantValue): Added support for
6256         EmptyCast's; fixes #55251.
6257
6258 2004-05-24  Martin Baulig  <martin@ximian.com>
6259
6260         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6261         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6262         which does the CS0135 check.  The reason is that we first need to
6263         check whether the variable actually exists.
6264
6265 2004-05-24  Martin Baulig  <martin@ximian.com>
6266
6267         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6268         than RootContext.LookupType() to find the explicit interface
6269         type.  Fixes #58584.
6270
6271 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6272
6273         * Makefile: Simplify.  Use executable.make.
6274         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6275
6276 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6277
6278         * decl.cs:
6279         * enum.cs:
6280         Use the invariant culture when doing String.Compare for CLS case
6281         sensitivity.
6282         
6283 2004-05-23  Martin Baulig  <martin@ximian.com>
6284
6285         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6286         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6287
6288         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6289         
6290 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6291
6292         * class.cs (MemberBase.Define): Reuse MemberType member for 
6293         resolved type. Other methods can use it too.
6294
6295 2004-05-23  Martin Baulig  <martin@ximian.com>
6296
6297         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6298         the variable also exists in the current block (otherwise, we need
6299         to report a CS0103).  Fixes #58670.
6300
6301 2004-05-23  Martin Baulig  <martin@ximian.com>
6302
6303         * flowanalysis.cs (Reachability.Reachable): Compute this
6304         on-the-fly rather than storing it as a field.
6305
6306 2004-05-23  Martin Baulig  <martin@ximian.com>
6307
6308         * flowanalysis.cs (Reachability.And): Manually compute the
6309         resulting `barrier' from the reachability.      
6310        
6311 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6312
6313         Fix bug #57835
6314         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6315         instance of ObsoleteAttribute when symbol is obsolete.
6316
6317         * class.cs
6318         (IMethodData): Extended interface for ObsoleteAttribute support.
6319
6320 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6321
6322         * attribute.cs: Fix bug #55970
6323
6324 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6325
6326         Fix bug #52705
6327         * attribute.cs
6328         (GetObsoleteAttribute): New method. Creates the instance of
6329         ObsoleteAttribute.
6330         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6331         ObsoleteAttribute when member is obsolete.
6332         (AttributeTester.Report_ObsoleteMessage): Common method for
6333         Obsolete error/warning reporting.
6334
6335         * class.cs
6336         (TypeContainer.base_classs_type): New member for storing parent type.
6337
6338         * decl.cs
6339         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6340         for this MemberCore.
6341
6342 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6343
6344         * attribute.cs, const.cs: Fix bug #58590
6345
6346 2004-05-21  Martin Baulig  <martin@ximian.com>
6347
6348         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6349         out parameters if the end of the method is unreachable.  Fixes
6350         #58098. 
6351
6352 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6353
6354         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6355         Hari was right, why extra method.
6356
6357 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6358
6359         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6360
6361 2004-05-20  Martin Baulig  <martin@ximian.com>
6362
6363         Merged this back from gmcs to keep the differences to a minumum.
6364
6365         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6366         instead of a Declspace.
6367         (Attribute.ResolveType): Likewise.
6368         (Attributes.Search): Likewise.
6369         (Attributes.Contains): Likewise.
6370         (Attributes.GetClsCompliantAttribute): Likewise.
6371
6372         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6373         argument.
6374         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6375         DeclSpace.
6376
6377 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6378
6379         Fix bug #58688 (MCS does not report error when the same attribute
6380         is assigned twice)
6381
6382         * attribute.cs (Attribute.Emit): Distinction between null and default.
6383
6384 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6385
6386         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6387         of a top-level attribute without an attribute target.
6388         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6389         Make non-static.
6390         (Attribute.Conditional_GetConditionName), 
6391         (Attribute.Obsolete_GetObsoleteMessage): Update.
6392         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6393         part of ScanForIndexerName.
6394         (Attribute.CanIgnoreInvalidAttribute): New function.
6395         (Attribute.ScanForIndexerName): Move to ...
6396         (Attributes.ScanForIndexerName): ... here.
6397         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6398         (Attributes.Search): New internal variant that can choose not to
6399         complain if types aren't resolved.  The original signature now
6400         complains.
6401         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6402         complaints suppressed.
6403         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6404         only if it not useful.
6405         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6406         top-level for attributes that are shared between the assembly
6407         and a top-level class.
6408         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6409         * class.cs: Update to reflect changes.
6410         (DefineIndexers): Fuse loops.
6411         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6412         a couple more variants of attribute names.
6413
6414 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6415
6416         Fix bug #52585 (Implemented explicit attribute declaration)
6417
6418         * attribute.cs:
6419         (Attributable.ValidAttributeTargets): New abstract method. It gets
6420         list of valid attribute targets for explicit target declaration.
6421         (Attribute.Target): It holds target itself.
6422         (AttributeSection): Removed.
6423         (Attribute.CheckTargets): New method. It checks whether attribute
6424         target is valid for the current element.
6425
6426         * class.cs:
6427         (EventProperty): New class. For events that are declared like
6428         property (with add and remove accessors).
6429         (EventField): New class. For events that are declared like field.
6430         class.cs
6431
6432         * cs-parser.jay: Implemented explicit attribute target declaration.
6433
6434         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6435         Override ValidAttributeTargets.
6436
6437         * parameter.cs:
6438         (ReturnParameter): Class for applying custom attributes on 
6439         the return type.
6440         (ParameterAtribute): New class. Class for applying custom
6441         attributes on the parameter type.
6442
6443 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6444
6445         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6446         definitions. 
6447
6448         (Method): Allow UNSAFE here.
6449
6450         * modifiers.cs: Support unsafe reporting.
6451
6452 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6453
6454         * decl.cs: Fix bug #58478.
6455
6456 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6457
6458         * statement.cs: When checking for unreachable code on an EmptyStatement,
6459         set the location. Fixes bug #58488.
6460
6461 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6462
6463         * driver.cs: Add -pkg handling.
6464
6465         From Gonzalo: UseShelLExecute=false
6466
6467 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6468
6469         * attribute.cs:
6470         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6471         for attribute.
6472         (Attribute.IsClsCompliaceRequired): Moved to base for better
6473         accesibility.
6474         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6475         when attribute is AttributeUsageAttribute.
6476         (Attribute.GetValidTargets): Simplified.
6477         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6478         attribute for this type.
6479         (Attribute.ApplyAttributes): Method renamed to Emit and make
6480         non-static.
6481         (GlobalAttributeSection): New class for special handling of global
6482         attributes (assembly, module).
6483         (AttributeSection.Emit): New method.
6484
6485         * class.cs: Implemented Attributable abstract methods.
6486         (MethodCore.LabelParameters): Moved to Parameter class.
6487         (Accessor): Is back simple class.
6488         (PropertyMethod): Implemented Attributable abstract class.
6489         (DelegateMethod): Implemented Attributable abstract class.
6490         (Event): New constructor for disctintion between normal Event
6491         and Event with accessors.
6492
6493         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6494
6495         * codegen.cs, const.cs, decl.cs, delegate.cs:
6496         (CommonAssemblyModulClass): Implemented Attributable abstract class
6497         and simplified.
6498
6499         * enum.cs: Implement IAttributeSupport interface.
6500         (EnumMember): New class for emum members. Implemented Attributable
6501         abstract class
6502
6503         * parameter.cs:
6504         (ParameterBase): Is abstract.
6505         (ReturnParameter): New class for easier [return:] attribute handling.
6506
6507         * typemanager.cs: Removed builder_to_attr.
6508
6509 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6510
6511         Fix bug #57151.
6512         * attribute.cs (Attribute.GetPositionalValue): New function.
6513         * class.cs (TypeContainer.VerifyMembers): New function.
6514         (TypeContainer.Emit): Use it.
6515         (ClassOrStruct): New base class for Class and Struct.
6516         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6517         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6518         class.
6519         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6520         then each non-static field should have a FieldOffset attribute.
6521         Otherwise, none of the fields should have a FieldOffset attribute.
6522         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6523         and FieldOffset attributes.
6524         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6525         (TypeManager.field_offset_attribute_type): New core types.
6526         (TypeManager.InitCoreTypes): Initialize them.
6527
6528 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6529
6530         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6531         Return correct type.
6532         From bug #58270.
6533
6534 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6535
6536         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6537         be implicitly converted to ulong.
6538         
6539         * expression.cs: The logic for allowing operator &, | and ^ worked
6540         was wrong, it worked before because we did not report an error in
6541         an else branch.  Fixes 57895.
6542
6543         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6544         allow volatile fields to be reference types.
6545
6546 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6547
6548         * driver.cs: Add support for /debug-
6549
6550 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6551
6552         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6553         Add a 'complain' parameter to silence errors.
6554         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6555         silently overlooked type-resolutions.
6556         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6557         to reflect changes.
6558         (Attributes.Search): New function.
6559         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6560         (Attributes.GetAttributeFullName): Remove hack.
6561         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6562         Update to reflect changes.
6563         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6564         Use Attributes.Search instead of nested loops.
6565
6566 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6567
6568         * decl.cs:
6569         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6570         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6571         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6572
6573         * report.cs: (Report.Warning): Renamed to Warning_T because of
6574         parameter collision.
6575
6576 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6577
6578         * expression.cs (MemberAccess.ResolveMemberAccess):
6579         Exit with non-zero status after Report.Error.
6580         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6581         Likewise.
6582         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6583
6584 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6585
6586         * support.cs: Don't hang when the file is empty.
6587
6588 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6589
6590         * support.cs: In SeekableStreamReader, compute the preamble size of the
6591           underlying stream. Position changes should take into account that initial
6592           count of bytes.
6593
6594 2004-05-03  Todd Berman  <tberman@sevenl.net>
6595
6596         * driver.cs: remove unused GetSysVersion function.
6597
6598 2004-05-03  Todd Berman  <tberman@sevenl.net>
6599
6600         * driver.cs: Remove the hack from saturday, as well as the hack
6601         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6602         link_paths to get that bit proper.
6603
6604 2004-05-01  Todd Berman  <tberman@sevenl.net>
6605
6606         * driver.cs: Try a LoadFrom before a Load, this checks the current
6607         path. This is currently a bug in mono that is be fixed, however, this
6608         provides a workaround for now. This will be removed when the bug
6609         is fixed.
6610
6611 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6612
6613         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6614         incomplete key pairs (#57941).
6615
6616 2004-05-01  Todd Berman  <tberman@sevenl.net>
6617
6618         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6619         from the GAC
6620
6621 2004-04-30  Jackson Harper  <jackson@ximian.com>
6622
6623         * codegen.cs: Open keys readonly.
6624         
6625 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6626
6627         * typemanager.cs: don't report cyclic struct layout when a struct
6628         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6629         which has 2 Pango.Rectangle fields.
6630
6631 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6632
6633         * expression.cs: Handle IntPtr comparisons with IL code
6634         rather than a method call.
6635
6636 2004-04-29  Martin Baulig  <martin@ximian.com>
6637
6638         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6639         the list of PropertyInfo's in class hierarchy and find the
6640         accessor.  Fixes #56013.
6641
6642 2004-04-29  Martin Baulig  <martin@ximian.com>
6643
6644         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6645
6646 2004-04-29  Martin Baulig  <martin@ximian.com>
6647
6648         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6649
6650         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6651
6652 2004-04-29  Martin Baulig  <martin@ximian.com>
6653
6654         * class.cs (ConstructorInitializer.Resolve): Check whether the
6655         parent .ctor is accessible.  Fixes #52146.
6656
6657 2004-04-29  Martin Baulig  <martin@ximian.com>
6658
6659         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6660
6661         * statement.cs (Using.EmitLocalVariableDecls): Use
6662         TypeManager.idisposable_type, not typeof (IDisposable).
6663         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6664
6665 2004-04-29  Martin Baulig  <martin@ximian.com>
6666
6667         * class.cs (Event.Define): Don't emit the field and don't set
6668         RTSpecialName and SpecialName for events on interfaces.  Fixes
6669         #57703. 
6670
6671 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6672
6673         Refactor Attribute.ApplyAttributes.
6674         * attribute.cs (Attributable): New base class for objects that can
6675         have Attributes applied on them.
6676         (Attribute): Make AttributeUsage fields public.
6677         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6678         (Attribute.IsInternalCall): New property.
6679         (Attribute.UsageAttr): Convert to a public read-only property.
6680         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6681         (Attribute.ResolveType, Attribute.Resolve)
6682         (Attribute.ScanForIndexerName): Update to reflect changes.
6683         (Attribute.CheckAttributeTarget): Re-format.
6684         (Attribute.ApplyAttributes): Refactor, to various
6685         Attributable.ApplyAttributeBuilder methods.
6686         * decl.cs (MemberCore): Make Attributable.
6687         * class.cs (Accessor): Make Attributable.
6688         (MethodData.ApplyAttributes): Use proper attribute types, not
6689         attribute names.
6690         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6691         (TypeContainer.ApplyAttributeBuilder)
6692         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6693         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6694         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6695         (Operator.ApplyAttributeBuilder): New factored-out methods.
6696         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6697         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6698         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6699         * parameter.cs (ParameterBase): New Attributable base class
6700         that can also represent Return types.
6701         (Parameter): Update to the changes.
6702
6703 2004-04-29  Jackson Harper  <jackson@ximian.com>
6704
6705         * driver.cs: Prefer the corlib system version when looking for
6706         assemblies in the GAC. This is still a hack, but its a better hack
6707         now.
6708         
6709 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6710
6711         * decl.cs, enum.cs: Improved error 3005 reporting.
6712   
6713         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6714         (related_symbols): New private member for list of symbols
6715         related to reported error/warning.
6716         
6717         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6718
6719 2004-04-29  Martin Baulig  <martin@ximian.com>
6720
6721         * ecore.cs (Expression.Constantify): If we're an enum and
6722         TypeManager.TypeToCoreType() doesn't give us another type, use
6723         t.UnderlyingSystemType.  Fixes #56178.  
6724
6725 2004-04-29  Martin Baulig  <martin@ximian.com>
6726
6727         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6728         interfaces and for each interface, only add members directly
6729         declared in that interface.  Fixes #53255.
6730
6731 2004-04-28  Martin Baulig  <martin@ximian.com>
6732
6733         * expression.cs (ConditionalLogicalOperator): Use a temporary
6734         variable for `left' to avoid that we evaluate it more than once;
6735         bug #52588.
6736
6737 2004-04-28  Martin Baulig  <martin@ximian.com>
6738
6739         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6740         `void[]' (CS1547).
6741
6742 2004-04-28  Martin Baulig  <martin@ximian.com>
6743
6744         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6745         void (CS1547).
6746
6747         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6748         whether the type is not void (CS1547).
6749
6750 2004-04-28  Martin Baulig  <martin@ximian.com>
6751
6752         * expression.cs (Unary.DoResolveLValue): Override this and report
6753         CS0131 for anything but Operator.Indirection.
6754
6755 2004-04-28  Martin Baulig  <martin@ximian.com>
6756
6757         Committing a patch from Ben Maurer; see bug #50820.
6758
6759         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6760         check for classes.
6761
6762         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6763         classes.        
6764
6765 2004-04-28  Martin Baulig  <martin@ximian.com>
6766
6767         Committing a patch from Ben Maurer; see bug #50820.
6768
6769         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6770         check for classes.
6771
6772         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6773         classes.        
6774
6775 2004-04-28  Martin Baulig  <martin@ximian.com>
6776
6777         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6778         (Block.AddLabel): Call DoLookupLabel() to only search in the
6779         current block.
6780
6781 2004-04-28  Martin Baulig  <martin@ximian.com>
6782
6783         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6784         comparing StringConstants and NullLiterals in Equality and Inequality.
6785
6786 2004-04-28  Jackson Harper  <jackson@ximian.com>
6787
6788         * driver.cs: Attempt to load referenced assemblies from the
6789         GAC. This is the quick and dirty version of this method that
6790         doesnt take into account versions and just takes the first
6791         canidate found. Will be good enough for now as we will not have more
6792         then one version installed into the GAC until I update this method.
6793
6794 2004-04-28  Martin Baulig  <martin@ximian.com>
6795
6796         * typemanager.cs (TypeManager.CheckStructCycles): New public
6797         static method to check for cycles in the struct layout.
6798
6799         * rootcontext.cs (RootContext.PopulateTypes): Call
6800         TypeManager.CheckStructCycles() for each TypeContainer.
6801         [Note: We only need to visit each type once.]
6802
6803 2004-04-28  Martin Baulig  <martin@ximian.com>
6804
6805         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6806
6807         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6808         success and added `out object value'.  Use a `bool resolved' field
6809         to check whether we've already been called rather than
6810         `ConstantValue != null' since this breaks for NullLiterals.
6811
6812 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6813
6814         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6815         setting of this flag, since the 'set' method may be non-public.
6816
6817 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6818
6819         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6820         check on current_vector.Block.
6821
6822 2004-04-27  Martin Baulig  <martin@ximian.com>
6823
6824         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6825         a field initializer.  Fixes #56459.
6826
6827 2004-04-27  Martin Baulig  <martin@ximian.com>
6828
6829         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6830         we're not attempting to use an indexer.  Fixes #52154.
6831
6832 2004-04-27  Martin Baulig  <martin@ximian.com>
6833
6834         * statement.cs (Return): Don't create a return label if we don't
6835         need it; reverts my change from January 20th.  Thanks to Ben
6836         Maurer for this.
6837
6838 2004-04-27  Martin Baulig  <martin@ximian.com>
6839
6840         According to the spec, `goto' can only leave a nested scope, but
6841         never enter it.
6842
6843         * statement.cs (Block.LookupLabel): Only lookup in the current
6844         block, don't recurse into parent or child blocks.
6845         (Block.AddLabel): Check in parent and child blocks, report
6846         CS0140/CS0158 if we find a duplicate.
6847         (Block): Removed this indexer for label lookups.
6848         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6849         this already does the error reporting for us.
6850
6851         * flowanalysis.cs
6852         (FlowBranching.UsageVector.Block): New public variable; may be null.
6853         (FlowBranching.CreateSibling): Added `Block' argument.
6854         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6855         label for the target of a `goto' and check whether we're not
6856         leaving a `finally'.
6857
6858 2004-04-27  Martin Baulig  <martin@ximian.com>
6859
6860         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6861         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6862         just for returns).
6863
6864 2004-04-27  Martin Baulig  <martin@ximian.com>
6865
6866         * statement.cs (Block.AddLabel): Also check for implicit blocks
6867         and added a CS0158 check.
6868
6869 2004-04-27  Martin Baulig  <martin@ximian.com>
6870
6871         * flowanalysis.cs (FlowBranchingLoop): New class.
6872         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6873         UsageVector's instead of an ArrayList.
6874         (FlowBranching.Label): Likewise.
6875         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6876         (FlowBranching.AddBreakVector): New method.
6877
6878 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6879
6880         * attribute.cs: Small regression fix: only convert the type if we
6881         the type is different, fixes System.Drawing build.
6882
6883 2004-04-27  Martin Baulig  <martin@ximian.com>
6884
6885         * attribute.cs (Attribute.Resolve): If we have a constant value
6886         for a named field or property, implicity convert it to the correct
6887         type.
6888
6889 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6890
6891         * statement.cs (Block.Block): Implicit blocks share
6892         'child_variable_names' fields with parent blocks.
6893         (Block.AddChildVariableNames): Remove.
6894         (Block.AddVariable): Mark variable as "used by a child block" in
6895         every surrounding block.
6896         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6897         been used in a child block, complain about violation of "Invariant
6898         meaning in blocks" rule.
6899         * cs-parser.jay (declare_local_variables): Don't use
6900         AddChildVariableNames.
6901         (foreach_statement): Don't create an implicit block: 'foreach'
6902         introduces a scope.
6903
6904 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6905
6906         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6907         converting from 0L to ulong.  Fixes 57522.
6908
6909 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6910
6911         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6912         derived class hides via 'new' keyword field from base class (test-242.cs).
6913         TODO: Handle this in the more general way.
6914         
6915         * class.cs (CheckBase): Ditto.
6916
6917 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6918
6919         * decl.cs (caching_flags): New member for storing cached values
6920         as bit flags.
6921         (MemberCore.Flags): New enum where bit flags for caching_flags
6922         are defined.
6923         (MemberCore.cls_compliance): Moved to caching_flags.
6924         (DeclSpace.Created): Moved to caching_flags.
6925
6926         * class.cs: Use caching_flags instead of DeclSpace.Created
6927         
6928 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6929
6930         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6931         if we are only a derived class, not a nested class.
6932
6933         * typemanager.cs: Same as above, but do this at the MemberLookup
6934         level (used by field and methods, properties are handled in
6935         PropertyExpr).   Allow for the qualified access if we are a nested
6936         method. 
6937
6938 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6939
6940         * class.cs: Refactoring.
6941         (IMethodData): New inteface; Holds links to parent members
6942         to avoid member duplication (reduced memory allocation).
6943         (Method): Implemented IMethodData interface.
6944         (PropertyBase): New inner classes for get/set methods.
6945         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6946         (Event): New inner classes for add/remove methods.
6947         (Event.DelegateMethod): Implemented IMethodData interface.
6948
6949         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6950         EmitContext (related to class.cs refactoring).
6951
6952 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6953
6954         * delegate.cs (Delegate.VerifyApplicability): If the number of
6955         arguments are the same as the number of parameters, first try to
6956         verify applicability ignoring  any 'params' modifier on the last
6957         parameter.
6958         Fixes #56442.
6959
6960 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6961
6962         * class.cs (TypeContainer.AddIndexer): Use
6963         'ExplicitInterfaceName' to determine if interface name was
6964         explicitly specified.  'InterfaceType' is not initialized at this time.
6965         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6966         Indexers array is already in the required order.  Initialize
6967         'IndexerName' only if there are normal indexers.
6968         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6969         (TypeContainer.Emit): Emit DefaultMember attribute only if
6970         IndexerName is initialized.
6971         Fixes #56300.
6972
6973 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6974
6975         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6976         Fixes #57007
6977
6978 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6979
6980         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6981         attributes.
6982         Fix for #56456.
6983
6984         * attribute.cs (Attribute.Resolve): Check for duplicate named
6985         attributes.
6986         Fix for #56463.
6987
6988 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6989
6990         * iterators.cs (MarkYield): track whether we are in an exception,
6991         and generate code accordingly.  Use a temporary value to store the
6992         result for our state.
6993
6994         I had ignored a bit the interaction of try/catch with iterators
6995         since their behavior was not entirely obvious, but now it is
6996         possible to verify that our behavior is the same as MS .NET 2.0
6997
6998         Fixes 54814
6999
7000 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7001
7002         * iterators.cs: Avoid creating temporaries if there is no work to
7003         do. 
7004
7005         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7006         Enumerations, use TypeManager.EnumToUnderlying and call
7007         recursively. 
7008
7009         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7010         bug #57013
7011
7012         (This.Emit): Use EmitContext.EmitThis to emit our
7013         instance variable.
7014
7015         (This.EmitAssign): Ditto.
7016
7017         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7018         codepaths, we will move all the functionality into
7019         Mono.CSharp.This 
7020
7021         (FieldExpr.EmitAssign): Ditto.
7022
7023         This fixes several hidden bugs that I uncovered while doing a code
7024         review of this today.
7025
7026         * codegen.cs (EmitThis): reworked so the semantics are more clear
7027         and also support value types "this" instances.
7028
7029         * iterators.cs: Changed so that for iterators in value types, we
7030         do not pass the value type as a parameter.  
7031
7032         Initialization of the enumerator helpers is now done in the caller
7033         instead of passing the parameters to the constructors and having
7034         the constructor set the fields.
7035
7036         The fields have now `assembly' visibility instead of private.
7037
7038 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7039
7040         * expression.cs (Argument.Resolve): Check if fields passed as ref
7041         or out are contained in a MarshalByRefObject.
7042
7043         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7044         another compiler type.
7045
7046 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7047
7048         * class.cs (Indexer.Define): use the new name checking method.
7049         Also, return false on an error.
7050         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7051         (is_identifier_[start/part]_character): make static.
7052
7053 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7054
7055         * expression.cs (Binary.ResolveOperator): Do no append strings
7056         twice: since we can be invoked more than once (array evaluation)
7057         on the same concatenation, take care of this here.  Based on a fix
7058         from Ben (bug #56454)
7059
7060 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7061
7062         * codegen.cs: Fix another case where CS1548 must be reported (when 
7063         delay-sign isn't specified and no private is available #56564). Fix
7064         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7065         error when MCS is used on the MS runtime and we need to delay-sign 
7066         (which seems unsupported by AssemblyBuilder - see #56621).
7067
7068 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7069
7070         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7071         (TypeManager.ComputeNamespaces): Faster implementation for
7072         Microsoft runtime.
7073
7074         * compiler.csproj: Updated AssemblyName to mcs.
7075
7076 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7077
7078         * rootcontext.cs: Add new types to the boot resolution.
7079
7080         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7081         MulticastDelegate is not allowed.
7082
7083         * typemanager.cs: Add new types to lookup: System.TypedReference
7084         and ArgIterator.
7085
7086         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7087         check for TypedReference or ArgIterator, they are not allowed. 
7088
7089         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7090         makes us properly catch 1510 in some conditions (see bug 56016 for
7091         details). 
7092
7093 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7094
7095         * CryptoConvert.cs: update from corlib version
7096         with endian fixes.
7097
7098 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7099
7100         * class.cs (Indexer.Define): Check indexername declaration
7101
7102 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7103
7104         * attribute.cs (IsClsCompliant): Fixed problem with handling
7105         all three states (compliant, not-compliant, undetected).
7106
7107 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7108
7109         * attribute.cs (Attribute): Location is now public.
7110         (Resolve): Store resolved arguments (pos_values) in attribute class.
7111         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7112         (GetClsCompliantAttributeValue): New method that gets
7113         CLSCompliantAttribute value.
7114         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7115         if exists else null.
7116         (AttributeTester): New class for CLS-Compliant verification routines.
7117
7118         * class.cs (Emit): Add CLS-Compliant verification.
7119         (Method.GetSignatureForError): Implemented.
7120         (Constructor.GetSignatureForError): Implemented
7121         (Constructor.HasCompliantArgs): Returns if constructor has
7122         CLS-Compliant arguments.
7123         (Constructor.Emit): Override.
7124         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7125         is needed to test only parameters.
7126         (FieldBase.GetSignatureForError): Implemented.
7127         (TypeContainer): New member for storing base interfaces.
7128         (TypeContainer.FindMembers): Search in base interfaces too.
7129
7130         * codegen.cs (GetClsComplianceAttribute): New method that gets
7131         assembly or module CLSCompliantAttribute value.
7132         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7133         for assembly.
7134         (ModuleClass.Emit): Add error 3012 test.
7135
7136         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7137
7138         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7139         state for all decl types.
7140         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7141         if CLS-Compliant tests are required.
7142         (IsClsCompliaceRequired): New method. Analyze whether code
7143         must be CLS-Compliant.
7144         (IsExposedFromAssembly): New method. Returns true when MemberCore
7145         is exposed from assembly.
7146         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7147         value or gets cached value.
7148         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7149         is explicitly marked with CLSCompliantAttribute.
7150         (IsIdentifierClsCompliant): New abstract method. This method is
7151         used to testing error 3005.
7152         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7153         for identifier and parameters CLS-Compliant testing.
7154         (VerifyClsCompliance): New method. The main virtual method for
7155         CLS-Compliant verifications.
7156         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7157         null. I don't know why is null (too many public members !).
7158         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7159         and get value of first CLSCompliantAttribute that found.
7160
7161         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7162         (VerifyClsCompliance): Override and add extra tests.
7163
7164         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7165         clscheck- disable CLS-Compliant verification event if assembly is has
7166         CLSCompliantAttribute(true).
7167
7168         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7169         ApllyAttribute is now called in emit section as in the other cases.
7170         Possible future Emit integration.
7171         (IsIdentifierClsCompliant): New override.
7172         (VerifyClsCompliance): New override.
7173         (GetEnumeratorName): Returns full enum name.
7174
7175         * parameter.cs (GetSignatureForError): Implemented.
7176
7177         * report.cs (WarningData): New struct for Warning message information.
7178         (LocationOfPreviousError): New method.
7179         (Warning): New method. Reports warning based on the warning table.
7180         (Error_T): New method. Reports error based on the error table.
7181
7182         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7183         verifications are done here.
7184
7185         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7186
7187         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7188         CLSCompliantAttribute.
7189         (all_imported_types): New member holds all imported types from other
7190         assemblies.
7191         (LoadAllImportedTypes): New method fills static table with exported types
7192         from all referenced assemblies.
7193         (Modules): New property returns all assembly modules.
7194
7195 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7196
7197         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7198         throwing a parser error.
7199
7200         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7201         which removes the hardcoded get_/set_ prefixes for properties, as
7202         IL allows for the properties to be named something else.  
7203
7204         Bug #56013
7205
7206         * expression.cs: Do not override operand before we know if it is
7207         non-null.  Fix 56207
7208
7209 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7210
7211         * typemanager.cs: support for pinned variables.
7212
7213 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7214
7215         * decl.cs, typemanager.cs: Avoid using an arraylist
7216         as a buffer if there is only one result set.
7217
7218 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7219
7220         * expression.cs: Make sure you cant call a static method
7221         with an instance expression, bug #56174.
7222
7223 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7224
7225         * class.cs (IsDuplicateImplementation): Improve error reporting to
7226         flag 663 (method only differs in parameter modifier).
7227
7228         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7229         in preprocessor directives.
7230
7231         * location.cs (LookupFile): Allow for the empty path.
7232
7233         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7234         better approach for some of that patch, but its failing with the
7235         CharSet enumeration.  For now try/catch will do.
7236
7237         * typemanager.cs: Do not crash if a struct does not have fields.
7238         Fixes 56150.
7239
7240 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7241
7242         * expression.cs: cs0213, cant fix a fixed expression.
7243         fixes 50231.
7244
7245 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7246
7247         * cs-parser.jay: detect invalid embeded statements gracefully.
7248         bug #51113.
7249
7250 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7251
7252         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7253         As a regex:
7254         s/
7255         the invocation type may not be a subclass of the tye of the item/
7256         The type of the item must be a subclass of the invocation item.
7257         /g
7258
7259         Fixes bug #50820.
7260
7261 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7262
7263         * attribute.cs: Added methods to get a string and a bool from an
7264         attribute. Required to information from AssemblyKeyFileAttribute,
7265         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7266         * codegen.cs: Modified AssemblyName creation to include support for
7267         strongnames. Catch additional exceptions to report them as CS1548.
7268         * compiler.csproj: Updated include CryptoConvert.cs.
7269         * compiler.csproj.user: Removed file - user specific configuration.
7270         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7271         Mono.Security assembly. The original class is maintained and tested in
7272         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7273         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7274         like CSC 8.0 (C# v2) supports.
7275         * Makefile: Added CryptoConvert.cs to mcs sources.
7276         * rootcontext.cs: Added new options for strongnames.
7277
7278 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7279
7280         * driver.cs: For --expect-error, report error code `2'
7281         if the program compiled with no errors, error code `1' if
7282         it compiled with an error other than the one expected.
7283
7284 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7285
7286         * compiler.csproj: Updated for Visual Studio .NET 2003.
7287         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7288         * compiler.sln: Updated for Visual Studio .NET 2003.
7289
7290 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7291
7292         * expression.cs: Fix bug #47234. We basically need to apply the
7293         rule that we prefer the conversion of null to a reference type
7294         when faced with a conversion to 'object' (csc behaviour).
7295
7296 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7297
7298         * statement.cs: Shorter form for foreach, eliminates
7299         a local variable. r=Martin.
7300
7301 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7302
7303         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7304         checks if we can use brtrue/brfalse to test for 0.
7305         * expression.cs: use the above in the test for using brtrue/brfalse.
7306         cleanup code a bit.
7307
7308 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7309
7310         * expression.cs: Rewrite string concat stuff. Benefits:
7311
7312         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7313         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7314         rather than a concat chain.
7315
7316         * typemanager.cs: Add lookups for more concat overloads.
7317
7318 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7319
7320         * expression.cs: Emit shorter il code for array init.
7321
7322         newarr
7323         dup
7324         // set 1
7325
7326         // set 2
7327
7328         newarr
7329         stloc.x
7330
7331         ldloc.x
7332         // set 1
7333
7334         ldloc.x
7335         // set 2
7336
7337 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7338
7339         * statement.cs: Before, two switch blocks would be merged if the
7340         total size of the blocks (end_item - begin_item + 1) was less than
7341         two times the combined sizes of the blocks.
7342
7343         Now, it will only merge if after the merge at least half of the
7344         slots are filled.
7345
7346         fixes 55885.
7347
7348 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7349
7350         * class.cs : csc build fix for GetMethods(). See bug #52503.
7351
7352 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7353
7354         * expression.cs: Make sure fp comparisons work with NaN.
7355         This fixes bug #54303. Mig approved this patch a long
7356         time ago, but we were not able to test b/c the runtime
7357         had a related bug.
7358
7359 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7360
7361         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7362
7363 2004-03-19  Martin Baulig  <martin@ximian.com>
7364
7365         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7366         error here and not in our caller.
7367
7368 2004-03-19  Martin Baulig  <martin@ximian.com>
7369
7370         * interface.cs: Completely killed this file.
7371         (Interface): We're now a TypeContainer and live in class.cs.
7372
7373         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7374         argument; we're now also called for interfaces.
7375         (TypeContainer.DefineMembers): Allow this method being called
7376         multiple times.
7377         (TypeContainer.GetMethods): New public method; formerly known as
7378         Interface.GetMethod().  This is used by PendingImplementation.
7379         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7380         it's now private and non-static.
7381         (Interface): Moved this here; it's now implemented similar to
7382         Class and Struct.
7383         (Method, Property, Event, Indexer): Added `bool is_interface'
7384         argument to their .ctor's.
7385         (MemberBase.IsInterface): New public field.
7386
7387         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7388         instances instead of InterfaceMethod, InterfaceProperty, etc.
7389         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7390         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7391
7392 2004-03-19  Martin Baulig  <martin@ximian.com>
7393
7394         * class.cs (MethodCore.IsDuplicateImplementation): New private
7395         method which does the CS0111 checking.
7396         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7397         Use IsDuplicateImplementation().
7398
7399 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7400
7401         * decl.cs (FindMemberToOverride): New method to find the correct
7402         method or property to override in the base class.
7403         * class.cs
7404             - Make Method/Property use the above method to find the
7405               version in the base class.
7406             - Remove the InheritableMemberSignatureCompare as it is now
7407               dead code.
7408
7409         This patch makes large code bases much faster to compile, as it is
7410         O(n) rather than O(n^2) to do this validation.
7411
7412         Also, it fixes bug 52458 which is that nested classes are not
7413         taken into account when finding the base class member.
7414
7415         Reviewed/Approved by Martin.
7416
7417 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7418
7419         * interface.cs: In all interface classes removed redundant
7420         member initialization.
7421
7422 2004-03-16  Martin Baulig  <martin@ximian.com>
7423
7424         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7425
7426 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7427
7428         * decl.cs (DefineTypeAndParents): New helper method to define a
7429         type's containers before the type itself is defined;  This is a
7430         bug exposed by the recent changes to Windows.Forms when an
7431         implemented interface was defined inside a class that had not been
7432         built yet.   
7433
7434         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7435
7436         (Check): Loop correctly to report errors modifiers
7437         (UNSAFE was not in the loop, since it was the same as TOP).
7438
7439         * interface.cs: Every interface member now takes a ModFlags,
7440         instead of a "is_new" bool, which we set on the base MemberCore. 
7441
7442         Every place where we called "UnsafeOk" in the interface, now we
7443         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7444         the unsafe settings from the member declaration instead of the
7445         container interface. 
7446
7447         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7448
7449         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7450         `set_indexer_name' to the pending bits (one per type).
7451
7452         We fixed a bug today that was picking the wrong method to
7453         override, since for properties the existing InterfaceMethod code
7454         basically ignored the method name.  Now we make sure that the
7455         method name is one of the valid indexer names.
7456
7457 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7458  
7459         * support.cs (SeekableStreamReader): Keep track of stream byte
7460         positions and don't mix them with character offsets to the buffer.
7461
7462         Patch from Gustavo Giráldez
7463
7464 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7465
7466         * interface.cs (InterfaceSetGetBase): Removed double member
7467         initialization, base class does it as well.
7468
7469 2004-03-13  Martin Baulig  <martin@ximian.com>
7470
7471         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7472         when compiling corlib.
7473
7474 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7475
7476         * convert.cs (ExplicitConversion): We were reporting an error on
7477         certain conversions (object_type source to a value type, when the
7478         expression was `null') before we had a chance to pass it through
7479         the user defined conversions.
7480
7481         * driver.cs: Replace / and \ in resource specifications to dots.
7482         Fixes 50752
7483
7484         * class.cs: Add check for duplicate operators.  Fixes 52477
7485
7486 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7487
7488         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7489         that are in the middle of the statements, not only at the end.
7490         Fixes #54987
7491
7492         * class.cs (TypeContainer.AddField): No longer set the
7493         `HaveStaticConstructor' flag, now we call it
7494         `UserDefineStaticConstructor' to diferentiate the slightly
7495         semantic difference.
7496
7497         The situation is that we were not adding BeforeFieldInit (from
7498         Modifiers.TypeAttr) to classes that could have it.
7499         BeforeFieldInit should be set to classes that have no static
7500         constructor. 
7501
7502         See:
7503
7504         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7505
7506         And most importantly Zoltan's comment:
7507
7508         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7509
7510         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7511          before its static fields are used', i.e. initialization does not need
7512          to be triggered by the first access to the type. Setting this flag
7513          helps the JIT to compile better code, since it can run the static
7514          constructor at JIT time, and does not need to generate code to call it
7515          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7516          this flag for lots of classes like String. 
7517          
7518          csc sets this flag if the type does not have an explicit static 
7519          constructor. The reasoning seems to be that if there are only static
7520          initalizers for a type, and no static constructor, then the programmer
7521          does not care when this initialization happens, so beforefieldinit
7522          can be used.
7523          
7524          This bug prevents the AOT compiler from being usable, since it 
7525          generates so many calls to mono_runtime_class_init that the AOT code
7526          is much slower than the JITted code. The JITted code is faster, 
7527          because it does not generate these calls if the vtable is type is
7528          already initialized, which is true in the majority of cases. But the
7529          AOT compiler can't do this."
7530
7531 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7532
7533         * class.cs (MethodData.Emit): Refactor the code so symbolic
7534         information is generated for destructors;  For some reasons we
7535         were taking a code path that did not generate symbolic information
7536         before. 
7537
7538 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7539
7540         * class.cs: Create a Constructor.CheckBase method that
7541         takes care of all validation type code. The method
7542         contains some code that was moved from Define.
7543
7544         It also includes new code that checks for duplicate ctors.
7545         This fixes bug #55148.
7546
7547 2004-03-09  Joshua Tauberer <tauberer@for.net>
7548
7549         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7550         a { ... }-style array creation invokes EmitStaticInitializers
7551         which is not good for reference-type arrays.  String, decimal
7552         and now null constants (NullCast) are not counted toward
7553         static initializers.
7554
7555 2004-03-05  Martin Baulig  <martin@ximian.com>
7556
7557         * location.cs (SourceFile.HasLineDirective): New public field;
7558         specifies whether the file contains or is referenced by a "#line"
7559         directive.
7560         (Location.DefineSymbolDocuments): Ignore source files which
7561         either contain or are referenced by a "#line" directive.        
7562
7563 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7564
7565         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7566         direct access to our parent, so check the method inline there.
7567
7568 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7569
7570         * expression.cs (Invocation.EmitCall): Miguel's last commit
7571         caused a regression. If you had:
7572
7573             T t = null;
7574             t.Foo ();
7575
7576         In Foo the implict this would be null.
7577
7578 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7579
7580         * expression.cs (Invocation.EmitCall): If the method is not
7581         virtual, do not emit a CallVirt to it, use Call.
7582
7583         * typemanager.cs (GetFullNameSignature): Improve the method to
7584         cope with ".ctor" and replace it with the type name.
7585
7586         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7587         as an argument the ConstructorBuilder where it is being defined,
7588         to catch the recursive constructor invocations.
7589
7590 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7591
7592         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7593         routines to check if a type is an enumerable/enumerator allow
7594         classes that implement the IEnumerable or IEnumerator interfaces.
7595
7596         * class.cs (Property, Operator): Implement IIteratorContainer, and
7597         implement SetYields.
7598
7599         (Property.Define): Do the block swapping for get_methods in the
7600         context of iterators.   We need to check if Properties also
7601         include indexers or not.
7602
7603         (Operator): Assign the Block before invoking the
7604         OperatorMethod.Define, so we can trigger the Iterator code
7605         replacement. 
7606
7607         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7608         Property and Operator classes are not created when we parse the
7609         declarator but until we have the block completed, so we use a
7610         singleton SimpleIteratorContainer.Simple to flag whether the
7611         SetYields has been invoked.
7612
7613         We propagate this setting then to the Property or the Operator to
7614         allow the `yield' to function.
7615
7616 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7617
7618         * codegen.cs: Implemented attribute support for modules.
7619         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7620         Assembly/Module functionality.
7621
7622         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7623         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7624         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7625
7626 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7627
7628         * interface.cs (FindMembers): The operation is performed on all base
7629         interfaces and not only on the first. It is required for future CLS Compliance patch.
7630
7631 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7632
7633         * statement.cs, codegen.cs:
7634         This patch deals with patterns such as:
7635
7636         public class List : IEnumerable {
7637
7638                 public MyEnumerator GetEnumerator () {
7639                         return new MyEnumerator(this);
7640                 }
7641
7642                 IEnumerator IEnumerable.GetEnumerator () {
7643                         ...
7644                 }
7645                 
7646                 public struct MyEnumerator : IEnumerator {
7647                         ...
7648                 }
7649         }
7650
7651         Before, there were a few things we did wrong:
7652         1) we would emit callvirt on a struct, which is illegal
7653         2) we emited ldarg when we needed to emit ldarga
7654         3) we would mistakenly call the interface methods on an enumerator
7655         type that derived from IEnumerator and was in another assembly. For example:
7656
7657         public class MyEnumerator : IEnumerator
7658
7659         Would have the interface methods called, even if there were public impls of the
7660         method. In a struct, this lead to invalid IL code.
7661
7662 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7663
7664         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7665           renamed to Emit.
7666
7667         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7668
7669 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7670
7671         * cs-parser.jay: Fix small regression: we were not testing V2
7672         compiler features correctly.
7673
7674         * interface.cs: If the emit context is null, then create one
7675
7676 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7677
7678         * decl.cs (GetSignatureForError): New virtual method to get full name
7679           for error messages.
7680
7681         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7682           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7683
7684         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7685           Duplicated members and code in these classes has been removed.
7686           Better encapsulation in these classes.
7687
7688 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7689
7690         * assign.cs (Assign.DoResolve): When dealing with compound
7691         assignments, there is a new rule in ECMA C# 2.4 (might have been
7692         there before, but it is documented here) that states that in:
7693
7694         a op= b;
7695
7696         If b is of type int, and the `op' is a shift-operator, then the
7697         above is evaluated as:
7698
7699         a = (int) a op b 
7700
7701         * expression.cs (Binary.ResolveOperator): Instead of testing for
7702         int/uint/long/ulong, try to implicitly convert to any of those
7703         types and use that in pointer arithmetic.
7704
7705         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7706         method to print information for from the type, not from the
7707         null-method we were given.
7708
7709 2004-02-01  Duncan Mak  <duncan@ximian.com>
7710
7711         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7712         parsing for cmd, fixes bug #53694.
7713
7714 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7715
7716         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7717         in the member name duplication tests. Property and operator name duplication
7718         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7719
7720 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7721
7722         * interface.cs (PopulateMethod): Fixed crash when interface method
7723         returns not existing type (error test cs0246-3.cs).
7724
7725 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7726
7727         * cs-parser.jay (interface_accessors): Re-write actions to also
7728         store attributes attached to get and set methods. Fix spelling
7729         while at it.
7730
7731         (inteface_property_declaration): Modify accordingly.
7732
7733         (InterfaceAccessorInfo): New helper class to store information to pass
7734         around between rules that use interface_accessors.
7735
7736         * interface.cs (Emit): Apply attributes on the get and set
7737         accessors of properties and indexers too.
7738
7739         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7740         right MethodBuilder when applying attributes to the get and set accessors.
7741
7742 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7743
7744         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7745
7746 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7747
7748         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7749
7750 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7751
7752         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7753         changes that treat `yield' specially when present before `break'
7754         or `return' tokens.
7755
7756         * cs-tokenizer.cs: yield is no longer a keyword.
7757
7758 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7759
7760         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7761         setting for default constructors.
7762         For default constructors are almost every time set wrong Modifier. The
7763         generated IL code has been alright. But inside mcs this values was
7764         wrong and this was reason why several of my CLS Compliance tests
7765         failed.
7766
7767 2004-01-22  Martin Baulig  <martin@ximian.com>
7768
7769         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7770         not a QualifiedIdentifier.  This is what `type_name_expression'
7771         was previously doing.
7772         (type_name_expression): Removed; the code is now in
7773         `namespace_or_type_name'.
7774         (qualified_identifier): Removed, use `namespace_or_type_name'
7775         instead.
7776         (QualifiedIdentifier): Removed this class.      
7777
7778 2004-01-22  Martin Baulig  <martin@ximian.com>
7779
7780         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7781         not a string as alias name.
7782
7783 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7784
7785         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7786         #52730 bug, and instead compute correctly the need to use a
7787         temporary variable when requesting an address based on the
7788         static/instace modified of the field and the constructor.
7789  
7790 2004-01-21  Martin Baulig  <martin@ximian.com>
7791
7792         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7793         class and namespace before looking up aliases.  Fixes #52517.
7794
7795 2004-01-21  Martin Baulig  <martin@ximian.com>
7796
7797         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7798         assinged in a 'try'; fixes exception4.cs.
7799
7800 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7801         * class.cs : Implemented parameter-less constructor for TypeContainer
7802
7803         * decl.cs: Attributes are now stored here. New property OptAttributes
7804
7805         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7806
7807         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7808
7809 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7810
7811         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7812           (CSharpSignature): New method for indexer and property signature.
7813
7814 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7815
7816         * pending.cs (IsVirtualFilter): Faster implementation.
7817
7818 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7819
7820         * typemanager.cs: Avoid inclusion of same assembly more than once.
7821
7822 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7823
7824         * cs-parser.jay: Fixed problem where the last assembly attribute
7825           has been applied also to following declaration (class, struct, etc.)
7826           
7827 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7828
7829         * class.cs: Added error CS0538, CS0539 reporting.
7830         Fixed crash on Microsoft runtime when field type is void.
7831
7832         * cs-parser.jay: Added error CS0537 reporting.
7833
7834         * pending.cs: Added error CS0535 reporting.
7835         Improved error report for errors CS0536, CS0534.
7836
7837 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7838
7839         Merge a few bits from the Anonymous Method MCS tree.
7840
7841         * statement.cs (ToplevelBlock): New class for toplevel methods,
7842         will hold anonymous methods, lifted variables.
7843
7844         * cs-parser.jay: Create toplevel blocks for delegates and for
7845         regular blocks of code. 
7846
7847 2004-01-20  Martin Baulig  <martin@ximian.com>
7848
7849         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7850         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7851         and `NeedExplicitReturn'; added `IsLastStatement'.
7852         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7853         have a `ReturnLabel' or we're not unreachable.
7854
7855         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7856         child's reachability; don't just override ours with it.  Fixes
7857         #58058 (lluis's example).
7858         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7859         InFinally(), InLoop(), InSwitch() and
7860         BreakCrossesTryCatchBoundary() methods.
7861
7862         * statement.cs (Return): Do all error checking in Resolve().
7863         Unless we are the last statement in a top-level block, always
7864         create a return label and jump to it.
7865         (Break, Continue): Do all error checking in Resolve(); also make
7866         sure we aren't leaving a `finally'.
7867         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7868         statement in a top-level block.
7869         (Block.Flags): Added `IsDestructor'.
7870         (Block.IsDestructor): New public property.
7871
7872 2004-01-20  Martin Baulig  <martin@ximian.com>
7873
7874         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7875
7876 2004-01-20  Martin Baulig  <martin@ximian.com>
7877
7878         * statement.cs (Statement.ResolveUnreachable): New public method.
7879         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7880         (Block.Resolve): Resolve unreachable statements.
7881
7882 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7883
7884         * expression.cs: We need to fix the case where we do
7885         not have a temp variable here.
7886
7887         * assign.cs: Only expression compound assignments need
7888         temporary variables.
7889
7890 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7891
7892         * flowanalysis.cs: Reduce memory allocation in a few ways:
7893           - A block with no variables should not allocate a bit
7894             vector for itself.
7895           - A method with no out parameters does not need any tracking
7896             for assignment of the parameters, so we need not allocate
7897             any data for it.
7898           - The arrays:
7899                 public readonly Type[] VariableTypes;
7900                 public readonly string[] VariableNames;
7901             Are redundant. The data is already stored in the variable
7902             map, so we need not allocate another array for it.
7903           - We need to add alot of checks for if (params | locals) == null
7904             due to the first two changes.
7905
7906 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7907
7908         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7909         implement IMemoryLocation, we store a copy on a local variable and
7910         take the address of it.  Patch from Benjamin Jemlich
7911
7912         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7913         to use a special "type_name_expression" rule which reduces the
7914         number of "QualifiedIdentifier" classes created, and instead
7915         directly creates MemberAccess expressions.
7916
7917 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7918
7919         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7920         that fixes #52853.  Null literal assignment to ValueType
7921
7922         * class.cs (MethodData.Emit): Instead of checking the name of the
7923         method to determine if its a destructor, create a new derived
7924         class from Method called Destructor, and test for that.  
7925
7926         * cs-parser.jay: Create a Destructor object instead of a Method.  
7927
7928         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7929
7930         Fixes: 52933
7931
7932 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7933
7934         * expression.cs (Binary.ResolveOperator): Perform an implicit
7935         conversion from MethodGroups to their delegate types on the
7936         Addition operation.
7937
7938         * delegate.cs: Introduce a new class DelegateCreation that is the
7939         base class for `NewDelegate' and `ImplicitDelegateCreation',
7940         factor some code in here.
7941
7942         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7943         conversion from MethodGroups to compatible delegate types. 
7944
7945         * ecore.cs (Expression.Resolve): Do not flag error 654
7946         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7947         we allow conversions from MethodGroups to delegate types now.
7948
7949         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7950         assignments in v2 either.
7951
7952 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7953
7954         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7955         static read-only fields in ctors.
7956
7957         Applied patch from Benjamin Jemlich 
7958
7959         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7960
7961 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7962
7963         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7964         here to return true, as they can be used like this:
7965
7966                 (XXX) int.MEMBER ()
7967
7968         Fixed 49836 and all the other dups
7969
7970 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7971
7972         * driver.cs: Implement /win32res and /win32icon.
7973
7974 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7975
7976         * cs-parser.jay: Add a rule to improve error handling for the
7977         common mistake of placing modifiers after the type.
7978
7979 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7980
7981         * cs-parser.jay (interface_event_declaration): Catch
7982         initialization of events on interfaces, and report cs0068
7983
7984         * cs-parser.jay (interface_event_declaration): Catch
7985         initialization of events. 
7986
7987         * ecore.cs: Better report missing constructors.
7988
7989         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7990         the error reporting done in the wrong place.  Fix.
7991
7992         * expression.cs (Binary.ResolveOperator): Catch the 
7993         operator + (E x, E y) error earlier, and later allow for implicit
7994         conversions in operator +/- (E e, U x) from U to the underlying
7995         type of E.
7996
7997         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7998         52596, if the container class is abstract, the default constructor
7999         is protected otherwise its public (before, we were always public).
8000
8001         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8002         fixed statement.
8003
8004         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8005         Jemlich that fixes bug #52597, MCS was generating invalid code for
8006         idisposable structs.   Thanks to Ben for following up with this
8007         bug as well.
8008
8009 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8010
8011         * driver.cs: Allow assemblies without code to be generated, fixes
8012         52230.
8013
8014 2004-01-07  Nick Drochak <ndrochak@gol.com>
8015
8016         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8017
8018 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8019
8020         * cs-parser.jay: Add rules to improve error reporting if fields or
8021         methods are declared at the namespace level (error 116)
8022
8023         * Add rules to catch event add/remove
8024
8025 2004-01-04  David Sheldon <dave-mono@earth.li>
8026
8027   * expression.cs: Added matching ")" to error message for 
8028   CS0077
8029
8030 2004-01-03 Todd Berman <tberman@gentoo.org>
8031
8032         * ecore.cs, attribute.cs:
8033         Applying fix from #52429.
8034
8035 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8036
8037         * ecore.cs, expression.cs, statement.cs:
8038         Total rewrite of how we handle branching. We
8039         now handle complex boolean expressions with fewer
8040         jumps. As well if (x == 0) no longer emits a ceq.
8041
8042         if (x is Foo) is much faster now, because we generate
8043         better code.
8044
8045         Overall, we get a pretty big improvement on our benchmark
8046         tests. The code we generate is smaller and more readable.
8047
8048         I did a full two-stage bootstrap. The patch was reviewed
8049         by Martin and Miguel.
8050
8051 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8052
8053         * cs-parser.jay: Make primary_expression not take a QI.
8054         we dont need this because the member_access rule covers
8055         us here. So we replace the rule with just IDENTIFIER.
8056
8057         This has two good effects. First, we remove a s/r conflict.
8058         Second, we allocate many fewer QualifiedIdentifier objects.
8059
8060 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8061
8062         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8063         set the correct information via SRE. This prevents
8064         hanging on the MS runtime. Fixes #29374.
8065
8066 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8067
8068         * convert.cs: correctly handle conversions to value types
8069         from Enum and ValueType as unboxing conversions.
8070
8071         Fixes bug #52569. Patch by Benjamin Jemlich.
8072
8073 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8074
8075         * expression.cs (BetterConversion): Prefer int -> uint
8076         over int -> ulong (csc's behaviour). This fixed bug #52046.
8077
8078 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8079
8080         * decl.cs (MemberCache.FindMembers): now returns a
8081         MemberInfo [].
8082
8083         * typemanager.cs: In general, go with with ^^.
8084         (CopyNewMethods): take an IList.
8085         (RealMemberLookup): Only allocate an arraylist
8086         if we copy from two sets of methods.
8087
8088         This change basically does two things:
8089         1) Fewer array lists allocated due to CopyNewMethods.
8090         2) the explicit cast in MemberList costed ALOT.
8091
8092 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8093
8094         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8095         a hashtable to avoid needless string allocations when an identifier is
8096         used more than once (the common case).
8097
8098 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8099
8100         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8101         is broken, it will not return anything. So, we
8102         have to use the information we have in mcs to
8103         do the task.
8104
8105         * typemanager.cs: Add a cache for GetInterfaces,
8106         since this will now be used more often (due to ^^)
8107
8108         (GetExplicitInterfaces) New method that gets the
8109         declared, not effective, interfaces on a type
8110         builder (eg, if you have interface IFoo, interface
8111         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8112         { IBar }.
8113
8114         This patch makes MCS able to bootstrap itself on
8115         Windows again.
8116
8117 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8118
8119         * expression.cs: Remove the Nop's that Miguel put
8120         in by mistake.
8121
8122 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8123
8124         * report.cs, codegen.cs: Give the real stack trace to
8125         the error when an exception is thrown.
8126
8127 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8128
8129         * decl.cs: only allocate hashtables for ifaces if 
8130         it is an iface!
8131
8132 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8133
8134         * expression.cs: fix the error from cs0121-2.cs
8135         (a parent interface has two child interfaces that
8136         have a function with the same name and 0 params
8137         and the function is called through the parent).
8138
8139 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8140
8141         * class.cs, rootcontext.cs, typmanager.cs: do not
8142         leak pointers.
8143
8144 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8145
8146         * codegen.cs: remove stack for the ec flow branching.
8147         It is already a linked list, so no need.
8148
8149 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8150
8151         * Makefile: Allow custom profiler here.
8152
8153 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8154
8155         * typemanager.cs (LookupType):
8156           - Use a static char [], because split takes
8157             a param array for args, so it was allocating
8158             every time.
8159           - Do not store true in a hashtable, it boxes.
8160
8161 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8162
8163         * flowanalysis.cs: bytify common enums.
8164
8165 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8166
8167         * modifiers.cs: Add a new set of flags for the
8168         flags allowed on explicit interface impls.
8169         * cs-parser.jay: catch the use of modifiers in
8170         interfaces correctly.
8171         * class.cs: catch private void IFoo.Blah ().
8172
8173         All related to bug #50572.
8174
8175 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8176
8177         * decl.cs: Rewrite the consistant accessability checking.
8178         Accessability is not linear, it must be implemented in
8179         a tableish way. Fixes #49704.
8180
8181 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8182
8183         * expression.cs: Handle negation in a checked context.
8184         We must use subtraction from zero. Fixes #38674.
8185
8186 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8187
8188         * class.cs: Ignore static void main in DLLs.
8189         * rootcontext.cs: Handle the target type here,
8190         since we are have to access it from class.cs
8191         * driver.cs: account for the above.
8192
8193 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8194
8195         * report.cs: Give line numbers and files if available.
8196
8197 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8198
8199         * driver.cs: Implement /addmodule.
8200
8201         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8202         ModuleBuilders.
8203
8204 2003-12-20  Martin Baulig  <martin@ximian.com>
8205
8206         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8207         (FieldBase.IsAssigned): Removed this field.
8208         (FieldBase.SetAssigned): New public method.
8209         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8210
8211 2003-12-20  Martin Baulig  <martin@ximian.com>
8212
8213         * expression.cs (LocalVariableReference.DoResolve): Don't set
8214         `vi.Used' if we're called from DoResolveLValue().
8215
8216         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8217         returns the usage vector it just merged into the current one -
8218         pass this one to UsageWarning().
8219         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8220         of the `EmitContext', don't call this recursively on our children.
8221
8222 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8223
8224         * driver.cs: Implement /target:module.
8225
8226 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8227
8228         * support.cs (CharArrayHashtable): New helper class.
8229
8230         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8231         char arrays, not strings, so we can avoid creating a string in
8232         consume_identifier if the identifier is a keyword.
8233
8234 2003-12-16  Martin Baulig  <martin@ximian.com>
8235
8236         * statement.cs (LocalInfo.Assigned): Removed this property.
8237         (LocalInfo.Flags): Removed `Assigned'.
8238         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8239         and uses flow analysis.
8240         (Block.UsageWarning): Made this method private.
8241         (Block.Resolve): Call UsageWarning() if appropriate.
8242
8243         * expression.cs (LocalVariableReference.DoResolve): Always set
8244         LocalInfo.Used here.
8245
8246 2003-12-13  Martin Baulig  <martin@ximian.com>
8247
8248         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8249         any value here; we're now using flow analysis to figure out
8250         whether a statement/block returns a value.
8251
8252 2003-12-13  Martin Baulig  <martin@ximian.com>
8253
8254         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8255         working again.
8256         (FlowBranching.MergeFinally): Don't call
8257         `branching.CheckOutParameters()' here, this is called in
8258         MergeTopBlock().
8259         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8260         when adding the `finally' vector.       
8261
8262 2003-12-13  Martin Baulig  <martin@ximian.com>
8263
8264         * flowanalysis.cs
8265         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8266         actually work and also fix #48962.
8267
8268 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8269
8270         * decl.cs: Do not check System.Object for nested types,
8271         since we know it does not have any. Big bang for buck:
8272
8273         BEFORE:
8274            Run 1:   8.35 seconds
8275            Run 2:   8.32 seconds
8276            corlib:  17.99 seconds
8277         AFTER:
8278            Run 1:   8.17 seconds
8279            Run 2:   8.17 seconds
8280            corlib:  17.39 seconds
8281
8282 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8283
8284         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8285         time we are returning 0 members, so we save alot here.
8286
8287 2003-12-11  Martin Baulig  <martin@ximian.com>
8288
8289         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8290         `MergeChild()', also just take the `FlowBranching' as argument;
8291         call Merge() on it and return the result.
8292         (FlowBranching.Merge): We don't need to do anything if we just
8293         have one sibling.
8294
8295 2003-12-11  Martin Baulig  <martin@ximian.com>
8296
8297         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8298         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8299         Maurer for this idea.
8300
8301 2003-12-11  Martin Baulig  <martin@ximian.com>
8302
8303         * flowanalysis.cs (MergeResult): This class is now gone; we now
8304         use the `UsageVector' for this.  The reason for this is that if a
8305         branching just has one sibling, we don't need to "merge" them at
8306         all - that's the next step to do.
8307         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8308         `MergeResult'.
8309
8310 2003-12-11  Martin Baulig  <martin@ximian.com>
8311
8312         Reworked flow analyis and made it more precise and bug-free.  The
8313         most important change is that we're now using a special `Reachability'
8314         class instead of having "magic" meanings of `FlowReturns'.  I'll
8315         do some more cleanups and optimizations and also add some more
8316         documentation this week.
8317
8318         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8319         largely reworked this class.
8320         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8321         the new `Reachability' class instead of having "magic" values here.
8322         (FlowBranching): We're now using an instance of `Reachability'
8323         instead of having separate `Returns', `Breaks' etc. fields.
8324
8325         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8326         based on flow analysis; ignore the return value of block.Emit ().
8327
8328 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8329
8330         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8331         if they are private.
8332
8333 2003-12-09  Martin Baulig  <martin@ximian.com>
8334
8335         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8336         call them directly on the UsageVector.
8337
8338 2003-12-09  Martin Baulig  <martin@ximian.com>
8339
8340         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8341         Changed return type from `FlowReturns' to `Reachability'.
8342
8343 2003-12-09  Martin Baulig  <martin@ximian.com>
8344
8345         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8346         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8347         `Reachable' fields with a single `Reachability' one.
8348
8349 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8350
8351         * class.cs (FindMembers): Remove foreach's.
8352
8353         Bootstrap times:
8354
8355         BEFORE
8356                 Run 1:   8.74 seconds
8357                 Run 2:   8.71 seconds
8358
8359         AFTER
8360                 Run 1:   8.64 seconds
8361                 Run 2:   8.58 seconds
8362
8363
8364 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8365
8366         * cs-parser.jay:
8367         * gen-treedump.cs:
8368         * statement.cs:
8369         This patch does a few things:
8370                 1. EmptyStatement is now a singleton, so it is never reallocated.
8371                 2. All blah is EmptyStatement constructs have been changed to
8372                    blah == EmptyStatement.Value, which is much faster and valid
8373                    now that EmptyStatement is a singleton.
8374                 3. When resolving a block, rather than allocating a new array for
8375                    the non-empty statements, empty statements are replaced with
8376                    EmptyStatement.Value
8377                 4. Some recursive functions have been made non-recursive.
8378         Mainly the performance impact is from (3), however (1) and (2) are needed for
8379         this to work. (4) does not make a big difference in normal situations, however
8380         it makes the profile look saner.
8381
8382         Bootstrap times:
8383
8384         BEFORE
8385         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8386         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8387         Total memory allocated: 56397 KB
8388
8389         AFTER
8390         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8391         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8392         Total memory allocated: 55666 KB
8393
8394 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8395
8396         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8397         than the hashtable in a hashtable version
8398
8399         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8400         we always end up concating a string. This results in a huge perf
8401         loss, because many strings have to be tracked by the GC. In this
8402         patch, we first use a hashtable that works with two keys, so that
8403         the strings do not need to be concat'ed.
8404
8405         Bootstrap times:
8406         BEFORE
8407                 Run 1:   8.74 seconds
8408                 Run 2:   8.71 seconds
8409
8410         AFTER
8411                 Run 1:   8.65 seconds
8412                 Run 2:   8.56 seconds
8413
8414 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8415
8416         * Makefile: Add a new target `do-time' that does a quick and simple
8417         profile, leaving easy to parse output.
8418
8419 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8420
8421         * codegen.cs (Init): Create the dynamic assembly with 
8422         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8423
8424 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8425
8426         * support.cs: Make the PtrHashtable use only one
8427         instance of its comparer.
8428
8429 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8430
8431         * typemanager.cs: Fix lookup of GetNamespaces.
8432
8433 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8434
8435         * expression.cs: Removed redundant line.
8436
8437         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8438         ArrayLists, use for loops with bounds.  
8439
8440         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8441         arraylist.
8442
8443         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8444         arraylists, use for loop with bounds.
8445
8446         The above three changes give us a 0.071 second performance
8447         improvement out of 3.294 seconds down to 3.223.  On my machine
8448         the above changes reduced the memory usage by 1,387 KB during
8449         compiler bootstrap.
8450
8451         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8452         QualifiedIdentifiers.  Before we created a new string through
8453         concatenation, and mostly later on, the result would be
8454         manipulated by DecomposeQI through string manipulation.
8455
8456         This reduced the compiler memory usage for bootstrapping from
8457         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8458         compile times in 0.05 seconds.
8459
8460 2003-11-28  Dick Porter  <dick@ximian.com>
8461
8462         * support.cs: Do string compares with the Invariant culture.
8463
8464         * rootcontext.cs: 
8465         * gen-treedump.cs: 
8466         * expression.cs: 
8467         * driver.cs: 
8468         * decl.cs: 
8469         * codegen.cs: 
8470         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8471         the comparison is done with the Invariant culture.
8472
8473 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8474
8475         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8476         GetEnumerator method.
8477
8478         (ProbeCollectionType): Iterate starting at the most specific type
8479         upwards looking for a GetEnumerator
8480
8481         * expression.cs: Shift count can be up to 31 for int/uint and 63
8482         for long/ulong.
8483
8484 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8485
8486         * statement.cs (Block.LookupLabel): Also look for the label on the
8487         children blocks.  Use a hash table to keep track of visited
8488         nodes. 
8489
8490         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8491         we actually did transform the other operand, otherwise fall back
8492         to the common codepath that casts to long.
8493
8494         * cs-tokenizer.cs: Use the same code pattern as the int case.
8495         Maybe I should do the parsing myself, and avoid depending on the
8496         Parse routines to get this done.
8497
8498 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8499
8500         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8501         which fixes bug 51347.  This time test it.
8502
8503         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8504         attributes for example can not tell the difference between these.
8505         The difference was only a syntax feature of the language. 
8506
8507         * attribute.cs: Apply attributes to delegates.
8508
8509         * delegate.cs: Call the apply attributes method.
8510
8511 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8512
8513         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8514         comparing 0 vs Byte.MinValue, not the value
8515
8516         (ImplicitConversionRequired): When reporting a conversion error,
8517         use error 31 to print out the constant error instead of the
8518         simpler 29.
8519
8520         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8521         which fixes bug 51347.
8522
8523 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8524
8525         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8526         which fixes the -warnaserror command line option.
8527
8528 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8529
8530         * cfold.cs (DoNumericPromotions): During constant folding of
8531         additions on UIntConstant, special case intconstants with
8532         IntConstants like we do on the expression binary operator. 
8533
8534 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8535
8536         * convert.cs (ImplicitReferenceConversion): We were missing a case
8537         (System.Enum are not value types or class types, so we need to
8538         classify them separatedly).
8539
8540         * driver.cs: We do not support error 2007.
8541
8542 2003-11-12 Jackson Harper <jackson@ximian.com>
8543
8544         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8545         system directory. Also use the full file name so users can
8546         libraries names mscorlib-o-tron.dll in a non system dir.
8547
8548 2003-11-10  Martin Baulig  <martin@ximian.com>
8549
8550         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8551         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8552         calling `ResolveType()' on them, directly assign their `Type'.
8553
8554 2003-11-08  Martin Baulig  <martin@ximian.com>
8555
8556         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8557         return value and the `out parent' parameter.
8558         (TypeContainer.DefineType): Moved the CS0644 check into
8559         GetClassBases().  Don't pass the interface types to the
8560         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8561         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8562
8563         * ecore.cs (TypeExpr.IsAttribute): New property.
8564         (TypeExpr.GetInterfaces): New method.
8565
8566         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8567         TypeExpr instead of a Type.
8568         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8569         (Interface.DefineType): Don't pass the interface types to the
8570         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8571         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8572
8573         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8574         instead of a `Type[]'.
8575         (TypeManager.RegisterBuilder): Likewise.
8576         (TypeManager.AddUserInterface): Likewise.
8577         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8578         `Type[]' and also return a `TypeExpr[]'.
8579         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8580
8581 2003-11-08  Martin Baulig  <martin@ximian.com>
8582
8583         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8584         Expression.     
8585
8586 2003-11-08  Martin Baulig  <martin@ximian.com>
8587
8588         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8589         TypeManager.ResolveExpressionTypes().
8590
8591         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8592         instead of an Expression.
8593         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8594         (TypeExpression): New public class; formerly known as `TypeExpr'.
8595
8596         * expression.cs (ComposedCast): Derive from TypeExpr.
8597
8598         * typemanager.cs (TypeManager.system_*_expr): These are now
8599         TypExpr's instead of Expression's.
8600         (TypeManager.ResolveExpressionTypes): New public static function;
8601         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8602         of them.        
8603
8604 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8605
8606         * expression.cs (New.DoResolve): Do not dereference value that
8607         might be a null return.
8608
8609         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8610         sure that the constant value has the right type.  Fixes an
8611         unreported bug, similar to 50425.
8612
8613         * const.cs (Const.LookupConstantValue): Call
8614         ImplicitStandardConversionExists before doing a conversion to
8615         avoid havng the TypeManager.ChangeType do conversions.
8616
8617         Reduced the number of casts used
8618
8619         (Const.ChangeType): New routine to enable reuse of the constant
8620         type changing code from statement.
8621
8622         * typemanager.cs (ChangeType): Move common initialization to
8623         static global variables.
8624
8625         Fixes #50425.
8626
8627         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8628         every value type to go through, even if it was void.  Fix that. 
8629
8630         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8631         character of the define, and the is_identifier_part_character for
8632         the rest of the string.
8633
8634 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8635
8636         * expression.cs (UnaryMutator.EmitCode): When I updated
8637         LocalVariableReference.DoResolve, I overdid it, and dropped an
8638         optimization done on local variable references.
8639
8640 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8641
8642         * ecore.cs: Convert the return from Ldlen into an int.
8643
8644 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8645
8646         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8647         the accessibility, this is a special case for toplevel non-public
8648         classes (internal for instance).
8649
8650 2003-10-20  Nick Drochak <ndrochak@gol.com>
8651
8652         * ecore.cs: Fix typo and build.  Needed another right paren.
8653
8654 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8655
8656         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8657         `internal' case regular and protected, but not allowing protected
8658         to be evaluated later.  Bug 49840
8659
8660 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8661
8662         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8663         to kb.Nlast, and not the kb.nFirst to isolate the switch
8664         statement.
8665
8666         Extract the underlying type, so enumerations of long/ulong are
8667         treated like long/ulong.
8668
8669 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8670
8671         * expression.cs (New): Overload the meaning of RequestedType to
8672         track the possible creation of the NewDelegate type, since
8673         DoResolve is invoked more than once for new constructors on field
8674         initialization.
8675
8676         See bugs: #48800 and #37014
8677
8678         * cs-parser.jay (declare_local_constants): Take an arraylist
8679         instead of a single constant.
8680
8681         (local_constant_declaration): It should take a
8682         constant_declarators, not a constant_declarator.  Fixes 49487
8683
8684         * convert.cs: Fix error report.
8685
8686 2003-10-13 Jackson Harper <jackson@ximian.com>
8687
8688         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8689         bug #49611
8690
8691 2003-10-09  Martin Baulig  <martin@ximian.com>
8692
8693         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8694         to the .ctor.
8695         (MethodCore.DoDefineParameters): Removed the TypeContainer
8696         argument; use the DeclSpace which was passed to the .ctor instead.
8697         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8698         TypeContainer; we only need a DeclSpace here.
8699
8700 2003-10-09  Martin Baulig  <martin@ximian.com>
8701
8702         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8703         to the .ctor.
8704         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8705         EmitContext's .ctor.    
8706
8707 2003-10-09  Martin Baulig  <martin@ximian.com>
8708
8709         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8710         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8711         AsAccessible(), moved them as well.
8712
8713         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8714
8715 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8716
8717         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8718
8719 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8720
8721         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8722         generation for >=, as spotted by Paolo, bug 48679.  
8723         Patch from David Waite.
8724
8725         * cs-tokenizer.cs: Add handling for #pragma.
8726
8727         * cs-parser.jay: Allow for both yield and yield return in the
8728         syntax.  The anti-cobolization of C# fight will go on!
8729
8730         * class.cs (TypeBuilder.DefineType): Catch error condition here
8731         (Parent.DefineType erroring out and returning null).
8732
8733         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8734         coping with enumerations variables, we were mistakenly processing
8735         them as a regular value type instead of built-in types.  Fixes the
8736         bug #48063
8737
8738         * typemanager.cs (IsBuiltinOrEnum): New method.
8739
8740 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8741
8742         * cs-parser.jay: Upgrade: yield now needs the return clause.
8743
8744 2003-09-19  Martin Baulig  <martin@ximian.com>
8745
8746         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8747         `MemberCache parent' argument.  Normally, an interface doesn't
8748         have a parent type except System.Object, but we use this in gmcs
8749         for generic type parameters.
8750
8751 2003-09-18  Martin Baulig  <martin@ximian.com>
8752
8753         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8754         on `type.IsInterface'; don't check whether the type has a parent
8755         to determine whether it's an interface.
8756
8757 2003-09-15  Martin Baulig  <martin@ximian.com>
8758
8759         * class.cs (TypeContainer.DefineType): Added an error flag to
8760         avoid reporting duplicate CS0146's ("class definition is
8761         circular.").
8762
8763         * driver.cs (Driver.MainDriver): Abort if
8764         RootContext.ResolveTree() reported any errors.
8765
8766 2003-09-07  Martin Baulig  <martin@ximian.com>
8767
8768         * report.cs (Error, Warning): Added overloaded versions which take
8769         a `params object[] args' and call String.Format().
8770
8771 2003-09-07  Martin Baulig  <martin@ximian.com>
8772
8773         * decl.cs (DeclSpace..ctor): Don't call
8774         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8775         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8776         (DeclSpace.RecordDecl): New method.
8777
8778         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8779
8780 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8781
8782         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8783         value attributes to be applied to ParameterBuilders.
8784
8785         * class.cs (MethodCore.LabelParameters): Make static and more
8786         generic so that it can be used from other places - like interface
8787         methods, for instance.
8788
8789         * interface.cs (Interface.Emit): Call LabelParameters before
8790         emitting attributes on the InterfaceMethod.
8791
8792 2003-08-26  Martin Baulig  <martin@ximian.com>
8793
8794         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8795         resolving aliases; fixes #47927.
8796
8797 2003-08-26  Martin Baulig  <martin@ximian.com>
8798
8799         * statement.cs (Using.DoResolve): This is internally emitting a
8800         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8801         do not always return.  Fixes #47681.
8802
8803 2003-08-26  Martin Baulig  <martin@ximian.com>
8804
8805         * decl.cs (MemberCore): Moved WarningNotHiding(),
8806         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8807         into MemberBase.
8808         (AdditionResult): Make this nested in DeclSpace.
8809         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8810         argument; call NamespaceEntry.Define() unless we're nested in a
8811         class or struct.
8812
8813         * namespace.cs (Namespace.DefineName): New public function.  This
8814         is called from DeclSpace's .ctor to add 
8815         (Namespace.Lookup): Include DeclSpaces in the lookup.
8816
8817         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8818
8819         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8820
8821 2003-08-25  Martin Baulig  <martin@ximian.com>
8822
8823         * convert.cs (Convert.ExplicitReferenceConversion): When
8824         converting from an interface type to a class, unbox if the target
8825         type is a struct type.  Fixes #47822.
8826
8827 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8828
8829         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8830         #47854.
8831
8832 2003-08-22  Martin Baulig  <martin@ximian.com>
8833
8834         * class.cs (TypeManager.DefineType): When defining a nested type,
8835         call DefineType() on our parent; fixes #47801.
8836
8837 2003-08-22  Martin Baulig  <martin@ximian.com>
8838
8839         * class.cs (MethodData.Define): While checking if a method is an
8840         interface implementation, improve the test a bit more to fix #47654.
8841
8842 2003-08-22  Martin Baulig  <martin@ximian.com>
8843
8844         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8845         correctly; fixes #47722.
8846
8847 2003-08-22  Martin Baulig  <martin@ximian.com>
8848
8849         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8850         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8851
8852         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8853
8854 2003-08-22  Martin Baulig  <martin@ximian.com>
8855
8856         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8857         can only be assigned in static constructors.  Fixes #47161.
8858
8859 2003-08-22  Martin Baulig  <martin@ximian.com>
8860
8861         Rewrote and improved the flow analysis code.
8862
8863         * flowbranching.cs (FlowBranching): Make this class abstract.
8864         (FlowBranching.CreateBranching): New static function to create a
8865         new flow branching.
8866         (FlowBranchingBlock, FlowBranchingException): New classes.
8867         (FlowBranching.UsageVector.Type): New public readonly field.
8868         (FlowBranching.UsageVector.Breaks): Removed the setter.
8869         (FlowBranching.UsageVector.Returns): Removed the setter.
8870         (FlowBranching.UsageVector): Added Break(), Return(),
8871         NeverReachable() and Throw() methods to modify the reachability.
8872         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8873         done by FlowBranching.Merge().
8874         (FlowBranching.UsageVector.MergeChild): New method; merges the
8875         merge result into the current vector.
8876         (FlowBranching.Merge): New abstract method to merge a branching.
8877
8878 2003-08-12  Martin Baulig  <martin@ximian.com>
8879
8880         * expression.cs (Indirection.CacheTemporaries): Create the
8881         LocalTemporary with the pointer type, not its element type.
8882
8883 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8884
8885         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8886         token was a keyword or not.
8887
8888         Add `error' options where an IDENTIFIER was expected;  Provide
8889         CheckToken and CheckIdentifierToken convenience error reporting
8890         functions. 
8891
8892         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8893
8894         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8895         NameSpaceEntry NameSpaceEntry.
8896
8897         (LookupInterfaceOrClass): Avoid creating a full qualified name
8898         from namespace and name: avoid doing lookups when we know the
8899         namespace is non-existant.   Use new Tree.LookupByNamespace which
8900         looks up DeclSpaces based on their namespace, name pair.
8901
8902         * driver.cs: Provide a new `parser verbose' to display the
8903         exception thrown during parsing.  This is turned off by default
8904         now, so the output of a failure from mcs is more graceful.
8905
8906         * namespace.cs: Track all the namespaces defined in a hashtable
8907         for quick lookup.
8908
8909         (IsNamespace): New method
8910
8911 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8912
8913         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8914         we know that we need to concatenate (full typename can never be
8915         null). 
8916
8917         * class.cs: ditto.
8918
8919         * statement.cs: Use a bitfield;  Do not initialize to null things
8920         which are done by the constructor by default.
8921
8922         * cs-parser.jay: bug fix, parameter was 4, not 3.
8923
8924         * expression.cs: Just use the property;
8925
8926         * statement.cs: No need for GetVariableInfo method.
8927
8928 2003-08-08  Martin Baulig  <martin@ximian.com>
8929
8930         * flowanalysis.cs (FlowReturns): This is now nested in the
8931         `FlowBranching' class.
8932         (MyBitVector): Moved this here from statement.cs.
8933         (FlowBranching.SiblingType): New enum type.
8934         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8935
8936 2003-08-07  Martin Baulig  <martin@ximian.com>
8937
8938         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8939         `FlowBranching' class and called `BranchingType'.
8940
8941 2003-08-07  Martin Baulig  <martin@ximian.com>
8942
8943         * flowanalysis.cs: Moved all the control flow analysis code into
8944         its own file.
8945
8946 2003-08-07  Martin Baulig  <martin@ximian.com>
8947
8948         * assign.cs (Assign.DoResolve): `target' must either be an
8949         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8950         #37319.
8951
8952 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8953
8954         * expression.cs (BinaryMethod): This kind of expression is created by the
8955         Binary class if it determines that the operator has to be handled
8956         by a method.
8957
8958         (BinaryDelegate): This kind of expression is created if we are
8959         dealing with a + or - operator on delegates.
8960
8961         (Binary): remove method, argumetns, and DelegateOperator: when
8962         dealing with methods, 
8963
8964         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8965
8966         * statement.cs (Block): use bitfields for the three extra booleans
8967         we had in use.   Remove unused topblock parameter.
8968
8969         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8970
8971         * assign.cs: Drop extra unneeded tests.
8972
8973 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8974
8975         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8976
8977         * statement.cs (Foreach): Use VariableStorage instead of
8978         LocalBuilders.   
8979
8980         * codegen.cs (VariableStorage): New class used by clients that
8981         require a variable stored: locals or fields for variables that
8982         need to live across yield.
8983
8984         Maybe provide a convenience api for EmitThis+EmitLoad?
8985
8986         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8987         these bad boys.
8988
8989 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8990
8991         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8992         RemapParameterLValue): New methods that are used to turn a
8993         precomputed FieldInfo into an expression like this:
8994
8995                 instance.FieldInfo
8996
8997         The idea is to use this instead of making LocalVariableReference
8998         have more than one meaning.
8999
9000         * cs-parser.jay: Add error production to BASE.
9001
9002         * ecore.cs: Deal with TypeManager.GetField returning null, which
9003         is now a valid return value.
9004
9005         (FieldExprNoAddress): New expression for Fields whose address can
9006         not be taken.
9007
9008         * expression.cs (LocalVariableReference): During the resolve
9009         phases, create new expressions if we are in a remapping context.
9010         Remove code that dealt with remapping here.
9011
9012         (ParameterReference): same.
9013
9014         (ProxyInstance): New expression, like the `This' expression, but
9015         it is born fully resolved.  We know what we are doing, so remove
9016         the errors that are targeted to user-provided uses of `this'.
9017
9018         * statement.cs (Foreach): our variable is now stored as an
9019         Expression;  During resolution, follow the protocol, dont just
9020         assume it will return this.
9021
9022 2003-08-06  Martin Baulig  <martin@ximian.com>
9023
9024         * support.cs (SeekableStreamReader.cs): New public class.
9025
9026         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9027         SeekableStreamReader instead of the normal StreamReader.
9028
9029 2003-08-04  Martin Baulig  <martin@ximian.com>
9030
9031         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9032         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9033         deambiguate casts and delegate invocations.
9034         (parenthesized_expression): Use the new tokens to ensure this is
9035         not a cast of method invocation.
9036
9037         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9038         when reading a `)' and Deambiguate_CloseParens () was previously
9039         called.
9040
9041         * expression.cs (ParenthesizedExpression): New class.  This is
9042         just used for the CS0075 test.
9043         (Binary.DoResolve): Check for CS0075.   
9044
9045 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9046
9047         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9048         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9049         reference comparison.
9050
9051         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9052         examine the ReturnType for equality - this is necessary in the
9053         cases of implicit and explicit operators whose signature also
9054         includes the return type.
9055
9056 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9057
9058         * namespace.cs: Cache the result of the namespace computation,
9059         instead of computing it every time.
9060
9061 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9062
9063         * decl.cs: Use a global arraylist that we reuse over invocations
9064         to avoid excesive memory consumption.  Reduces memory usage on an
9065         mcs compile by one meg (45 average).
9066
9067         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9068         private, work around that.
9069
9070 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9071
9072         * literal.cs (IntLiteral): Define Zero and One static literals. 
9073
9074         * cs-parser.jay (integer_literal): use static literals to reduce
9075         memory usage for the most used literals (0, 1 and -1).  211kb
9076         reduced in memory usage.
9077
9078         Replace all calls to `new ArrayList' with `new
9079         ArrayList(4)' which is a good average number for most allocations,
9080         and also requires only 16 bytes of memory for its buffer by
9081         default. 
9082
9083         This reduced MCS memory usage in seven megabytes for the RSS after
9084         bootstrapping.
9085
9086 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9087
9088         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9089         handle params methods the correct way by forming only one
9090         applicable set with params and normal methods in them. Earlier we
9091         were looking at params methods only if we found no normal methods
9092         which was not the correct thing to do.
9093
9094         (Invocation.BetterFunction): Take separate arguments indicating
9095         when candidate and the best method are params methods in their
9096         expanded form.
9097
9098         This fixes bugs #43367 and #46199.
9099
9100         * attribute.cs: Documentation updates.
9101
9102         (CheckAttribute): Rename to CheckAttributeTarget.
9103         (GetValidPlaces): Rename to GetValidTargets.
9104
9105         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9106         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9107
9108         Fixes bug #44468.
9109
9110 2003-07-28  Martin Baulig  <martin@ximian.com>
9111
9112         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9113         name when looking up the base class of a nested class.  Fixes #46977.
9114
9115 2003-07-26  Martin Baulig  <martin@ximian.com>
9116
9117         * expression.cs (Indexers.Indexer): New nested struct; contains
9118         getter, setter and the indexer's type.
9119         (Indexers.Properties): This is now an ArrayList of
9120         Indexers.Indexer's.
9121         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9122         indexer doesn't have any getters.
9123
9124         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9125         for embedded property and indexer assignments.
9126
9127 2003-07-26  Martin Baulig  <martin@ximian.com>
9128
9129         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9130         preprocessor directive is not the first non-whitespace character
9131         on a line.
9132
9133 2003-07-26  Martin Baulig  <martin@ximian.com>
9134
9135         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9136         namespace parsing, follow the spec more closely.
9137
9138         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9139         NamespaceEntry.Lookup().
9140
9141 2003-07-25  Martin Baulig  <martin@ximian.com>
9142
9143         * MethodCore.cs (OverridesSomething): New public field; it's set
9144         from TypeContainer.DefineMembers if this method overrides
9145         something (which doesn't need to be a method).  Fix #39462.
9146
9147 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9148
9149         * typemanager.cs (GetMembers): Ensure that the list of members is
9150         reversed. This keeps things in sync.
9151
9152         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9153         find an AttributeUsage attribute.
9154
9155         * expression.cs (Invocation.OverloadResolve): Perform the check
9156         which disallows Invoke to be directly called on a Delegate.
9157
9158         (Error_InvokeOnDelegate): Report error cs1533.
9159
9160 2003-07-25  Martin Baulig  <martin@ximian.com>
9161
9162         * expression.cs (Indexers.GetIndexersForType): Only look in the
9163         interface hierarchy if the requested type is already an
9164         interface.  Fixes #46788 while keeping #46502 fixed.
9165
9166 2003-07-25  Martin Baulig  <martin@ximian.com>
9167
9168         * class.cs (TypeContainer.DefineMembers): Check whether all
9169         readonly fields have been assigned and report warning CS0649 if
9170         not.
9171
9172         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9173         a valuetype.
9174
9175 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9176
9177         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9178         returned from GetMethods to make things consistent with the
9179         assumptions MCS makes about ordering of methods.
9180
9181         This should comprehensively fix bug #45127 and it does :-)
9182
9183         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9184         ordering is actually reverse.
9185
9186         * Clean up some debug messages I left lying around.
9187
9188         * interface.cs (Populate*): Get rid of code which emits attributes
9189         since the stage in which we emit attributes is the 'Emit' stage,
9190         not the define stage.
9191
9192         (Emit): Move attribute emission for interface members here.
9193
9194 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9195
9196         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9197         closely: we eliminate methods in base types when we have an
9198         applicable method in a top-level type.
9199
9200         Please see section 14.5.5.1 for an exact description of what goes
9201         on. 
9202
9203         This fixes bug #45127 and a host of other related to corlib compilation.
9204
9205         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9206         array is the method corresponding to the top-level type (this is
9207         because of the changes made to icall.c) so we change this
9208         accordingly.
9209
9210         (MethodGroupExpr.Name): This too.
9211
9212         * typemanager.cs (GetElementType): New method which does the right
9213         thing when compiling corlib. 
9214
9215         * everywhere: Make use of the above in the relevant places.
9216
9217 2003-07-22  Martin Baulig  <martin@ximian.com>
9218
9219         * cs-parser.jay (invocation_expression): Moved
9220         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9221         `cast_expression', but create a InvocationOrCast which later
9222         resolves to either an Invocation or a Cast.
9223
9224         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9225         method; call this before EmitStatement() to make sure that this
9226         expression can be used as a statement.
9227
9228         * expression.cs (InvocationOrCast): New class; resolves to either
9229         an Invocation or a Cast.
9230
9231         * statement.cs (StatementExpression): Call ResolveStatement() on
9232         the ExpressionStatement before emitting it.
9233
9234 2003-07-21  Martin Baulig  <martin@ximian.com>
9235
9236         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9237         `ref' and `out' attributes match; fixes #46220.
9238         (MemberAccess.ResolveMemberAccess): You can't reference a type
9239         through an expression; fixes #33180.
9240         (Indexers.GetIndexersForType): Don't return the indexers from
9241         interfaces the class implements; fixes #46502.
9242
9243 2003-07-21  Martin Baulig  <martin@ximian.com>
9244
9245         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9246         CS0661 checks; fixes bug #30442.
9247
9248 2003-07-21  Martin Baulig  <martin@ximian.com>
9249
9250         * decl.cs (AdditionResult): Added `Error'.
9251
9252         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9253
9254         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9255         makes cs0031.cs actually work.
9256
9257 2003-07-20  Martin Baulig  <martin@ximian.com>
9258
9259         * namespace.cs: Fixed that bug which caused a crash when compiling
9260         the debugger's GUI.
9261
9262 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9263
9264         * typemanager.cs (LookupTypeReflection): Never expose types which
9265         are NotPublic, NestedPrivate, NestedAssembly, or
9266         NestedFamANDAssem.  We used to return these, and later do a check
9267         that would report a meaningful error, but the problem is that we
9268         would not get the real match, if there was a name override.
9269
9270 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9271
9272         * namespace.cs (Namespace, Name): Do not compute the namespace
9273         name dynamically, compute it in the constructor.  This reduced
9274         memory usage by 1697 KB.
9275
9276         * driver.cs: Use --pause to pause at the end.
9277
9278 2003-07-17  Peter Williams  <peter@newton.cx>
9279
9280         * Makefile: Change the name of the test target so that it doesn't
9281         conflict with the recursive test target.
9282
9283 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9284
9285         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9286         AddressOf): Do not use EmitThis, that was wrong, use the actual
9287         this pointer.
9288
9289 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9290
9291         * class.cs (MethodData.Define): While checking if a method is an
9292         interface implementation, improve the test: If we are not public
9293         (use new test here: use the computed MethodAttributes directly,
9294         instead of the parsed modifier flags) check if the `implementing'
9295         method comes from an interface or not.
9296
9297         * pending.cs (VerifyPendingMethods): Slightly better error
9298         message.
9299
9300         * makefile: add test target that does the mcs bootstrap.
9301
9302 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9303
9304         * interface.cs (Define): Do nothing here since there are no
9305         members to populate etc. Move the attribute emission out of here
9306         since this was just totally the wrong place to put it. Attribute
9307         application happens during the 'Emit' phase, not in the 'Define'
9308         phase.
9309
9310         (Emit): Add this method and move the attribute emission here
9311
9312         * rootcontext.cs (EmitCode): Call the Emit method on interface
9313         types too.
9314
9315 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9316
9317         * expression.cs (OverloadResolve): Report error only if Location
9318         is not 'Null' which means that there was a probe going on.
9319
9320 2003-07-14  Martin Baulig  <martin@ximian.com>
9321
9322         * expression.cs (ConditionalLogicalOperator): New public class to
9323         implement user defined conditional logical operators.
9324         This is section 14.11.2 in the spec and bug #40505.
9325
9326 2003-07-14  Martin Baulig  <martin@ximian.com>
9327
9328         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9329
9330 2003-07-14  Martin Baulig  <martin@ximian.com>
9331
9332         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9333
9334         * ecore.cs (IVariable.VerifyFixed): New interface method.
9335
9336         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9337         operator, check whether the variable is actually fixed.  Fixes bug
9338         #36055.  Set a variable definitely assigned when taking its
9339         address as required by the spec.
9340
9341         * statement.cs (LocalInfo.IsFixed): New field.
9342         (LocalInfo.MakePinned): Set `IsFixed' to true.
9343
9344 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9345
9346         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9347         for .ctors, ensure that we only ask for members declared in the
9348         attribute type (BindingFlags.DeclaredOnly).
9349
9350         Fixes bug #43632.
9351
9352         * expression.cs (Error_WrongNumArguments): Report error 1501
9353         correctly the way CSC does.
9354
9355 2003-07-13  Martin Baulig  <martin@ximian.com>
9356
9357         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9358         lookup on the fully qualified name, to make things like "X.X" work
9359         where "X.X" is a fully qualified type name, but we also have a
9360         namespace "X" in the using list.  Fixes #41975.
9361
9362 2003-07-13  Martin Baulig  <martin@ximian.com>
9363
9364         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9365         function. If we're a CompoundAssign, we need to create an embedded
9366         CompoundAssign, not an embedded Assign.
9367         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9368         Fixes #45854.
9369
9370 2003-07-13  Martin Baulig  <martin@ximian.com>
9371
9372         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9373         work to fix bug #46088.
9374
9375 2003-07-13  Ravi Pratap <ravi@ximian.com>
9376
9377         * class.cs (Operator.Emit): Do not emit attributes here - it is
9378         taken care of by the Method class that we delegate too. This takes
9379         care of bug #45876.
9380
9381 2003-07-10  Martin Baulig  <martin@ximian.com>
9382
9383         * expression.cs (TypeOfVoid): New class.
9384         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9385
9386 2003-07-10  Martin Baulig  <martin@ximian.com>
9387
9388         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9389         bug #35957.
9390
9391 2003-07-10  Martin Baulig  <martin@ximian.com>
9392
9393         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9394         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9395
9396         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9397
9398         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9399
9400 2003-07-10  Martin Baulig  <martin@ximian.com>
9401
9402         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9403         of decimal.  Fixes #42850.
9404
9405         NOTE: I also fixed the created byte blob, but this doesn't work on
9406         the MS runtime and csc never produces any byte blobs for decimal
9407         arrays.
9408
9409 2003-07-10  Martin Baulig  <martin@ximian.com>
9410
9411         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9412         structs; fixes #32068.
9413         (Block.AddChildVariableNames): Fixed #44302.
9414
9415 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9416
9417         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9418
9419 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9420
9421         * attribute.cs: And this test is onger needed.
9422
9423 2003-07-08  Martin Baulig  <martin@ximian.com>
9424
9425         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9426         inaccessible types.  Fixes #36313.
9427
9428         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9429
9430         * namespace.cs (NamespaceEntry): Create implicit entries for all
9431         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9432         implicit entries for N1.N2 and N1.
9433
9434 2003-07-08  Martin Baulig  <martin@ximian.com>
9435
9436         Rewrote the handling of namespaces to fix a lot of the issues
9437         wrt. `using' aliases etc.
9438
9439         * namespace.cs (Namespace): Splitted this class into a
9440         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9441
9442         * typemanager.cs (TypeManager.IsNamespace): Removed.
9443         (TypeManager.ComputeNamespaces): Only compute namespaces from
9444         loaded assemblies here, not the namespaces from the assembly we're
9445         currently compiling.
9446
9447 2003-07-08  Martin Baulig  <martin@ximian.com>
9448
9449         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9450
9451 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9452
9453         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9454         already fixed it.  
9455
9456         I thought about the memory savings here, but LookupTypeReflection
9457         is used under already very constrained scenarios.  Compiling
9458         corlib or mcs only exposes one hit, so it would not really reduce
9459         any memory consumption.
9460
9461 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9462
9463         * typemanager.cs: fixes bug #45889 by only adding public types from
9464         other assemblies to the list of known types.
9465
9466 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9467
9468         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9469         on the type we resolved.
9470
9471 2003-07-05  Martin Baulig  <martin@ximian.com>
9472
9473         * pending.cs (PendingImplementation.ParentImplements): Don't
9474         create the proxy if the parent is abstract.
9475
9476         * class.cs (TypeContainer.DefineIndexers): Process explicit
9477         interface implementations first.  Fixes #37714.
9478
9479 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9480
9481         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9482         defined recursively;  but since we modify the input parameters
9483         (left is set to `this' temporarily), we reset this value if the
9484         left_is_explicit is false, which gives the original semantics to
9485         the code.  
9486
9487         * literal.cs (NullPointer): new class used to represent a null
9488         literal in a pointer context.
9489
9490         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9491         type is a pointer, use a NullPointer object instead of a
9492         NullLiteral.   Closes 43687
9493
9494         (ExplicitConversion): Convert pointer values using
9495         the conv opcode to the proper type.
9496
9497         * ecore.cs (New): change ValueTypeVariable property into a method,
9498         that returns whether the valuetype is suitable for being used.
9499
9500         * expression.cs (Binary.DoNumericPromotions): Only return if we
9501         the int constant was a valid uint, and we can return both left and
9502         right as uints.  If not, we continue processing, to trigger the
9503         type conversion.  This fixes 39018.
9504
9505         * statement.cs (Block.EmitMeta): During constant resolution, set
9506         the CurrentBlock property on the emitcontext, so that we resolve
9507         constants propertly.
9508
9509 2003-07-02  Martin Baulig  <martin@ximian.com>
9510
9511         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9512         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9513
9514         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9515         than emitting it here.
9516
9517         * statement.cs: Fixed some more flow analysis bugs.
9518
9519 2003-07-02  Martin Baulig  <martin@ximian.com>
9520
9521         * class.cs (MethodData.Define): When implementing interface
9522         methods, set Final unless we're Virtual.
9523
9524         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9525         check work for interface methods.
9526
9527 2003-07-01  Martin Baulig  <martin@ximian.com>
9528
9529         * ecore.cs (EmitContext.This): Replaced this property with a
9530         GetThis() method which takes a Location argument.  This ensures
9531         that we get the correct error location for a CS0188.
9532
9533 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9534
9535         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9536         ImplicitStandardConversion.
9537
9538         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9539
9540 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9541
9542         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9543         optimization.
9544
9545 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9546
9547         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9548         constructors.
9549
9550         (MethodData.Define): Turn off initlocals for unsafe methods.
9551
9552 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9553
9554         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9555         complete;  Fixes #37521.
9556
9557         * delegate.cs: Use Modifiers.TypeAttr to compute the
9558         TypeAttributes, instead of rolling our own.  This makes the flags
9559         correct for the delegates.
9560
9561 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9562
9563         * class.cs (Constructor.Define): Set the private flag for static
9564         constructors as well.
9565
9566         * cs-parser.jay (statement_expression): Set the return value to
9567         null, to avoid a crash when we catch an error.
9568
9569 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9570
9571         * cs-parser.jay: Applied patch from Jackson that adds support for
9572         extern and unsafe modifiers to destructor declarations.
9573
9574         * expression.cs: Report error 21 if the user is trying to index a
9575         System.Array.
9576
9577         * driver.cs: Add an error message, suggested by the bug report.
9578
9579         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9580         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9581
9582 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9583
9584         * namespace.cs: Add some information to reduce FAQs.
9585
9586 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9587
9588         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9589         underlying enumeration types.  Fixes #43915.
9590
9591         * expression.cs: Treat ushort/short as legal values to be used in
9592         bitwise operations.
9593
9594 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9595
9596         * delegate.cs: transfer custom attributes for paramenters from
9597         the delegate declaration to Invoke and BeginInvoke.
9598
9599 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9600
9601         * attribute.cs: handle custom marshalers and emit marshal info
9602         for fields, too.
9603
9604 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9605
9606         * makefile.gnu: Added anonymous.cs to the compiler sources.
9607
9608 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9609
9610         * iterators.cs: Change the name of the proxy class to include two
9611         underscores.
9612
9613         * cs-parser.jay: Update grammar to include anonymous methods.
9614
9615         * anonymous.cs: new file.
9616
9617 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9618
9619         * class.cs (Field.Define): Add missing test for pointers and
9620         safety. 
9621
9622 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9623
9624         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9625         we use the stobj opcode.
9626
9627         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9628         since it wasn't the correct fix. 
9629
9630         It still is puzzling that we are required to use stobj for IntPtr
9631         which seems to be a ValueType.
9632
9633 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9636         during regular simple name resolution.   Now, the trick is that
9637         instead of returning for processing the simplename, we do a
9638         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9639         contextual lookup type).   If a match is found, return that, if
9640         not, return for further composition.
9641
9642         This fixes long-standing 30485.
9643
9644         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9645         using the address to initialize an object, do an Stobj instead of
9646         using the regular Stelem.
9647
9648         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9649         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9650         Because if we are a BaseIndexerAccess that value will be true.
9651         Fixes 43643.
9652
9653         * statement.cs (GotoCase.Resolve): Return after reporting an
9654         error, do not attempt to continue. 
9655
9656         * expression.cs (PointerArithmetic.Emit): If our operand is a
9657         long, convert our constants to match the operand before
9658         multiplying.  Convert to I type before adding.   Fixes 43670.
9659
9660 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9661
9662         * enum.cs (ImplicitConversionExists) : Rename to
9663         ImplicitEnumConversionExists to remove ambiguity. 
9664
9665         * ecore.cs (NullCast): New type of cast expression class which
9666         basically is very similar to EmptyCast with the difference being
9667         it still is a constant since it is used only to cast a null to
9668         something else
9669         (eg. (string) null)
9670
9671         * convert.cs (ImplicitReferenceConversion): When casting a null
9672         literal, we return a NullCast.
9673
9674         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9675         should be around anymore.
9676
9677         The renaming (reported was slightly wrong). Corrections:
9678
9679         ConvertImplicitStandard -> ImplicitConversionStandard
9680         ConvertExplicitStandard -> ExplicitConversionStandard
9681
9682         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9683         before passing them in !
9684
9685         * convert.cs (ImplicitConversionStandard): When comparing for
9686         equal expr and target types, ensure that expr is not a
9687         NullLiteral.
9688
9689         In general, we must not be checking (expr_type ==
9690         target_type) in the top level conversion methods
9691         (ImplicitConversion, ExplicitConversion etc). This checking is
9692         done in the methods that they delegate to.
9693
9694 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9695
9696         * convert.cs: Move Error_CannotConvertType,
9697         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9698         ImplicitNumericConversion, ImplicitConversionExists,
9699         ImplicitUserConversionExists, StandardConversionExists,
9700         FindMostEncompassedType, FindMostSpecificSource,
9701         FindMostSpecificTarget, ImplicitUserConversion,
9702         ExplicitUserConversion, GetConversionOperators,
9703         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9704         TryImplicitIntConversion, Error_CannotConvertImplicit,
9705         ConvertImplicitRequired, ConvertNumericExplicit,
9706         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9707         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9708         its own file.
9709
9710         Perform the following renames:
9711
9712         StandardConversionExists -> ImplicitStandardConversionExists
9713         ConvertImplicit -> ImplicitConversion
9714         ConvertImplicitStandard -> ImplicitStandardConversion
9715         TryImplicitIntConversion -> ImplicitIntConversion
9716         ConvertImplicitRequired -> ImplicitConversionRequired
9717         ConvertNumericExplicit -> ExplicitNumericConversion
9718         ConvertReferenceExplicit -> ExplicitReferenceConversion
9719         ConvertExplicit -> ExplicitConversion
9720         ConvertExplicitStandard -> ExplicitStandardConversion
9721
9722 2003-05-19  Martin Baulig  <martin@ximian.com>
9723
9724         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9725         (TypeInfo): Added support for structs having structs as fields.
9726
9727         * ecore.cs (FieldExpr): Implement IVariable.
9728         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9729         VariableInfo for the field.
9730
9731 2003-05-18  Martin Baulig  <martin@ximian.com>
9732
9733         * expression.cs (This.DoResolve): Report a CS0027 if we're
9734         emitting a field initializer.
9735
9736 2003-05-18  Martin Baulig  <martin@ximian.com>
9737
9738         * expression.cs (This.ResolveBase): New public function.
9739         (This.DoResolve): Check for CS0188.
9740
9741         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9742         This.Resolve().
9743
9744         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9745         `instance_expression' to null if we don't have any non-static
9746         methods.
9747
9748 2003-05-18  Martin Baulig  <martin@ximian.com>
9749
9750         Reworked the way how local variables and parameters are handled by
9751         the flow analysis code.
9752
9753         * statement.cs (TypeInfo, VariableMap): New public classes.
9754         (VariableInfo): New public class.  This is now responsible for
9755         checking whether a variable has been assigned.  It is used for
9756         parameters and local variables.
9757         (Block.EmitMeta): Take the InternalParameters as argument; compute
9758         the layout of the flow vectors here.
9759         (Block.LocalMap, Block.ParameterMap): New public properties.
9760         (FlowBranching): The .ctor doesn't get the InternalParameters
9761         anymore since Block.EmitMeta() now computes the layout of the flow
9762         vector.
9763         (MyStructInfo): This class is now known as `StructInfo' and nested
9764         in `TypeInfo'; we don't access this directly anymore.
9765
9766         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9767         property and removed IsAssigned(), IsFieldAssigned(),
9768         SetAssigned() and SetFieldAssigned(); we now call them on the
9769         VariableInfo so we don't need to duplicate this code everywhere.
9770
9771         * expression.cs (ParameterReference): Added `Block block' argument
9772         to the .ctor.
9773         (LocalVariableReference, ParameterReference, This): The new
9774         VariableInfo class is now responsible for all the definite
9775         assignment stuff.
9776
9777         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9778         IsParameterAssigned, SetParameterAssigned): Removed.
9779
9780 2003-05-18  Martin Baulig  <martin@ximian.com>
9781
9782         * typemanager.cs (InitCoreTypes): Try calling
9783         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9784         the 3-args-version.  Corlib now also needs our `void_type'.
9785         (GetMethod): Added overloaded version which takes an optional
9786         `bool report_errors' to allow lookups of optional methods.
9787
9788 2003-05-12  Martin Baulig  <martin@ximian.com>
9789
9790         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9791         only used for locals and not for parameters.
9792
9793 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9794
9795         * support.cs (InternalParameters.ParameterType): Return the
9796         ExternalType of the parameter.
9797
9798         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9799         they were unused.
9800
9801 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9802
9803         * class.cs (MethodData.Define): Do not set the `newslot' on
9804         interface members, if they are also flagged as "override".
9805
9806         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9807         better code for ++i and i++.  This only works for static fields
9808         and local variables.
9809
9810         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9811         want to pull the DeclSpace out of the builder_to_declspace instead
9812         of the TypeBuilder (like in TypeContainer.FindMembers).
9813
9814         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9815         instead of LookupTypeContainer.  Fixes the crash on .NET for
9816         looking up interface members.
9817
9818         * const.cs: Create our own emit context during the Definition
9819         stage, so that constants are evaluated in the proper context, when
9820         a recursive definition happens.
9821
9822 2003-05-11  Martin Baulig  <martin@ximian.com>
9823
9824         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9825         new block for a switch section.
9826         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9827         the adding/lookup in the switch block.  Fixes #39828.
9828
9829 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9830
9831         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9832         functionality: I needed to convert the data after I had performed
9833         the add/sub operation into the operands type size.
9834
9835         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9836         pass the type for the box operation, otherwise the resulting
9837         object would have been of type object.
9838
9839         (BoxedCast): Add constructor to specify the type to box as.
9840
9841 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9842
9843         * iterators.cs: I was reusing the `count' variable inadvertently,
9844         take steps to not allow this to happen.
9845
9846 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9847
9848         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9849         by creating an array at the point where the params starts and
9850         putting all those arguments there, then adjusting the size of the
9851         array.
9852
9853 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9854
9855         * expression.cs (New.AddressOf): Implement interface
9856         IMemoryLocation.  This is used when the `new' operator is used in
9857         the context of an invocation to a method on a value type.
9858
9859         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9860         example. 
9861
9862         * namespace.cs: Also check the using aliases here.
9863
9864         * driver.cs: Move the test for using validity after the types have
9865         been entered, so we do a single pass that also includes the using
9866         aliases. 
9867
9868         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9869         in the regular case.   CreateSiblingForFinally is doing extra
9870         error checking.
9871
9872         * attribute.cs (GetAttributeArgumentExpression): Store the result
9873         on an out value, and use the return value to indicate failure
9874         instead of using null (which is a valid return for Constant.GetValue).
9875
9876         * statement.cs: Perform the analysis flow for the increment
9877         portion after the statement, because this will be the real flow of
9878         execution.  Fixes #42385
9879
9880         * codegen.cs (EmitContext.EmitArgument,
9881         EmitContext.EmitStoreArgument): New helper functions when the
9882         RemapToProxy flag is set.
9883
9884         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9885         function.
9886
9887         Add support for remapping parameters. 
9888
9889         * iterators.cs: Propagate parameter values;  Store parameter
9890         values in the proxy classes.
9891
9892 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9893
9894         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9895         need a proxy reference;  I do not know what I was thinking
9896
9897         * cs-parser.jay (constructor_initializer): catch another error,
9898         and display nice message.
9899
9900         (field_declaration): catch void field declaration
9901         to flag a better error. 
9902
9903         * class.cs (MemberBase.CheckBase): Report an error instead of a
9904         warning if a new protected member is declared in a struct. 
9905         (Field.Define): catch the error of readonly/volatile.
9906
9907         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9908
9909         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9910         volatile variable is taken
9911
9912 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9913
9914         * statement.cs (Fixed.Resolve): Report an error if we are not in
9915         an unsafe context.
9916
9917 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9918
9919         * typemanager.cs: reuse the code that handles type clashes for
9920         delegates and enumerations.
9921
9922         * class.cs (Report28): Always report.
9923
9924         * expression.cs (EncodeAsAttribute): Allow nulls here.
9925
9926 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9927
9928         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9929         the functionality for testing whether an expression is valid for
9930         an attribute here.  Also handle the case of arrays of elements
9931         being stored. 
9932
9933         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9934         encoding a linear array into an array of objects that are suitable
9935         to be passed to an CustomAttributeBuilder.
9936
9937         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9938
9939         * ecore.cs: (FieldExpr): Handle field remapping here.
9940
9941         * iteratators.cs: Pass the instance variable (if the method is an
9942         instance method) to the constructors, so we can access the field
9943         variables on the class.
9944
9945         TODO: Test this with structs.  I think the THIS variable on
9946         structs might have to be a pointer, and not a refenrece
9947
9948 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9949
9950         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9951         local variables to fields in a proxy class.
9952
9953         * iterators.cs (PopulateProxy): Rename our internal fields to
9954         <XXX>.  
9955         Create a <THIS> field if we are an instance method, so we can
9956         reference our parent container variables.
9957         (MapVariable): Called back from the EmitContext code to enter a
9958         new variable to field mapping into the proxy class (we just create
9959         a FieldBuilder).
9960
9961         * expression.cs
9962         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9963         for using the remapped locals to fields.
9964
9965         I placed the code here, because that gives the same semantics to
9966         local variables, and only changes the Emit code.
9967
9968         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9969         statements inside iterators.
9970         (VariableInfo): Add a FieldBuilder for the cases when we are
9971         remapping local variables to fields in a proxy class
9972
9973         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9974         current_block != null.
9975
9976         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9977         not cope with strings, as it has been moved to the
9978         TableSwitchEmit.  Fixed bug in switch generation.
9979
9980         * expression.cs (New.DoResolve): Provide more context for the user
9981         when reporting an error.
9982
9983         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9984         pointers. 
9985
9986         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9987         check the permissions for it.  Note than in a type-resolution
9988         context the check was already present in DeclSpace.ResolveType,
9989         but was missing from the MemberAccess.
9990
9991         (ArrayCreation.CheckIndices): warn if the user has
9992         more nested levels of expressions, but there are no more
9993         dimensions specified.  Avoids crash on bug 41906.
9994
9995 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9996
9997         * statement.cs (Block): replace Implicit bool, for a generic
9998         flags.   
9999         New flag: `Unchecked'.  This is used during the EmitMeta phase
10000         (which is out-of-line with the regular Resolve/Emit process for a
10001         statement, as this is done ahead of time, but still gets a chance
10002         to call constant resolve).
10003
10004         (Block.Flags): new enum for adding a new flag.
10005
10006         (Block.EmitMeta): track the state of unchecked.
10007
10008         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10009         to enable constant resolution to work there as well.
10010
10011 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10012
10013         * typemanager.cs (ienumerable_type): Also look up
10014         System.Collections.IEnumerable. 
10015
10016 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10017
10018         TODO: Test more than one conditional per method.
10019
10020         * class.cs (Indexer.Define): Report the location where the user is
10021         referencing the unsupported feature.
10022
10023         (MethodData): Overload the use of `conditionals' to
10024         minimize the creation of needless ArrayLists.   This saves roughly
10025         212kb on my machine.
10026
10027         (Method): Implement the new IIteratorContainer interface.
10028         (Method.SetYields): Implement the method by setting the ModFlags
10029         to contain METHOD_YIELDS.
10030
10031         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10032         which just got set to null.
10033
10034         * iterators.cs: New file.
10035
10036         (Yield, YieldBreak): New statements.
10037
10038         * statement.cs (Return.Resolve): Flag an error if we are used in
10039         an iterator method.
10040
10041         * codegen.cs (InIterator): New flag set if the code is being
10042         compiled in an iterator method.
10043
10044         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10045         internal modifier, and we just use it to avoid adding extra
10046         fields, as this is seldom used.  
10047
10048         * cs-parser.jay: Add yield_statement (yield and yield break).
10049
10050         * driver.cs: New flag -v2 to turn on version 2 features. 
10051
10052         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10053         hashtable when v2 is enabled.
10054
10055 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10056
10057         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10058         there is already a namespace defined with this name.
10059
10060         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10061         people upgraded their corlibs.
10062
10063         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10064         always use fully qualified types, no need to use the compiler
10065         front end.
10066
10067         (TypeManager.IsNamespace): Use binarysearch.
10068
10069         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10070         AddDelegate): I did not quite use the new IsValid API properly: I
10071         have to pass the short-name and the fullname.  I was passing only
10072         the basename instead of the fullname sometimes. 
10073
10074         (TypeContainer.DefineType): call NamespaceClash.
10075
10076         * interface.cs (Interface.DefineType): use NamespaceClash before
10077         defining the type.
10078
10079         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10080         defining the type.
10081
10082         * enum.cs: (Enum.DefineType): use NamespaceClash before
10083         defining the type.
10084
10085         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10086         speed increase.  First, use the negative_hits cache when we get a
10087         negative.  Second, add the type with its full original name
10088         instead of the new . and + encoded name (reflection uses + to
10089         separate type from a nested type).  Use LookupTypeReflection
10090         directly which bypasses the type->name hashtable (that we already
10091         know does not contain the type.
10092
10093         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10094         location/container type. 
10095
10096         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10097
10098 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10099
10100         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10101
10102         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10103         method is being referenced in the method group from a static
10104         context, and report error 120 if so.
10105
10106         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10107         Error118. 
10108
10109         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10110         is created, we create the A namespace).
10111
10112         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10113         Fixes #41591
10114
10115 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10116
10117         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10118         invocation to ModuleBuilder.GetType with the same values will
10119         return a new type instance, so we need to cache its return
10120         values. 
10121
10122         * expression.cs (Binary.ResolveOperator): Only allow the compare
10123         operators on enums if they are of the same type.
10124
10125         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10126         types of ValueType on their own case.  Before we were giving them
10127         the same treatment as objects.
10128
10129         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10130         fullname.  Short name is used to compare against container name.
10131         Fullname is used to check against defined namespace names.
10132
10133         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10134         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10135
10136         (Method.CheckBase): Call parent.
10137         (MemberBase.CheckBase): Check for protected members on sealed
10138         classes.
10139         (PropertyBase.CheckBase): Call parent.
10140         (Field.Define): Call parent.
10141
10142         * report.cs: Negative error codes are now mapped to 8000 - code,
10143         so that the display is render more nicely.
10144
10145         * typemanager.cs: Do not use try/catch, instead report a regular
10146         error. 
10147
10148         (GetPointerType, GetReferenceType): These methods provide
10149         mechanisms to obtain the T* and T& from a T.  We had the code
10150         previously scattered around the code base, and it also used
10151         TypeManager.LookupType that would go through plenty of caches.
10152         This one goes directly to the type source.
10153
10154         In some places we did the Type.GetType followed by
10155         ModuleBuilder.GetType, but not in others, so this unifies the
10156         processing as well.
10157
10158         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10159         statements now that we have namespace information.
10160
10161         * typemanager.cs (IsNamespace): New method, returns whether the
10162         string presented is a namespace or not.
10163
10164         (ComputeNamespaces): New public entry point, computes the list of
10165         available namespaces, using the GetNamespaces API call in Mono, or
10166         the slower version in MS.NET.   
10167
10168         Now before we start the semantic analysis phase, we have a
10169         complete list of namespaces including everything that the user has
10170         provided.
10171
10172         Deleted old code to cache namespaces in .nsc files.
10173
10174 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10175
10176         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10177         class/struct location definition Location for the implicit
10178         constructor location.
10179
10180         (Operator.Define): Use the location of the operator for the
10181         implicit Method definition.
10182
10183         (Constructor.Emit): use the constructor location for the implicit
10184         base initializer constructor.
10185
10186         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10187         and the Expression class now contains two new methods:
10188
10189         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10190         isolate type lookup from the rest of the resolution process.
10191
10192         Since we use Expressions to hold type definitions due to the way
10193         we parse the input we have historically overloaded Resolve to
10194         perform the Type lookups if a special flag is passed.  Now this is
10195         eliminated and two methods take their place. 
10196
10197         The differences in the two methods between xStep and xTerminal is
10198         that xStep is involved in our current lookup system that uses
10199         SimpleNames to compose a name, while xTerminal is used just to
10200         catch the case where the simplename lookup failed.
10201
10202 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10203
10204         * expression.cs (ResolveMemberAccess): Remove redundant code.
10205         TypeExpr expressions are always born fully resolved.
10206
10207         * interface.cs (PopulateMethod): Do not lookup the types twice.
10208         We were doing it once during SemanticAnalysis and once during
10209         PopulateMethod.
10210
10211         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10212         in local variable type definitions, were being returned as a
10213         SimpleName (we decomposed everything into a string), that is
10214         because primary_expression was being used instead of a type in the
10215         grammar (reduce/reduce conflicts).
10216
10217         The part that was wrong is that we converted the expression into a
10218         string (an oversimplification in one hand, compounded with primary
10219         expressions doing string concatenation).
10220
10221         So things like:
10222
10223         A.B.C [] x;
10224
10225         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10226         using clauses from working on this particular context.  And a type
10227         was being matched directly against "A.B.C[]".
10228
10229         We now use the correct approach, and allow for ComposedCast to be
10230         part of the unary expression.  So the "A.B.C []" become a composed
10231         cast of "A.B.C" (as a nested group of MemberAccess with a
10232         SimpleName at the end) plus the rank composition "[]". 
10233
10234         Also fixes 35567
10235
10236 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10237
10238         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10239         for the access level checking.
10240
10241         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10242         `TypeContainer container', because I kept getting confused when I
10243         was debugging this code.
10244
10245         * expression.cs (Indexers): Instead of tracking getters/setters,
10246         we now track them in parallel.  We create one arraylist less, but
10247         most importantly it is possible now for the LValue code to find a
10248         matching get for a set.
10249
10250         (IndexerAccess.DoResolveLValue): Update the code.
10251         GetIndexersForType has been modified already to extract all the
10252         indexers from a type.  The code assumed it did not.
10253
10254         Also make the code set the correct return type for the indexer.
10255         This was fixed a long time ago for properties, but was missing for
10256         indexers.  It used to be void_type.
10257
10258         (Binary.Emit): Test first for doubles instead of
10259         floats, as they are more common.
10260
10261         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10262         when dealing with floats and the <=, >= operators.  This fixes bug
10263         #39314 
10264
10265         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10266         to load the array value by emitting a load on the foreach variable
10267         type.  This was incorrect.  
10268
10269         We now emit the code to load an element using the the array
10270         variable type, and then we emit the conversion operator.
10271
10272         Fixed #40176
10273
10274 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10275
10276         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10277
10278 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10279
10280         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10281         test for protection before we test for signatures. 
10282
10283         (MethodSignature.ToString): implement.
10284
10285         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10286         to the case where we reduced into a LongConstant.
10287
10288         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10289         depend on whether the information is acurrate, because the
10290         Microsoft runtime will always claim that the array type is public,
10291         regardless of the real state.
10292
10293         If the type is a pointer, another problem happens: the type is
10294         reported as non-public in Microsoft.  
10295
10296         In both cases we have to call CheckAccessLevel recursively with
10297         the underlying type as the argument to be tested.
10298
10299 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10300
10301         * assign.cs (Assign.Emit): If we are dealing with a compound
10302         assignment expression, we should use the code path that stores the
10303         intermediate result in a temporary value.  This fixes #40903.
10304
10305         *expression.cs (Indirection.ToString): Provide ToString method for
10306         debugging. 
10307
10308 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10309
10310         * class.cs: Null out fields holding references to Block objects so
10311         they can be garbage collected.
10312
10313         * expression.cs (OverloadResolve): Remove unused local.
10314
10315 2003-04-07  Martin Baulig  <martin@ximian.com>
10316
10317         * codegen.cs (EmitContext.CurrentFile): New public field.
10318         (EmitContext.Mark): Use the CurrentFile to check whether the
10319         location is in the correct file.
10320         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10321
10322 2003-04-07  Martin Baulig  <martin@ximian.com>
10323
10324         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10325
10326         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10327         location.  [FIXME: The location argument which gets passed to this
10328         method is sometimes wrong!]
10329
10330 2003-04-07  Nick Drochak <ndrochak@gol.com>
10331
10332         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10333
10334 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10335
10336         * expression.cs (Indirection.EmitAssign): We were using the
10337         temporary, but returning immediately instead of continuing the
10338         EmitAssing flow.
10339
10340 2003-04-06  Martin Baulig  <martin@ximian.com>
10341
10342         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10343         if it's a nested child, but also deriving from the outer class.
10344         See test 190.cs.
10345
10346         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10347         nested child, but also deriving from the outer class.  See
10348         test-190.cs.
10349         (FilterWithClosure): We may access private members of the outer
10350         class if we're a nested child and deriving from the outer class.
10351         (RealMemberLookup): Only set `closure_private_ok' if the
10352         `original_bf' contained BindingFlags.NonPublic.
10353
10354 2003-04-05  Martin Baulig  <martin@ximian.com>
10355
10356         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10357
10358 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10359
10360         * class.cs (Event.Define): Do not allow abstract events to have
10361         initializers. 
10362
10363 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10364
10365         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10366         block in event declarations.
10367
10368         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10369         value type, get its address.
10370
10371         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10372         leaving a class on the stack instead of a boolean value (int
10373         0/1).  Change the code so we compare against null, and then the
10374         result against zero.
10375
10376         * class.cs (TypeContainer.GetClassBases): We were checking for the
10377         parent class being sealed too late.
10378
10379         * expression.cs (Binary.Emit): For <= and >= when dealing with
10380         floating point values, use cgt.un and clt.un instead of cgt and
10381         clt alone.
10382
10383 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10384
10385         * statement.cs: Apply the same optimization as MS: skip the 
10386         GetEnumerator returning an IEnumerator, and use the one returning a 
10387         CharEnumerator instead. This allows us to avoid the try-finally block 
10388         and the boxing.
10389
10390 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10391
10392         * cs-parser.jay: Attributes cannot be applied to
10393                          namespaces. Fixes #40473
10394
10395 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10396
10397         * class.cs:
10398         (Add*): check if the name is valid using the full name for constants,
10399         fields, properties and events.
10400
10401 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10402
10403         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10404         char constants to be part of the enumeration.
10405
10406         * expression.cs (Conditional.DoResolve): Add support for operator
10407         true. Implements the missing functionality from 14.12
10408
10409         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10410         operator true/false as required by the spec.
10411
10412         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10413         implicit conversion to boolean.
10414
10415         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10416         also one where the type implements `operator true'. 
10417
10418         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10419         get an expression that will invoke operator true based on an
10420         expression.  
10421
10422         (GetConversionOperators): Removed the hack that called op_True
10423         here.  
10424
10425         (Expression.ResolveBoolean): Move this from Statement.
10426
10427 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10428
10429         * ecore.cs (FieldExpr): do not allow initialization of initonly
10430         fields on derived classes
10431
10432 2003-03-13  Martin Baulig  <martin@ximian.com>
10433
10434         * statement.cs (Block.Emit): Call ig.BeginScope() and
10435         ig.EndScope() when compiling with debugging info; call
10436         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10437
10438 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10439
10440         * expression.cs (Indexers): Do not construct immediately, allow
10441         for new members to be appended as we go.  Fixes 38143
10442
10443 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10444
10445         * expression.cs: save/restore context when resolving an unchecked
10446         expression.
10447
10448 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * cfold.cs: Catch division by zero in modulus operator during
10451         constant folding.
10452
10453 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10454
10455         * interface.cs (Interface.DefineMembers): Avoid defining members
10456         twice. 
10457
10458 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10459
10460         * driver.cs: handle the +/- options for -noconfig
10461
10462         * statement.cs (Unckeched.Resolve): Also track the state of
10463         unchecked in the Resolve phase.
10464
10465 2003-02-27  Martin Baulig  <martin@ximian.com>
10466
10467         * ecore.cs (Expression.MemberLookup): Don't create a
10468         MethodGroupExpr for something which is not a method.  Fixes #38291.
10469
10470 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10471
10472         * class.cs (MemberBase.CheckParameters): Also check that the type
10473         is unmanaged if it is a pointer.
10474
10475         * expression.cs (SizeOf.Resolve): Add location information.
10476
10477         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10478         a managed type is declared.
10479
10480         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10481         parameter modifiers as well.  Fixes bug 38606
10482
10483         * class.cs: Very sad.  Am backing out the speed up changes
10484         introduced by the ArrayList -> Array in the TypeContainer, as they
10485         were not actually that much faster, and introduced a bug (no error
10486         reports on duplicated methods).
10487
10488         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10489         source first, this will guarantee that we have a valid expression
10490         before calling in lower levels functions that will require a
10491         resolved object.  Then use this original_source in the
10492         target.ResolveLValue instead of the original source that was
10493         passed to us.
10494
10495         Another change.  Use target.Resolve instead of LValueResolve.
10496         Although we are resolving for LValues, we will let the Assign code
10497         take care of that (it will be called again from Resolve).  This
10498         basically allows code like this:
10499
10500         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10501         class Y { void A (X x) { x [0] += o; }
10502
10503         The problem was that the indexer was trying to resolve for
10504         set_Item (idx, object o) and never finding one.  The real set_Item
10505         was set_Item (idx, X).  By delaying the process we get the right
10506         semantics. 
10507
10508         Fixes bug 36505
10509
10510 2003-02-23  Martin Baulig  <martin@ximian.com>
10511
10512         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10513         while calling DoEmit ().
10514
10515         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10516         source files; if you use the #line directive inside a method, the
10517         compiler stops emitting line numbers for the debugger until it
10518         reaches the end of the method or another #line directive which
10519         restores the original file.
10520
10521 2003-02-23  Martin Baulig  <martin@ximian.com>
10522
10523         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10524
10525 2003-02-23  Martin Baulig  <martin@ximian.com>
10526
10527         * statement.cs (Block.AddChildVariableNames): We need to call this
10528         recursively, not just for our immediate children.
10529
10530 2003-02-23  Martin Baulig  <martin@ximian.com>
10531
10532         * class.cs (Event.Define): Always make the field private, like csc does.
10533
10534         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10535         actually work, fixes bug #37521.
10536
10537 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10538
10539         * delegate.cs: When creating the various temporary "Parameters"
10540         classes, make sure that we call the ComputeAndDefineParameterTypes
10541         on those new parameters (just like we do with the formal ones), to
10542         allow them to be resolved in the context of the DeclSpace.
10543
10544         This fixes the bug that Dick observed in Bugzilla #38530.
10545
10546 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10547
10548         * expression.cs (ResolveMemberAccess): When resolving a constant,
10549         do not attempt to pull a constant if the value was not able to
10550         generate a valid constant.
10551
10552         * const.cs (LookupConstantValue): Do not report more errors than required.
10553
10554 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10555
10556         * expression.cs: fixes bug #38328.
10557
10558 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10559
10560         * class.cs: Changed all the various members that can be part of a
10561         class from being an ArrayList to be an Array of the right type.
10562         During the DefineType type_list, interface_list, delegate_list and
10563         enum_list are turned into types, interfaces, delegates and enums
10564         arrays.  
10565
10566         And during the member population, indexer_list, event_list,
10567         constant_list, field_list, instance_constructor_list, method_list,
10568         operator_list and property_list are turned into their real arrays.
10569
10570         Although we could probably perform this operation earlier, for
10571         good error reporting we need to keep the lists and remove the
10572         lists for longer than required.
10573
10574         This optimization was triggered by Paolo profiling the compiler
10575         speed on the output of `gen-sample-program.pl' perl script. 
10576
10577         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10578         not crash in methods like MemberLookupFailed that use this field.  
10579
10580         This problem arises when the compiler fails to resolve a type
10581         during interface type definition for example.
10582
10583 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10584
10585         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10586         inherit from System.Object, so we have to stop at null, not only
10587         when reaching System.Object.
10588
10589 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10590
10591         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10592         DeclaredOnly because the parent indexer might have had a different
10593         name, but did not loop until the top of the hierarchy was reached.
10594
10595         The problem this one fixes is 35492: when a class implemented an
10596         indexer from an interface, we were getting the interface method
10597         (which was abstract) and we were flagging an error (can not invoke
10598         abstract method).
10599
10600         This also keeps bug 33089 functioning, and test-148 functioning.
10601
10602         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10603         out if a method is special is to see if it is declared in a
10604         property or event, or whether it is one of the predefined operator
10605         names.   This should fix correctly #36804.
10606
10607 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10608
10609         The goal here is to remove the dependency on EmptyCast.Peel ().
10610         Killing it completely.
10611
10612         The problem is that currently in a number of places where
10613         constants are expected, we have to "probe" for an EmptyCast, and
10614         Peel, which is not the correct thing to do, as this will be
10615         repetitive and will likely lead to errors. 
10616
10617         The idea is to remove any EmptyCasts that are used in casts that
10618         can be reduced to constants, so we only have to cope with
10619         constants. 
10620
10621         This bug hunt was triggered by Bug 37363 and the desire to remove
10622         the duplicate pattern where we were "peeling" emptycasts to check
10623         whether they were constants.  Now constants will always be
10624         constants.
10625
10626         * ecore.cs: Use an enumconstant here instead of wrapping with
10627         EmptyCast.  
10628
10629         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10630         throwing me off.  By handling this we can get rid of a few hacks.
10631
10632         * statement.cs (Switch): Removed Peel() code.
10633
10634 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10635
10636         * class.cs: Location information for error 508
10637
10638         * expression.cs (New.DoResolve): Add a guard against double
10639         resolution of an expression.  
10640
10641         The New DoResolve might be called twice when initializing field
10642         expressions (see EmitFieldInitializers, the call to
10643         GetInitializerExpression will perform a resolve on the expression,
10644         and later the assign will trigger another resolution
10645
10646         This leads to bugs (#37014)
10647
10648         * delegate.cs: The signature for EndInvoke should contain any ref
10649         or out parameters as well.  We were not doing this in the past. 
10650
10651         * class.cs (Field.Define): Do not overwrite the type definition
10652         inside the `volatile' group.  Turns out that volatile enumerations
10653         were changing the type here to perform a validity test, which
10654         broke conversions. 
10655
10656 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10657
10658         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10659         and structs, we do not want to load the instance variable
10660
10661         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10662         enum_type has to be handled like an object reference (implicit
10663         conversions exists from this to object), but the regular IsClass
10664         and IsValueType tests will never return true for this one.
10665
10666         Also we use TypeManager.IsValueType instead of type.IsValueType,
10667         just for consistency with the rest of the code (this is only
10668         needed if we ever use the construct exposed by test-180.cs inside
10669         corlib, which we dont today).
10670
10671 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10672
10673         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10674         just InternalCall.
10675
10676 2003-02-09  Martin Baulig  <martin@ximian.com>
10677
10678         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10679         (Namespace.DefineNamespaces): New static public method; this is
10680         called when we're compiling with debugging to add all namespaces
10681         to the symbol file.
10682
10683         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10684         pass it to the Namespace's .ctor.
10685
10686         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10687         and MethodBase arguments; pass the namespace ID to the symwriter;
10688         pass the MethodBase instead of the token to the symwriter.
10689         (SymbolWriter.DefineNamespace): New method to add a namespace to
10690         the symbol file.
10691
10692 2003-02-09  Martin Baulig  <martin@ximian.com>
10693
10694         * symbolwriter.cs: New file.  This is a wrapper around
10695         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10696         methods here in near future.
10697
10698 2003-02-09  Martin Baulig  <martin@ximian.com>
10699
10700         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10701         ILGenerator.MarkSequencePoint() which are actually used by the
10702         symbol writer.
10703
10704 2003-02-09  Martin Baulig  <martin@ximian.com>
10705
10706         * location.cs (SourceFile): New public sealed class.  This
10707         contains the name and an index which is used in the location's token.
10708         (Location): Reserve an appropriate number of bits in the token for
10709         the source file instead of walking over that list, this gives us a
10710         really huge performance improvement when compiling with debugging.
10711
10712         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10713         `SourceFile' argument instead of a string.
10714         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10715         but don't parse/tokenize here, we need to generate the list of all
10716         source files before we do that.
10717         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10718         the files.
10719
10720         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10721         instead of a string.
10722
10723         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10724         of a string.
10725
10726 2003-02-09  Martin Baulig  <martin@ximian.com>
10727
10728         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10729         filename on `#line default'.
10730
10731 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10732
10733         * statement.cs: don't clear the pinned var when the fixed statement
10734         returns from the method (fixes bug#37752).
10735
10736 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10737
10738         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10739         to IsValueType.
10740
10741 2003-02-07  Martin Baulig  <martin@ximian.com>
10742
10743         * driver.cs: Removed the `--debug-args' command line argument.
10744
10745         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10746         automatically by the AsssemblyBuilder.
10747         (CodeGen.InitializeSymbolWriter): We don't need to call any
10748         initialization function on the symbol writer anymore.  This method
10749         doesn't take any arguments.
10750
10751 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10752
10753         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10754         from referenced assemblies as well.
10755
10756 2003-02-02  Martin Baulig  <martin@ximian.com>
10757
10758         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10759
10760 2003-02-02  Martin Baulig  <martin@ximian.com>
10761
10762         * class.cs (Constructor.Emit): Open the symbol writer before
10763         emitting the constructor initializer.
10764         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10765         single-stepping through constructor initializers.
10766
10767 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10768
10769         * class.cs: Handle error 549: do not allow virtual methods in
10770         sealed classes. 
10771
10772 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10773
10774         * decl.cs: Check access levels when resolving types
10775
10776 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10777
10778         * statement.cs: Add parameters and locals set in catch blocks that might 
10779         return to set vector
10780
10781 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * class.cs (Operator): Set the SpecialName flags for operators.
10784
10785         * expression.cs (Invocation.DoResolve): Only block calls to
10786         accessors and operators on SpecialName methods.
10787
10788         (Cast.TryReduce): Handle conversions from char constants.
10789
10790
10791 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10792
10793         * statement.cs: small memory and time optimization in FlowBranching.
10794
10795 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10796
10797         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10798         problem that the last fix but in the other sid (Set).
10799
10800         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10801         access when there is no indexer in the hierarchy.
10802
10803 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10804
10805         * class.cs: Combine some if statements.
10806
10807 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10808
10809         * driver.cs: fixed bug #37187.
10810
10811 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10812
10813         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10814         any indexer, it's needed to build a list with all the indexers in the
10815         hierarchy (AllGetters), else we have problems. Fixes #35653.
10816
10817 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10818
10819         * class.cs (MethodData.Define): It is wrong for an interface
10820         implementation to be static in both cases: explicit and implicit.
10821         We were only handling this in one case.
10822
10823         Improve the if situation there to not have negations.
10824
10825         * class.cs (Field.Define): Turns out that we do not need to check
10826         the unsafe bit on field definition, only on usage.  Remove the test.
10827
10828 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10829
10830         * driver.cs: use assembly.Location instead of Codebase (the latest
10831         patch made mcs fail when using MS assemblies).
10832
10833 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10834
10835         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10836         get the path to *corlib.dll.
10837
10838 2003-01-21  Nick Drochak <ndrochak@gol.com>
10839
10840         * cs-tokenizer.cs:
10841         * pending.cs:
10842         * typemanager.cs: Remove compiler warnings
10843
10844 2003-01-20  Duncan Mak  <duncan@ximian.com>
10845
10846         * AssemblyInfo.cs: Bump the version number to 0.19.
10847
10848 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10849
10850         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10851
10852 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10853
10854         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10855
10856 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10857
10858         * cs-parser.jay: Small fix: we were not comparing the constructor
10859         name correctly.   Thanks to Zoltan for the initial pointer.
10860
10861 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10862
10863         * cs-tokenizer.cs: Set file name when specified with #line
10864
10865 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10866
10867         * cs-parser.jay: Only perform the constructor checks here if we
10868         are named like the class;  This will help provider a better
10869         error.  The constructor path is taken when a type definition is
10870         not found, but most likely the user forgot to add the type, so
10871         report that rather than the constructor error.
10872
10873 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10874
10875         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10876         allocations.
10877
10878 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10879
10880         * cs-parser.jay: Add cleanup call.
10881
10882 2003-01-13  Duncan Mak  <duncan@ximian.com>
10883
10884         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10885         consistent with other methods.
10886
10887 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10888
10889         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10890
10891 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10892
10893         * attribute.cs: only set GuidAttr to true when we have a
10894         GuidAttribute.
10895
10896 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10897
10898         * ecore.cs:
10899         * expression.cs:
10900         * typemanager.cs: fixes to allow mcs compile corlib with the new
10901         Type.IsSubclassOf fix.
10902
10903 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10904
10905         * expression.cs (LocalVariableReference.DoResolve): Classify a
10906         constant as a value, not as a variable.   Also, set the type for
10907         the variable.
10908
10909         * cs-parser.jay (fixed_statement): take a type instead of a
10910         pointer_type, so we can produce a better error message later.
10911
10912         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10913         as an error.  
10914
10915         (For.DoEmit): Make inifinite loops have a
10916         non-conditional branch back.
10917
10918         (Fixed.DoEmit): First populate the pinned variables, then emit the
10919         statement, then clear the variables.  Before I was emitting the
10920         code once for each fixed piece.
10921
10922
10923 2003-01-08  Martin Baulig  <martin@ximian.com>
10924
10925         * statement.cs (FlowBranching.MergeChild): A break in a
10926         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10927
10928 2003-01-08  Martin Baulig  <martin@ximian.com>
10929
10930         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10931         lives in the same number space than `param_map'.  Fixes #36154.
10932
10933 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10934
10935         * cs-parser.jay (constructor_declaration): Set the
10936         Constructor.ModFlags before probing for it.  This makes the
10937         compiler report 514, 515 and 132 (the code was there, but got
10938         broken). 
10939
10940         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10941         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10942         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10943
10944 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10945
10946         * enum.cs: create the enum static fields using the enum type.
10947
10948 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10949
10950         * class.cs: don't try to create the ParamBuilder for the return
10951         type if it's not needed (and handle it breaking for the ms runtime
10952         anyway).
10953
10954 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10955
10956         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10957
10958 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10959
10960         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10961         the command.   This showed up while compiling the JANET source
10962         code, which used \r as its only newline separator.
10963
10964 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10965
10966         * class.cs (Method.Define): If we are an operator (because it
10967         reuses our code), then set the SpecialName and HideBySig.  #36128
10968
10969 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10970
10971         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10972         exception, report error 120 `object reference required'.
10973
10974         * driver.cs: Add --pause option, used during to measure the size
10975         of the process as it goes with --timestamp.
10976
10977         * expression.cs (Invocation.DoResolve): Do not allow methods with
10978         SpecialName to be invoked.
10979
10980 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10981
10982         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10983         number before adding it.
10984
10985 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10986
10987         * ecore.cs (StandardImplicitConversion): When in an unsafe
10988         context, we allow conversion between void * to any other pointer
10989         type. This fixes bug #35973.
10990
10991 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10992
10993         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10994         is not thrown when extensionless outputs are used 
10995
10996 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10997
10998         * rootcontext.cs: fixed compilation of corlib.
10999
11000 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11001
11002         * attribute.cs (Attributes.Contains): Add new method.
11003
11004         * class.cs (MethodCore.LabelParameters): if the parameter is an
11005         `out' parameter, check that no attribute `[In]' has been passed.
11006
11007         * enum.cs: Handle the `value__' name in an enumeration.
11008
11009 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11010
11011         * decl.cs: Added special case to allow overrides on "protected
11012         internal" methods
11013
11014 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11015
11016         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11017         since it makes much more sense.
11018
11019         (Attributes.ctor): Don't require a Location parameter.
11020
11021         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11022
11023         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11024         since we already have that information per attribute.
11025
11026         * everywhere : make appropriate changes.
11027
11028         * class.cs (LabelParameters): Write the code which actually
11029         applies attributes to the return type. We can't do this on the MS
11030         .NET runtime so we flag a warning in the case an exception is
11031         thrown.
11032
11033 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11034
11035         * const.cs: Handle implicit null conversions here too.
11036
11037 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11038
11039         * class.cs (MethodCore.LabelParameters): Remove the extra
11040         Type [] parameter since it is completely unnecessary. Instead
11041         pass in the method's attributes so that we can extract
11042         the "return" attribute.
11043
11044 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11045
11046         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11047         of ignoring it and letting the compile continue.
11048
11049         * typemanager.cs (ChangeType): use an extra argument to return an
11050         error condition instead of throwing an exception.
11051
11052 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * expression.cs (Unary.TryReduce): mimic the code for the regular
11055         code path.  Perform an implicit cast in the cases where we can
11056         implicitly convert to one of the integral types, and then reduce
11057         based on that constant.   This fixes bug #35483.
11058
11059 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11060
11061         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11062
11063 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11064
11065         * namespace.cs: fixed bug #35489.
11066
11067 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11068
11069         * class.cs: Remove some dead code.
11070
11071         * cs-parser.jay: Estimate the number of methods needed
11072         (RootContext.MethodCount);
11073
11074         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11075         numbers instead of StringBuilders.
11076
11077         * support.cs (PtrHashtable): Add constructor with initial size;
11078         We can now reduce reallocations of the method table.
11079
11080 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11081
11082         * attribute.cs (ApplyAttributes): Keep track of the emitted
11083         attributes on a per-target basis. This fixes bug #35413.
11084
11085 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11086
11087         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11088         default to the Windows 1252 encoding.
11089
11090         (UnixParseOption): Support version, thanks to Alp for the missing
11091         pointer. 
11092
11093         * AssemblyInfo.cs: Add nice assembly information.
11094
11095         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11096         (bug 35169).
11097
11098         * cs-parser.jay: Allow a trailing comma before the close bracked
11099         in the attribute_section production.
11100
11101         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11102         address of the instance was being taken, I will take this out,
11103         because we take the address of the object immediately here.
11104
11105 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11106
11107         * typemanager.cs (AreMultipleAllowed): Take care of the most
11108         obvious case where attribute type is not in the current assembly -
11109         stupid me ;-)
11110
11111 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11112
11113         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11114         definitions, instead of doing that afterwards.  
11115
11116         Also we use a nice little hack, depending on the constructor, we
11117         know if we are a "composed" name or a simple name.  Hence, we
11118         avoid the IndexOf test, and we avoid 
11119
11120         * codegen.cs: Add code to assist in a bug reporter to track down
11121         the source of a compiler crash. 
11122
11123 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11124
11125         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11126         types have been emitted for a given element and flag an error
11127         if something which does not have AllowMultiple set is used more
11128         than once.
11129
11130         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11131         attribute types and their corresponding AllowMultiple properties
11132
11133         (AreMultipleAllowed): Check the property for a given type.
11134
11135         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11136         property in the case we have a TypeContainer.
11137
11138         (Attributes.AddAttribute): Detect duplicates and just skip on
11139         adding them. This trivial fix catches a pretty gross error in our
11140         attribute emission - global attributes were being emitted twice!
11141
11142         Bugzilla bug #33187 is now fixed.
11143
11144 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11145
11146         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11147         instead of pp_and).
11148
11149         * expression.cs (Binary.ResolveOperator): I can only use the
11150         Concat (string, string, string) and Concat (string, string,
11151         string, string) if the child is actually a concatenation of
11152         strings. 
11153
11154 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11155
11156         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11157         context where we need a 2-character lookahead.
11158
11159         * pending.cs (PendingImplementation): Rework so we can keep track
11160         of interface types all the time, and flag those which were
11161         implemented by parents as optional.
11162
11163 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11164
11165         * expression.cs (Binary.ResolveOperator): Use
11166         String.Concat(string,string,string) or
11167         String.Concat(string,string,string,string) when possible. 
11168
11169         * typemanager: More helper methods.
11170
11171
11172 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11173
11174         * pending.cs: remove the bogus return from GetMissingInterfaces()
11175         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11176
11177 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11178
11179         * namespace.cs: avoid duplicated 'using xxx' being added to
11180         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11181         when we get more than one 'using' statement for the same namespace.
11182         Report a CS0105 warning for it.
11183
11184 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11185
11186         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11187         of calling getChar/putback, uses internal knowledge of it.    
11188
11189         (xtoken): Reorder tokenizer so most common patterns are checked
11190         first.  This reduces the compilation time in another 5% (from 8.11s
11191         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11192
11193         The parsing time is 22% of the compilation in mcs, and from that
11194         64% is spent on the tokenization process.  
11195
11196         I tried using a binary search for keywords, but this is slower
11197         than the hashtable.  Another option would be to do a couple of
11198         things:
11199
11200                 * Not use a StringBuilder, instead use an array of chars,
11201                   with a set value.  Notice that this way we could catch
11202                   the 645 error without having to do it *afterwards*.
11203
11204                 * We could write a hand-parser to avoid the hashtable
11205                   compares altogether.
11206
11207         The identifier consumption process takes 37% of the tokenization
11208         time.  Another 15% is spent on is_number.  56% of the time spent
11209         on is_number is spent on Int64.Parse:
11210
11211                 * We could probably choose based on the string length to
11212                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11213                   computations. 
11214
11215         Another 3% is spend on wrapping `xtoken' in the `token' function.
11216
11217         Handle 0xa0 as whitespace (#34752)
11218
11219 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11220
11221         * typemanager.cs (IsCLRType): New routine to tell whether a type
11222         is one of the builtin types.  
11223
11224         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11225         typecode in more places instead of doing pointer comparissions.
11226         We could leverage some knowledge about the way the typecodes are
11227         laid out.
11228
11229         New code to cache namespaces in assemblies, it is currently not
11230         invoked, to be used soon.
11231
11232         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11233
11234         * expression.cs (Binary.ResolveOperator): specially handle
11235         strings, and do not perform user-defined operator overloading for
11236         built-in types.
11237
11238 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11239
11240         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11241         internalcall as it is a pretty simple operation;  Avoid whenever
11242         possible to call Char.IsLetter.
11243
11244         (consume_identifier): Cut by half the number of
11245         hashtable calls by merging the is_keyword and GetKeyword behavior.
11246
11247         Do not short-circuit, because if we do, we
11248         report errors (ie, #if false && true would produce an invalid
11249         directive error);
11250
11251
11252 2002-11-24  Martin Baulig  <martin@ximian.com>
11253
11254         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11255         check constant ranges and report a CS0221.  Fixes #33186.
11256
11257 2002-11-24  Martin Baulig  <martin@ximian.com>
11258
11259         * cs-parser.jay: Make this work for uninitialized variable
11260         declarations in the `for' initializer.  Fixes #32416.
11261
11262 2002-11-24  Martin Baulig  <martin@ximian.com>
11263
11264         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11265         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11266
11267 2002-11-24  Martin Baulig  <martin@ximian.com>
11268
11269         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11270         argument; if true, we also check for user-defined conversions.
11271         This is only needed if both arguments are of a user-defined type.
11272         Fixes #30443, added test-175.cs.
11273         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11274
11275         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11276
11277 2002-11-24  Martin Baulig  <martin@ximian.com>
11278
11279         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11280         function to get the store opcode.
11281         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11282         only emit the Ldelema if the store opcode is Stobj.  You must run
11283         both test-34 and test-167 to test this.  Fixes #34529.
11284
11285 2002-11-23  Martin Baulig  <martin@ximian.com>
11286
11287         * ecore.cs (Expression.MemberLookup): Added additional
11288         `qualifier_type' argument which is used when we're being called
11289         from MemberAccess.DoResolve() and null if we're called from a
11290         SimpleName lookup.
11291         (Expression.MemberLookupFailed): New method to report errors; this
11292         does the CS1540 check and reports the correct error message.
11293
11294         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11295         argument for the CS1540 check and redone the way how we're dealing
11296         with private members.  See the comment in the source code for details.
11297         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11298         `closure_start_type' to `closure_qualifier_type' and check whether
11299         it's not null.  It was not this filter being broken, it was just
11300         being called with the wrong arguments.
11301
11302         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11303         and pass it the correct `qualifier_type'; this also does the error
11304         handling for us.
11305
11306 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11307
11308         * expression.cs (Invocation.EmitParams): If the we are dealing
11309         with a non-built-in value type, load its address as well.
11310
11311         (ArrayCreation): Use a a pretty constant instead
11312         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11313         static initializers.  
11314
11315         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11316         because they are not really value types, just glorified integers. 
11317
11318         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11319
11320         * ecore.cs: Remove redundant code for enumerations, make them use
11321         the same code path as everything else, fixes the casting issue
11322         with enumerations in Windows.Forms.
11323
11324         * attribute.cs: Do only cast to string if it is a string, the
11325         validation happens later.
11326
11327         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11328         people upgrade their corlibs.
11329
11330         * ecore.cs: Oops, enumerations were not following the entire code path
11331
11332 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11333
11334         * typemanager.cs (FilterWithClosure): Commented out the test for
11335         1540 in typemanager.cs, as it has problems when accessing
11336         protected methods from a parent class (see test-174.cs). 
11337
11338         * attribute.cs (Attribute.ValidateGuid): new method.
11339         (Attribute.Resolve): Use above.
11340
11341 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11342
11343         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11344
11345         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11346         handling for enumerations, as we only needed the TypeContainer
11347         functionality to begin with (this is required for the fix below to
11348         work for enums that reference constants in a container class for
11349         example). 
11350
11351         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11352
11353         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11354         a valid TypeBuilder to perform lookups on.o
11355
11356         * class.cs (InheritableMemberSignatureCompare): Use true in the
11357         call to GetGetMethod and GetSetMethod, because we are comparing
11358         the signature, and we need to get the methods *even* if they are
11359         private. 
11360
11361         (PropertyBase.CheckBase): ditto.
11362
11363         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11364         GotoCase.Resolve): Use Peel on EmpytCasts.
11365
11366         * ecore.cs (EmptyCast): drop child, add Peel method.
11367
11368 2002-11-17  Martin Baulig  <martin@ximian.com>
11369
11370         * ecore.cs (EmptyCast.Child): New public property.
11371
11372         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11373         label resolved to an EmptyCast.  Fixes #34162.
11374         (GotoCase.Resolve): Likewise.
11375         (Block.EmitMeta): Likewise.
11376
11377 2002-11-17  Martin Baulig  <martin@ximian.com>
11378
11379         * expression.cs (Invocation.BetterConversion): Prefer int over
11380         uint; short over ushort; long over ulong for integer literals.
11381         Use ImplicitConversionExists instead of StandardConversionExists
11382         since we also need to check for user-defined implicit conversions.
11383         Fixes #34165.  Added test-173.cs.
11384
11385 2002-11-16  Martin Baulig  <martin@ximian.com>
11386
11387         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11388         with the `true' and `false' literals.  Fixes #33151.
11389
11390 2002-11-16  Martin Baulig  <martin@ximian.com>
11391
11392         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11393         October 22nd; don't do the cs1540 check for static members.
11394
11395         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11396         now using our own filter here and doing the cs1540 check again.
11397
11398 2002-11-16  Martin Baulig  <martin@ximian.com>
11399
11400         * support.cs (InternalParameters): Don't crash if we don't have
11401         any fixed parameters.  Fixes #33532.
11402
11403 2002-11-16  Martin Baulig  <martin@ximian.com>
11404
11405         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11406         when looking up static methods to make this work on Windows.
11407         Fixes #33773.
11408
11409 2002-11-16  Martin Baulig  <martin@ximian.com>
11410
11411         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11412         a setter rather than using PropertyInfo.CanWrite.
11413
11414 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11415
11416         * class.cs: Allow acces to block member by subclasses. Fixes build
11417         breaker.
11418
11419 2002-11-14  Martin Baulig  <martin@ximian.com>
11420
11421         * class.cs (Constructor.Emit): Added the extern/block check.
11422         Fixes bug #33678.
11423
11424 2002-11-14  Martin Baulig  <martin@ximian.com>
11425
11426         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11427         iteration while looking for indexers, this is needed because the
11428         indexer may have a different name in our base classes.  Fixed the
11429         error reporting (no indexers at all, not get accessor, no
11430         overloaded match).  Fixes bug #33089.
11431         (IndexerAccess.DoResolveLValue): Likewise.
11432
11433 2002-11-14  Martin Baulig  <martin@ximian.com>
11434
11435         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11436         indexers.  Fixes the first part of bug #33089.
11437         (MethodSignature.InheritableMemberSignatureCompare): Added support
11438         for properties.
11439
11440 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11441
11442         * attribute.cs (Attribute.Resolve): Catch the
11443         NullReferenceException and report it since it isn't supposed to
11444         happen. 
11445
11446 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11447
11448         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11449         LogicalOr and LogicalAnd that can benefit from recursively
11450         handling EmitBranchable.  The code now should be nice for Paolo.
11451
11452 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11453
11454         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11455         the Type lookups, as we perform quite a number of lookups on
11456         non-Types.  This can be removed once we can deterministically tell
11457         whether we have a type or a namespace in advance.
11458
11459         But this might require special hacks from our corlib.
11460
11461         * TODO: updated.
11462
11463         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11464         and double which avoids a conversion from an integer to a double.
11465
11466         * expression.cs: tiny optimization, avoid calling IsConstant,
11467         because it effectively performs the lookup twice.
11468
11469 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11470
11471         But a bogus return here to keep the semantics of the old code
11472         until the Mono runtime is fixed.
11473
11474         * pending.cs (GetMissingInterfaces): New method used to remove all
11475         the interfaces that are already implemented by our parent
11476         classes from the list of pending methods. 
11477
11478         * interface.cs: Add checks for calls after ResolveTypeExpr.
11479
11480 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11481
11482         * class.cs (Class.Emit): Report warning 67: event not used if the
11483         warning level is beyond 3.
11484
11485         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11486         being a NullLiteral.
11487
11488         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11489         specifiers. 
11490
11491         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11492         path that might fail if a type can not be resolved.
11493
11494         * expression.cs (Binary.Emit): Emit unsigned versions of the
11495         operators. 
11496
11497         * driver.cs: use error 5.
11498
11499 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11500
11501         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11502
11503 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11504
11505         * cs-parser.jay (switch_section): A beautiful patch from Martin
11506         Baulig that fixed 33094.
11507
11508 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11509
11510         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11511         Check whether the base is abstract and report an error if so.
11512
11513         * expression.cs (IndexerAccess.DoResolveLValue,
11514         IndexerAccess.DoResolve): ditto. 
11515
11516         (Invocation.DoResolve): ditto.
11517
11518         (Invocation.FullMethodDesc): Improve the report string.
11519
11520         * statement.cs (Block): Eliminate IsVariableDefined as it is
11521         basically just a wrapper for GetVariableInfo.
11522
11523         * ecore.cs (SimpleName): Use new 
11524
11525         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11526         type, as we return the actual parameter ref/unref state on a
11527         different call.
11528
11529 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11530
11531         * support.cs: Return proper flags REF/OUT fixing the previous
11532         commit.  
11533
11534         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11535         not used to mean `ref' but `ref or out' in ParameterReference
11536
11537         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11538         full type signature instead of calling TypeManger.CSharpName
11539         ourselves. 
11540
11541         * support.cs (InternalParameters.ParameterDesc): Do not compare
11542         directly to the modflags, because REF/OUT will actually be bitsets
11543         if set. 
11544
11545         * delegate.cs (VerifyMethod): Check also the modifiers.
11546
11547         * cs-tokenizer.cs: Fix bug where floating point values with an
11548         exponent where a sign was missing was ignored.
11549
11550         * driver.cs: Allow multiple assemblies to be specified in a single
11551         /r: argument
11552
11553 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11556         because identifiers after a parenthesis would end up in this kind
11557         of production, and we needed to desamiguate it for having casts
11558         like:
11559
11560                 (UserDefinedType *) xxx
11561
11562 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11563
11564         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11565         we should set on the Bindingflags.NonPublic, but not turn on
11566         private_ok.  private_ok controls whether a Private member is
11567         returned (this is chekced on the filter routine), while the
11568         BindingFlags.NonPublic just controls whether private/protected
11569         will be allowed.   This fixes the problem part of the problem of
11570         private properties being allowed to be used in derived classes.
11571
11572         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11573         so we can call the children DoResolveLValue method (this will
11574         properly signal errors on lvalue assignments to base properties)
11575
11576         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11577         getter are null, and we have a property info, we know that this
11578         happened because the lookup failed, so we report an error 122 for
11579         protection level violation.
11580
11581         We also silently return if setter and getter are null in the
11582         resolve functions, this condition only happens if we have flagged
11583         the error before.  This is the other half of the problem. 
11584
11585         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11586         not have accessibility information, that is why we were returning
11587         true in the filter function in typemanager.cs.
11588
11589         To properly report 122 (property is inaccessible because of its
11590         protection level) correctly, we report this error in ResolveAccess
11591         by failing if both the setter and the getter are lacking (ie, the
11592         lookup failed). 
11593
11594         DoResolve and DoLResolve have been modified to check for both
11595         setter/getter being null and returning silently, the reason being
11596         that I did not want to put the knowledge about this error in upper
11597         layers, like:
11598
11599         int old = Report.Errors;
11600         x = new PropertyExpr (...);
11601         if (old != Report.Errors)
11602                 return null;
11603         else
11604                 return x;
11605
11606         So the property expr is returned, but it is invalid, so the error
11607         will be flagged during the resolve process. 
11608
11609         * class.cs: Remove InheritablePropertySignatureCompare from the
11610         class, as we no longer depend on the property signature to compute
11611         whether it is possible to implement a method or not.
11612
11613         The reason is that calling PropertyInfo.GetGetMethod will return
11614         null (in .NET, in Mono it works, and we should change this), in
11615         cases where the Get Method does not exist in that particular
11616         class.
11617
11618         So this code:
11619
11620         class X { public virtual int A { get { return 1; } } }
11621         class Y : X { }
11622         class Z : Y { public override int A { get { return 2; } } }
11623
11624         Would fail in Z because the parent (Y) would not have the property
11625         defined.  So we avoid this completely now (because the alternative
11626         fix was ugly and slow), and we now depend exclusively on the
11627         method names.
11628
11629         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11630         reference method, instead of using the property.
11631
11632         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11633         routines are gone now.
11634
11635         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11636         names, they were incorrectly named.
11637
11638         * cs-tokenizer.cs: Return are more gentle token on failure. 
11639
11640         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11641         had an out-of-sync index variable, which caused it to remove from
11642         the list of pending methods the wrong method sometimes.
11643
11644 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11647         CanWrite, because those refer to this particular instance of the
11648         property, and do not take into account the fact that we can
11649         override single members of a property.
11650
11651         Constructor requires an EmitContext.  The resolution process does
11652         not happen here, but we need to compute the accessors before,
11653         because the resolution does not always happen for properties.
11654
11655         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11656         subclass, before we did not update this flag, but we did update
11657         bindingflags. 
11658
11659         (GetAccessors): Drop this routine, as it did not work in the
11660         presence of partially overwritten set/get methods. 
11661
11662         Notice that this broke the cs1540 detection, but that will require
11663         more thinking. 
11664
11665 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11666
11667         * class.cs:
11668         * codegen.cs:
11669         * driver.cs: issue a warning instead of an error if we don't support
11670         debugging for the platform. Also ignore a couple of errors that may
11671         arise when trying to write the symbols. Undo my previous patch.
11672
11673 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11674
11675         * driver.cs: ignore /debug switch except for Unix platforms.
11676
11677 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11678
11679         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11680
11681 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11682
11683         * driver.cs: Do not make mcs-debug conditional, so we do not break
11684         builds that use it.
11685
11686         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11687         review this patch.  But basically after all the children variables
11688         have been merged, the value of "Breaks" was not being set to
11689         new_breaks for Switch blocks.  I think that it should be set after
11690         it has executed.  Currently I set this to the value of new_breaks,
11691         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11692         conservative, but I do not understand this code very well.
11693
11694         I did not break anything in the build, so that is good ;-)
11695
11696         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11697
11698 2002-10-20  Mark Crichton  <crichton@gimp.org>
11699
11700         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11701
11702 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11703
11704         * cfold.cs: Fixed compile blocker.
11705
11706 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11707
11708         * driver.cs: I was chekcing the key, not the file.
11709
11710 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11711
11712         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11713         message that we were generating - we just need to silently return
11714         a null.
11715
11716 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11717
11718         * class.cs (Event.Define): Change my previous commit, as this
11719         breaks the debugger.  This is a temporary hack, as it seems like
11720         the compiler is generating events incorrectly to begin with.
11721
11722         * expression.cs (Binary.ResolveOperator): Added support for 
11723         "U operator - (E x, E y)"
11724
11725         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11726         y)".
11727
11728         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11729         init-only variables, but this path did not take into account that
11730         there might be also instance readonly variables.  Correct this
11731         problem. 
11732
11733         This fixes bug 32253
11734
11735         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11736         delegates as well.
11737
11738         * driver.cs: Change the extension for modules to `netmodule'
11739
11740         * cs-parser.jay: Improved slightly the location tracking for
11741         the debugger symbols.
11742
11743         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11744         modifiers that were specified instead of the hardcoded value
11745         (FamAndAssem).  This was basically ignoring the static modifier,
11746         and others.  Fixes 32429.
11747
11748         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11749         fixed a bug in the process (32476)
11750
11751         * expression.cs (ArrayAccess.EmitAssign): Patch from
11752         hwang_rob@yahoo.ca that fixes bug 31834.3
11753
11754 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11755
11756         * driver.cs: Make the module extension .netmodule.
11757
11758 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11759
11760         * driver.cs: Report an error if the resource file is not found
11761         instead of crashing.
11762
11763         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11764         false, like Emit does.
11765
11766 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11767
11768         * typemanager.cs: Remove unused private member.  Also reported mcs
11769         bug to report this as a warning like csc.
11770
11771 2002-10-15  Martin Baulig  <martin@gnome.org>
11772
11773         * statement.cs (Statement.Emit): Made this a virtual method; emits
11774         the line number info and calls DoEmit().
11775         (Statement.DoEmit): New protected abstract method, formerly knows
11776         as Statement.Emit().
11777
11778         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11779
11780 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11781
11782         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11783         have fixed a remaining problem: not every AddXXXX was adding a
11784         fully qualified name.  
11785
11786         Now everyone registers a fully qualified name in the DeclSpace as
11787         being defined instead of the partial name.  
11788
11789         Downsides: we are slower than we need to be due to the excess
11790         copies and the names being registered this way.  
11791
11792         The reason for this is that we currently depend (on the corlib
11793         bootstrap for instance) that types are fully qualified, because
11794         we dump all the types in the namespace, and we should really have
11795         types inserted into the proper namespace, so we can only store the
11796         basenames in the defined_names array.
11797
11798 2002-10-10  Martin Baulig  <martin@gnome.org>
11799
11800         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11801         from bug #31834, see the bug report for a testcase which is
11802         miscompiled.
11803
11804 2002-10-10  Martin Baulig  <martin@gnome.org>
11805
11806         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11807         flow analysis code for this.
11808
11809         * statement.cs (Do, While, For): Tell the flow analysis code about
11810         infinite loops.
11811         (FlowBranching.UsageVector): Added support for infinite loops.
11812         (Block.Resolve): Moved the dead code elimination here and use flow
11813         analysis to do it.
11814
11815 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11816
11817         * class.cs (Field.Define): Catch cycles on struct type
11818         definitions. 
11819
11820         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11821         fields if the fields are static.  We only need to check instance
11822         fields. 
11823
11824         * expression.cs (As.DoResolve): Test for reference type.
11825
11826         * statement.cs (Using.ResolveExpression): Use
11827         ConvertImplicitRequired, not ConvertImplicit which reports an
11828         error on failture
11829         (Using.ResolveLocalVariableDecls): ditto.
11830
11831         * expression.cs (Binary.ResolveOperator): Report errors in a few
11832         places where we had to.
11833
11834         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11835
11836 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11837
11838         * expression.cs: Use StoreFromPtr instead of extracting the type
11839         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11840
11841         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11842         an enumeration value to a System.Enum, but System.Enum is not a
11843         value type, but an class type, so we need to box.
11844
11845         (Expression.ConvertExplicit): One codepath could return
11846         errors but not flag them.  Fix this.  Fixes #31853
11847
11848         * parameter.cs (Resolve): Do not allow void as a parameter type.
11849
11850 2002-10-06  Martin Baulig  <martin@gnome.org>
11851
11852         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11853         if it's a class type and not a struct.  Fixes #31815.
11854
11855 2002-10-06  Martin Baulig  <martin@gnome.org>
11856
11857         * statement.cs: Reworked the flow analysis code a bit to make it
11858         usable for dead code elimination.
11859
11860 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11861
11862         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11863
11864 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11865
11866         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11867         to fix the test 165, will investigate deeper.
11868
11869 2002-10-04  Martin Baulig  <martin@gnome.org>
11870
11871         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11872         finally blocks actually work.
11873         (Try.Resolve): We don't need to create a sibling for `finally' if
11874         there is no finally block.
11875
11876 2002-10-04  Martin Baulig  <martin@gnome.org>
11877
11878         * class.cs (Constructor.Define): The default accessibility for a
11879         non-default constructor is private, not public.
11880
11881 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11882
11883         * class.cs (Constructor): Make AllowedModifiers public, add
11884         EXTERN.
11885
11886         * cs-parser.jay: Perform the modifiers test here, as the
11887         constructor for the Constructor class usually receives a zero
11888         because of the way we create it (first we create, later we
11889         customize, and we were never checking the modifiers).
11890
11891         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11892         is a version of LookupTypeReflection that includes the type-name
11893         cache.  This can be used as a fast path for functions that know
11894         the fully qualified name and are only calling into *.GetType() to
11895         obtain a composed type.
11896
11897         This is also used by TypeManager.LookupType during its type
11898         composition.
11899
11900         (LookupType): We now also track the real type name, as sometimes
11901         we can get a quey for the real type name from things like
11902         ComposedCast.  This fixes bug 31422.
11903
11904         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11905         complete type fullname, it does not have to go through the type
11906         resolution system to obtain the composed version of the type (for
11907         obtaining arrays or pointers).
11908
11909         (Conditional.Emit): Use the EmitBoolExpression to
11910         generate nicer code, as requested by Paolo.
11911
11912         (ArrayCreation.CheckIndices): Use the patch from
11913         hwang_rob@yahoo.ca to validate the array initializers. 
11914
11915 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11916
11917         * class.cs (ConstructorInitializer.Emit): simplify code by using
11918         Invocation.EmitCall, and at the same time, fix the bugs in calling
11919         parent constructors that took variable arguments. 
11920
11921         * ecore.cs (Expression.ConvertNumericExplicit,
11922         Expression.ImplicitNumericConversion): Remove the code that
11923         manually wrapped decimal (InternalTypeConstructor call is now gone
11924         as well).
11925
11926         * expression.cs (Cast.TryReduce): Also handle decimal types when
11927         trying to perform a constant fold on the type.
11928
11929         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11930
11931         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11932         that only turned off an error report, and did nothing else. 
11933
11934 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11935
11936         * driver.cs: Handle and ignore /fullpaths
11937
11938 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11939
11940         * expression.cs (Binary.ResolveOperator): Catch the case where
11941         DoNumericPromotions returns true, 
11942
11943         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11944
11945 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11946
11947         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11948         report error 70.
11949
11950 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11951
11952         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11953         conversion exists, but it is also required that the conversion be
11954         performed.  This manifested in "(Type64Enum) 2".  
11955
11956         * class.cs (TypeManager.AddMethod): The fix is not to change
11957         AddEnum, because that one was using a fully qualified name (every
11958         DeclSpace derivative does), but to change the AddMethod routine
11959         that was using an un-namespaced name.  This now correctly reports
11960         the duplicated name.
11961
11962         Revert patch until I can properly fix it.  The issue
11963         is that we have a shared Type space across all namespaces
11964         currently, which is wrong.
11965
11966         Options include making the Namespace a DeclSpace, and merge
11967         current_namespace/current_container in the parser.
11968
11969 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11970
11971         * cs-parser.jay: Improve error reporting when we get a different
11972         kind of expression in local_variable_type and
11973         local_variable_pointer_type. 
11974
11975         Propagate this to avoid missleading errors being reported.
11976
11977         * ecore.cs (ImplicitReferenceConversion): treat
11978         TypeManager.value_type as a target just like object_type.   As
11979         code like this:
11980
11981         ValueType v = 1;
11982
11983         Is valid, and needs to result in the int 1 being boxed before it
11984         is assigned to the value type v.
11985
11986         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11987         to validate the enumeration name.
11988
11989         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11990         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11991         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11992
11993         * ecore.cs (TryImplicitIntConversion): When doing an
11994         implicit-enumeration-conversion, check if the type is 64-bits and
11995         perform a conversion before passing to EnumConstant.
11996
11997 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11998
11999         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12000         report ambiguous type references.  Unlike the MS version, we
12001         report what the ambiguity is.   Innovation at work ;-)
12002
12003         (DeclSpace.FindType): Require a location argument to
12004         display when we display an ambiguous error.
12005
12006         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12007
12008         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12009
12010         * expression.cs (EmitDynamicInitializers): Apply patch from
12011         hwang_rob@yahoo.ca that fixes the order in which we emit our
12012         initializers. 
12013
12014 2002-09-21  Martin Baulig  <martin@gnome.org>
12015
12016         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12017         delegate takes no arguments.
12018
12019 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12020
12021         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12022         from integers.
12023
12024         * expression.cs: Extract the underlying type.
12025
12026         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12027
12028         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12029
12030 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12031
12032         * class.cs (TypeContainer.DefineType): We can not use the nice
12033         PackingSize with the size set to 1 DefineType method, because it
12034         will not allow us to define the interfaces that the struct
12035         implements.
12036
12037         This completes the fixing of bug 27287
12038
12039         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12040         means also structs.  This fixes part of the problem. 
12041         (Expresion.ImplicitReferenceConversionExists): ditto.
12042
12043         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12044         error if there were no errors reported during the type lookup
12045         process, to avoid duplicates or redundant errors.  Without this
12046         you would get an ambiguous errors plus a type not found.  We have
12047         beaten the user enough with the first error.  
12048
12049         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12050         reference. 
12051
12052         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12053         during the resolution process, stop the lookup, this avoids
12054         repeated error reports (same error twice).
12055
12056         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12057
12058         * typemanager.cs (LookupType): Redo the type lookup code to match
12059         the needs of System.Reflection.  
12060
12061         The issue is that System.Reflection requires references to nested
12062         types to begin with a "+" sign instead of a dot.  So toplevel
12063         types look like: "NameSpace.TopLevelClass", and nested ones look
12064         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12065         levels. 
12066
12067 2002-09-19  Martin Baulig  <martin@gnome.org>
12068
12069         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12070         says that a method always returns or always throws an exception,
12071         don't report the CS0161.
12072
12073         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12074         set `Returns = new_returns'.
12075
12076 2002-09-19  Martin Baulig  <martin@gnome.org>
12077
12078         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12079         to an enum constant, check for a CS0176.
12080
12081 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12082
12083         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12084         for operators that must be in pairs and report errors.
12085
12086         * ecore.cs (SimpleName.DoResolveType): During the initial type
12087         resolution process, when we define types recursively, we must
12088         check first for types in our current scope before we perform
12089         lookups in the enclosing scopes.
12090
12091         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12092
12093         (Invocation.VerifyArgumentsCompat): Call
12094         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12095         I thought we were supposed to always call this, but there are a
12096         few places in the code where we dont do it.
12097
12098 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12099
12100         * driver.cs: Add support in -linkres and -resource to specify the
12101         name of the identifier.
12102
12103 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12104
12105         * ecore.cs (StandardConversionExists): Sync with the conversion
12106         code: allow anything-* to void* conversions.
12107
12108         (FindMostSpecificSource): Use an Expression argument
12109         instead of a Type, because we might be handed over a Literal which
12110         gets a few more implicit conversions that plain types do not.  So
12111         this information was being lost.
12112
12113         Also, we drop the temporary type-holder expression when not
12114         required.
12115
12116 2002-09-17  Martin Baulig  <martin@gnome.org>
12117
12118         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12119         this is an explicit interface implementation.
12120
12121 2002-09-17  Martin Baulig  <martin@gnome.org>
12122
12123         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12124         different `IndexerName' attributes.
12125
12126         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12127         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12128         virtual CommonResolve().
12129
12130 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12131
12132         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12133         and convert that to the UnderlyingType.
12134
12135         * statement.cs (Foreach.Resolve): Indexers are just like variables
12136         or PropertyAccesses.
12137
12138         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12139         inside quoted strings, we were not doing this before.
12140
12141 2002-09-16  Martin Baulig  <martin@gnome.org>
12142
12143         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12144         resolve it.  This is needed for the definite assignment check of the
12145         instance expression, fixes bug #29846.
12146         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12147
12148 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12149
12150         * parameter.cs: Fix compile error.  Cannot reference static member
12151         from an instance object.  Is this an mcs bug?
12152
12153 2002-09-14  Martin Baulig  <martin@gnome.org>
12154
12155         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12156         multiple times.  Fixes bug #30295, added test-166.cs.
12157
12158 2002-09-14  Martin Baulig  <martin@gnome.org>
12159
12160         * statement.cs (Block.Emit): Don't emit unreachable code.
12161         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12162         `break' statements.
12163         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12164
12165 2002-09-14  Martin Baulig  <martin@gnome.org>
12166
12167         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12168         is set.
12169
12170 2002-09-14  Martin Baulig  <martin@gnome.org>
12171
12172         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12173         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12174         be false on the ms runtime.
12175
12176 2002-09-13  Martin Baulig  <martin@gnome.org>
12177
12178         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12179         the CS0038 error message.
12180
12181 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12182
12183         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12184         constant inside, return it.
12185
12186 2002-09-12  Martin Baulig  <martin@gnome.org>
12187
12188         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12189         implicit conversion can be done between enum types.
12190
12191         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12192         check whether an implicit conversion to the current enum's UnderlyingType
12193         exists and report an error if not.
12194
12195         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12196         without debugging support.
12197
12198         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12199         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12200
12201 2002-09-12  Martin Baulig  <martin@gnome.org>
12202
12203         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12204
12205         * ecore.cs (IMemberExpr.DeclaringType): New property.
12206         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12207         nonstatic member of an outer type (CS0038).
12208
12209 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12210
12211         * driver.cs: Activate the using-error detector at warning level
12212         4 (at least for MS-compatible APIs).
12213
12214         * namespace.cs (VerifyUsing): Small buglett fix.
12215
12216         * pending.cs (PendingImplementation): pass the container pointer. 
12217
12218         * interface.cs (GetMethods): Allow for recursive definition.  Long
12219         term, I would like to move every type to support recursive
12220         definitions, not the current ordering mechanism that we have right
12221         now.
12222
12223         The situation is this: Attributes are handled before interfaces,
12224         so we can apply attributes to interfaces.  But some attributes
12225         implement interfaces, we will now handle the simple cases
12226         (recursive definitions will just get an error).  
12227
12228         * parameter.cs: Only invalidate types at the end if we fail to
12229         lookup all types.  
12230
12231 2002-09-09  Martin Baulig  <martin@gnome.org>
12232
12233         * ecore.cs (PropertyExpr.Emit): Also check for
12234         TypeManager.system_int_array_get_length so this'll also work when
12235         compiling corlib.  Fixes #30003.
12236
12237 2002-09-09  Martin Baulig  <martin@gnome.org>
12238
12239         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12240         and throw an exception if we can't get the type's size.  Fixed #30040,
12241         added test-165.cs.
12242
12243 2002-09-09  Martin Baulig  <martin@gnome.org>
12244
12245         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12246
12247         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12248         context.  Fixes bug #30027.
12249
12250         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12251         virtual functions.  Fixes bug #30043, added test-164.cs.
12252
12253 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12254
12255         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12256
12257 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12258
12259         * driver.cs: Use an object to get the windows codepage since it's not a
12260         static property.
12261
12262 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12263
12264         * statement.cs (For.Emit): for infinite loops (test == null)
12265         return whether there is a break inside, not always "true".
12266
12267         * namespace.cs (UsingEntry): New struct to hold the name of the
12268         using definition, the location where it is defined, and whether it
12269         has been used in a successful type lookup.
12270
12271         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12272         strings.
12273
12274         * decl.cs: ditto.
12275
12276 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12277
12278         * attribute.cs : Fix incorrect code which relied on catching
12279         a NullReferenceException to detect a null being passed in
12280         where an object was expected.
12281
12282 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12283
12284         * statement.cs (Try): flag the catch variable as assigned
12285
12286         * expression.cs (Cast): Simplified by using ResolveType instead of
12287         manually resolving.
12288
12289         * statement.cs (Catch): Fix bug by using ResolveType.
12290
12291 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12292
12293         * expression.cs (BetterConversion): Special case for when we have
12294         a NullLiteral as the argument and we have to choose between string
12295         and object types - we choose string the way csc does.
12296
12297         * attribute.cs (Attribute.Resolve): Catch the
12298         NullReferenceException and report error #182 since the Mono
12299         runtime no more has the bug and having this exception raised means
12300         we tried to select a constructor which takes an object and is
12301         passed a null.
12302
12303 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12304
12305         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12306         message (1502, 1503) when we can't locate a method after overload
12307         resolution. This is much more informative and closes the bug
12308         Miguel reported.
12309
12310         * interface.cs (PopulateMethod): Return if there are no argument
12311         types. Fixes a NullReferenceException bug.
12312
12313         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12314         expressions too. Previously we were checking only in one place for
12315         positional arguments leaving out named arguments.
12316
12317         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12318         type to the enum type is not allowed. Remove code corresponding to
12319         that.
12320
12321         (ConvertNumericExplicit): Allow explicit conversions from
12322         the underlying type to enum type. This precisely follows the spec
12323         and closes a bug filed by Gonzalo.
12324
12325 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12326
12327         * compiler.csproj:
12328         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12329
12330 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12331
12332         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12333         it was important that we stored the right value after the
12334         reduction in `converted'.
12335
12336 2002-09-04  Martin Baulig  <martin@gnome.org>
12337
12338         * location.cs (Location.SymbolDocument): Use full pathnames for the
12339         source files.
12340
12341 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12342
12343         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12344         of the expression resolve mechanism, because that will catch the
12345         SimpleName error failures.
12346
12347         (Conditional): If we can not resolve the
12348         expression, return, do not crash.
12349
12350 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12351
12352         * cs-tokenizer.cs:
12353         (location): display token name instead of its number.
12354
12355 2002-08-28  Martin Baulig  <martin@gnome.org>
12356
12357         * expression.cs (Binary.ResolveOperator): Don't silently return
12358         but return an error if an operator cannot be applied between two
12359         enum types.
12360
12361 2002-08-28  Martin Baulig  <martin@gnome.org>
12362
12363         * class.cs (Constructor.Define): Set the permission attributes
12364         correctly instead of making all constructors public.
12365
12366 2002-08-28  Martin Baulig  <martin@gnome.org>
12367
12368         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12369         for private members before reporting a CS0103; if we find anything,
12370         it's a CS0122.
12371
12372 2002-08-28  Martin Baulig  <martin@gnome.org>
12373
12374         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12375         to check whether `closure_start_type == closure_invocation_type',
12376         we also need to check whether `m.DeclaringType == closure_invocation_type'
12377         before bypassing the permission checks.  We might be accessing
12378         protected/private members from the base class.
12379         (TypeManager.RealMemberLookup): Only set private_ok if private
12380         members were requested via BindingFlags.NonPublic.
12381
12382         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12383
12384         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12385         MethodGroupExpr.IsExplicitImpl if appropriate.
12386         (Invocation.DoResolve): Don't report the CS0120 for explicit
12387         interface implementations.
12388
12389 2002-08-27  Martin Baulig  <martin@gnome.org>
12390
12391         * expression.cs (Invocation.DoResolve): If this is a static
12392         method and we don't have an InstanceExpression, we must report
12393         a CS0120.
12394
12395 2002-08-25  Martin Baulig  <martin@gnome.org>
12396
12397         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12398         `==' between a valuetype and an object.
12399
12400 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12401
12402         * ecore.cs (TypeExpr): Provide a ToString method.
12403
12404 2002-08-24  Martin Baulig  <martin@gnome.org>
12405
12406         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12407         now called proggie.dbg and it's a binary file.
12408
12409 2002-08-23  Martin Baulig  <martin@gnome.org>
12410
12411         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12412
12413 2002-08-23  Martin Baulig  <martin@gnome.org>
12414
12415         * struct.cs (MyStructInfo.ctor): Make this work with empty
12416         structs; it's not allowed to use foreach() on null.
12417
12418 2002-08-23  Martin Baulig  <martin@gnome.org>
12419
12420         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12421         writer the full pathname of the generated assembly.
12422
12423 2002-08-23  Martin Baulig  <martin@gnome.org>
12424
12425         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12426         A `finally' block never returns or breaks; improved handling of
12427         unreachable code.
12428
12429 2002-08-23  Martin Baulig  <martin@gnome.org>
12430
12431         * statement.cs (Throw.Resolve): Allow `throw null'.
12432
12433 2002-08-23  Martin Baulig  <martin@gnome.org>
12434
12435         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12436         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12437         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12438         MemberLookup would return a wrong event if this is an explicit
12439         interface implementation and the class has an event with the same
12440         name.
12441
12442 2002-08-23  Martin Baulig  <martin@gnome.org>
12443
12444         * statement.cs (Block.AddChildVariableNames): New public method.
12445         (Block.AddChildVariableName): Likewise.
12446         (Block.IsVariableNameUsedInChildBlock): Likewise.
12447         (Block.AddVariable): Check whether a variable name has already
12448         been used in a child block.
12449
12450         * cs-parser.jay (declare_local_variables): Mark all variable names
12451         from the current block as being used in a child block in the
12452         implicit block.
12453
12454 2002-08-23  Martin Baulig  <martin@gnome.org>
12455
12456         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12457         find the symbol writer.
12458
12459         * driver.cs: csc also allows the arguments to /define being
12460         separated by commas, not only by semicolons.
12461
12462 2002-08-23  Martin Baulig  <martin@gnome.org>
12463
12464         * interface.cs (Interface.GetMembers): Added static check for events.
12465
12466 2002-08-15  Martin Baulig  <martin@gnome.org>
12467
12468         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12469         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12470
12471         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12472         why the MethodData.EmitDestructor() change was necessary.
12473
12474 2002-08-20  Martin Baulig  <martin@gnome.org>
12475
12476         * class.cs (TypeContainer.FindMembers): Added static check for events.
12477
12478         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12479
12480         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12481         use Type.GetEvents(), not Type.FindMembers().
12482
12483 2002-08-20  Martin Baulig  <martin@gnome.org>
12484
12485         * decl.cs (MemberCache): Added a special method cache which will
12486         be used for method-only searched.  This ensures that a method
12487         search will return a MethodInfo with the correct ReflectedType for
12488         inherited methods.      
12489
12490 2002-08-20  Martin Baulig  <martin@gnome.org>
12491
12492         * decl.cs (DeclSpace.FindMembers): Made this public.
12493
12494 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12495
12496         * delegate.cs: fixed build on windows.
12497         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12498
12499 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12500
12501         * ecore.cs (StandardConversionExists): Return a false
12502         if we are trying to convert the void type to anything else
12503         since that is not allowed.
12504
12505         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12506         we flag error 70 in the event an event is trying to be accessed
12507         directly from outside the declaring type.
12508
12509 2002-08-20  Martin Baulig  <martin@gnome.org>
12510
12511         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12512         MemberCache from typemanager.cs to decl.cs.
12513
12514 2002-08-19  Martin Baulig  <martin@gnome.org>
12515
12516         * class.cs (TypeContainer): Implement IMemberContainer.
12517         (TypeContainer.DefineMembers): Create the MemberCache.
12518         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12519         return public members if BindingFlags.Public was given, check
12520         whether members are static.
12521
12522 2002-08-16  Martin Baulig  <martin@gnome.org>
12523
12524         * decl.cs (DeclSpace.Define): Splitted this in Define and
12525         DefineMembers.  DefineMembers is called first and initializes the
12526         MemberCache.
12527
12528         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12529         DefineMembers() on all our DeclSpaces.
12530
12531         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12532         but call DefineMembers() on all nested interfaces.  We call their
12533         Define() in our new Define() function.
12534
12535         * interface.cs (Interface): Implement IMemberContainer.
12536         (Interface.Define): Moved all code except the attribute stuf to
12537         DefineMembers().
12538         (Interface.DefineMembers): Initialize the member cache.
12539
12540         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12541         need this anymore since we can use MemberCache.FindMembers directly.
12542
12543 2002-08-19  Martin Baulig  <martin@gnome.org>
12544
12545         * typemanager.cs (MemberCache): When creating the cache for an
12546         interface type, add all inherited members.
12547         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12548         to `out bool used_cache' and documented it.
12549         (TypeManager.MemberLookup): If we already used the cache in the first
12550         iteration, we don't need to do the interfaces check.
12551
12552 2002-08-19  Martin Baulig  <martin@gnome.org>
12553
12554         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12555         here from IMemberFinder and don't implement this interface anymore.
12556         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12557
12558         * typemanager.cs (IMemberFinder): This interface is now only used by
12559         classes which actually support the member cache.
12560         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12561         since we only put DeclSpaces into this Hashtable.
12562         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12563         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12564
12565 2002-08-16  Martin Baulig  <martin@gnome.org>
12566
12567         * typemanager.cs (ICachingMemberFinder): Removed.
12568         (IMemberFinder.MemberCache): New property.
12569         (TypeManager.FindMembers): Merged this with RealFindMembers().
12570         This function will never be called from TypeManager.MemberLookup()
12571         so we can't use the cache here, just the IMemberFinder.
12572         (TypeManager.MemberLookup_FindMembers): Check whether the
12573         IMemberFinder has a MemberCache and call the cache's FindMembers
12574         function.
12575         (MemberCache): Rewrote larger parts of this yet another time and
12576         cleaned it up a bit.
12577
12578 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12579
12580         * driver.cs (LoadArgs): Support quoting.
12581
12582         (Usage): Show the CSC-like command line arguments.
12583
12584         Improved a few error messages.
12585
12586 2002-08-15  Martin Baulig  <martin@gnome.org>
12587
12588         * typemanager.cs (IMemberContainer.Type): New property.
12589         (IMemberContainer.IsInterface): New property.
12590
12591         The following changes are conditional to BROKEN_RUNTIME, which is
12592         defined at the top of the file.
12593
12594         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12595         class'es members, but add all members from TypeHandle.ObjectType
12596         if we're an interface.
12597         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12598         is the current type.
12599         (MemberCache.CacheEntry.Container): Removed this field.
12600         (TypeHandle.GetMembers): Include inherited members.
12601
12602 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12603
12604         * typemanager.cs: fixed compilation and added a comment on a field that
12605         is never used.
12606
12607 2002-08-15  Martin Baulig  <martin@gnome.org>
12608
12609         * class.cs (ConstructorInitializer.Resolve): In the
12610         Expression.MemberLookup call, use the queried_type as
12611         invocation_type.
12612
12613         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12614         declared' attribute, it's always true.
12615         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12616         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12617         temporary wrapper for FindMembers which tells MemberLookup whether
12618         members from the base classes are included in the return value.
12619         This will go away soon.
12620         (TypeManager.MemberLookup): Use this temporary hack here; once the
12621         new MemberCache is completed, we don't need to do the DeclaredOnly
12622         looping here anymore since the MemberCache will take care of this.
12623         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12624         (MemberCache): When creating the MemberCache for a class, get
12625         members from the current class and all its base classes.
12626         (MemberCache.CacheEntry.Container): New field.  This is a
12627         temporary hack until the Mono runtime is fixed to distinguish
12628         between ReflectedType and DeclaringType.  It allows us to use MCS
12629         with both the MS runtime and the unfixed Mono runtime without
12630         problems and without accecting performance.
12631         (MemberCache.SearchMembers): The DeclaredOnly looping from
12632         TypeManager.MemberLookup is now done here.      
12633
12634 2002-08-14  Martin Baulig  <martin@gnome.org>
12635
12636         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12637         Type.GetFields on dynamic types but get the fields from the
12638         corresponding TypeContainer.
12639         (MyStructInfo.GetStructInfo): Added check for enum types.
12640
12641         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12642         (MemberList.SyncRoot): Implemented.
12643         (TypeManager.FilterWithClosure): No need to check permissions if
12644         closure_start_type == closure_invocation_type, don't crash if
12645         closure_invocation_type is null.
12646
12647 2002-08-13  Martin Baulig  <martin@gnome.org>
12648
12649         Rewrote TypeContainer.FindMembers to use a member cache.  This
12650         gives us a speed increase of about 35% for the self-hosting MCS
12651         build and of about 15-20% for the class libs (both on GNU/Linux).
12652
12653         * report.cs (Timer): New class to get enhanced profiling.  This
12654         whole class is "TIMER" conditional since it remarkably slows down
12655         compilation speed.
12656
12657         * class.cs (MemberList): New class.  This is an IList wrapper
12658         which we're now using instead of passing MemberInfo[]'s around to
12659         avoid copying this array unnecessarily.
12660         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12661         (ICachingMemberFinder, IMemberContainer): New interface.
12662         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12663         has already been checked, otherwise use it for the name comparision.
12664         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12665         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12666         if possible.  Returns a MemberList, not a MemberInfo [].
12667         (TypeHandle): New class, implements IMemberContainer.  We create
12668         one instance of this class per type, it contains a MemberCache
12669         which is used to do the member lookups.
12670         (MemberCache): New class.  Each instance of this class contains
12671         all members of a type and a name-based hash table.
12672         (MemberCache.FindMembers): This is our new member lookup
12673         function.  First, it looks up all members of the requested name in
12674         the hash table.  Then, it walks this list and sorts out all
12675         applicable members and returns them.
12676
12677 2002-08-13  Martin Baulig  <martin@gnome.org>
12678
12679         In addition to a nice code cleanup, this gives us a performance
12680         increase of about 1.4% on GNU/Linux - not much, but it's already
12681         half a second for the self-hosting MCS compilation.
12682
12683         * typemanager.cs (IMemberFinder): New interface.  It is used by
12684         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12685         Enum, Delegate or Interface.
12686         (TypeManager.finder_to_member_finder): New PtrHashtable.
12687         (TypeManager.finder_to_container): Removed.
12688         (TypeManager.finder_to_delegate): Removed.
12689         (TypeManager.finder_to_interface): Removed.
12690         (TypeManager.finder_to_enum): Removed.
12691
12692         * interface.cs (Interface): Implement IMemberFinder.
12693
12694         * delegate.cs (Delegate): Implement IMemberFinder.
12695
12696         * enum.cs (Enum): Implement IMemberFinder.
12697
12698         * class.cs (TypeContainer): Implement IMemberFinder.
12699
12700 2002-08-12  Martin Baulig  <martin@gnome.org>
12701
12702         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12703
12704 2002-08-12  Martin Baulig  <martin@gnome.org>
12705
12706         * ecore.cs (ITypeExpression): New interface for expressions which
12707         resolve to a type.
12708         (TypeExpression): Renamed to TypeLookupExpression.
12709         (Expression.DoResolve): If we're doing a types-only lookup, the
12710         expression must implement the ITypeExpression interface and we
12711         call DoResolveType() on it.
12712         (SimpleName): Implement the new ITypeExpression interface.
12713         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12714         hack, the situation that we're only looking up types can't happen
12715         anymore when this method is called.  Moved the type lookup code to
12716         DoResolveType() and call it.
12717         (SimpleName.DoResolveType): This ITypeExpression interface method
12718         is now doing the types-only lookup.
12719         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12720         (ResolveFlags): Added MaskExprClass.
12721
12722         * expression.cs (MemberAccess): Implement the ITypeExpression
12723         interface.
12724         (MemberAccess.DoResolve): Added support for a types-only lookup
12725         when we're called via ITypeExpression.DoResolveType().
12726         (ComposedCast): Implement the ITypeExpression interface.
12727
12728         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12729         Expression.Resolve() with ResolveFlags.Type instead.
12730
12731 2002-08-12  Martin Baulig  <martin@gnome.org>
12732
12733         * interface.cs (Interface.Define): Apply attributes.
12734
12735         * attribute.cs (Attribute.ApplyAttributes): Added support for
12736         interface attributes.
12737
12738 2002-08-11  Martin Baulig  <martin@gnome.org>
12739
12740         * statement.cs (Block.Emit): Only check the "this" variable if we
12741         do not always throw an exception.
12742
12743         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12744         whether the property has a set accessor.
12745
12746 2002-08-11  Martin Baulig  <martin@gnome.org>
12747
12748         Added control flow analysis support for structs.
12749
12750         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12751         with control flow analysis turned off.
12752         (IVariable): New interface.
12753         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12754         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12755         (FieldExpr.DoResolve): Resolve the instance expression with flow
12756         analysis turned off and do the definite assignment check after the
12757         resolving when we know what the expression will resolve to.
12758
12759         * expression.cs (LocalVariableReference, ParameterReference):
12760         Implement the new IVariable interface, only call the flow analysis
12761         code if ec.DoFlowAnalysis is true.
12762         (This): Added constructor which takes a Block argument.  Implement
12763         the new IVariable interface.
12764         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12765         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12766         This does the definite assignment checks for struct members.
12767
12768         * class.cs (Constructor.Emit): If this is a non-static `struct'
12769         constructor which doesn't have any initializer, call
12770         Block.AddThisVariable() to tell the flow analysis code that all
12771         struct elements must be initialized before control returns from
12772         the constructor.
12773
12774         * statement.cs (MyStructInfo): New public class.
12775         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12776         argument to this indexer.  If non-zero, check an individual struct
12777         member, not the whole struct.
12778         (FlowBranching.CheckOutParameters): Check struct members.
12779         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12780         overloaded versions of these methods which take an additional
12781         `int field_idx' argument to check struct members.
12782         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12783         overloaded versions of these methods which take an additional
12784         `string field_name' argument to check struct member.s
12785         (VariableInfo): Implement the IVariable interface.
12786         (VariableInfo.StructInfo): New public property.  Returns the
12787         MyStructInfo instance of the variable if it's a struct or null.
12788         (Block.AddThisVariable): New public method.  This is called from
12789         Constructor.Emit() for non-static `struct' constructor which do
12790         not have any initializer.  It creates a special variable for the
12791         "this" instance variable which will be checked by the flow
12792         analysis code to ensure that all of the struct's fields are
12793         initialized before control returns from the constructor.
12794         (UsageVector): Added support for struct members.  If a
12795         variable/parameter is a struct with N members, we reserve a slot
12796         in the usage vector for each member.  A struct is considered fully
12797         initialized if either the struct itself (slot 0) or all its
12798         members are initialized.
12799
12800 2002-08-08  Martin Baulig  <martin@gnome.org>
12801
12802         * driver.cs (Driver.MainDriver): Only report an error CS5001
12803         if there were no compilation errors.
12804
12805         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12806         `UnsafeContext' property to determine whether the parent is in
12807         unsafe context rather than checking the parent's ModFlags:
12808         classes nested in an unsafe class are unsafe as well.
12809
12810 2002-08-08  Martin Baulig  <martin@gnome.org>
12811
12812         * statement.cs (UsageVector.MergeChildren): Distinguish between
12813         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12814         we return.  Added test17() and test18() to test-154.cs.
12815
12816 2002-08-08  Martin Baulig  <martin@gnome.org>
12817
12818         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12819         Family access, make sure the invoking type isn't a subclass of the
12820         queried type (that'd be a CS1540).
12821
12822         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12823         this method which takes an additional `Type invocation_type'.
12824
12825         * expression.cs (BaseAccess.DoResolve): Use the base type as
12826         invocation and query type.
12827         (MemberAccess.DoResolve): If the lookup failed and we're about to
12828         report a CS0122, try a lookup with the ec.ContainerType - if this
12829         succeeds, we must report a CS1540.
12830
12831 2002-08-08  Martin Baulig  <martin@gnome.org>
12832
12833         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12834         (MethodGroupExpr): Implement the IMemberExpr interface.
12835
12836         * expression (MemberAccess.ResolveMemberAccess): No need to have
12837         any special code for MethodGroupExprs anymore, they're now
12838         IMemberExprs.   
12839
12840 2002-08-08  Martin Baulig  <martin@gnome.org>
12841
12842         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12843         Family, FamANDAssem and FamORAssem permissions.
12844         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12845
12846 2002-08-08  Martin Baulig  <martin@gnome.org>
12847
12848         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12849         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12850         or loop block.
12851
12852 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12853
12854         * driver.cs: implemented /resource option to embed managed resources.
12855
12856 2002-08-07  Martin Baulig  <martin@gnome.org>
12857
12858         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12859         (FieldBase.HasFieldInitializer): New public property.
12860         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12861         returns the field initializer and makes sure it is only resolved once.
12862         (TypeContainer.EmitFieldInitializers): Call
12863         FieldBase.GetInitializerExpression to get the initializer, this ensures
12864         that it isn't resolved multiple times.
12865
12866         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12867         the resolving process (SimpleName/MemberLookup) that we're currently
12868         emitting a field initializer (which must not access any instance members,
12869         this is an error CS0236).
12870
12871         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12872         argument, if the `IsFieldInitializer' flag is set, we must report and
12873         error CS0236 and not an error CS0120.   
12874
12875 2002-08-07  Martin Baulig  <martin@gnome.org>
12876
12877         * ecore.cs (IMemberExpr): New public interface.
12878         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12879         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12880         if the expression is an IMemberExpr.
12881
12882         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12883         to be null, implicitly default to `this' if we're non-static in
12884         this case.  Simplified the code a lot by using the new IMemberExpr
12885         interface.  Also fixed bug #28176 here.
12886
12887 2002-08-06  Martin Baulig  <martin@gnome.org>
12888
12889         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12890         ParameterReferences during semantic analysis so that we can do a
12891         type-only search when resolving Cast, TypeOf and SizeOf.
12892         (block): Pass the `current_local_parameters' to the Block's
12893         constructor.
12894
12895         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12896         argument to the constructor.
12897         (ConstructorInitializer.Resolve): Create a temporary implicit
12898         block with the parameters.
12899
12900         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12901         references here if we aren't doing a type-only search.
12902
12903         * statement.cs (Block): Added constructor which takes a
12904         `Parameters parameters' argument.
12905         (Block.Parameters): New public property.
12906
12907         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12908         to `Parameters' and made it public readonly.
12909
12910 2002-08-06  Martin Baulig  <martin@gnome.org>
12911
12912         * ecore.cs (Expression.Warning): Made this public as well.
12913
12914         * report.cs (Report.Debug): Print the contents of collections.
12915
12916 2002-08-06  Martin Baulig  <martin@gnome.org>
12917
12918         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12919         used to tell Resolve() which kinds of expressions it may return.
12920         (Expression.Resolve): Added overloaded version of this method which
12921         takes a `ResolveFlags flags' argument.  This can be used to tell
12922         Resolve() which kinds of expressions it may return.  Reports a
12923         CS0118 on error.
12924         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12925         ResolveFlags.SimpleName.
12926         (Expression.Error118): Added overloaded version of this method which
12927         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12928         which kinds of expressions are allowed.
12929
12930         * expression.cs (Argument.ResolveMethodGroup): New public method.
12931         Resolves an argument, but allows a MethodGroup to be returned.
12932         This is used when invoking a delegate.
12933
12934         * TODO: Updated a bit.
12935
12936 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12937
12938         Fixed compilation with csc.
12939
12940         * ecore.cs: Expression.Error made public. Is this correct? Should
12941         Warning be made public too?
12942
12943         * expression.cs: use ea.Location instead of ea.loc.
12944         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12945
12946 2002-08-06  Martin Baulig  <martin@gnome.org>
12947
12948         * ecore.cs (Expression.loc): Moved the location here instead of
12949         duplicating it in all derived classes.
12950         (Expression.Location): New public property.
12951         (Expression.Error, Expression.Warning): Made them non-static and
12952         removed the location argument.
12953         (Expression.Warning): Added overloaded version which takes an
12954         `int level' argument.
12955         (Expression.Error118): Make this non-static and removed the
12956         expression and location arguments.
12957         (TypeExpr): Added location argument to the constructor.
12958
12959         * expression.cs (StaticCallExpr): Added location argument to
12960         the constructor.
12961         (Indirection, PointerArithmetic): Likewise.
12962         (CheckedExpr, UnCheckedExpr): Likewise.
12963         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12964         (StringPtr): Likewise.
12965
12966
12967 2002-08-05  Martin Baulig  <martin@gnome.org>
12968
12969         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12970
12971         * assign.cs (Assign.DoResolve): Check whether the source
12972         expression is a value or variable.
12973
12974         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12975         while resolving the corresponding blocks.
12976
12977         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12978         an error, don't silently return null.
12979
12980         * statement.cs (Block.AddVariable): Do the error reporting here
12981         and distinguish between CS0128 and CS0136.
12982         (Block.DoResolve): Report all unused labels (warning CS0164).
12983         (LabeledStatement): Pass the location to the constructor.
12984         (LabeledStatement.HasBeenReferenced): New property.
12985         (LabeledStatement.Resolve): Set it to true here.
12986
12987         * statement.cs (Return.Emit): Return success even after reporting
12988         a type mismatch error (CS0126 or CS0127), this is what csc does and
12989         it avoids confusing the users with any consecutive errors.
12990
12991 2002-08-05  Martin Baulig  <martin@gnome.org>
12992
12993         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12994
12995         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12996
12997         * expression.cs (MemberAccess.DoResolve): Silently return if an
12998         error has already been reported.
12999
13000         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13001         error has already been reported.
13002
13003 2002-08-05  Martin Baulig  <martin@gnome.org>
13004
13005         * statement.cs (UsageVector): Only initialize the `parameters'
13006         vector if we actually have any "out" parameters.
13007
13008 2002-08-05  Martin Baulig  <martin@gnome.org>
13009
13010         * expression.cs (Binary.ResolveOperator): When combining delegates,
13011         they must have the same type.
13012
13013 2002-08-05  Martin Baulig  <martin@gnome.org>
13014
13015         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13016         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13017         work with the ms runtime and we also don't need it: if we're a
13018         PropertyBuilder and not in the `indexer_arguments' hash, then we
13019         are a property and not an indexer.
13020
13021         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13022         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13023         since the latter one doesn't work with the ms runtime.
13024
13025 2002-08-03  Martin Baulig  <martin@gnome.org>
13026
13027         Fixed bugs #27998 and #22735.
13028
13029         * class.cs (Method.IsOperator): New public field.
13030         (Method.CheckBase): Report CS0111 if there's already a method
13031         with the same parameters in the current class.  Report CS0508 when
13032         attempting to change the return type of an inherited method.
13033         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13034         and it's not marked abstract or extern.
13035         (PropertyBase): New abstract base class for Property and Indexer.
13036         (PropertyBase.CheckBase): Moved here from Property and made it work
13037         for indexers.
13038         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13039         the same so we can reuse it there.
13040         (Property, Indexer): Derive from PropertyBase.
13041         (MethodSignature.inheritable_property_signature_filter): New delegate
13042         to find properties and indexers.
13043
13044         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13045         argument and improved error reporting.
13046
13047         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13048         EmptyReadOnlyParameters and made it a property.
13049
13050         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13051         version of this method which takes a `PropertyInfo indexer'.
13052         (TypeManager.RegisterIndexer): New method.
13053
13054         * class.cs: Added myself as author of this file :-)
13055
13056 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13057
13058         * class.cs: fixed compilation on windoze.
13059
13060 2002-08-03  Martin Baulig  <martin@gnome.org>
13061
13062         * interface.cs (Interface.GetInterfaceBases): Check whether all
13063         base interfaces are at least as accessible than the current one.
13064
13065         * class.cs (TypeContainer.GetClassBases): Check whether base types
13066         are at least as accessible than the current type.
13067         (TypeContainer.AsAccessible): Implemented and made non-static.
13068         (MemberBase.CheckParameters): Report errors if the accessibility
13069         checks fail.
13070
13071         * delegate.cs (Delegate.Delegate): The default visibility is
13072         internal for top-level types and private for nested types.
13073         (Delegate.Define): Report errors if the accessibility checks fail.
13074
13075         * enum.cs (Enum.Enum): The default visibility is internal for
13076         top-level types and private for nested types.
13077         (Enum.DefineType): Compute the correct visibility.
13078
13079         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13080         function which takes a `bool is_toplevel' instead of a TypeContainer.
13081
13082         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13083         builtin type.
13084
13085 2002-08-02  Martin Baulig  <martin@gnome.org>
13086
13087         * expression.cs (LocalVariableReferenc): Added constructor which
13088         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13089         (LocalVariableReference.IsReadOnly): New property.
13090         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13091         variable is readonly, use our own readonly flag to do this; you can
13092         use the new constructor to get a writable reference to a read-only
13093         variable.
13094
13095         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13096         reference to the local variable.
13097
13098 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13099
13100         * rootcontext.cs (ResolveCore): Also include System.Exception
13101
13102         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13103         we reach an EmptyStatement.
13104
13105         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13106         is also fine.
13107
13108         * expression.cs (Binary.ResolveOperator): Check error result in
13109         two places.
13110
13111         use brtrue/brfalse directly and avoid compares to null.
13112
13113 2002-08-02  Martin Baulig  <martin@gnome.org>
13114
13115         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13116         Fixes bug #28407, added test-155.cs.
13117
13118 2002-08-01  Martin Baulig  <martin@gnome.org>
13119
13120         * class.cs (Event.EmitDefaultMethod): Make this work with static
13121         events.  Fixes #28311, added verify-3.cs.
13122
13123 2002-08-01  Martin Baulig  <martin@gnome.org>
13124
13125         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13126         `is_disposable' fields.
13127         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13128         `hm.is_disposable' if we're using the collection pattern.
13129         (Foreach.EmitCollectionForeach): Use the correct type for the
13130         enumerator's local variable, only emit the try/finally block if
13131         necessary (fixes #27713).
13132
13133 2002-08-01  Martin Baulig  <martin@gnome.org>
13134
13135         * ecore.cs (Expression.report118): Renamed to Error118 and made
13136         it public static.
13137
13138         * statement.cs (Throw.Resolve): Check whether the expression is of
13139         the correct type (CS0118) and whether the type derives from
13140         System.Exception (CS0155).
13141         (Catch.Resolve): New method.  Do the type lookup here and check
13142         whether it derives from System.Exception (CS0155).
13143         (Catch.CatchType, Catch.IsGeneral): New public properties.
13144
13145         * typemanager.cs (TypeManager.exception_type): Added.
13146
13147 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13148
13149         * driver.cs: Updated About function.
13150
13151 2002-07-31  Martin Baulig  <martin@gnome.org>
13152
13153         Implemented Control Flow Analysis.
13154
13155         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13156         (EmitContext.CurrentBranching): Added.
13157         (EmitContext.StartFlowBranching): Added.
13158         (EmitContext.EndFlowBranching): Added.
13159         (EmitContext.KillFlowBranching): Added.
13160         (EmitContext.IsVariableAssigned): Added.
13161         (EmitContext.SetVariableAssigned): Added.
13162         (EmitContext.IsParameterAssigned): Added.
13163         (EmitContext.SetParameterAssigned): Added.
13164         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13165         Added control flow analysis stuff here.
13166
13167         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13168         resolve the expression as lvalue.
13169         (LocalVariableReference.DoResolve): Check whether the variable has
13170         already been assigned.
13171         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13172         the parameter as assigned here.
13173         (ParameterReference.DoResolve): Check whether the parameter has already
13174         been assigned.
13175         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13176         expression as lvalue.
13177
13178         * statement.cs (FlowBranching): New class for the flow analysis code.
13179         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13180         (LabeledStatement.IsDefined): New public property.
13181         (LabeledStatement.AddUsageVector): New public method to tell flow
13182         analyis that the label may be reached via a forward jump.
13183         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13184         flow analysis.
13185         (VariableInfo.Number): New public field.  This is used by flow analysis
13186         to number all locals of a block.
13187         (Block.CountVariables): New public property.  This is the number of
13188         local variables in this block (including the locals from all parent
13189         blocks).
13190         (Block.EmitMeta): Number all the variables.
13191
13192         * statement.cs: Added flow analysis support to all classes.
13193
13194 2002-07-31  Martin Baulig  <martin@gnome.org>
13195
13196         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13197         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13198         then use this argument.
13199
13200         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13201
13202         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13203         use this to specify /define options.
13204
13205 2002-07-29  Martin Baulig  <martin@gnome.org>
13206
13207         * statement.cs (Fixed): Moved all code that does variable lookups
13208         and resolvings from Emit to Resolve.
13209
13210         * statement.cs (For): Moved all code that does variable lookups
13211         and resolvings from Emit to Resolve.
13212
13213         * statement.cs (Using): Moved all code that does variable lookups
13214         and resolvings from Emit to Resolve.
13215
13216 2002-07-29  Martin Baulig  <martin@gnome.org>
13217
13218         * attribute.cs (Attribute.Resolve): Explicitly catch a
13219         System.NullReferenceException when creating the
13220         CustromAttributeBuilder and report a different warning message.
13221
13222 2002-07-29  Martin Baulig  <martin@gnome.org>
13223
13224         * support.cs (ParameterData.ParameterName): Added method to
13225         get the name of a parameter.
13226
13227         * typemanager.cs (TypeManager.IsValueType): New public method.
13228
13229 2002-07-29  Martin Baulig  <martin@gnome.org>
13230
13231         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13232         is a flag which specifies that it's either ref or out.
13233         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13234         the out parameter to `out Parameter.Modifier mod', also set the
13235         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13236
13237         * support.cs (InternalParameters.ParameterModifier): Distinguish
13238         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13239         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13240
13241         * expression.cs (Argument.GetParameterModifier): Distinguish
13242         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13243         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13244
13245 2002-07-29  Martin Baulig  <martin@gnome.org>
13246
13247         * expression.cs (ParameterReference.ParameterReference): Added
13248         `Location loc' argument to the constructor.
13249
13250         * cs-parser.jay: Pass location to ParameterReference.
13251
13252 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13253
13254         * statement.cs (Try): Initialize the location.
13255
13256         * cs-parser.jay: pass location to Try.
13257
13258         * expression.cs (Unary.Reduce): Change the prototype to return
13259         whether a constant fold could be performed or not.  The result is
13260         returned in an out parameters.  In the case of Indirection and
13261         AddressOf, we want to perform the full tests.
13262
13263 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13264
13265         * statement.cs (Statement.Emit): Flag dead code.
13266
13267 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13268
13269         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13270
13271 2002-07-27  Martin Baulig  <martin@gnome.org>
13272
13273         * class.cs (MethodData.Define): Put back call to
13274         TypeManager.AddMethod(), accidentally commented this out.
13275
13276         * report.cs (Debug): New public method to print debugging information,
13277         this is `[Conditional ("DEBUG")]'.
13278
13279 2002-07-26  Martin Baulig  <martin@gnome.org>
13280
13281         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13282         (switch_statement): Push the current_block to the switch_stack and
13283         pop it again when we're done with the switch.
13284         (switch_section): The new block is a child of the current_block.
13285         Fixes bug #24007, added test-152.cs.
13286
13287 2002-07-27  Martin Baulig  <martin@gnome.org>
13288
13289         * expression.cs (Invocation.EmitArguments): When calling a varargs
13290         function with only its fixed arguments, we need to pass an empty
13291         array.
13292
13293 2002-07-27  Martin Baulig  <martin@gnome.org>
13294
13295         Mono 0.13 has been released.
13296
13297 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13298
13299         * driver.cs: Rename --resource to --linkres, because that is what
13300         we do currently, we dont support --resource yet.
13301
13302         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13303
13304 2002-07-25  Martin Baulig  <martin@gnome.org>
13305
13306         * class.cs (MethodData): New public class.  This is a `method builder'
13307         class for a method or one accessor of a Property/Indexer/Event.
13308         (MethodData.GetMethodFlags): Moved here from MemberBase.
13309         (MethodData.ApplyAttributes): Likewise.
13310         (MethodData.ApplyObsoleteAttribute): Likewise.
13311         (MethodData.ApplyConditionalAttribute): Likewise.
13312         (MethodData.ApplyDllImportAttribute): Likewise.
13313         (MethodData.CheckAbstractAndExternal): Likewise.
13314         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13315         (MethodData.Emit): Formerly known as Method.Emit().
13316         (MemberBase): Moved everything which was specific to a single
13317         accessor/method to MethodData.
13318         (Method): Create a new MethodData and call Define() and Emit() on it.
13319         (Property, Indexer, Event): Create a new MethodData objects for each
13320         accessor and call Define() and Emit() on them.
13321
13322 2002-07-25  Martin Baulig  <martin@gnome.org>
13323
13324         Made MethodCore derive from MemberBase to reuse the code from there.
13325         MemberBase now also checks for attributes.
13326
13327         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13328         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13329         as virtual.
13330         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13331         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13332         (MemberBase.ApplyAttributes): New virtual method; applies the
13333         attributes to a method or accessor.
13334         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13335         (MemberBase.ApplyConditionalAttribute): Likewise.
13336         (MemberBase.ApplyDllImportAttribute): Likewise.
13337         (MemberBase.CheckAbstractAndExternal): Likewise.
13338         (MethodCore.ParameterTypes): This is now a property instead of a
13339         method, it's initialized from DoDefineParameters().
13340         (MethodCore.ParameterInfo): Removed the set accessor.
13341         (MethodCore.DoDefineParameters): New protected virtual method to
13342         initialize ParameterTypes and ParameterInfo.
13343         (Method.GetReturnType): We can now simply return the MemberType.
13344         (Method.GetMethodFlags): Override the MemberBase version and add
13345         the conditional flags.
13346         (Method.CheckBase): Moved some code from Define() here, call
13347         DoDefineParameters() here.
13348         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13349         here to avoid some larger code duplication.
13350         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13351         ensure that abstract and external accessors don't declare a body.
13352
13353         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13354         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13355         lookup in the attribute's parent classes, so we need to abort as soon
13356         as we found the first match.
13357         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13358         the attribute has no arguments.
13359
13360         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13361         of a Method.
13362
13363 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13364
13365         * cs-parser.jay: reverted previous patch.
13366
13367 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13368
13369         * cs-parser.jay: fixed bug #22119.
13370
13371 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13372
13373         * attribute.cs: fixed compilation. The error was:
13374         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13375         be assigned to before control leaves the current method."
13376         [FIXME:  Filed as bug #28186: MCS must report this error.]
13377
13378 2002-07-25  Martin Baulig  <martin@gnome.org>
13379
13380         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13381         method to pull the condition name ouf of a Conditional attribute.
13382         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13383         the obsolete message and error flag out of an Obsolete attribute.
13384
13385         * class.cs (Method.GetMethodFlags): New public method to get the
13386         TypeManager.MethodFlags for this method.
13387         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13388         private methods.
13389         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13390         if we're overriding a virtual function, set the new private variable
13391         `parent_method'; call the new TypeManager.AddMethod().
13392
13393         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13394         the MethodBuilder and the Method in a PtrHashtable.
13395         (TypeManager.builder_to_method): Added for this purpose.
13396         (TypeManager.MethodFlags): Added IsObsoleteError.
13397         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13398         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13399         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13400         the message from the attribute.
13401
13402 2002-07-24  Martin Baulig  <martin@gnome.org>
13403
13404         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13405         preprocessor directives, ensure that the argument to #define/#undef is
13406         exactly one identifier and that it's actually an identifier.
13407
13408         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13409         did not work ....
13410
13411 2002-07-24  Martin Baulig  <martin@gnome.org>
13412
13413         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13414         initialize it to TypeManager.object_type in the constructor.
13415         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13416         of the `hm.get_current' method if we're using the collection pattern.
13417         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13418         for the explicit conversion to make it work when we're using the collection
13419         pattern and the `Current' property has a different return type than `object'.
13420         Fixes #27713.
13421
13422 2002-07-24  Martin Baulig  <martin@gnome.org>
13423
13424         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13425         does not match, but don't report any errors.  This method is called in
13426         order for all methods in a MethodGroupExpr until a matching method is
13427         found, so we don't want to bail out if the first method doesn't match.
13428         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13429         matches, report the 123.  Fixes #28070.
13430
13431 2002-07-24  Martin Baulig  <martin@gnome.org>
13432
13433         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13434         TypeManager.TypeToCoreType() to the top of the method so the
13435         following equality checks will work.  Fixes #28107.
13436
13437 2002-07-24  Martin Baulig  <martin@gnome.org>
13438
13439         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13440         operand is of type uint, and the other operand is of type sbyte,
13441         short or int, the operands are converted to type long." -
13442         Actually do what this comment already told us.  Fixes bug #28106,
13443         added test-150.cs.
13444
13445 2002-07-24  Martin Baulig  <martin@gnome.org>
13446
13447         * class.cs (MethodBase): New abstract class.  This is now a base
13448         class for Property, Indexer and Event to avoid some code duplication
13449         in their Define() and DefineMethods() methods.
13450         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13451         generic methods for Define() and DefineMethods().
13452         (FieldBase): Derive from MemberBase, not MemberCore.
13453         (Property): Derive from MemberBase, not MemberCore.
13454         (Property.DefineMethod): Moved all the code from this method to the
13455         new MethodBase.DefineAccessor(), just call it with appropriate
13456         argumetnts.
13457         (Property.Define): Call the new Property.DoDefine(), this does some
13458         sanity checks and we don't need to duplicate the code everywhere.
13459         (Event): Derive from MemberBase, not MemberCore.
13460         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13461         accessors, this will also make them work with interface events.
13462         (Indexer): Derive from MemberBase, not MemberCore.
13463         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13464         (Indexer.Define): Use the new MethodBase functions.
13465
13466         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13467         argument to the constructor.
13468         (Interface.FindMembers): Added support for interface events.
13469         (Interface.PopluateEvent): Implemented.
13470
13471         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13472
13473 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13474
13475         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13476         but this is required to check for a method name being the same as
13477         the containing class.  
13478
13479         Handle this now.
13480
13481 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13482
13483         * interface.cs: initialize variable.
13484
13485 2002-07-23  Martin Baulig  <martin@gnome.org>
13486
13487         Implemented the IndexerName attribute in interfaces.
13488
13489         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13490         name if this is an explicit interface implementation.
13491         (Indexer.InterfaceIndexerName): New public variable.  If we're
13492         implementing an interface indexer, this is the IndexerName in that
13493         interface.  Otherwise, it's the IndexerName.
13494         (Indexer.DefineMethod): If we're implementing interface indexer,
13495         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13496         and Pending.ImplementIndexer methods.
13497         (Indexer.Define): Also define the PropertyBuilder if we're
13498         implementing an interface indexer and this is neither an explicit
13499         interface implementation nor do the IndexerName match the one in
13500         the interface.
13501
13502         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13503         If a method is defined here, then we always need to create a proxy
13504         for it.  This is used when implementing interface indexers.
13505         (Pending.IsInterfaceIndexer): New public method.
13506         (Pending.ImplementIndexer): New public method.
13507         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13508         This is used when implementing interface indexers to define a proxy
13509         if necessary.
13510         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13511         define a proxy if necessary.
13512
13513         * interface.cs (Interface.IndexerName): New public variable.
13514         (Interface.PopulateIndexer): Set the IndexerName.
13515         (Interface.DefineIndexers): New private method.  Populate all the
13516         indexers and make sure their IndexerNames match.
13517
13518         * typemanager.cs (IndexerPropertyName): Added support for interface
13519         indexers.
13520
13521 2002-07-22  Martin Baulig  <martin@gnome.org>
13522
13523         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13524         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13525         ret if HasReturnLabel.
13526         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13527         variables.
13528
13529         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13530         and set the ec.LoopBeginTryCatchLevel.
13531         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13532         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13533         the current ec.TryCatchLevel, the branch goes out of an exception
13534         block.  In this case, we need to use Leave and not Br.
13535
13536 2002-07-22  Martin Baulig  <martin@gnome.org>
13537
13538         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13539         block unless the block does not always return or it is contained in
13540         another try { ... } catch { ... } block.  Fixes bug #26506.
13541         Added verify-1.cs to the test suite.
13542
13543 2002-07-22  Martin Baulig  <martin@gnome.org>
13544
13545         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13546         then we do not always return.  Fixes bug #24985.
13547
13548 2002-07-22  Martin Baulig  <martin@gnome.org>
13549
13550         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13551         lookup on a per-class level; ie. walk up the class hierarchy until we
13552         found at least one applicable method, then choose the best among them.
13553         Fixes bug #24463 and test-29.cs.
13554
13555 2002-07-22  Martin Baulig  <martin@gnome.org>
13556
13557         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13558         return types of the methods.  The return type is not part of the
13559         signature and we must not check it to make the `new' modifier work.
13560         Fixes bug #27999, also added test-147.cs.
13561         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13562
13563         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13564         on the method's return type.
13565
13566 2002-07-21  Martin Baulig  <martin@gnome.org>
13567
13568         * assign.cs: Make this work if the rightmost source is a constant and
13569         we need to do an implicit type conversion.  Also adding a few more tests
13570         to test-38.cs which should have caught this.
13571
13572         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13573         target in the makefile for this.  The makefile.gnu is primarily intended
13574         for end-users who don't want to debug the compiler.
13575
13576 2002-07-21  Martin Baulig  <martin@gnome.org>
13577
13578         * assign.cs: Improved the Assign class so it can now handle embedded
13579         assignments (X = Y = Z = something).  As a side-effect this'll now also
13580         consume less local variables.  test-38.cs now passes with MCS, added
13581         a few new test cases to that test.
13582
13583 2002-07-20  Martin Baulig  <martin@gnome.org>
13584
13585         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13586         instructions.  Fixes bug #27977, also added test-146.cs.
13587
13588 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13589
13590         * cs-tokenizer.cs: fixed getHex ().
13591
13592 2002-07-19  Martin Baulig  <martin@gnome.org>
13593
13594         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13595         not Type.GetType() to lookup the array type.  This is needed when
13596         we're constructing an array of a user-defined type.
13597         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13598         single-dimensional arrays, but also for single-dimensial arrays of
13599         type decimal.
13600
13601 2002-07-19  Martin Baulig  <martin@gnome.org>
13602
13603         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13604         this function is called, it's not allowed to share LocalBuilders
13605         among ILGenerators.
13606
13607 2002-07-19  Martin Baulig  <martin@gnome.org>
13608
13609         * expression.cs (Argument.Resolve): Report an error 118 when trying
13610         to pass a type as argument.
13611
13612 2002-07-18  Martin Baulig  <martin@gnome.org>
13613
13614         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13615         Conv_R_Un for the signed `long' type.
13616
13617 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13618
13619         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13620         `expr' for the temporary result, as that will fail if we do
13621         multiple resolves on the same expression.
13622
13623 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13624
13625         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13626         ec.TypeContainer for looking up aliases. 
13627
13628         * class.cs (TypeContainer): Remove LookupAlias from here.
13629
13630         * decl.cs (DeclSpace); Move here.
13631
13632 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13633
13634         * class.cs (FindMembers): Only call filter if the constructor
13635         bulider is not null.
13636
13637         Also handle delegates in `NestedTypes' now.  Now we will perform
13638         type lookups using the standard resolution process.  This also
13639         fixes a bug.
13640
13641         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13642         This uses Expressions (the limited kind that can be parsed by the
13643         tree) instead of strings.
13644
13645         * expression.cs (ComposedCast.ToString): Implement, used to flag
13646         errors since now we have to render expressions.
13647
13648         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13649         FormArrayType. 
13650
13651         * ecore.cs (SimpleName.ToString): ditto.
13652
13653         * cs-parser.jay: Instead of using strings to assemble types, use
13654         Expressions to assemble the type (using SimpleName, ComposedCast,
13655         MemberAccess).  This should fix the type lookups in declarations,
13656         because we were using a different code path for this.
13657
13658         * statement.cs (Block.Resolve): Continue processing statements
13659         even when there is an error.
13660
13661 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13662
13663         * class.cs (Event.Define): Also remove the `remove' method from
13664         the list of pending items.
13665
13666         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13667         generate more compact code. 
13668
13669 2002-07-17  Martin Baulig  <martin@gnome.org>
13670
13671         * const.cs (Const.LookupConstantValue): Add support for constant
13672         `unchecked' and `checked' expressions.
13673         Also adding test case test-140.cs for this.
13674
13675 2002-07-17  Martin Baulig  <martin@gnome.org>
13676
13677         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13678         check whether mi.ReturnType implements the IEnumerator interface; the
13679         `==' and the IsAssignableFrom() will fail in this situation.
13680
13681 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13682
13683         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13684         here too.
13685
13686 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13687
13688         * expression.cs: fixed bug #27811.
13689
13690 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13691
13692         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13693         Molaro: when we are a ref, the value already contains a pointer
13694         value, do not take the address of it.
13695
13696 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13697         * removed mb-parser.jay and mb-tokenizer.cs
13698
13699 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13700
13701         * expression.cs: check against the building corlib void type.
13702
13703 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13704
13705         * ecore.cs: fix for valuetype static readonly fields: when 
13706         initializing them, we need their address, not the address of a copy.
13707
13708 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13709
13710         * typemanager.cs: register also enum_type in corlib.
13711
13712 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13713
13714         * class.cs: allow calling this (but not base) initializers in structs.
13715
13716 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13717
13718         * ecore.cs: make sure we compare against the building base types
13719         in GetTypeSize ().
13720
13721 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13722
13723         * typemanager.cs: fix TypeToCoreType() to handle void and object
13724         (corlib gets no more typerefs after this change).
13725
13726 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * expression.cs (ArrayCreation.EmitArrayArguments): use
13729         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13730
13731         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13732         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13733         array indexes, the runtime actually forbids them.
13734
13735         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13736         for array arguments here.
13737
13738         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13739         instead of the default for ValueTypes.
13740
13741         (New.DoEmit): Use IsValueType instead of
13742         IsSubclassOf (value_type)
13743         (New.DoResolve): ditto.
13744         (Invocation.EmitCall): ditto.
13745
13746         * assign.cs (Assign): ditto.
13747
13748         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13749         Statements *are* currently doing part of their resolution during
13750         Emit.  
13751
13752         Expressions do always resolve during resolve, but statements are
13753         only required to propagate resolution to their children.
13754
13755 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13756
13757         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13758
13759         (LoadAssembly): Do not add the dll if it is already specified
13760
13761         (MainDriver): Add the System directory to the link path at the end,
13762         after all the other -L arguments. 
13763
13764         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13765         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13766         ldelem.u1) and using the opposite for sbytes.
13767
13768         This fixes Digger, and we can finally run it.
13769
13770         * driver.cs (UnixParseOption): Move the option parsing here.  
13771         (CSCParseOption): Implement CSC-like parsing of options.
13772
13773         We now support both modes of operation, the old Unix way, and the
13774         new CSC-like way.  This should help those who wanted to make cross
13775         platform makefiles.
13776
13777         The only thing broken is that /r:, /reference: and /lib: are not
13778         implemented, because I want to make those have the same semantics
13779         as the CSC compiler has, and kill once and for all the confussion
13780         around this.   Will be doing this tomorrow.
13781
13782         * statement.cs (Unsafe.Resolve): The state is checked during
13783         resolve, not emit, so we have to set the flags for IsUnsfe here.
13784
13785 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13786
13787         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13788         not catch the Error_ObjectRefRequired in SimpleName (as it is
13789         possible to have a class/instance variable name that later gets
13790         deambiguated), we have to check this here.      
13791
13792 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13793
13794         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13795         make static and put into Expression.
13796
13797         (Event.Define): Register the private field of the event with the 
13798         TypeManager so that GetFieldFromEvent can get at it.
13799
13800         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13801         keep track of the private field associated with an event which
13802         has no accessors.
13803
13804         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13805         private field.
13806
13807         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13808
13809 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13810
13811         * expression.cs (Binary.EmitBranchable): this routine emits the
13812         Binary expression in a branchable context.  This basically means:
13813         we need to branch somewhere, not just get the value on the stack.
13814
13815         This works together with Statement.EmitBoolExpression.
13816
13817         * statement.cs (Statement.EmitBoolExpression): Use
13818         EmitBranchable. 
13819
13820 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13821
13822         * statement.cs (For): Reduce the number of jumps in loops.
13823
13824         (For): Implement loop inversion for the For statement.
13825
13826         (Break): We can be breaking out of a Try/Catch controlled section
13827         (foreach might have an implicit try/catch clause), so we need to
13828         use Leave instead of Br.
13829
13830         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13831         now).  If the instace expression supports IMemoryLocation, we use
13832         the AddressOf method from the IMemoryLocation to extract the
13833         address instead of emitting the instance.
13834
13835         This showed up with `This', as we were emitting the instance
13836         always (Emit) instead of the Address of This.  Particularly
13837         interesting when This is a value type, as we dont want the Emit
13838         effect (which was to load the object).
13839
13840 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13841
13842         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13843
13844         * statement.cs (Checked): Set the CheckedState during the resolve
13845         process too, as the ConvCast operations track the checked state on
13846         the resolve process, and not emit.
13847
13848         * cs-parser.jay (namespace_member_declaration): Flag that we have
13849         found a declaration when we do.  This is used to flag error 1529
13850
13851         * driver.cs: Report ok when we display the help only.
13852
13853 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13854
13855         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13856
13857 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13858
13859         * cs-tokenizer.cs (define): We also have to track locally the
13860         defines.  AllDefines is just used for the Conditional Attribute,
13861         but we also need the local defines for the current source code. 
13862
13863 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13864
13865         * statement.cs (While, For, Do): These loops can exit through a
13866         Break statement, use this information to tell whether the
13867         statement is the last piece of code.
13868
13869         (Break): Flag that we break.
13870
13871         * codegen.cs (EmitContexts): New `Breaks' state variable.
13872
13873 2002-07-03  Martin Baulig  <martin@gnome.org>
13874
13875         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13876         modifiers in method declarations in structs.  Otherwise, you won't
13877         be able to override things like Object.Equals().
13878
13879 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13880
13881         * class.cs (Method, Property, Indexer): Do not allow the public
13882         modifier to be used in explicit interface implementations.
13883
13884         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13885         override modifiers in method declarations in structs
13886
13887 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13888
13889         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13890         integer or real overflow, report an error
13891
13892 2002-07-02  Martin Baulig  <martin@gnome.org>
13893
13894         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13895         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13896         to tell the runtime about our newly created System.Object and
13897         System.ValueType types.
13898
13899 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13900
13901         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13902         struct instead of Ldarg/Starg.
13903
13904 2002-07-02  Martin Baulig  <martin@gnome.org>
13905
13906         * expression.cs (Indirection.Indirection): Call
13907         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13908
13909 2002-07-02  Martin Baulig  <martin@gnome.org>
13910
13911         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13912         ValueType, call TypeManager.TypeToCoreType() on it.
13913         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13914         the OpCodes.Newarr argument.
13915
13916 2002-07-02  Martin Baulig  <martin@gnome.org>
13917
13918         * expression.cs (Invocation.EmitCall): When compiling corlib,
13919         replace all calls to the system's System.Array type to calls to
13920         the newly created one.
13921
13922         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13923         System.Array methods.
13924         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13925         from the system's System.Array type which must be replaced.
13926
13927 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13928
13929         * typemanager.cs: load unverifiable_code_ctor so we can build
13930         corlib using the correct type. Avoid using GetTypeCode() with
13931         TypeBuilders.
13932         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13933         TypeManager.object_type to allow building corlib.
13934
13935 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13936
13937         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13938
13939 2002-07-01  Martin Baulig  <martin@gnome.org>
13940
13941         * class.cs: Make the last change actually work, we need to check
13942         whether `ifaces != null' to avoid a crash.
13943
13944 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13945
13946         * class.cs: when we build structs without fields that implement
13947         interfaces, we need to add the interfaces separately, since there is
13948         no API to both set the size and add the interfaces at type creation
13949         time.
13950
13951 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13952
13953         * expression.cs: the dimension arguments to the array constructors
13954         need to be converted if they are a long.
13955
13956 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13957
13958         * class.cs: don't emit ldarg.0 if there is no parent constructor
13959         (fixes showstopper for corlib).
13960
13961 2002-06-29  Martin Baulig  <martin@gnome.org>
13962
13963         MCS now compiles corlib on GNU/Linux :-)
13964
13965         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13966         ie. check for MethodImplOptions.InternalCall.
13967
13968         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13969         and TypeManager.attribute_type are null, so we must explicitly check
13970         whether parent is not null to find out whether it's an attribute type.
13971         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13972         and SetBuilder, not only if the property is neither abstract nor external.
13973         This is necessary to set the MethodImplOptions on the accessor methods.
13974         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13975         SetBuilder, see Property.Emit().
13976
13977         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13978         populate "System.Object", "System.ValueType" and "System.Attribute" since
13979         they've already been populated from BootCorlib_PopulateCoreTypes().
13980
13981 2002-06-29  Martin Baulig  <martin@gnome.org>
13982
13983         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13984         is the NullLiteral, we also need to make sure that target_type is not
13985         an enum type.   
13986
13987 2002-06-29  Martin Baulig  <martin@gnome.org>
13988
13989         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13990         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13991         before calling BootstrapCorlib_ResolveDelegate ().
13992
13993 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13994
13995         * statement.cs: fixed build-breaker. All tests passed ok.
13996
13997 2002-06-27  Martin Baulig  <martin@gnome.org>
13998
13999         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14000         for System.Decimal when compiling corlib.
14001
14002 2002-06-27  Martin Baulig  <martin@gnome.org>
14003
14004         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14005         switch blocks which contain nothing but a default clause.
14006
14007 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14008
14009        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14010
14011 2002-06-27  Martin Baulig  <martin@gnome.org>
14012
14013         * ecore.cs (PropertyExpr.PropertyExpr): Call
14014         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14015
14016         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14017         is already a TypeBuilder.
14018
14019 2002-06-27  Martin Baulig  <martin@gnome.org>
14020
14021         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14022         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14023         the "from an array-type to System.Array" case.  This makes it work
14024         when compiling corlib.
14025
14026 2002-06-27  Martin Baulig  <martin@gnome.org>
14027
14028         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14029         non-static PropertyExpr, set its InstanceExpression.  This makes
14030         the `ICollection.Count' property work in System/Array.cs.
14031
14032 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14033
14034         * driver.cs: Made error handling more consistent.  Errors now
14035         tracked by Report class, so many methods which used to return int
14036         now return void.  Main() now prints success/failure and 
14037         errors/warnings message.
14038
14039         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14040         the magic number return values (123 and 124).  Now, if the
14041         expected error occurs, the compiler exits with success (exit value
14042         0).  If the compilation completes without seeing that particular
14043         error, the compiler exits with failure (exit value 1).  The
14044         makefile in mcs/errors has been changed to handle the new behaviour.
14045
14046         * report.cs: Made 'expected error' number a property and renamed
14047         it from 'Probe' to 'ExpectedError'.
14048
14049         * genericparser.cs: Removed error handling support, since it is
14050         now all done by Report class.
14051
14052         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14053         class, so parse() no longer returns an int.
14054
14055         * namespace.cs: Use Report.Error instead of GenericParser.error
14056
14057 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14058
14059         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14060         TypeContainer.AddOperator): At the front of the list put the
14061         explicit implementations, so they get resolved/defined first. 
14062
14063 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14064
14065         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14066         interface type is implemented by this TypeContainer.  Used during
14067         explicit interface implementation.
14068
14069         (Property.Define, Indexer.Define, Method.Define): Validate that
14070         the given interface in the explicit implementation is one of the
14071         base classes for the containing type.
14072
14073         Also if we are explicitly implementing an interface, but there is
14074         no match in the pending implementation table, report an error.
14075
14076         (Property.Define): Only define the property if we are
14077         not explicitly implementing a property from an interface.  Use the
14078         correct name also for those properties (the same CSC uses,
14079         although that is really not needed).
14080
14081         (Property.Emit): Do not emit attributes for explicitly implemented
14082         properties, as there is no TypeBuilder.
14083
14084         (Indexer.Emit): ditto.
14085
14086         Hiding then means that we do not really *implement* a pending
14087         implementation, which makes code fail.
14088
14089 2002-06-22  Martin Baulig  <martin@gnome.org>
14090
14091         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14092         the return value of Object.GetType().  [FIXME: we need to do this whenever
14093         we get a type back from the reflection library].
14094
14095 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14096
14097         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14098
14099 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14100
14101         * attribute.cs: Return null if we can not look up the type.
14102
14103         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14104         the interface types found.
14105
14106         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14107         interface types found.
14108
14109         * typemanager.cs (GetInterfaces): Make this routine returns alll
14110         the interfaces and work around the lame differences between
14111         System.Type and System.Reflection.Emit.TypeBuilder in the results
14112         result for GetInterfaces.
14113
14114         (ExpandInterfaces): Given an array of interface types, expand and
14115         eliminate repeated ocurrences of an interface.  This expands in
14116         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14117         be IA, IB, IC.
14118
14119 2002-06-21  Martin Baulig  <martin@gnome.org>
14120
14121         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14122         on System.Enum.
14123
14124 2002-06-21  Martin Baulig  <martin@gnome.org>
14125
14126         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14127         and called with one of the core types, return the corresponding typebuilder for
14128         that type.
14129
14130         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14131         element type.
14132
14133 2002-06-21  Martin Baulig  <martin@gnome.org>
14134
14135         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14136         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14137         (Expression.ConvertReferenceExplicit): Likewise.
14138
14139         * expression.cs (ElementAccess.DoResolve): Likewise.
14140         (ElementAccess.DoResolveLValue): Likewise.
14141
14142 2002-06-10  Martin Baulig  <martin@gnome.org>
14143
14144         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14145         add the "value" parameter to the parameter list.
14146
14147         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14148         to our caller.
14149
14150 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14151
14152         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14153         the argument to an int, uint, long or ulong, per the spec.  Also
14154         catch negative constants in array creation.
14155
14156 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14157
14158         * class.cs: do not allow the same interface to appear twice in
14159         the definition list.
14160
14161 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14162
14163         * ecore.cs: don't use ldlen with System.Array.
14164
14165 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14166
14167         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14168
14169 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14170
14171         * modifiers.cs: produce correct field attributes for protected
14172         internal. Easy fix so miguel can work on ther harder stuff:-)
14173
14174 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14175
14176         * pending.cs: New file.  Move the code from class.cs here.
14177         Support clearning the pending flag for all methods (when not doing
14178         explicit interface implementation).
14179
14180 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14181
14182         * rootcontext.cs: added a couple more types needed to bootstrap.
14183
14184 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14185
14186         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14187         constructor in the type, instead of any constructor in the type
14188         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14189         a bug in the Mono runtime when applying the params attribute). 
14190
14191 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14192         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14193
14194 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14195
14196         * expression.cs (Unary.ResolveOperator): Use TypeManager
14197         to resolve the type.
14198
14199 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14200
14201         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14202         attached.
14203
14204         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14205         with each member too.
14206
14207         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14208         field builders too - this takes care of the enum member case.
14209
14210 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14211
14212         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14213         address-of operator on both value types and pointers.
14214
14215 2002-06-10  Martin Baulig  <martin@gnome.org>
14216
14217         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14218         PropertyBuilder to the `property_builders' list.
14219
14220         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14221         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14222         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14223         find any indexers which are inherited from an interface.
14224
14225 2002-06-09  Martin Baulig  <martin@gnome.org>
14226
14227         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14228         the same type as the constant if necessary.  There's also a test-130.cs
14229         for this.
14230
14231         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14232
14233         * typemanager.cs (TypeManager.ChangeType): Previously known as
14234         Enum.ChangeEnumType().
14235
14236 2002-06-09  Martin Baulig  <martin@gnome.org>
14237
14238         * expression.cs (Cast.TryReduce): Added support for consts.
14239
14240 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14241
14242         * class.cs (Accessor): Hold attributes information so we can pass
14243         it along.
14244
14245         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14246         Modify to pass in attributes attached to the methods.
14247
14248         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14249
14250         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14251         to handle the Accessor kind :-)
14252
14253         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14254
14255 2002-06-08  Martin Baulig  <martin@gnome.org>
14256
14257         * expression.cs (Unary.TryReduceNegative): Added support for
14258         ULongConstants.
14259
14260 2002-06-08  Martin Baulig  <martin@gnome.org>
14261
14262         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14263         name can't be found in the `defined_names' - the caller will do a
14264         MemberLookup in this case and thus find methods in System.Enum
14265         such as Enum.IsDefined().
14266
14267 2002-06-08  Martin Baulig  <martin@gnome.org>
14268
14269         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14270         Convert.ChangeType() which works with TypeBuilder created types.
14271         (Enum.LookupEnumValue, Enum.Define): Use it here.
14272
14273         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14274         `TypeBuilder.BaseType != null' check.
14275         (TypeContainer.FindMembers): Only lookup parent members if we
14276         actually have a parent.
14277         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14278         (ConstructorInitializer.Resolve): Likewise.
14279
14280         * interface.cs (Interface.FindMembers): Added
14281         `TypeBuilder.BaseType != null' check.
14282
14283         * rootcontext.cs (RootContext.ResolveCore): Added
14284         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14285         classes_second_stage.
14286
14287         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14288         debug_type and trace_type when compiling with --nostdlib.       
14289
14290 2002-06-07  Martin Baulig  <martin@gnome.org>
14291
14292         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14293         (AddField): Set it to true when adding a non-static field.
14294         (DefineType): Use `have_nonstatic_fields' to find out whether we
14295         have non-static fields, not `Fields != null'.
14296
14297 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14298
14299         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14300         dereferencing a null on the static-field code path)
14301
14302 2002-05-30  Martin Baulig  <martin@gnome.org>
14303
14304         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14305         to take command line arguments.  Use reflection to call the new
14306         custom `Initialize' function on the symbol writer and pass it the
14307         command line arguments.
14308
14309         * driver.cs (--debug-args): New command line argument to pass command
14310         line arguments to the symbol writer.
14311
14312 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14313
14314         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14315         the target type for indexers and properties.  Thanks to Joe for
14316         catching this.
14317
14318 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * typemanager.cs (MethodFlags): returns the method flags
14321         (Obsolete/ShouldIgnore) that control warning emission and whether
14322         the invocation should be made, or ignored. 
14323
14324         * expression.cs (Invocation.Emit): Remove previous hack, we should
14325         not do this on matching a base type, we should do this based on an attribute
14326
14327         Only emit calls to System.Diagnostics.Debug and
14328         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14329         on the command line.
14330
14331         * rootcontext.cs: Global settings for tracing and debugging.
14332
14333         * cs-tokenizer.cs (define): New utility function to track
14334         defines.   Set the global settings for TRACE and DEBUG if found.
14335
14336 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14337
14338         * interface.cs (Populate*): Pass in the TypeContainer as well as
14339         the DeclSpace as parameters so that we can create EmitContexts and
14340         then use that to apply attributes etc.
14341
14342         (PopulateMethod, PopulateEvent, PopulateProperty)
14343         (PopulateIndexer): Apply attributes everywhere.
14344
14345         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14346         etc.
14347
14348         (ApplyAttributes): Update accordingly.
14349
14350         We now apply interface attributes for all members too.
14351
14352 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * class.cs (Indexer.Define); Correctly check if we are explicit
14355         implementation (instead of checking the Name for a ".", we
14356         directly look up if the InterfaceType was specified).
14357
14358         Delay the creation of the PropertyBuilder.
14359
14360         Only create the PropertyBuilder if we are not an explicit
14361         interface implementation.   This means that explicit interface
14362         implementation members do not participate in regular function
14363         lookups, and hence fixes another major ambiguity problem in
14364         overload resolution (that was the visible effect).
14365
14366         (DefineMethod): Return whether we are doing an interface
14367         implementation. 
14368
14369         * typemanager.cs: Temporary hack until we get attributes in
14370         interfaces (Ravi is working on that) and we get IndexerName
14371         support in interfaces.
14372
14373         * interface.cs: Register the indexers as properties.
14374
14375         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14376         warning, I have verified that this is a bug in the .NET runtime
14377         (JavaScript suffers of the same problem).
14378
14379         * typemanager.cs (MemberLookup): When looking up members for
14380         interfaces, the parent of an interface is the implicit
14381         System.Object (so we succeed in searches of Object methods in an
14382         interface method invocation.  Example:  IEnumerable x;  x.ToString
14383         ()) 
14384
14385 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * class.cs (Event): Events should also register if they do
14388         implement the methods that an interface requires.
14389
14390         * typemanager.cs (MemberLookup); use the new GetInterfaces
14391         method. 
14392
14393         (GetInterfaces): The code used to lookup interfaces for a type is
14394         used in more than one place, factor it here. 
14395
14396         * driver.cs: Track the errors at the bottom of the file, we kept
14397         on going.
14398
14399         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14400         instance if the method we are calling is static!
14401
14402 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14403
14404         * attribute.cs (ApplyAttributes): Make this function filter out
14405         the IndexerName attribute (as that attribute in reality is never
14406         applied) and return the string constant for the IndexerName
14407         attribute. 
14408
14409         * class.cs (TypeContainer.Emit): Validate that all the indexers
14410         have the same IndexerName attribute, and if so, set the
14411         DefaultName attribute on the class. 
14412
14413         * typemanager.cs: The return value might contain other stuff (not
14414         only methods).  For instance, consider a method with an "Item"
14415         property and an Item method.
14416
14417         * class.cs: If there is a problem with the parameter types,
14418         return. 
14419
14420 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14421
14422         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14423         looks at user defined conversion after making a call to 
14424         StandardConversionExists - we need this for overload resolution.
14425
14426         * expression.cs : Update accordingly the various method calls.
14427
14428         This fixes 2 bugs filed against implicit user defined conversions 
14429
14430 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14431
14432         * statement.cs: Track the result of the assignment.
14433
14434 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * expression.cs (MemberAccess): Improved error reporting for
14437         inaccessible members.
14438
14439 2002-05-22  Martin Baulig  <martin@gnome.org>
14440
14441         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14442         itself with debugging support.
14443
14444 2002-05-22  Martin Baulig  <martin@gnome.org>
14445
14446         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14447         Removed, this isn't needed anymore.
14448
14449 2002-05-20  Martin Baulig  <martin@gnome.org>
14450
14451         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14452         be underlying type for an enum.
14453
14454 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14455
14456         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14457         that splits out the loading of just the core types.
14458
14459         * rootcontext.cs (ResolveCore): Split the struct resolution in
14460         two, so we can load the enumeration underlying types before any
14461         enums are used.
14462
14463         * expression.cs (Is): Bandaid until we fix properly Switch (see
14464         bug #24985 for details).
14465
14466         * typemanager.cs (ImplementsInterface): The hashtable will contain
14467         a null if there are no interfaces implemented.
14468
14469 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14470
14471         * cs-parser.jay (indexer_declarator): It is fine to have array
14472         parameters
14473
14474 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * typemanager.cs: (RegisterBuilder): New function used to register
14477         TypeBuilders that implement interfaces.  Since
14478         TypeBuilder.GetInterfaces (as usual) does not work with lame
14479         Reflection.Emit. 
14480         (AddUserType): register interfaces.
14481
14482         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14483         dealing with TypeBuilder.  Also, arrays are showing up as
14484         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14485         methods can not be invoked on them!
14486
14487         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14488         (ImplicitReferenceConversionExists): Split out from
14489         StandardConversionExists. 
14490
14491         * expression.cs (As): We were only implementing one of the three
14492         cases for the as operator.  We now implement them all.
14493         (Is): Implement the various other cases for Is as well.
14494
14495         * typemanager.cs (CACHE): New define used to control if we want or
14496         not the FindMembers cache.  Seems to have a negative impact on
14497         performance currently
14498
14499         (MemberLookup): Nested types have full acess to
14500         enclosing type members
14501
14502         Remove code that coped with instance/static returns for events, we
14503         now catch this in RealFindMembers.
14504
14505         (RealFindMembers): only perform static lookup if the instance
14506         lookup did not return a type or an event.  
14507
14508 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14509
14510         * assign.cs (CompoundAssign): We pass more semantic information
14511         now to Compound Assignments than we did before: now we have all
14512         the information at hand, and now we resolve the target *before* we
14513         do the expression expansion, which allows the "CacheValue" method
14514         to have the effect we intended (before, a [x] += 1 would generate
14515         two differen ArrayAccess expressions from the ElementAccess,
14516         during the resolution process).
14517
14518         (CompoundAssign.DoResolve): Resolve target and original_source here.
14519
14520 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14521
14522         * expression.cs (ArrayAccess): dropped debugging information. 
14523
14524         * typemanager.cs: Small bug fix: I was always returning i_members,
14525         instead of one of i_members or s_members (depending on which had
14526         the content).
14527
14528         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14529         method is invoked before any code generation takes place, and it
14530         is a mechanism to inform that the expression will be invoked more
14531         than once, and that the method should use temporary values to
14532         avoid having side effects
14533
14534         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14535
14536         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14537         implementation.
14538
14539         * expression.cs (Indirection, ArrayAccess): Add support for
14540         CacheTemporaries in these two bad boys. 
14541
14542         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14543         ldobj or ldind_ref.  
14544         (StoreFromPtr): Handle stobj as well.
14545
14546         * expression.cs (UnaryMutator): Share more code.
14547
14548         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14549         down: I was not tracking the Filter function as well, which
14550         was affecting the results of the cache.
14551
14552 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14553
14554         * attribute.cs: Remove the hack to handle the CharSet property on
14555         StructLayouts. 
14556
14557 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14558
14559         * attribute.cs (DoResolve): More uglyness, we now only try to
14560         resolve the attribute partially, to extract the CharSet
14561         information (only if we are a StructLayout attribute).  Otherwise 
14562
14563         (GetExtraTypeInfo): Add some code to conditionally kill in the
14564         future this.   I am more and more convinced that the .NET
14565         framework has special code to handle the attribute setting on
14566         certain elements.
14567
14568         * expression.cs (IsParamsMethodApplicable): Revert my previous
14569         foreach change here, it was wrong.
14570
14571 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14572
14573         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14574         (pp_expr): do not abort on unknown input, just return.
14575         (eval): abort if there are pending chars.
14576
14577         * attribute.cs (Attribute.Resolve): Positional parameters are
14578         optional.  Deal with that case.
14579
14580         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14581         the Ansi/Unicode/Auto information for the type.
14582
14583         (TypeContainer.DefineType): instantiate the EmitContext here, as
14584         we will be using it during the type definition (to resolve
14585         attributes) and during the emit phase.
14586
14587         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14588         to pull type information out of the attributes
14589
14590         (Attribute.Resolve): track the constructor builder, and allow for
14591         multiple invocations (structs and classes will use this).
14592
14593         * ecore.cs (MemberLookupFinal): new version with all the
14594         parameters customizable.
14595
14596         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14597         constructors.  Return if the result value is null (as the error
14598         would have been flagged already by MemberLookupFinal)
14599
14600         Do not allow instances of abstract classes or interfaces to be
14601         created.
14602
14603         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14604         We have to compare the assembly property here when dealing with
14605         FamANDAssem and Assembly access modifiers, because we might be
14606         creating an assembly from *modules* (that means that we are not
14607         getting TypeBuilders for types defined in other modules that are
14608         part of this assembly).
14609
14610         (Method.Emit): If the method is marked abstract and has a body,
14611         emit an error. 
14612
14613         (TypeContainer.DefineMembers): If both the defined member and the
14614         parent name match are methods, then do not emit any warnings: let
14615         the Method.Define routine take care of flagging warnings.  But if
14616         there is a mismatch (method overrides something else, or method is
14617         overriwritten by something, then emit warning).
14618
14619         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14620         set to null, this means `do not check for the return type on the
14621         signature'. 
14622
14623         (Method.Define): set the return type for the method signature to
14624         null, so that we get methods with the same name and parameters and
14625         different return types.  This is used to flag warning 114 (you are
14626         hiding a method, and you probably want to use the new/override
14627         keywords instead).
14628
14629         * typemanager.cs (MemberLookup): Implemented proper access
14630         control, closing a long standing set of bug reports.  The problem
14631         was that the Framework only has two bits: Public and NonPublic,
14632         and NonPublic includes private and protected methods, but we need
14633         to enforce the FamANDAssem, FamOrAssem and Family. 
14634
14635 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14636
14637         * statement.cs (GotoCase): Return true: Ammounts to giving up
14638         knowledge on whether we return or not, and letting the other case
14639         be responsible for it.
14640
14641 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * driver.cs: Do not load directories for each file processed, only
14644         do it if there is a pattern.
14645
14646         * ecore.cs: Report readonly assigns here as well, as we might have
14647         been resolved only by MemberAccess.
14648
14649         (SimpleName.SimpleNameResolve): Also be useful for LValue
14650         resolution.   We need this to propagate assign to local readonly variables
14651
14652         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14653         do not want to reuse potential criteria memory.
14654
14655         * class.cs (MyEventBuilder): Set reflected_type;
14656
14657         * ecore.cs (Constantify): Added support for constifying bools.
14658
14659         (RootContext.LookupType): Added a cache for values looked up in
14660         the declaration space.
14661
14662         * typemanager.cs (FindMembers): Now is a front-end to
14663         RealFindMembers, and provides a two-level hashtable-based cache to
14664         the request.  
14665
14666         15% performance improvement: from 22.5 to 19.2 seconds.
14667
14668         * expression.cs (IsParamsMethodApplicable): use foreach.
14669         (Invocation.DoResolve): ditto.
14670         (New.DoResolve): ditto.
14671         (ArrayCreation.DoResolve): ditto.
14672
14673         * ecore.cs (FindMostEncompassingType): use foreach.
14674
14675         * delegate.cs (NewDelegate.DoResolve): Use foreach
14676
14677         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14678         (RemoveMethods): use foreach.
14679
14680         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14681         nested foreach statements instead of for, and also break out of
14682         the inner loop once a match is found.
14683
14684         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14685
14686 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14687
14688         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14689         we actually unwrap the expression to allow for extra information
14690         to be extracted. 
14691
14692         * expression.cs: Use Shr_Un on unsigned operations. 
14693
14694 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14695
14696         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14697         applicable operators was not being considered correctly. This closes
14698         the bug Miguel reported.
14699
14700 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14701
14702         * attribute.cs: check that the type derives from System.Attribute
14703         and report the correct error in that case (moved the duplicate code to
14704         its own method, too).
14705
14706 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14707
14708         * attribute.cs: lookup attribute type name as the spec says: first the
14709         bare attribute name and then name + "Attribute" (nant compiles with
14710         mcs after this fix).
14711
14712 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14713
14714         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14715         Because of the way we parse things, we should try to see if a
14716         UIntConstant can fit in an integer.
14717
14718 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14719
14720         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14721         when we are in an explicit context.
14722
14723         (ConvertReferenceExplicit): When converting from Iface type S to Class
14724         T make sure the rules are implemented as an OR.
14725
14726         * parameter.cs (ParameterType): Make it a property for now although the
14727         purpose really isn't anything immediate.
14728
14729         * expression.cs (Is*Applicable): Do better checking on the parameter type
14730         of a ref/out parameter. The ones from the system assemblies are already 
14731         marked with the correct type so we don't need to do any correction.
14732
14733         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14734         the object type is standard too so include that.
14735
14736 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14737
14738         * ecore.cs (StandardConversionExists): Augment with missing code:
14739         deal with IntConstant, LongConstants and Enumerations.
14740
14741         * assign.cs: Report the error, instead of failing silently
14742
14743         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14744         typecontainer that they are declared, because the
14745         typecontainer/namespace will have the list of using clauses that
14746         need to be applied.
14747
14748         Assembly Attributes were escaping the normal registration
14749         mechanism. 
14750
14751         (EmitCode): Apply attributes within an EmitContext that represents
14752         the container they were declared on.
14753
14754         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14755
14756 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14757
14758         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14759         Revamp completely - make much cleaner as we now operate only
14760         on a set of Types.
14761
14762         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14763         to implement the logic detailed in the spec more correctly.
14764
14765         (UserDefinedConversion): Update accordingly.
14766
14767 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14768
14769         * statement.cs: Return flow analysis information up.
14770
14771         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14772         and the default.
14773
14774         (token): Do not consume an extra character before calling
14775         decimal_digits.
14776
14777 2002-05-06  Piers Haken <piersh@friskit.com>
14778
14779         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14780
14781 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14782
14783         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14784         EmitContext during the instance constructor initializer
14785         resolution, to stop access to instance variables.
14786
14787         This is mandated by the spec, last paragraph of the `constructor
14788         initializers' section. 
14789
14790 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14791
14792         * cs-parser.jay, class.cs (Accessor): new class used to represent
14793         an accessor (get or set).  In the past we used `null' to represent
14794         a missing accessor.  But this is ambiguous because there was no
14795         way to tell in abstract indexers/properties if one of them was
14796         specified.
14797
14798         Now there is a way of addressing that.
14799
14800         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14801         instead of FindMembers.
14802
14803         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14804         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14805
14806         * attribute.cs: Treat indexers and properties as the same in terms
14807         of applying attributes
14808
14809         * ecore.cs (FindMostEncompassedType): Use statically initialized
14810         EmptyExpressions()s like we do elsewhere to avoid creating useless
14811         objects (and we take this out of the tight loop).
14812
14813         (GetConversionOperators): Move the code to extract the actual
14814         operators to a separate routine to clean things up.
14815
14816 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14817
14818         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14819         events are always registered FieldBuilders.
14820
14821         * class.cs (FieldBase): New class shared by Fields 
14822
14823         * delegate.cs: If we are a toplevel delegate, use our full name.
14824         If we are a nested delegate, then only use our tail name.
14825
14826 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14827
14828         * expression.cs (IsApplicable): Ensure that we add the "&" to
14829         ref/out types before comparing it with the type of the argument.
14830
14831         (IsParamsMethodApplicable): Ditto.
14832
14833         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14834         silly me ;-)
14835
14836         * delegate.cs : Handle the case when we have more than one applicable
14837         method. Flag an error only when we finish checking all.
14838
14839 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14840
14841         * expression.cs: Add support for boolean static initializers.
14842
14843 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14844
14845         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14846
14847         * parameter.cs (ComputeParameterTypes,
14848         ComputeAndDefineParameterTypes): Better error handling: now we
14849         clear the `types' cache if we fail during any of the type lookups.
14850         We also return the status code correctly to our caller
14851
14852         * delegate.cs: If we fail to define a delegate, abort the extra
14853         steps. 
14854
14855         * expression.cs (Binary.ResolveOperator): for
14856         operator==(object,object) and operator !=(object, object) we also
14857         have to verify that there is an implicit conversion from one to
14858         the other.
14859
14860         (ArrayAccess.DoResolve): Array Access can operate on
14861         non-variables. 
14862
14863 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14864
14865         * assign.cs (CompoundAssign): A new class used as a "flag" that
14866         the assignment actually is happening as part of a compound
14867         assignment operator.
14868
14869         During compound assignment, a few new rules exist to enable things
14870         like:
14871
14872         byte b |= 1 + 2
14873
14874         From the spec:
14875
14876         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14877         to the type of x) if y is implicitly convertible to the type of x,
14878         and the operator is a builtin operator and the return type of the
14879         operator is explicitly convertible to the type of x. 
14880
14881         * rootcontext.cs: Reset warning level to 2.  4 catches various
14882         "interesting" features in mcs, we must clean this up at some
14883         point, but currently am trying to kill other bugs ;-)
14884
14885         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14886         in container classes as well.  
14887
14888         * expression.cs (Binary.ResolveOperator): Handle string case
14889         before anything else (as operator overloading does emit an error
14890         before doing anything else).
14891
14892         This code could go away when we move to a table driven model, but
14893         i could not come up with a good plan last night.
14894
14895 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14896
14897         * typemanager.cs (CSharpName): reimplementation using regex.
14898         * class.cs: added null check for fields in Emit
14899         * rootcontext.cs: set warninglevel to 4
14900
14901 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14902
14903         * typemanager.cs (CSharpName): reimplemented with Lupus
14904         suggestion.
14905
14906 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14907
14908         * statement.cs (If): correclty implement Resolve, because we were
14909         not catching sem errors in there.  The same process is needed
14910         everywhere else. 
14911         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14912
14913
14914         (Statement.Warning_DeadCodeFound): Factorize code.
14915         (While): Report dead code here too.
14916
14917         (Statement): Added Resolve virtual method to allow
14918         for resolution split from the emit code.
14919
14920 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14921
14922         * statement.cs (EmitBoolExpression): No longer try to resolve the
14923         expression here.    
14924         (MakeBoolean): New utility function that resolve, implicitly
14925         converts to boolean and tags the expression. 
14926
14927
14928         (If, Do): Implement dead code elimination.
14929         (While): Implement loop inversion
14930
14931         (Do, While, For, If): Resolve the expression prior to calling our
14932         code generation.
14933
14934 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14935
14936         * class.cs:
14937           - added method Report28 (warning: program has more than one entry point)
14938           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14939           - modified method Method.Define, the part at the end of the method
14940
14941         * rootcontext.cs: added static public Location EntryPointLocation;
14942           
14943         * ../errors/cs0028.cs : Add test case for the above warning.              
14944
14945         * typemanager.cs:
14946           - modified method CSharpName to allow arrays of primitive type to
14947             be printed nicely (e.g. instead of System.Int32[][] it now prints
14948             int[][])
14949           - added method CSharpSignature: returns the signature of a method
14950             in string format to be used in reporting errors, warnings, etc.
14951
14952         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14953         with String.Empty.
14954
14955 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14956
14957         * delegate.cs (Define): Fix extremely silly bug where I was
14958         setting the type of the 'object' parameter of the BeginInvoke
14959         method to System.IAsyncResult instead of System.Object ;-)
14960
14961 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14962
14963         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14964         here. 
14965
14966         (Constructor.Emit): return if we fail to initialize the
14967         constructor.  Another door closed!  
14968
14969         * expression.cs (New.DoResolve): Improve error message (from -6 to
14970         1501).  Use DeclaredOnly lookup to find the exact constructor.
14971
14972         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14973         loop.  This is useful.
14974
14975         * cs-parser.jay: Adjust the default parameters so that destructors
14976         have the proper signature.
14977
14978 2002-04-26  Martin Baulig  <martin@gnome.org>
14979
14980         * driver.cs (LoadAssembly): If `assembly' contains any characters
14981         which are only valid in path names and not in assembly names
14982         (currently slash, backslash and point), use Assembly.LoadFrom ()
14983         instead of Assembly.Load () on the `assembly' (before iteration
14984         over the link_paths).
14985
14986 2002-04-26  Martin Baulig  <martin@gnome.org>
14987
14988         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14989
14990 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14991
14992         * class.cs (Property): use the new typemanager.MemberLookup
14993
14994         (TypeContainer.MemberLookup): Implement using the
14995         TypeManager.MemberLookup now. 
14996
14997         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14998         and return MemberInfos, so that these can be used without an
14999         EmitContext (what we had before).
15000
15001 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15002
15003         * expression.cs: Fix the case where the argument to params if the
15004         type of the params.  I omitted handling this before.   Fixed
15005
15006 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15007
15008         * driver.cs: Call BootCorlib_PopulateCoreType
15009
15010         * class.cs (Property.CheckBase): Check for properties only, not
15011         for all members. 
15012
15013         * interface.cs: Temporary hack: try/catch around the
15014         CustomAttributeBuilder, because I am getting an exception that I
15015         do not understand.
15016
15017         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15018         types whose definitions are required to be there (attributes are
15019         defined before standard types).
15020
15021         Compute definitions as we boot the various types, as they are used
15022         immediately (value_type class will need object_type, but if we do
15023         not initialize object_type, we will pass a null, which will let
15024         the runtime pick the System.Object from the existing corlib, which
15025         is not what we want).
15026
15027 2002-04-22  Patrik Torstensson <totte@labs2.com>
15028
15029         * cs-tokenizer.cs: fixed a number of trim() issues.
15030
15031 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15032
15033         * expression.cs (Argument.Type): Ensure that we return the correct
15034         type when we have out or ref parameters [in which case we 
15035         append a "&"].
15036
15037 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15038
15039         * class.cs (Property, Indexer): Allow extern modifier in there. 
15040
15041         * typemanager.cs (InitBaseTypes): Initializes object_type and
15042         value_type, since those will be used early on during the bootstrap
15043         process to compile corlib.
15044
15045         (InitCoreTypes): Move code from here to InitBaseTypes.
15046
15047 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15048
15049         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15050         single-dimension arrays as using the ldlen opcode.  
15051
15052         Daniel Lewis discovered this optimization.  
15053
15054         * typemanager.cs: Add signature for System.Array::get_Length
15055
15056 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15057
15058         * statement.cs: report the error when the foreach does not apply to an
15059         array nor a collection.
15060
15061 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15062
15063         * expression.cs: Add implicit conversions to the operator ~.
15064
15065         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15066
15067         * typemanager.cs: Locate the decimal constructor.
15068
15069 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15070
15071         * attribute.cs: use the new property of TypeOf.
15072         * expression.cs: added 'get' property around typearg.
15073
15074         These changes fix a build breaker reported by NickD. Is this the
15075         correct way to fix?  If not, please, revert my changes and make it
15076         work :-).
15077
15078 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15079
15080         * attribute.cs: Add support for typeof in attribute invocations.
15081         I am not sure that this is right though.
15082
15083 2002-04-14  Duncan Mak  <duncan@ximian.com>
15084
15085         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15086         Binary.Operator.Division case.
15087
15088 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15089
15090         * class.cs (DefineType): Ensure that we do a proper check on
15091         attribute types and also register it with the TypeManager.
15092
15093         (TypeContainer.Targets): The default for attribute types is
15094         AttributeTargets.All.
15095
15096         * attribute.cs (ApplyAttributes): Registering the attribute type
15097         is done elsewhere, not when we discover we have a Usage attribute.
15098
15099 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15100
15101         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15102         and get rid of is_delegate parameter.
15103
15104         * everywhere : update.
15105
15106 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15107
15108         * cs-parser.jay (compilation_unit): Revamp completely to use
15109         some new ideas that I got from Rhys' grammar to solve the problems
15110         with assembly level attributes.
15111
15112         (outer_declaration): New grammar production.
15113
15114         (attribute_sections): Add.
15115
15116         (opt_attributes): Base on attribute_sections
15117
15118         (namespace_declaration): Allow opt_attributes to tackle the case
15119         when we have assembly level attributes - we are clever in this
15120         regard now ;-)
15121
15122         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15123         attributes in the non-global context.
15124
15125         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15126         instead of SetGlobalAttributes.
15127
15128         * class.cs, rootcontext.cs : Ensure we define and generate 
15129         attribute types before anything else.
15130
15131         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15132         and flag the new error -20 for the case when the attribute type
15133         does not have valid targets specified. csc does not catch this.
15134
15135         * ../errors/errors.txt : update for error # -20
15136
15137 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15138
15139         * support.cs (InternalParameters.ParameterModifier): Do some null
15140         checking and return sane values.
15141
15142         * class.cs (Method.Define): If we are a PInvoke method, ensure
15143         that we are static and extern. Report error # 601
15144
15145         * ../errors/cs0601.cs : Add test case for the above error.
15146
15147 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15148
15149         * rootcontext.cs (attribute_types): We need to keep type of
15150         all attribute types separately and emit code for them first.
15151
15152         (RegisterAttribute) : Implement.
15153
15154         * class.cs (DefineType): Check if the current Type is a custom
15155         attribute type and register it accordingly.
15156
15157         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15158         adding the first attribute twice and rename to
15159
15160         (SetGlobalAttributes): this.
15161
15162         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15163         lookups.
15164
15165         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15166         if we are processing global arguments. Hmm, I am unsure of this.
15167
15168 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15169
15170         * expression.cs: added static array of strings to avoid calling
15171         Enum.ToString () for Operator in Binary. Significant recover of
15172         performance.
15173
15174 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15175
15176         * class.cs (FindMembers): Allow the Builders of the various
15177         members to be null.  If they are skip them.  This only happens
15178         during the PInvoke declaration.
15179
15180 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15181
15182         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15183         failure, so we do not keep going afterwards.
15184
15185         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15186         wanted to pass `false' as the `is_delegate' argument.  If this is
15187         the case, why not use delegate_type == null to mean `is_delegate =
15188         false' and anything else as is_delegate = true.
15189
15190 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15191
15192         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15193         code for the section, not the beginning of the tests.
15194
15195 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15196
15197         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15198
15199         * expression.cs (Binary): same.  Warn about errors where we have
15200         Enum/Enum in operator + as well.
15201
15202 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15203
15204         * statement.cs:
15205                 - added support for switch(bool)
15206                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15207                 - add TableSwitchEmit() to handle table-based switch statements
15208
15209 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15210
15211         * expression.cs (Invocation.OverloadResolve): Factor out code which
15212         does parameter compatibility checking with arguments so that we can 
15213         re-use the code even from Delegate.VerifyApplicability
15214
15215         (VerifyArgumentsCompat): Move above code here.
15216
15217         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15218         and instead make a call to the above method.
15219
15220 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15221
15222         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15223         We use it to keep track of classes which are attribute types.
15224
15225 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15226
15227         * delegate.cs (Delegate.Define): Correctly define the types in the
15228         presence of fixed and array parameters.
15229
15230         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15231         doing FindMembers.
15232
15233         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15234         include NonPublic after the first iteration.
15235
15236         * class.cs (Indexer.CheckBase): Only check if both parents are
15237         non-null. 
15238
15239         * cs-parser.jay (accessor_body): If empty, set to null.
15240
15241         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15242         same code path here to resolve constants names that we did have in
15243         MemberAccess.DoResolve.  There is too much code duplicated here.
15244
15245 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15246
15247         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15248
15249         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15250         to MakeUnionSet.
15251
15252         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15253         tokens, numbers and strings.
15254
15255         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15256         parenthesis.
15257
15258         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15259         asyncronous parameters and the regular parameters.  
15260
15261         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15262         specify the target directory.
15263
15264         * expression.cs: (This.DoResolve): Simplify
15265         (As.Emit): Optimize, do not generate IsInst if the expression is
15266         always of the given type.
15267
15268         (Is.DoResolve): Bug fix, we were reporting both always/never for
15269         the is expression.
15270
15271         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15272         creating too many unnecessary arrays.
15273
15274 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15275
15276         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15277         fields instead of rolling our own initializer.   Takes care of all
15278         implicit conversions, and drops unnecessary static checks/argument.
15279
15280 2002-03-31  Dick Porter  <dick@ximian.com>
15281
15282         * driver.cs: use the GetDirectories() return values properly, and
15283         use "/" as path separator.
15284
15285 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15286
15287         * expression.cs (Unary): Optimize - - expr into expr.
15288         (Binary): Optimize a + (-b) into a -b.
15289
15290         * codegen.cs (CodeGen): Made all methods static.
15291
15292 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * rootcontext.cs: 
15295
15296         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15297         TypeBuilder property.
15298
15299         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15300         instead. 
15301
15302         * tree.cs: Removed the various RecordXXXX, and replaced with a
15303         single RecordDecl.  Removed all the accessor methods, and just
15304         left a single access point Type 
15305
15306         * enum.cs: Rename DefineEnum to DefineType.
15307
15308         * decl.cs: New abstract method `DefineType' used to unify the
15309         Defines for Enumerations, Interfaces, TypeContainers and
15310         Delegates.
15311
15312         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15313         LookupBaseClasses method that used to live in class.cs and
15314         interface.cs here, and renamed to FindType.
15315
15316         * delegate.cs: Implement DefineType.  Take advantage of the
15317         refactored pattern for locating the parent builder without taking
15318         the parent_builder argument (which we know does not work if we are
15319         nested, and triggering a toplevel definition).
15320
15321 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15322
15323         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15324         accessibility of a member has changed during override and report
15325         an error if so.
15326
15327         * class.cs (Method.Define, Property.Define): Only complain on
15328         overrides if the method is private, any other accessibility is
15329         fine (and since we just checked the permission is the same, we are
15330         good to go).
15331
15332         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15333         and elif are processed always.  The other pre-processing
15334         directives are only processed if we are "taking" the path
15335
15336 2002-03-29  Martin Baulig  <martin@gnome.org>
15337
15338         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15339         current location is not Null.
15340
15341         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15342         a separate method so we can profile it.
15343
15344         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15345         `span.Seconds' are just seconds, but no minutes or hours.
15346         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15347
15348 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15351         Remove the gratuitous set of Final:
15352
15353                                 // If an interface implementation, then we can set Final.
15354                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15355                                     implementing.DeclaringType.IsInterface)
15356                                         flags |= MethodAttributes.Final;
15357
15358         I do not know what I was smoking when I used that.
15359
15360
15361         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15362         step into fixing the name resolution issues for delegates and
15363         unifying the toplevel name resolution.
15364
15365 2002-03-28  Martin Baulig  <martin@gnome.org>
15366
15367         * class.cs (Method.Emit): If we have a symbol writer, call its
15368         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15369         tell it about the current method.
15370
15371         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15372         writer that we're going to emit the first byte of IL code for a new
15373         statement (a new source line).
15374         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15375         EmitContext.Mark() before emitting any code.
15376
15377         * location.cs (SymbolDocument): Return null when we're Null.
15378
15379         * statement.cs (Statement): Moved the `Location loc' variable here.
15380         (Statement.EmitBoolExpression): If we have a symbol writer, call
15381         ec.Mark() before emitting any code to tell it that we're at the
15382         beginning of a new statement.
15383         (StatementExpression): Added `Location' argument to the constructor.
15384         (Block): Added public readonly variable `StartLocation' and public
15385         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15386         (Block): Added constructor which takes a start and end location.
15387         (Block.SetEndLocation): New method. This sets the end location.
15388         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15389         local variables we create.
15390         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15391         each statement and do also mark the begin and end of the block.
15392
15393         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15394         tell it the current lexer.Location, use Location.Null for the end of the
15395         block.
15396         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15397         current block, set its end location using SetEndLocation().
15398         (statement_expression): StatementExpression constructor now takes the
15399         lexer.Location as additional argument.
15400         (for_statement, declare_local_variables): Likewise.
15401         (declare_local_variables): When creating a new implicit block, use the
15402         new Block constructor and pass it the lexer.Location.
15403
15404 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15405
15406         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15407         members also on the parent interfaces recursively.
15408
15409 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15410
15411         * report.cs: Use new formats, since Gonzalo finished the missing
15412         bits. 
15413
15414         * expression.cs (Binary.ResolveOperator): added missing operator|
15415         operator& and operator^ for bool/bool.
15416
15417         * cs-parser.jay: CheckDef now takes a Location argument that is
15418         used to report errors more precisly (instead of reporting the end
15419         of a definition, we try to track something which is a lot closer
15420         to the source of the problem).
15421
15422         * cs-tokenizer.cs: Track global token use, so we can properly flag
15423         the use of #define/#undef after the first token has been seen.
15424
15425         Also, rename the reportXXXX to Error_DescriptiveName
15426
15427         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15428         TypeContainer, so that Enum and Interface can use this too.
15429
15430         * class.cs (TypeContainer.LookupInterfaceOrClass,
15431         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15432         `builder' argument.  Typically this was used to pass the parent
15433         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15434         the definition).  
15435
15436         The problem is that a nested class could trigger the definition of
15437         a toplevel class, and the builder would be obviously wrong in that
15438         case. 
15439
15440         So we drop this argument, and we compute dynamically the
15441         TypeBuilder/ModuleBuilder (the correct information was available
15442         to us anyways from DeclSpace.Parent)
15443
15444         * interface.cs (Interface.DefineInterface): Drop builder
15445         parameter cleanup like class.cs
15446
15447         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15448         like class.cs
15449
15450         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15451         values. 
15452
15453         (Try.Emit): Propagate the returns value from the statement.
15454
15455         (Return.Emit): Even if we are leavning 
15456
15457         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15458
15459         * modifiers.cs: Fix the computation of MethodAttributes flags.
15460
15461 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15462
15463         * driver.cs: allow compilation of files that start with '/'.
15464         Add a default case when checking the argument of --target.
15465
15466 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15467
15468         * interface.cs: Implement the same search algorithm for types in
15469         the interface code.
15470
15471         * delegate.cs: Do not allow multiple definition.
15472
15473         * Recovered ChangeLog that got accidentally amputated
15474
15475         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15476
15477         * rootcontext.cs: Load manually enum to allow core classes to
15478         contain enumerations.
15479
15480         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15481         Update to new static methods in TypeManager.
15482
15483         * typemanager.cs (GetMethod, GetConstructor): Use our
15484         implementation of FindMembers to find the members, since during
15485         corlib compilation, the types are TypeBuilders and GetMethod and
15486         GetConstructor do not work.
15487
15488         Make all methods in TypeManager static.
15489
15490         (InitCodeHelpers): Split the functionality from
15491         the InitCodeTypes function.
15492
15493         * driver.cs: Call InitCodeHelpers after we have populated the
15494         types. 
15495
15496         * cs-parser.jay (delegate_declaration): we did not used to compute
15497         the delegate name correctly for void delegates.
15498
15499 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * rootcontext.cs (RootContext): Init the interface_resolve_order
15502         and type_container_resolve_order always.
15503
15504         (ResolveCore, BootstrapCorlib_ResolveClass,
15505         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15506         compiler when compiling with --nostdlib
15507
15508         * class.cs (TypeContainer.DefineType): Check that our parent is
15509         not null.  This test is most important when we are bootstraping
15510         the core types.
15511
15512         * codegen.cs: Split out the symbol writing code.
15513
15514 2002-03-25  Martin Baulig  <martin@gnome.org>
15515
15516         * driver.cs (-g): Made -g an alias for --debug.
15517
15518 2002-03-24  Martin Baulig  <martin@gnome.org>
15519
15520         * codegen.cs (SymbolWriter): New public variable. Returns the
15521         current symbol writer.
15522         (CodeGen): Added `bool want_debugging_support' argument to the
15523          constructor. If true, tell the ModuleBuild that we want debugging
15524         support and ask it for the ISymbolWriter.
15525         (Save): If we have a symbol writer, call it's Close() method after
15526         saving the assembly.
15527
15528         * driver.c (--debug): New command line argument to create a
15529         debugger information file.
15530
15531         * location.cs (SymbolDocument): New public property. Returns an
15532         ISymbolDocumentWriter object for the current source file or null
15533         if we don't have a symbol writer.
15534
15535 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15536
15537         * driver.cs (LoadAssembly): Correctly return when all the paths
15538         have been tried and not before.
15539
15540         * statement.cs (Switch.Emit): return the actual coverage for this
15541         statement (returns/not-returns)
15542
15543         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15544         switch of the statement if we are the last switch section.  That
15545         kills two problems: try/catch problems (we used to emit an empty
15546         nop at the end) and switch statements where all branches would
15547         return. 
15548
15549 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15550
15551         * driver.cs: Add default assemblies (the equivalent to the
15552         Microsoft CSC.RSP file)
15553
15554         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15555         also update tokens_seen and set it to false.
15556
15557         * driver.cs: Implement --recurse for Mike.
15558
15559         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15560         correctly splitting out the paths.
15561
15562 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15563
15564         * interface.cs (Interface.PopulateProperty): Instead of using
15565         `parent' as the declaration space for the set parameters, use
15566         `this' 
15567
15568         * support.cs (InternalParameters): InternalParameters constructor
15569         takes a DeclSpace instead of a TypeContainer.
15570
15571         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15572         types are being initialized, load the address of it before calling
15573         the function.  
15574
15575         (New): Provide a mechanism to disable the generation of local
15576         value type temporaries when the caller will be providing us with
15577         an address to store it.
15578
15579         (ArrayCreation.EmitDynamicInitializers): Use it.
15580
15581 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * expression.cs (Invocation.EmitArguments): Only probe for array
15584         property if there is more than one argument.  Sorry about that.
15585
15586         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15587         empty param arrays.
15588
15589         * class.cs (Method.LabelParameters): Fix incorrect code path that
15590         prevented the `ParamArrayAttribute' from being applied to the
15591         params attribute.
15592
15593 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15594
15595         * support.cs (ReflectionParameters): Correctly compute whether the
15596         last argument is a params array.  Fixes the problem with
15597         string.Split ('a')
15598
15599         * typemanager.cs: Make the assemblies array always be non-null
15600         (empty, but non-null)
15601
15602         * tree.cs (RecordDecl): New function that abstracts the recording
15603         of names.  This reports error 101, and provides a pointer to the
15604         previous declaration.  Fixes a crash in the compiler.
15605
15606         * cs-parser.jay (constructor_declaration): Update to new grammar,
15607         and provide a constructor_body that can be empty.
15608
15609 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * driver.cs: Add support for --resources.
15612
15613         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15614         Make all types for the various array helper methods be integer.
15615
15616         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15617         CheckState to ConvCast.
15618
15619         (ConvCast): Now it takes a `checked' state argument, to avoid
15620         depending on the emit context for the conversion, and just using
15621         the resolve time setting.
15622
15623         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15624         instead of Invocation.EmitArguments.  We do not emit the original
15625         arguments, instead we emit those which have been converted to
15626         unsigned int expressions.
15627
15628         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15629
15630         * codegen.cs: ditto.
15631
15632         * expression.cs (LocalVariableReference): Drop the use of the
15633         Store function that depended on the variable index.
15634
15635         * statement.cs (VariableInfo): Drop the `Idx' property from this
15636         class, as this is not taking into account the indexes for
15637         temporaries tat we generate during the execution, getting the
15638         indexes wrong.
15639
15640         * class.cs: First emit class initializers, then call the parent
15641         constructor. 
15642
15643         * expression.cs (Binary): Fix opcode emision.
15644         (UnaryMutator.EmitCode): Support checked code generation
15645
15646         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15647         matches for events for both the Static and Instance scans,
15648         pointing to the same element.   Fix that.
15649
15650 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15651
15652         * rootcontext.cs (ResolveTree): Always set the
15653         interface_resolve_order, because nested interfaces will be calling
15654         into us.
15655
15656         * class.cs (GetInterfaceOrClass): Track the same resolution
15657         process used by TypeManager.LookupType.  This fixes the nested
15658         type lookups in class declarations (separate path from
15659         LookupType). 
15660
15661         (TypeContainer.DefineType): Also define nested interfaces.
15662         (TypeContainer.RegisterOrder): New public function used to
15663         register the order in which child interfaces need to be closed.
15664
15665         Nested interfaces need to be closed after their parents have been
15666         created. 
15667
15668         * interface.cs (InterfaceAttr): Put all the logic for computing
15669         the interface attribute here. 
15670
15671         (DefineInterface): Register our interface order with the
15672         RootContext or with the TypeContainer depending on the case.
15673
15674 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15675
15676         * cs-parser.jay: rework foreach statement to work with the new
15677         changes to the policy on SimpleNames.
15678
15679         * report.cs: support Stacktrace on warnings as well.
15680
15681         * makefile: drop --unsafe and /unsafe from the compile.
15682
15683 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15684
15685         * ecore.cs (StandardConversionExists): Modify to take an Expression
15686         as the first parameter. Ensure we do null -> reference type conversion
15687         checking.
15688
15689         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15690         temporary Expression objects.
15691
15692 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15693
15694         * interface.cs: workaround bug in method overloading resolution
15695         (there is already a bugzilla bug for it).
15696
15697 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15698
15699         We could also solve this problem by having a separate path for
15700         performing type lookups, instead of DoResolve, we could have a
15701         ResolveType entry point, and only participating pieces of the
15702         production (simplename, deref, array) would implement this. 
15703
15704         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15705         signal SimpleName to only resolve type names and not attempt to
15706         resolve anything else.
15707
15708         * expression.cs (Cast): Set the flag.
15709
15710         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15711
15712         * class.cs: Only report 108 if there is no `new' modifier.
15713
15714         * cs-parser.jay: rework foreach statement to work with the new
15715         changes to the policy on SimpleNames.
15716
15717         * report.cs: support Stacktrace on warnings as well.
15718
15719         * makefile: drop --unsafe and /unsafe from the compile.
15720
15721 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15722
15723         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15724         lookups here, instead of doing that at parse time.  This means
15725         that our grammar will not introduce `LocalVariableReferences' as
15726         expressions at this point.  That solves the problem of code like
15727         this:
15728
15729         class X {
15730            static void Main ()
15731            { int X = 1;
15732             { X x = null }}}
15733
15734         This is only half the fix.  The full fix requires parameters to
15735         also be handled in this way.
15736
15737         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15738         makes the use more obvious of the DeclSpace.  The
15739         ec.TypeContainer.TypeBuilder is now only used to pull the
15740         TypeBuilder for it.
15741
15742         My theory is that I can get rid of the TypeBuilder completely from
15743         the EmitContext, and have typecasts where it is used (from
15744         DeclSpace to where it matters).  
15745
15746         The only pending problem is that the code that implements Aliases
15747         is on TypeContainer, and probably should go in DeclSpace.
15748
15749         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15750         lookups here, instead of doing that at parse time.  This means
15751         that our grammar will not introduce `LocalVariableReferences' as
15752         expressions at this point.  That solves the problem of code like
15753         this:
15754
15755         class X {
15756            static void Main ()
15757            { int X = 1;
15758             { X x = null }}}
15759
15760         This is only half the fix.  The full fix requires parameters to
15761         also be handled in this way.
15762
15763         * class.cs (Property.DefineMethod): When implementing an interface
15764         method, set newslot, when implementing an abstract method, do not
15765         set the flag (before we tried never setting it, or always setting
15766         it, which is the difference).
15767         (Indexer.DefineMethod): same.
15768         (Method.DefineMethod): same.
15769
15770         * ecore.cs: Only set the status used flag if we get back a Field.
15771
15772         * attribute.cs: Temporary hack, so Paolo can keep working.
15773
15774 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15775
15776         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15777         the unmanaged type in the case we have a MarshalAs attribute.
15778
15779         (Resolve): Handle the case when we are parsing the special MarshalAs
15780         attribute [we need to store the unmanaged type to use later]
15781
15782         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15783         MarshalAs Attribute.
15784
15785         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15786         on parameters and accordingly set the marshalling info.
15787
15788 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15789
15790         * class.cs: Optimizing slightly by removing redundant code after
15791         we switched to the `NoTypes' return value.
15792         (Property.DefineMethod): use NoTypes here too.
15793
15794         This fixes the bug I introduced in my last batch of changes.
15795
15796 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15797
15798         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15799
15800         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15801         Enums since those are types too. 
15802
15803         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15804
15805         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15806         thanks to a call during the lookup process.
15807
15808 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15809
15810         * statement.cs (Foreach): Lots of work to accomodate a particular
15811         kind of foreach statement that I had not kept in mind.  It is
15812         possible to have foreachs on classes that provide a GetEnumerator
15813         method that return objects that implement the "pattern" for using
15814         a foreach, there is no need to support GetEnumerator
15815         specifically. 
15816
15817         This is needed to compile nant.
15818
15819         * decl.cs: Only report 114 if the member is not `Finalize' and if
15820         the warning level is at least 2.
15821
15822         * class.cs: Moved the compare function from Method to
15823         MethodSignature. 
15824
15825         (MethodSignature.InheritableMemberSignatureCompare): Add new
15826         filter function that is used to extract inheritable methods from a
15827         class. 
15828
15829         (Method.Define): Use the new `inheritable_method_signature_filter'
15830         delegate
15831
15832         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15833         command. 
15834
15835 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15836
15837         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15838
15839         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15840
15841         * expression.cs: Pass location information to
15842         ConvertImplicitStandard. 
15843
15844         * class.cs: Added debugging code to track return values from
15845         interfaces. 
15846
15847 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15848
15849         * expression.cs (Is.DoResolve): If either side of the `is' is an
15850         interface, do not flag the warning.
15851
15852         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15853         for interfaces
15854
15855         * report.cs: Allow for --fatal to be used with --probe.
15856
15857         * typemanager.cs (NoTypes): Move the definition for the empty Type
15858         array here. 
15859
15860         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15861         properties. 
15862         (TypeContainer.DefineProxy): New function used to proxy to parent
15863         implementations when implementing interfaces.
15864         (TypeContainer.ParentImplements): used to lookup if our parent
15865         implements a public function that is required by an interface.
15866         (TypeContainer.VerifyPendingMethods): Hook this up.
15867
15868         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15869         `modules' and `assemblies' arraylists into arrays.  We only grow
15870         these are the very early start up of the program, so this improves
15871         the speedof LookupType (nicely measured).
15872
15873         * expression.cs (MakeByteBlob): Replaced unsafe code with
15874         BitConverter, as suggested by Paolo.
15875
15876         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15877         folding of string concatenation, but if either side is a string,
15878         and the other is not, then return null, and let the runtime use
15879         the concatenation on the string plus the object (using
15880         `Object.ToString'). 
15881
15882 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15883
15884         Constant Folding has been implemented now.
15885
15886         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15887         the error instead on types that are not supported in one's
15888         complement. 
15889
15890         * constant.cs (Constant and all children): New set of functions to
15891         perform implict and explicit conversions.
15892
15893         * ecore.cs (EnumConstant): Implement the new functions to perform
15894         conversion by proxying to the child expression.
15895
15896         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15897         own separate setting that can not be turned off from the command
15898         line using --unchecked or --checked and is only controlled using
15899         the checked/unchecked statements and expressions.  This setting is
15900         used by the constant folder to flag errors.
15901
15902         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15903         ConstantCheckState as well.   
15904
15905         During Resolve, they also have to flag the state, because the
15906         constant folder runs completely in the Resolve phase.
15907
15908         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15909         well.
15910
15911 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * cfold.cs: New file, this file contains the constant folder.
15914
15915         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15916         argument to track whether we are using the resulting address to
15917         load or store a value and provide better error messages. 
15918
15919         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15920         new AddressOf arguments.
15921
15922         * statement.cs (Foreach.EmitCollectionForeach): Update
15923
15924         * expression.cs (Argument.Emit): Call AddressOf with proper
15925         arguments to track usage.
15926
15927         (New.DoEmit): Call AddressOf with new arguments.
15928
15929         (Unary.Emit): Adjust AddressOf call.
15930
15931 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15932
15933         * cs-parser.jay (member_access): Change the case for pre-defined types
15934         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15935         this suggestion.
15936
15937         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15938         a method body.
15939
15940         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15941         essentially like methods and apply attributes like MethodImplOptions to them too.
15942
15943         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15944         not being null.
15945
15946         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15947         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15948         is the DeclSpace.
15949
15950         * Update code everywhere accordingly.
15951
15952         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15953
15954         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15955
15956 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15957
15958         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15959         try performing lookups against those instead of jumping straight into using
15960         the 'using' clauses.
15961
15962         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15963
15964         (LookupType): Perform lookups in implicit parents too.
15965
15966         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15967         sequence as RootContext.LookupType. 
15968
15969         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15970         the various cases of namespace lookups into this method.
15971
15972 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15973
15974         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15975         in positional arguments)
15976
15977         * class.cs (Operator): Update the AllowedModifiers to contain
15978         extern. 
15979
15980         * cs-parser.jay: Update operator declaration to allow for the
15981         operator body to be empty.
15982
15983         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15984         values. 
15985
15986 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * class.cs (Method.Emit): Label parameters.
15989
15990         * driver.cs: Return 1 or 0 as the program exit code.
15991
15992 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15993
15994         * expression.cs: Special case the `null' object when trying to
15995         auto-compute the type, as anything can be explicitly converted to
15996         that. 
15997
15998         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15999         spotting this Paolo.
16000
16001         (Expression.ImplicitNumericConversion): Perform comparissions of
16002         the type using the underlying type in the case of an enumeration
16003         rather than using the enumeration type for the compare.
16004
16005         Cope with the underlying == type case, which is not possible to
16006         catch before. 
16007
16008         (Expression.ConvertNumericExplicit): Perform comparissions of
16009         the type using the underlying type in the case of an enumeration
16010         rather than using the enumeration type for the compare.
16011
16012         * driver.cs: If the user does not supply an extension, assume .exe
16013
16014         * cs-parser.jay (if_statement): Rewrote so that we can track the
16015         location for the if statement.
16016
16017         * expression.cs (Binary.ConstantFold): Only concat strings when
16018         the operation is "+", not everything ;-)
16019
16020         * statement.cs (Statement.EmitBoolExpression): Take a location
16021         argument. 
16022         (If, While, Do): Track location.
16023
16024         * expression.cs (Binary.ResolveOperator): In the object + string
16025         case, I was missing a call to ConvertImplicit
16026
16027 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16028
16029         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16030         Location arguments. Ensure we use RootContext.LookupType to do our work
16031         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16032
16033         * interface.cs (PopulateMethod): Handle the type of the parameter being
16034         null gracefully.
16035
16036         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16037         have a params method with no fixed arguments and a call is made with no
16038         arguments.
16039
16040 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16041
16042         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16043         the verbatim-string-literal
16044
16045         * support.cs (InternalParameters.ParameterModifier): handle null
16046         fixed parameters.
16047         (InternalParameters.ParameterType): ditto.
16048
16049         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16050         duplicating the name of the variable parameter.
16051         (GetParameterByName): Fix bug where we were not looking up array
16052         paramters if they were the only present (thanks Paolo!).
16053         (GetParameterInfo): We only have an empty set of types if both
16054         fixed and array are set to null.
16055         (GetParameterInfo-idx): Handle FixedParameter == null
16056
16057         * cs-parser.jay: Handle the case where there is no catch
16058         statements (missing null test).
16059
16060 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * driver.cs (MainDriver): Be conservative on our command line
16063         handling.
16064
16065         Catch DirectoryNotFoundException when calling GetFiles.
16066
16067         (SplitPathAndPattern): Used to split the input specification into
16068         a path and a pattern that we can feed to Directory.GetFiles.
16069
16070 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16071
16072         * statement.cs (Fixed): Implement the last case of the Fixed
16073         statement (string handling).
16074
16075         * expression.cs (StringPtr): New class used to return a char * to
16076         a string;  Used by the Fixed statement.
16077
16078         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16079
16080         * expression.cs (Binary.ResolveOperator): Remove redundant
16081         MemberLookup pn parent type.
16082         Optimize union call, we do not need a union if the types are the same.
16083         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16084         type.
16085
16086         Specialize the use of MemberLookup everywhere, instead of using
16087         the default settings. 
16088
16089         (StackAlloc): Implement stackalloc keyword.
16090
16091         * cs-parser.jay: Add rule to parse stackalloc.
16092
16093         * driver.cs: Handle /h, /help, /?
16094
16095         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16096         before we supported unsafe code.
16097
16098         * makefile: add --unsafe to the self compilation of mcs.
16099
16100 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16101
16102         * expression.cs (PointerArithmetic): New class that is used to
16103         perform pointer arithmetic.
16104         (Binary.Resolve): Handle pointer arithmetic
16105         Handle pointer comparission.
16106         (ArrayPtr): Utility expression class that is used to take the
16107         address of an array.
16108
16109         (ElementAccess): Implement array access for pointers
16110
16111         * statement.cs (Fixed): Implement fixed statement for arrays, we
16112         are missing one more case before we are done.
16113
16114         * expression.cs (Indirection): Implement EmitAssign and set the
16115         ExprClass to Variable.  This allows pointer dereferences to be
16116         treated as variables, and to have values assigned to them.
16117
16118         * ecore.cs (Expression.StoreFromPtr): New utility function to
16119         store values dereferencing.
16120
16121 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16122
16123         * expression.cs (Binary.ResolveOperator): Ensure that we are
16124         not trying to operate on a void type - this fixes the reported
16125         bug.
16126
16127         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16128         the parent implementation is sealed.
16129
16130         * ../errors/cs0239.cs : Add.
16131
16132         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16133
16134         * typemanager.cs (unverifiable_code_type): Corresponds to 
16135         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16136         which have unsafe code in them.
16137
16138         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16139         unsafe context.
16140
16141 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16142
16143         * cs-tokenizer.cs: Add support for @"litreal strings"
16144
16145         Make tokenizer accept pre-processor directives
16146         on any column (remove the old C-like limitation). 
16147
16148         * rootcontext.cs (EmitCode): Emit any global attributes.
16149         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16150
16151         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16152
16153         * cs-parser.jay: Add support for global attributes.  
16154
16155 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * expression.cs (Indirection): New helper class.  Unary will
16158         create Indirection classes to be able to implement the
16159         IMemoryLocation interface on it.
16160
16161 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16162
16163         * cs-parser.jay (fixed_statement): reference the right statement.
16164
16165         * statement.cs (Fixed.Emit): Finish implementing the fixed
16166         statement for the &x case.
16167
16168 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16169
16170         * class.cs (Property.Define, Method.Define): Remove newslot when
16171         `implementing'.  
16172
16173         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16174         wrong.  NewSlot should only be used if the `new' keyword is present.
16175
16176         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16177         locating our system dir.  Sorry about this.
16178
16179 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16180
16181         * driver.cs (GetSystemDir): Compute correctly the location of our
16182         system assemblies.  I was using the compiler directory instead of
16183         the library directory.
16184
16185 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16186
16187         * expression.cs (BetterFunction): Put back in what Miguel commented out
16188         since it is the correct fix. The problem is elsewhere ;-)
16189
16190         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16191         parameters of the parms method are themselves compatible or not !
16192
16193         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16194         to check that a class implements an interface before saying that an implicit
16195         conversion was allowed. Use ImplementsInterface to do the checking.
16196
16197 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16198
16199         * class.cs (Method.Define): Track whether we are an explicit
16200         implementation or not.  And only call DefineMethodOverride if we
16201         are an explicit implementation.
16202
16203         (Property.DefineMethod): Ditto.
16204
16205 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16206
16207         * expression.cs (BetterFunction): Catch hideous bug which was
16208          preventing us from detecting ambiguous calls due to implicit casts i.e
16209         cs0121.
16210
16211 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16212
16213         * support.cs (Pair): Remove un-needed method.  I figured why I was
16214         getting the error in cs-parser.jay, the variable in a foreach loop
16215         is readonly, and the compiler does not really treat this as a variable.
16216
16217         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16218         instead of EQUALS in grammar.  
16219
16220         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16221
16222         * expression.cs (Unary.DoResolve): Check whether the argument is
16223         managed or not.
16224
16225 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16226
16227         * support.cs: Api for Pair to set a value.  Despite the fact that
16228         the variables are public the MS C# compiler refuses to compile
16229         code that accesses the field if the variable is part of a foreach
16230         statement. 
16231
16232         * statement.cs (Fixed): Begin implementation of the fixed
16233         statement.
16234
16235         (Block.AddVariable): Return the VariableInfo on success and null
16236         on failure instead of true/false. 
16237
16238         * cs-parser.jay (foreach): Catch errors on variables already
16239         defined (we were ignoring this value before) and properly unwind
16240         the block hierarchy
16241
16242         (fixed_statement): grammar for the fixed statement.
16243
16244 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16245
16246         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16247         pointer types to be incretemented.
16248
16249         (SizeOf): Implement.
16250
16251         * cs-parser.jay (pointer_member_access): Implement
16252         expr->IDENTIFIER production.
16253
16254         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16255         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16256         on safe contexts.
16257
16258         (Unary): Implement indirection.
16259
16260         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16261         use in non-unsafe context).
16262
16263         (SimpleName.DoResolve): Check for pointers in field access on safe
16264         contexts. 
16265
16266         (Expression.LoadFromPtr): Factor the load-indirect code in this
16267         function.  This was duplicated in UnboxCast and ParameterReference
16268
16269 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16270
16271         * expression.cs (ComposedCast): report an error if a pointer cast
16272         is used in a safe region.
16273
16274         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16275         pointer type casts in unsafe context.
16276
16277         * codegen.cs (EmitContext): Set up IsUnsafe.
16278
16279         * cs-parser.jay (non_expression_type): Add productions for pointer
16280         casts. 
16281
16282         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16283         code.  We should not use force into static mode if the method is
16284         not virtual.  Fixes bug in MIS
16285
16286         * statement.cs (Do.Emit, While.Emit, For.Emit,
16287         Statement.EmitBoolExpression): Add support to Do and While to
16288         propagate infinite loop as `I do return' semantics.
16289
16290         Improve the For case to also test for boolean constants.
16291
16292         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16293         to the list of attributes we can add.
16294
16295         Remove `EmitContext' argument.
16296
16297         * class.cs (Method.Define): Apply parameter attributes.
16298         (Constructor.Define): Apply parameter attributes.
16299         (MethodCore.LabelParameters): Move here the core of labeling
16300         parameters. 
16301
16302         * support.cs (ReflectionParameters.ParameterModifier,
16303         InternalParameters.ParameterModifier): Use IsByRef on the type and
16304         only return the OUT bit for these parameters instead of in/out/ref
16305         flags.
16306
16307         This is because I miss-understood things.  The ParameterInfo.IsIn
16308         and IsOut represent whether the parameter has the [In] and [Out]
16309         attributes set.  
16310
16311 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16312
16313         * ecore.cs (FieldExpr.Emit): Release temporaries.
16314
16315         * assign.cs (LocalTemporary.Release): new function.
16316
16317         * codegen.cs (EmitContext.GetTemporaryStorage,
16318         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16319         temporary storage.  Now we can "put back" localbuilders when we
16320         are done with them
16321
16322 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16323
16324         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16325         need to make a copy of the variable to generate verifiable code.
16326
16327 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16328
16329         * driver.cs: Compute dynamically the system directory.
16330
16331         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16332         Slower, but more generally useful.  Used by the abstract
16333         registering implementation. 
16334
16335         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16336         the rules for the special rule on Type/instances.  First check if
16337         we have the same name, and if so, try that special static path
16338         rather than the instance path.
16339
16340 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16341
16342         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16343         for, while and if.
16344
16345         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16346         Enum, ValueType, Delegate or Array for non-corlib compiles.
16347
16348         * cs-tokenizer.cs: Catch long identifiers (645)
16349
16350         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16351         piece of code.
16352
16353         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16354         fix, we were returning too early, so we were not registering
16355         pending methods from abstract classes.
16356
16357         Do not register pending methods if the class is abstract.
16358
16359         * expression.cs (Conditional.DoResolve): Report circular implicit
16360         conversions when we neecd to compute it for conditional
16361         expressions. 
16362
16363         (Is.DoResolve): If the expression is always of the provided type,
16364         flag warning 183.  If the expression can not ever be of the
16365         provided type flag warning 184.
16366
16367         * class.cs: Catch 169 as well.
16368
16369         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16370         read. 
16371
16372 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16373
16374         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16375
16376 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16377
16378         * interface.cs: (PopulateMethod): Check for pointers being defined
16379         only if the unsafe context is active.
16380         (PopulateProperty): ditto.
16381         (PopulateIndexer): ditto.
16382
16383         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16384         specified.  If pointers are present, make sure that they are
16385         present in an unsafe context.
16386         (Constructor, Constructor.Define): ditto.
16387         (Field, Field.Define): ditto.
16388         (Property, Property.Define): ditto.
16389         (Event, Event.Define): ditto.
16390
16391         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16392         hashtable if there are classes or structs defined.
16393
16394         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16395         code, as the constant resolution moved.
16396
16397         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16398         the metadata, so we can flag error 133. 
16399
16400         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16401         pointer is being declared in an unsafe context.
16402
16403 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16404
16405         * modifiers.cs (Modifiers.Check): Require a Location argument.
16406         Report error 227 for Unsafe use.
16407
16408         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16409
16410         * statement.cs (For.Emit): If the test is null, then report that
16411         we do `return', as we wont reach anything afterwards.
16412
16413         (Switch.SwitchGoverningType): Track the expression that matched
16414         the conversion.
16415
16416         * driver.cs: Allow negative numbers as an error code to flag.
16417
16418         * cs-parser.jay: Handle 1551.
16419
16420         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16421
16422 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16423
16424         * cs-parser.jay: Report 1518 (type declaration can only contain
16425         class, struct, interface, enum or delegate)
16426
16427         (switch_label): Report 1523 (keywords `case' or `default' must
16428         preced code)
16429
16430         (opt_switch_sections): Report 1522 (empty switch)
16431
16432         * driver.cs: Report 1515 (response file specified multiple times)
16433         Report 1516 (Source file specified multiple times).
16434
16435         * expression.cs (Argument.Resolve): Signal 1510
16436
16437         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16438         access not allowed in static code)
16439
16440 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16441
16442         * typemanager.cs (IsPointerType): Utility method which we are going
16443         to need a lot.
16444
16445         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16446         the object type, so we take care of that.
16447
16448         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16449
16450         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16451         added to non-params parameters :-)
16452
16453         * typemanager.cs (CSharpName): Include 'void' type too. 
16454
16455         (void_ptr_type): Include in the set of core types.
16456
16457         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16458         duplicating code.
16459
16460         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16461         an unsafe context.
16462
16463         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16464         completely forgotten about it.
16465
16466 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16467
16468         * cs-parser.jay (pointer_type): Add. This begins our implementation
16469         of parsing rules for unsafe code.
16470
16471         (unsafe_statement): Implement.
16472
16473         (embedded_statement): Modify to include the above.
16474
16475         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16476
16477         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16478         if the current context is an unsafe one.
16479
16480         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16481         are handled differently, we need separate rules for them.
16482
16483         (local_variable_declaration): Update to use local_variable_pointer_type
16484         to allow variable declarations of unmanaged pointer types.
16485
16486         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16487         in unsafe contexts.
16488
16489         * ../errors/cs0214.cs : Add.
16490
16491 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16492
16493         * makefile: remove 'response' file when cleaning.
16494
16495 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16496
16497         * cs-parser.jay: Report 1524.
16498
16499 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16500
16501         * typemanager.cs (RegisterMethod): drop checking if we have
16502         registered this from here
16503
16504 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16505
16506         * class.cs (Method.EmitDestructor): Implement calling our base
16507         destructor. 
16508
16509         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16510         value of InFinally.
16511
16512         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16513         this routine and will wrap the call in a try/catch block.  Deal
16514         with the case.
16515
16516 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16517
16518         * ecore.cs (Expression.MemberLookup): instead of taking a
16519         parameter `same_type' that was used to tell whether we could
16520         access private members we compute our containing type from the
16521         EmitContext.
16522
16523         (FieldExpr): Added partial support for volatile fields.  This does
16524         not work for volatile fields exposed from assemblies, as I can not
16525         figure out how to extract the modreq from it.
16526
16527         Updated all the source files to use this.
16528
16529         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16530         because it is referenced by MemberLookup very often. 
16531
16532 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16533
16534         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16535         TypeBuilder.GetCustomAttributes to retrieve what we need.
16536
16537         Get rid of redundant default_member_attr_type as this is the same as
16538         default_member_type which already exists.
16539
16540         * interface.cs, attribute.cs : Update accordingly.
16541
16542 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16543
16544         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16545         work for TYpeBuilders though.  Ravi, can you please fix this?
16546
16547         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16548
16549         * expression.cs (Argument.Emit): Handle the case of ref objects
16550         being passed to ref functions;  
16551
16552         (ParameterReference.EmitLoad): Loads the content of the pointer
16553         without dereferencing.
16554
16555 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16556
16557         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16558
16559 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16560
16561         * class.cs (Indexer.DefineMethod): Incorporate the interface
16562         type in the name of the method if we are doing explicit interface
16563         implementation.
16564
16565         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16566
16567         (BetterConversion): Fix extremely trivial bug where we were referring to
16568         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16569         again !
16570
16571         * ../errors/bug16.cs : Add although we have fixed it.
16572
16573 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16574
16575         * expression.cs (BaseIndexer): Begin implementation.
16576
16577         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16578
16579         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16580         production directly to remove a shift/reduce, and implement
16581         explicit interface implementation.
16582
16583         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16584         after a floating point suffix.
16585
16586         * expression.cs (DoNumericPromotions): Improved the conversion for
16587         uint/uint.  If we have a constant, we avoid doing a typecast to a
16588         larger type.
16589
16590         * class.cs (Indexer): Implement explicit interface implementation
16591         for indexers.
16592
16593 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16594
16595         * class.cs: make the default instance constructor public and hidebysig.
16596
16597 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16598
16599         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16600         so we can call it from elsewhere.
16601
16602         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16603         we emit it internally if the class has a defined indexer; otherwise the user
16604         emits it by decorating the class definition with the DefaultMemberAttribute.
16605
16606         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16607         attribute is not used on a type which defines an indexer.
16608
16609         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16610         character when we skip whitespace.
16611
16612         * ../errors/cs0646.cs : Add.
16613
16614 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16615
16616         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16617         again. 
16618
16619         * makefile: Add practical target `mcs3.exe' which builds the third
16620         generation compiler. 
16621
16622         * expression.cs (New): Fix structures constructor calling.
16623
16624         * class.cs (Property, Method, Indexer): Emit Final flag on the
16625         method if we are an interface implementation and we are not
16626         abstract. 
16627
16628         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16629         whether this property is referencing a `base' method.
16630
16631         * expression.cs (Invocation.EmitCall): take an extra argument:
16632         is_base, this is used to determine whether the `call' or
16633         `callvirt' opcode should be used.
16634
16635
16636         * delegate.cs: update EmitCall.
16637
16638         * class.cs (Method.Define): Set NewSlot for the cases where we are
16639         not implementing an interface method.
16640
16641         (Property.Define): ditto.
16642
16643 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16644
16645         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16646         'r'.  Allows mcs to parse itself fully.
16647
16648 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16649
16650         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16651         of the number of initializers that require the InitializeArray method.
16652
16653         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16654         update the above field where necessary.
16655
16656         (MakeByteBlob): Update accordingly.
16657
16658         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16659         greater than 2.
16660
16661         (EmitDynamicInitializers): Update in accordance with the new optimization.
16662
16663         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16664         same OpCode applies.
16665
16666         * cs-parser.jay : Fix some glaring errors I introduced.
16667
16668 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16669
16670         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16671         so that we can check for name clashes there too.
16672
16673         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16674         for interface indexers.
16675
16676         * interfaces.cs (Define): Emit the default member attribute.
16677
16678         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16679         variable was being referred to while setting the value ;-)
16680
16681 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16682
16683         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16684         byte-by-byte information when we know the data is zero.
16685
16686         Make the block always a multiple of 4, because
16687         DefineInitializedData has a bug.
16688
16689         * assign.cs: Fix, we should assign from the temporary, not from
16690         the source. 
16691
16692         * expression.cs (MakeByteBlob): Fix my incorrect code.
16693
16694 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16695
16696         * typemanager.cs (EnumToUnderlying): This function is used to get
16697         the underlying type from an enumeration, because it does not
16698         always work. 
16699
16700         * constant.cs: Use the I4_S form for values between -128 and 127.
16701
16702         * statement.cs (Block.LookupLabel): Looks up a label.
16703         (Block): Drop support for labeled blocks.
16704
16705         (LabeledStatement): New kind of statement that represents a label
16706         only.
16707
16708         (Goto): Finally implement this bad boy.
16709
16710         * cs-parser.jay: Update to reflect new mechanism to implement
16711         labels.
16712
16713 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16714
16715         * codegen.cs (EmitContext.This): a codegen property that keeps the
16716         a single instance of this instead of creating many different this
16717         instances. 
16718
16719         * delegate.cs (Delegate.DoResolve): Update to use the property;
16720
16721         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16722
16723         * expression.cs (BaseAccess.DoResolve): Ditto.
16724
16725 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16726
16727         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16728         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16729
16730         (InitCoreTypes): Update accordingly.
16731
16732         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16733         so we can quickly store the state.
16734
16735         (ApplyAttributes): Set the correct implementation flags
16736         for InternalCall methods.
16737
16738 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16739
16740         * expression.cs (EmitCall): if a method is not virtual, then do
16741         not use callvirt on it.
16742
16743         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16744         user defined stuff) requires the use of stobj, which takes an
16745         address on the stack instead of an array and an index.  So emit
16746         the Ldelema operation for it.
16747
16748         (EmitStoreOpcode): Use stobj for valuetypes.
16749
16750         (UnaryMutator.EmitCode): Use the right 1 value depending on
16751         whether we are dealing with int64/uint64, float or doubles.
16752
16753         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16754         constructors that I implemented last night.
16755
16756         (Constructor.IsDefault): Fix to work properly for static
16757         constructors.
16758
16759         * cs-parser.jay (CheckDef): report method signature errors.
16760         Update error number 103 to be 132.
16761
16762         * decl.cs: New AdditionResult enumeration value: MethodExists.
16763         Although we do this check for methods later on in the semantic
16764         analysis, catching repeated default constructors is so easy that
16765         we catch these here. 
16766
16767         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16768         promotions code.
16769
16770         (ParameterReference.EmitAssign, Emit): handle
16771         bools as bytes.
16772
16773         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16774         (ArrayAccess.EmitStoreOpcode): ditto.
16775
16776         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16777
16778         * expression.cs (MakeByteBlob): Complete all the missing types
16779         (uint, short, ushort, byte, sbyte)
16780
16781         * class.cs: Only init instance field initializers on instance
16782         constructors. 
16783
16784         Rename `constructors' to instance_constructors. 
16785
16786         (TypeContainer.AddConstructor): Only add constructors to the list
16787         if it is not static.
16788
16789         Make sure that we handle default_static_constructor independently
16790         everywhere where we handle instance_constructors
16791
16792 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16793
16794         * class.cs: Do not lookup or create a base initializer for a
16795         static constructor.
16796
16797         (ConstructorInitializer.Resolve): use the proper type to lookup
16798         for constructors.
16799
16800         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16801
16802         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16803         in DeclSpace. 
16804
16805         * decl.cs: CloseType is now an virtual method, the default
16806         implementation just closes this type.
16807
16808 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16809
16810         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16811         to PreserveSig by default. Also emit HideBySig on such methods.
16812
16813         Basically, set the defaults to standard values.
16814
16815         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16816         argument, if candidate is better, it can't be worse than the best !
16817
16818         (Invocation): Re-write bits to differentiate between methods being
16819         applicable in their expanded form and their normal form - for params
16820         methods of course.
16821
16822         Get rid of use_standard everywhere as only standard conversions are allowed
16823         in overload resolution. 
16824
16825         More spec conformance.
16826
16827 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16828
16829         * driver.cs: Add --timestamp, to see where the compiler spends
16830         most of its time.
16831
16832         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16833         `this' in static code.
16834
16835         (SimpleName.DoResolve): Implement in terms of a helper function
16836         that allows static-references to be passed upstream to
16837         MemberAccess.
16838
16839         (Expression.ResolveWithSimpleName): Resolve specially simple
16840         names when called by MemberAccess to implement the special
16841         semantics. 
16842
16843         (Expression.ImplicitReferenceConversion): Handle conversions from
16844         Null to reference types before others, as Null's type is
16845         System.Object. 
16846
16847         * expression.cs (Invocation.EmitCall): Handle the special case of
16848         calling methods declared on a reference type from a ValueType
16849         (Base classes System.Object and System.Enum)
16850
16851         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16852         the left hand side is a TypeExpr, not on every enumeration. 
16853
16854         (Binary.Resolve): If types are reference types, then do a cast to
16855         object on operators != and == of both arguments.
16856
16857         * typemanager.cs (FindMembers): Extract instance and static
16858         members if requested.
16859
16860         * interface.cs (PopulateProperty): Use void_type instead of null
16861         as the return type for the setter method.
16862
16863         (PopulateIndexer): ditto.
16864
16865 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16866
16867         * support.cs (ReflectionParameters): Fix minor bug where we
16868         were examining the wrong parameter for the ParamArray attribute.
16869
16870         Cope with requests for the type of the parameter at position
16871         greater than the params parameter's. We now return the element
16872         type of the params array as that makes more sense.
16873
16874         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16875         accordingly as we no longer have to extract the element type
16876         ourselves.
16877
16878         (Invocation.OverloadResolve): Update.
16879
16880 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16881
16882         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16883         against IEnumerator, test whether the return value is a descendant
16884         of the IEnumerator interface.
16885
16886         * class.cs (Indexer.Define): Use an auxiliary method to implement
16887         the other bits of the method definition.  Begin support for
16888         explicit interface implementation.
16889
16890         (Property.DefineMethod): Use TypeManager.void_type instead of null
16891         for an empty return value.
16892
16893 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16894
16895         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16896         dealing with a FieldExpr which is composed of a FieldBuilder, in
16897         the code path we did extract the constant, but we should have
16898         obtained the underlying value to be able to cast it (otherwise we
16899         end up in an infinite loop, this is what Ravi was running into).
16900
16901         (ArrayCreation.UpdateIndices): Arrays might be empty.
16902
16903         (MemberAccess.ResolveMemberAccess): Add support for section
16904         14.5.4.1 that deals with the special case of E.I when E is a type
16905         and something else, that I can be a reference to a static member.
16906
16907         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16908         handle a particular array type to create byte blobs, it is just
16909         something we dont generate byteblobs for.
16910
16911         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16912         arguments. 
16913
16914         * location.cs (Push): remove the key from the hashtable that we
16915         are about to add.   This happens for empty files.
16916
16917         * driver.cs: Dispose files after we have parsed them.
16918
16919         (tokenize): new function that only runs the tokenizer on its
16920         input, for speed testing.
16921
16922 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16923
16924         * class.cs (Event.Define): Define the private field only if there
16925         are no accessors defined.
16926
16927         * expression.cs (ResolveMemberAccess): If there is no associated
16928         field with the event, that means we have an event defined with its
16929         own accessors and we should flag error cs0070 since transforming
16930         ourselves into a field is not valid in that case.
16931
16932         * ecore.cs (SimpleName.DoResolve): Same as above.
16933
16934         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16935         and charset to sane values.
16936
16937 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16938
16939         * assign.cs (DoResolve): Perform check on events only if they 
16940         are being accessed outside the declaring type.
16941
16942         * cs-parser.jay (event_declarations): Update rules to correctly
16943         set the type of the implicit parameter etc.
16944
16945         (add_accessor, remove_accessor): Set current local parameters.
16946
16947         * expression.cs (Binary): For delegate addition and subtraction,
16948         cast the return value from the method into the appropriate delegate
16949         type.
16950
16951 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16952
16953         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16954         of these as the workaround is unnecessary.
16955
16956         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16957         delegate data - none of that is needed at all.
16958
16959         Re-write bits to extract the instance expression and the delegate method
16960         correctly.
16961
16962         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16963         on delegates too.
16964
16965         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16966         of attaching attributes instead of duplicating code everywhere.
16967
16968         * everywhere : Update code to do attribute emission using the above method.
16969
16970 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16971
16972         * expression.cs (IsParamsMethodApplicable): if there are not
16973         parameters, return immediately.
16974
16975         * ecore.cs: The 0 literal can be implicity converted to an enum
16976         type. 
16977
16978         (SimpleName.DoResolve): First lookup the type, then lookup the
16979         members. 
16980
16981         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16982         want to get its address.  If the InstanceExpression is not
16983         addressable, store the result in a temporary variable, then get
16984         the address of it.
16985
16986         * codegen.cs: Only display 219 errors on warning level or above. 
16987
16988         * expression.cs (ArrayAccess): Make it implement the
16989         IMemoryLocation interface.
16990
16991         (Binary.DoResolve): handle the operator == (object a, object b)
16992         and operator != (object a, object b) without incurring into a
16993         BoxedCast (because 5 != o should never be performed).
16994
16995         Handle binary enumerator operators.
16996
16997         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16998         value type, otherwise use Ldelem_ref.
16999
17000         Use precomputed names;
17001
17002         (AddressOf): Implement address of
17003
17004         * cs-parser.jay (labeled_statement): Fix recursive block
17005         addition by reworking the production.
17006
17007         * expression.cs (New.DoEmit): New has a special case:
17008                 
17009                  If we are dealing with a ValueType, we have a few
17010                  situations to deal with:
17011                 
17012                     * The target of New is a ValueType variable, that is
17013                       easy, we just pass this as the variable reference
17014                 
17015                     * The target of New is being passed as an argument,
17016                       to a boxing operation or a function that takes a
17017                       ValueType.
17018                 
17019                       In this case, we need to create a temporary variable
17020                       that is the argument of New.
17021
17022
17023 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17024
17025         * rootcontext.cs (LookupType): Check that current_type is not null before
17026         going about looking at nested types.
17027
17028         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17029         not implement the IAssignMethod interface any more.
17030
17031         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17032         where we tranform them into FieldExprs if they are being resolved from within
17033         the declaring type.
17034
17035         * ecore.cs (SimpleName.DoResolve): Do the same here.
17036
17037         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17038
17039         * ../errors/bug10.cs : Add.
17040
17041         * ../errors/cs0070.cs : Add.
17042
17043         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17044
17045         * assign.cs : Get rid of EventIsLocal everywhere.
17046
17047 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17048
17049         * ecore.cs (ConvertIntLiteral): finished the implementation.
17050
17051         * statement.cs (SwitchLabel): Convert the value we are using as a
17052         key before looking up the table.
17053
17054 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * codegen.cs (EmitTopBlock): Require a Location argument now.
17057
17058         * cs-parser.jay (constructor_declarator): We need to setup
17059         current_local_parameters before we parse the
17060         opt_constructor_initializer, to allow the variables to be bound
17061         to the constructor arguments.
17062
17063         * rootcontext.cs (LookupType): First lookup nested classes in our
17064         class and our parents before we go looking outside our class.
17065
17066         * expression.cs (ConstantFold): Extract/debox the values at the
17067         beginnning. 
17068
17069         * rootcontext.cs (EmitCode): Resolve the constants first before we
17070         resolve the types.  This is not really needed, but it helps debugging.
17071
17072         * statement.cs: report location.
17073
17074         * cs-parser.jay: pass location to throw statement.
17075
17076         * driver.cs: Small bug fix.
17077
17078         * report.cs: Updated format to be 4-zero filled digits.
17079
17080 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17081
17082         * expression.cs (CheckIndices): Fix minor bug where the wrong
17083         variable was being referred to ;-)
17084
17085         (DoEmit): Do not call EmitStaticInitializers when the 
17086         underlying type is System.Object.
17087
17088 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17089
17090         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17091         and do the usual workaround for SRE.
17092
17093         * class.cs (MyEventBuilder.EventType): New member to get at the type
17094         of the event, quickly.
17095
17096         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17097
17098         * assign.cs (Assign.DoResolve): Handle the case when the target
17099         is an EventExpr and perform the necessary checks.
17100
17101         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17102         interface.
17103
17104         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17105
17106         (EventExpr): Set the type in the constructor itself since we 
17107         are meant to be born fully resolved.
17108
17109         (EventExpr.Define): Revert code I wrote earlier.
17110                 
17111         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17112         instance expression is null. The instance expression is a This in that case
17113         or a null, depending on whether it is a static method or not.
17114
17115         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17116         refers to more than one method.
17117
17118         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17119         and accordingly flag errors.
17120
17121 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17122
17123         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17124
17125 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17126
17127         * location.cs (ToString): Provide useful rutine.
17128
17129 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17130
17131         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17132         objects, return the actual integral boxed.
17133
17134         * statement.cs (SwitchLabel): define an ILLabel for each
17135         SwitchLabel. 
17136
17137         (Switch.CheckSwitch): If the value is a Literal, extract
17138         the underlying literal.
17139
17140         Also in the unused hashtable we had, add the SwitchLabel so we can
17141         quickly look this value up.
17142
17143         * constant.cs: Implement a bunch of new constants.  Rewrite
17144         Literal based on this.  Made changes everywhere to adapt to this.
17145
17146         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17147         dereferencing array only once, and also copes with enumrations.
17148
17149         bytes are two bytes wide, not one.
17150
17151         (Cast): Perform constant conversions.
17152
17153         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17154         wrappers to the literals here.
17155
17156         * expression.cs (DoNumericPromotions): long literals can converted
17157         to ulong implicity (this is taken care of elsewhere, but I was
17158         missing this spot).
17159
17160         * ecore.cs (Expression.Literalize): Make the return type Literal,
17161         to improve type checking.
17162
17163         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17164
17165 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17166
17167         * literal.cs: Revert code from ravi that checked the bounds.  The
17168         bounds are sane by the definition of the type itself. 
17169
17170         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17171         need to actually look up in our parent hierarchy for interfaces
17172         implemented. 
17173
17174         * const.cs: Use the underlying type for enumerations
17175
17176         * delegate.cs: Compute the basename for the delegate creation,
17177         that should fix the delegate test case, and restore the correct
17178         Type Lookup semantics in rootcontext
17179
17180         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17181         referencing a nested type with the Reflection API is using the "+"
17182         sign. 
17183
17184         * cs-parser.jay: Do not require EOF token at the end.
17185
17186 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17187
17188         * rootcontext.cs (LookupType): Concatenate type names with
17189         a '.' instead of a '+' The test suite passes again.
17190
17191         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17192         field of the enumeration.
17193
17194         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17195         the case when the member is an EventExpr.
17196
17197         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17198         static has an associated instance expression.
17199
17200         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17201
17202         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17203
17204         * class.cs (Event.Define): Register event and perform appropriate checks
17205         for error #111.
17206
17207         We define the Add and Remove methods even if the use provides none because
17208         in that case, we provide default implementations ourselves.
17209
17210         Define a private field of the type of the event. This is done by the CSC compiler
17211         and we should be doing it too ;-)
17212
17213         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17214         More methods we use in code we generate.
17215
17216         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17217         is important.
17218
17219         (InitCoreTypes): Update accordingly for the above.
17220
17221         * class.cs (Event.Emit): Generate code for default accessors that we provide
17222
17223         (EmitDefaultMethod): Do the job in the above.
17224
17225         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17226         appropriate place.
17227
17228 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17229
17230         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17231         builders even if we were missing one.
17232
17233         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17234         pass the Basename as our class name instead of the Name.  The
17235         basename will be correctly composed for us.
17236
17237         * parameter.cs (Paramters): Now takes a Location argument.
17238
17239         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17240         make all the code call directly LookupType in RootContext and take
17241         this chance to pass the Location information everywhere.
17242
17243         * Everywhere: pass Location information.
17244
17245 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17246
17247         * class.cs (Constructor.Define): Updated way of detecting the
17248         length of the parameters.
17249
17250         (TypeContainer.DefineType): Use basename as the type name for
17251         nested types.
17252
17253         (TypeContainer.Define): Do not recursively define types here, as
17254         definition is taken care in order by the RootContext.
17255
17256         * tree.cs: Keep track of namespaces in a per-file basis.
17257
17258         * parameter.cs (Parameter.ComputeSignature): Update to use
17259         DeclSpace. 
17260
17261         (Parameters.GetSignature): ditto.
17262
17263         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17264         instead of a TypeContainer.
17265
17266         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17267         resolve names.  Because we need to be resolve in our context, not
17268         our parents.
17269
17270         * driver.cs: Implement response files.
17271
17272         * class.cs (TypeContainer.DefineType): If we are defined, do not
17273         redefine ourselves.
17274
17275         (Event.Emit): Emit the code for add/remove handlers.
17276         (Event.Define): Save the MethodBuilders for add/remove.
17277
17278         * typemanager.cs: Use pair here too.
17279
17280         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17281         DictionaryEntry requires the first argument to be non-null.  
17282
17283         (enum_declaration): Compute full name for registering the
17284         enumeration.
17285
17286         (delegate_declaration): Instead of using
17287         formal_parameter_list, use opt_formal_parameter_list as the list
17288         can be empty.
17289
17290         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17291         (EventParsing): New property that controls whether `add' and
17292         `remove' are returned as tokens or identifiers (for events);
17293
17294 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17295
17296         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17297         use MyEventBuilder only and let it wrap the real builder for us.
17298
17299         (MyEventBuilder): Revamp constructor etc.
17300
17301         Implement all operations that we perform on EventBuilder in precisely the same
17302         way here too.
17303
17304         (FindMembers): Update to use the EventBuilder member.
17305
17306         (Event.Emit): Update accordingly.
17307
17308 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17309
17310         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17311         by calling the appropriate methods.
17312
17313         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17314         useful.
17315
17316         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17317
17318 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17319
17320         * delegate.cs (Delegate.Populate): Check that the return type
17321         and various parameters types are indeed accessible.
17322
17323         * class.cs (Constructor.Define): Same here.
17324
17325         (Field.Define): Ditto.
17326
17327         (Event.Define): Ditto.
17328
17329         (Operator.Define): Check that the underlying Method defined itself
17330         correctly - so it's MethodBuilder should not be null.
17331
17332         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17333         expression happens to be null.
17334
17335         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17336         members but as of now we don't seem to be able to do anything really useful with it.
17337
17338         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17339         not the EventBuilder.
17340
17341 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17342
17343         * cs-tokenizer.cs: Add support for defines.
17344         Add support for #if, #elif, #else, #endif
17345
17346         (eval_var): evaluates a variable.
17347         (eval): stubbed for evaluating functions.
17348
17349         * cs-parser.jay: Pass the defines information
17350
17351         * driver.cs: Add --define command line option.
17352
17353         * decl.cs: Move MemberCore here.
17354
17355         Make it the base class for DeclSpace.  This allows us to catch and
17356         report 108 and 109 for everything now.
17357
17358         * class.cs (TypeContainer.Define): Extract all the members
17359         before populating and emit the warning 108 (new keyword required
17360         to override) instead of having each member implement this.
17361
17362         (MemberCore.Define): New abstract method, we will be using this in
17363         the warning reporting engine in Populate.
17364
17365         (Operator.Define): Adjust to new MemberCore protocol. 
17366
17367         * const.cs (Const): This does not derive from Expression, it is a
17368         temporary object we use to create fields, it is a MemberCore. 
17369
17370         * class.cs (Method.Define): Allow the entry point to be in a
17371         specific class.
17372
17373         * driver.cs: Rewrite the argument handler to clean it up a bit.
17374
17375         * rootcontext.cs: Made it just an auxiliary namespace feature by
17376         making everything static.
17377
17378         * driver.cs: Adapt code to use RootContext type name instead of
17379         instance variable.
17380
17381         * delegate.cs: Remove RootContext argument.
17382
17383         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17384         argument. 
17385
17386         * class.cs (Event.Define): The lookup can fail.
17387
17388         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17389
17390         * expression.cs: Resolve the this instance before invoking the code.
17391
17392 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17393
17394         * cs-parser.jay: Add a production in element_access that allows
17395         the thing to become a "type" reference.  This way we can parse
17396         things like "(string [])" as a type.
17397
17398         Note that this still does not handle the more complex rules of
17399         casts. 
17400
17401
17402         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17403
17404         * ecore.cs: (CopyNewMethods): new utility function used to
17405         assemble the list of methods from running FindMembers.
17406
17407         (MemberLookup): Rework FindMembers so that 
17408
17409 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * class.cs (TypeContainer): Remove Delegates who fail to be
17412         defined.
17413
17414         * delegate.cs (Populate): Verify that we dont get null return
17415         values.   TODO: Check for AsAccessible.
17416
17417         * cs-parser.jay: Use basename to emit error 574 (destructor should
17418         have the same name as container class), not the full name.
17419
17420         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17421         possible representation.  
17422
17423         Also implements integer type suffixes U and L.
17424
17425 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17426
17427         * expression.cs (ArrayCreation.DoResolve): We need to do the
17428         argument resolution *always*.
17429
17430         * decl.cs: Make this hold the namespace.  Hold the root context as
17431         well.
17432         (LookupType): Move here.
17433
17434         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17435
17436         * location.cs (Row, Name): Fixed the code, it was always returning
17437         references to the first file.
17438
17439         * interface.cs: Register properties defined through interfaces.
17440
17441         * driver.cs: Add support for globbing on the command line
17442
17443         * class.cs (Field): Make it derive from MemberCore as well.
17444         (Event): ditto.
17445
17446 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17447
17448         * class.cs (Event::Define): Check that the type of the event is a delegate
17449         type else flag error #66.
17450
17451         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17452         same.
17453
17454         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17455         values of EntryPoint, CharSet etc etc.
17456
17457         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17458
17459         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17460         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17461         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17462         which needs this to do its work.
17463
17464         * ../errors/cs0066.cs : Add.
17465
17466 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17467
17468         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17469         helper functions.
17470
17471         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17472         clears out the parameters field.
17473         (MemberSignatureCompare): Cleanup
17474
17475         (MemberCore): New base class used to share code between MethodCore
17476         and Property.
17477
17478         (RegisterRequiredImplementations) BindingFlags.Public requires
17479         either BindingFlags.Instace or Static.  Use instance here.
17480
17481         (Property): Refactored code to cope better with the full spec.
17482
17483         * parameter.cs (GetParameterInfo): Return an empty array instead
17484         of null on error.
17485
17486         * class.cs (Property): Abstract or extern properties have no bodies.
17487
17488         * parameter.cs (GetParameterInfo): return a zero-sized array.
17489
17490         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17491         method modifier validation to the typecontainer so we can reuse
17492         this on properties.
17493
17494         (MethodCore.ParameterTypes): return an empty sized array of types.
17495
17496         (Property.Define): Test property modifier validity.
17497
17498         Add tests for sealed/override too.
17499
17500         (Method.Emit): abstract or extern methods have no bodies.
17501
17502 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17503
17504         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17505         thing.
17506
17507         (Method::Define, ::Emit): Modify accordingly.
17508
17509         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17510
17511         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17512
17513         * makefile: Pass in /unsafe.
17514
17515 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17516
17517         * class.cs (MakeKey): Kill routine.
17518
17519         * class.cs (TypeContainer.Define): Correctly define explicit
17520         method implementations (they require the full interface name plus
17521         the method name).
17522
17523         * typemanager.cs: Deply the PtrHashtable here and stop using the
17524         lame keys.  Things work so much better.
17525
17526         This of course broke everyone who depended on `RegisterMethod' to
17527         do the `test for existance' test.  This has to be done elsewhere.
17528
17529         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17530         the object stupid Equals method (because, that like fails all over
17531         the place).  We still do not use it.
17532
17533         * class.cs (TypeContainer.SetRequiredInterface,
17534         TypeContainer.RequireMethods): Killed these two routines and moved
17535         all the functionality to RegisterRequiredImplementations.
17536
17537         (TypeContainer.RegisterRequiredImplementations): This routine now
17538         registers all the implementations required in an array for the
17539         interfaces and abstract methods.  We use an array of structures
17540         which can be computed ahead of time to reduce memory usage and we
17541         also assume that lookups are cheap as most classes will not
17542         implement too many interfaces.
17543
17544         We also avoid creating too many MethodSignatures.
17545
17546         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17547         clear the "pending" bit if we find that there are problems with
17548         the declaration.
17549
17550         (TypeContainer.VerifyPendingMethods): Update to report errors of
17551         methods that look like implementations but are not.
17552
17553         (TypeContainer.Define): Add support for explicit interface method
17554         implementation. 
17555
17556 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17557
17558         * typemanager.cs: Keep track of the parameters here instead of
17559         being a feature of the TypeContainer.
17560
17561         * class.cs: Drop the registration of parameters here, as
17562         InterfaceMethods are also interface declarations.
17563
17564         * delegate.cs: Register methods with the TypeManager not only with
17565         the TypeContainer.  This code was buggy.
17566
17567         * interface.cs: Full registation here.
17568
17569 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17570
17571         * expression.cs: Remove reducer for binary expressions, it can not
17572         be done this way.
17573
17574         * const.cs: Put here the code that used to go into constant.cs
17575
17576         * constant.cs: Put here the code for constants, this is a new base
17577         class for Literals.
17578
17579         * literal.cs: Make Literal derive from Constant.
17580
17581 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17582
17583         * statement.cs (Return.Emit): Report error 157 if the user
17584         attempts to return from a finally block.
17585
17586         (Return.Emit): Instead of emitting a return, jump to the end of
17587         the function.
17588
17589         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17590         LocalBuilder to store the result of the function.  ReturnLabel is
17591         the target where we jump.
17592
17593
17594 2001-12-09  Radek Doulik  <rodo@ximian.com>
17595
17596         * cs-parser.jay: remember alias in current namespace
17597
17598         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17599         namespaces
17600
17601         * class.cs (LookupAlias): lookup alias in my_namespace
17602
17603         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17604         aliases hashtable
17605         (LookupAlias): lookup alias in this and if needed in parent
17606         namespaces
17607
17608 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17609
17610         * support.cs: 
17611
17612         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17613         making things static.  I need this to avoid passing the
17614         TypeContainer when calling ParameterType.
17615
17616         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17617         that did string manipulation to compute the type and then call
17618         GetType.  Use Parameter.ParameterType instead.
17619
17620         * cs-tokenizer.cs: Consume the suffix for floating values.
17621
17622         * expression.cs (ParameterReference): figure out whether this is a
17623         reference parameter or not.  Kill an extra variable by computing
17624         the arg_idx during emission.
17625
17626         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17627         function that returns whether a parameter is an out/ref value or not.
17628
17629         (Parameter.ParameterType): The type of the parameter (base,
17630         without ref/out applied).
17631
17632         (Parameter.Resolve): Perform resolution here.
17633         (Parameter.ExternalType): The full type (with ref/out applied).
17634
17635         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17636         support for expressions on the using statement.
17637
17638 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17639
17640         * statement.cs (Using.EmitLocalVariableDecls): Split the
17641         localvariable handling of the using statement.
17642
17643         (Block.EmitMeta): Keep track of variable count across blocks.  We
17644         were reusing slots on separate branches of blocks.
17645
17646         (Try.Emit): Emit the general code block, we were not emitting it. 
17647
17648         Check the type of the declaration to be an IDisposable or
17649         something that can be implicity converted to it. 
17650
17651         Emit conversions if required.
17652
17653         * ecore.cs (EmptyExpression): New utility class.
17654         (Expression.ImplicitConversionExists): New utility function.
17655
17656 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17657
17658         * statement.cs (Using): Implement.
17659
17660         * expression.cs (LocalVariableReference): Support read only variables.
17661
17662         * statement.cs: Remove the explicit emit for the Leave opcode.
17663         (VariableInfo): Add a readonly field.
17664
17665 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17666
17667         * ecore.cs (ConvCast): new class used to encapsulate the various
17668         explicit integer conversions that works in both checked and
17669         unchecked contexts.
17670
17671         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17672         properly generate the overflow opcodes.
17673
17674 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17675
17676         * statement.cs: The correct type for the EmptyExpression is the
17677         element_type, not the variable type.  Ravi pointed this out.
17678
17679 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17680
17681         * class.cs (Method::Define): Handle PInvoke methods specially
17682         by using DefinePInvokeMethod instead of the usual one.
17683
17684         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17685         above to do the task of extracting information and defining the method.
17686
17687 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17688
17689         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17690         of the condition for string type.
17691
17692         (Emit): Move that here. 
17693
17694         (ArrayCreation::CheckIndices): Keep string literals in their expression
17695         form.
17696
17697         (EmitDynamicInitializers): Handle strings appropriately.
17698
17699 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17700
17701         * codegen.cs (EmitContext): Replace multiple variables with a
17702         single pointer to the current Switch statement.
17703
17704         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17705         EmitContext.
17706
17707 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17708
17709         * statement.cs 
17710
17711         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17712         default'.
17713
17714         (Foreach.Emit): Foreach on arrays was not setting
17715         up the loop variables (for break/continue).
17716
17717         (GotoCase): Semi-implented.
17718
17719 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17720
17721         * attribute.cs (CheckAttribute): Handle system attributes by using
17722         Attribute.GetAttributes to examine information we need.
17723
17724         (GetValidPlaces): Same here.
17725
17726         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17727
17728         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17729
17730         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17731
17732         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17733
17734         (Method::Emit): Handle the case when we are a PInvoke method.
17735
17736 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17737
17738         * expression.cs: Use ResolveWithSimpleName on compound names.
17739
17740 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17741
17742         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17743         before trying to reduce it.
17744
17745         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17746
17747         * constant.cs (LookupConstantValue): Implement.
17748
17749         (EmitConstant): Use the above in emitting the constant.
17750
17751         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17752         that are user-defined by doing a LookupConstantValue on them.
17753
17754         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17755         too, like above.
17756
17757 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17758
17759         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17760
17761         (BaseAccess.DoResolve): Implement.
17762
17763         (MemberAccess.DoResolve): Split this routine into a
17764         ResolveMemberAccess routine that can be used independently
17765
17766 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17767
17768         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17769         As that share bits of the implementation.  Is returns a boolean,
17770         while As returns the Type that is being probed.
17771
17772 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17773
17774         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17775         instead of a Literal - much easier.
17776
17777         (EnumInTransit): Remove - utterly useless :-)
17778
17779         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17780
17781         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17782
17783         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17784         chain when we have no associated expression.
17785
17786 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17787
17788         * constant.cs (Define): Use Location while reporting the errror.
17789
17790         Also emit a warning when 'new' is used and there is no inherited
17791         member to hide.
17792
17793         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17794         populated.
17795
17796         (LookupEnumValue): Implement to lookup an enum member's value and define it
17797         if necessary.
17798
17799         (Populate): Re-write accordingly to use the above routine.
17800
17801 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17802
17803         * expression.cs (This): Fix prototype for DoResolveLValue to
17804         override the base class DoResolveLValue.
17805
17806         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17807         declarations) 
17808
17809         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17810         (we need to load the address of the field here).  This fixes
17811         test-22. 
17812
17813         (FieldExpr.DoResolveLValue): Call the DoResolve
17814         function to initialize the Instance expression.
17815
17816         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17817         correctly the GetEnumerator operation on a value type.
17818
17819         * cs-parser.jay: Add more simple parsing error catches.
17820
17821         * statement.cs (Switch): Add support for string switches.
17822         Handle null specially.
17823
17824         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17825
17826 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17827
17828         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17829
17830         (declare_local_constant): New helper function.
17831
17832         * statement.cs (AddConstant): Keep a separate record of constants
17833
17834         (IsConstant): Implement to determine if a variable is a constant.
17835
17836         (GetConstantExpression): Implement.
17837
17838         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17839
17840         * statement.cs (IsVariableDefined): Re-write.
17841
17842 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17843
17844         * class.cs (TypeContainer::FindMembers): Look for constants
17845         in the case when we are looking for MemberTypes.Field
17846
17847         * expression.cs (MemberAccess::DoResolve): Check that in the
17848         case we are a FieldExpr and a Literal, we are not being accessed
17849         by an instance reference.
17850
17851         * cs-parser.jay (local_constant_declaration): Implement.
17852
17853         (declaration_statement): Implement for constant declarations.
17854
17855 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17856
17857         * statement.cs (Switch): Catch double defaults.
17858
17859         (Switch): More work on the switch() statement
17860         implementation.  It works for integral values now, need to finish
17861         string support.
17862
17863
17864 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17865
17866         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17867         integer literals into other integer literals.  To be used by
17868         switch. 
17869
17870 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17871
17872         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17873         some memory.
17874
17875         (EmitDynamicInitializers): Cope with the above since we extract data
17876         directly from ArrayData now.
17877
17878         (ExpectInitializers): Keep track of whether initializers are mandatory
17879         or not.
17880
17881         (Bounds): Make it a hashtable to prevent the same dimension being 
17882         recorded for every element in that dimension.
17883
17884         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17885         from being found.
17886
17887         Also fix bug which was causing the indices to be emitted in the reverse
17888         order.
17889
17890 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17891
17892         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17893         unfinished.  They do not work, because the underlying code is
17894         sloppy.
17895
17896 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17897
17898         * cs-parser.jay: Remove bogus fixme.
17899
17900         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17901         on Switch statement.
17902
17903 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17904
17905         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17906         the same. 
17907
17908         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17909         parameter. Apparently, any expression is allowed. 
17910
17911         (ValidateInitializers): Update accordingly.
17912
17913         (CheckIndices): Fix some tricky bugs thanks to recursion.
17914
17915         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17916         I was being completely brain-dead.
17917
17918         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17919         and re-write acordingly.
17920
17921         (DelegateInvocation): Re-write accordingly.
17922
17923         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17924
17925         (MakeByteBlob): Handle types more correctly.
17926
17927         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17928         initialization from expressions but it is incomplete because I am a complete
17929         Dodo :-|
17930
17931 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17934         on If.  Basically, we have to return `true' (ie, we do return to
17935         our caller) only if both branches of the if return.
17936
17937         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17938         short-circuit operators, handle them as short circuit operators. 
17939
17940         (Cast.DoResolve): Resolve type.
17941         (Cast.Cast): Take an expression as the target type.
17942
17943         * cs-parser.jay (cast_expression): Remove old hack that only
17944         allowed a limited set of types to be handled.  Now we take a
17945         unary_expression and we resolve to a type during semantic
17946         analysis.
17947
17948         Use the grammar productions from Rhys to handle casts (this is
17949         not complete like Rhys syntax yet, we fail to handle that corner
17950         case that C# has regarding (-x), but we will get there.
17951
17952 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17953
17954         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17955         field which is an array type.
17956
17957         * cs-parser.jay (declare_local_variables): Support array initialization too.
17958
17959         * typemanager.cs (MakeKey): Implement.
17960
17961         (everywhere): Use the above appropriately.
17962
17963         * cs-parser.jay (for_statement): Update for array initialization while
17964         declaring variables.
17965
17966         * ecore.cs : The error message was correct, it's the variable's names that
17967         were misleading ;-) Make the code more readable.
17968
17969         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17970         the correct type etc.
17971
17972         (ConvertExplicit): Handle Enum types by examining the underlying type.
17973
17974 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17975
17976         * parameter.cs (GetCallingConvention): Always return
17977         CallingConventions.Standard for now.
17978
17979 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17980
17981         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17982         and `r' after calling DoNumericPromotions.
17983
17984         * ecore.cs: Fix error message (the types were in the wrong order).
17985
17986         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17987         BindingFlags.Instance as well 
17988
17989         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17990         implicit int literal conversion in an empty cast so that we
17991         propagate the right type upstream.
17992
17993         (UnboxCast): new class used to unbox value types.
17994         (Expression.ConvertExplicit): Add explicit type conversions done
17995         by unboxing.
17996
17997         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17998         the target type before applying the implicit LongLiterals to ULong
17999         literal cast.
18000
18001 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18002
18003         * cs-parser.jay (for_statement): Reworked the way For works: now
18004         we declare manually any variables that are introduced in
18005         for_initializer to solve the problem of having out-of-band code
18006         emition (that is what got for broken).
18007
18008         (declaration_statement): Perform the actual variable declaration
18009         that used to be done in local_variable_declaration here.
18010
18011         (local_variable_declaration): Do not declare anything, just pass
18012         the information on a DictionaryEntry
18013
18014 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18015
18016         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18017         re-write of the logic to now make it recursive.
18018
18019         (UpdateIndices): Re-write accordingly.
18020
18021         Store element data in a separate ArrayData list in the above methods.
18022
18023         (MakeByteBlob): Implement to dump the array data into a byte array.
18024
18025 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18026
18027         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18028         into CheckIndices.
18029
18030         * constant.cs (Define): Implement.
18031
18032         (EmitConstant): Re-write fully.
18033
18034         Pass in location info.
18035
18036         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18037         respectively.
18038
18039         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18040         DictionaryEntry since we need location info too.
18041
18042         (constant_declaration): Update accordingly.
18043
18044         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18045         code into another method : UpdateIndices.
18046
18047 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18048
18049         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18050         some type checking etc.
18051
18052 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18053
18054         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18055         bits to provide dimension info if the user skips doing that.
18056
18057         Update second constructor to store the rank correctly.
18058
18059 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18060
18061         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18062         and try to implement.
18063
18064         * ../errors/cs0150.cs : Add.
18065
18066         * ../errors/cs0178.cs : Add.
18067
18068 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18069
18070         * statement.cs: Implement foreach on multi-dimensional arrays. 
18071
18072         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18073         name of the params argument.
18074
18075         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18076         initializing the array.
18077
18078         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18079         we can use this elsewhere.
18080
18081         * statement.cs: Finish implementation of foreach for single
18082         dimension arrays.
18083
18084         * cs-parser.jay: Use an out-of-band stack to pass information
18085         around, I wonder why I need this.
18086
18087         foreach_block: Make the new foreach_block the current_block.
18088
18089         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18090         function used to return a static Parameters structure.  Used for
18091         empty parameters, as those are created very frequently.
18092
18093         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18094
18095 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18096
18097         * interface.cs : Default modifier is private, not public. The
18098         make verify test passes again.
18099
18100 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18101
18102         * support.cs (ReflectionParameters): Fix logic to determine
18103         whether the last parameter is a params one. Test 9 passes again.
18104
18105         * delegate.cs (Populate): Register the builders we define with
18106         RegisterParameterForBuilder. Test 19 passes again.
18107
18108         * cs-parser.jay (property_declaration): Reference $6 instead
18109         of $$ to get at the location.
18110
18111         (indexer_declaration): Similar stuff.
18112
18113         (attribute): Ditto.
18114
18115         * class.cs (Property): Register parameters for the Get and Set methods
18116         if they exist. Test 23 passes again.
18117
18118         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18119         call to EmitArguments as we are sure there aren't any params arguments. 
18120         Test 32 passes again.
18121
18122         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18123         IndexOutOfRangeException. 
18124
18125         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18126         Test 33 now passes again.
18127
18128 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18129
18130         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18131         broke a bunch of things.  Will have to come up with a better way
18132         of tracking locations.
18133
18134         * statement.cs: Implemented foreach for single dimension arrays.
18135
18136 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18137
18138         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18139         an error.  This removes the lookup from the critical path.
18140
18141         * cs-parser.jay: Removed use of temporary_loc, which is completely
18142         broken. 
18143
18144 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18145
18146         * support.cs (ReflectionParameters.ParameterModifier): Report
18147         whether the argument is a PARAMS argument or not.
18148
18149         * class.cs: Set the attribute `ParamArrayAttribute' on the
18150         parameter argument.
18151
18152         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18153         and cons_param_array_attribute (ConstructorInfo for
18154         ParamArrayAttribute)., 
18155
18156         * codegen.cs: Emit the return using the `Return' statement, that
18157         way we can report the error correctly for missing return values. 
18158
18159         * class.cs (Method.Emit): Clean up.
18160
18161         * expression.cs (Argument.Resolve): Take another argument: the
18162         location where this argument is used.  Notice that this is not
18163         part of the "Argument" class as to reduce the size of the
18164         structure (we know the approximate location anyways).
18165
18166         Test if the argument is a variable-reference, if not, then
18167         complain with a 206.
18168
18169         (Argument.Emit): Emit addresses of variables.
18170
18171         (Argument.FullDesc): Simplify.
18172
18173         (Invocation.DoResolve): Update for Argument.Resolve.
18174
18175         (ElementAccess.DoResolve): ditto.
18176
18177         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18178         method should be virtual, as this method is always virtual.
18179
18180         (NewDelegate.DoResolve): Update for Argument.Resolve.
18181
18182         * class.cs (ConstructorInitializer.DoResolve): ditto.
18183
18184         * attribute.cs (Attribute.Resolve): ditto.
18185
18186 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18189
18190         * expression.cs (ParameterReference): Drop IStackStorage and implement
18191         IAssignMethod instead. 
18192
18193         (LocalVariableReference): ditto.
18194
18195         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18196         IAssignMethod instead. 
18197
18198 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18199
18200         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18201         enumerations that are used in heavily used structures derive from
18202         byte in a laughable and pathetic attempt to reduce memory usage.
18203         This is the kind of pre-optimzations that you should not do at
18204         home without adult supervision.
18205
18206         * expression.cs (UnaryMutator): New class, used to handle ++ and
18207         -- separatedly from the other unary operators.  Cleans up the
18208         code, and kills the ExpressionStatement dependency in Unary.
18209
18210         (Unary): Removed `method' and `Arguments' from this class, making
18211         it smaller, and moving it all to SimpleCall, so I can reuse this
18212         code in other locations and avoid creating a lot of transient data
18213         strucutres when not required.
18214
18215         * cs-parser.jay: Adjust for new changes.
18216
18217 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * enum.cs (Enum.Populate): If there is a failure during
18220         definition, return
18221
18222         * cs-parser.jay (opt_enum_base): we used to catch type errors
18223         here, but this is really incorrect.  The type error should be
18224         catched during semantic analysis.
18225
18226 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18227
18228         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18229         current_local_parameters as expected since I, in my stupidity, had forgotten
18230         to do this :-)
18231
18232         * attribute.cs (GetValidPlaces): Fix stupid bug.
18233
18234         * class.cs (Method::Emit): Perform check on applicability of attributes.
18235
18236         (Constructor::Emit): Ditto.
18237
18238         (Field::Emit): Ditto.
18239
18240         (Field.Location): Store location information.
18241
18242         (Property, Event, Indexer, Operator): Ditto.
18243
18244         * cs-parser.jay (field_declaration): Pass in location for each field.
18245
18246         * ../errors/cs0592.cs : Add.
18247
18248 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18249
18250         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18251
18252         (InitCoreTypes): Update accordingly.
18253
18254         (RegisterAttrType, LookupAttr): Implement.
18255
18256         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18257         info about the same.
18258
18259         (Resolve): Update to populate the above as necessary.
18260
18261         (Error592): Helper.
18262
18263         (GetValidPlaces): Helper to the above.
18264
18265         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18266
18267         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18268
18269 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18270
18271         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18272
18273         * ../errors/cs0617.cs : Add.
18274
18275 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18276
18277         * enum.cs (Emit): Rename to Populate to be more consistent with what
18278         we expect it to do and when exactly it is called.
18279
18280         * class.cs, rootcontext.cs : Update accordingly.
18281
18282         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18283         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18284
18285         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18286
18287         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18288         of a fieldinfo using the above, when dealing with a FieldBuilder.
18289
18290 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18291
18292         * ../errors/cs0031.cs : Add.
18293
18294         * ../errors/cs1008.cs : Add.
18295
18296         * ../errrors/cs0543.cs : Add.
18297
18298         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18299         enum type.
18300
18301         (FindMembers): Implement.
18302
18303         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18304         enums and delegates too.
18305
18306         (enum_types): Rename to builder_to_enum.
18307
18308         (delegate_types): Rename to builder_to_delegate.
18309
18310         * delegate.cs (FindMembers): Implement.
18311
18312 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18313
18314         * typemanager.cs (IsEnumType): Implement.
18315
18316         * enum.cs (Emit): Re-write parts to account for the underlying type
18317         better and perform checking etc.
18318
18319         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18320         of the underlying type.
18321
18322         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18323         value
18324
18325         * enum.cs (error31): Helper to report error #31.
18326
18327         * cs-parser.jay (enum_declaration): Store location of each member too.
18328
18329         * enum.cs (member_to_location): New hashtable. 
18330
18331         (AddEnumMember): Update location hashtable.
18332
18333         (Emit): Use the location of each member while reporting errors.
18334
18335 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18336
18337         * cs-parser.jay: A for_initializer if is a
18338         local_variable_declaration really ammount to have an implicit
18339         block with the variable declaration and no initializer for for.
18340
18341         * statement.cs (For.Emit): Cope with null initializers.
18342
18343         This fixes the infinite loop on for initializers.
18344
18345 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18346
18347         * enum.cs: More cleanup.
18348
18349         * ecore.cs: Remove dead code.
18350
18351         * class.cs (Property.Emit): More simplification.
18352         (Event.Emit): ditto.
18353
18354         Reworked to have less levels of indentation.
18355
18356 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18357
18358         * class.cs (Property): Emit attributes.
18359
18360         (Field): Ditto.
18361
18362         (Event): Ditto.
18363
18364         (Indexer): Ditto.
18365
18366         (Operator): Ditto.
18367
18368         * enum.cs (Emit): Ditto.
18369
18370         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18371         Enums too.
18372
18373         * class.cs (Field, Event, etc.): Move attribute generation into the
18374         Emit method everywhere.
18375
18376         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18377         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18378         as we had no way of defining nested enums !
18379
18380         * rootcontext.cs : Adjust code accordingly.
18381
18382         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18383
18384 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18385
18386         * expression.cs (EvalConstantExpression): Move into ecore.cs
18387
18388         * enum.cs (Enum): Rename some members and make them public and readonly
18389         according to our convention.
18390
18391         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18392         nothing else.
18393
18394         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18395
18396         (Enum::Emit): Write a simple version for now which doesn't try to compute
18397         expressions. I shall modify this to be more robust in just a while.
18398
18399         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18400
18401         (TypeContainer::CloseType): Create the Enum types too.
18402
18403         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18404
18405         * expression.cs (EvalConstantExpression): Get rid of completely.
18406
18407         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18408         user-defined values and other cases.
18409
18410         (IsValidEnumLiteral): Helper function.
18411
18412         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18413         out there in the case we had a literal FieldExpr.
18414
18415         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18416
18417         (Literalize): Revamp a bit to take two arguments.
18418
18419         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18420
18421 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18422
18423         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18424
18425         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18426
18427         (Resolve): Use the above to ensure we have proper initializers.
18428
18429 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18430
18431         * expression.cs (Expression::EvalConstantExpression): New method to 
18432         evaluate constant expressions.
18433
18434         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18435
18436 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18437
18438         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18439         in an array.
18440
18441         (Binary.ResolveOperator): Handle operator != (object a, object b)
18442         and operator == (object a, object b);
18443
18444         (Binary.DoNumericPromotions): Indicate whether the numeric
18445         promotion was possible.
18446
18447         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18448         Implement.  
18449
18450         Made the ArrayAccess implement interface IAssignMethod instead of
18451         IStackStore as the order in which arguments are passed reflects
18452         this.
18453
18454         * assign.cs: Instead of using expr.ExprClass to select the way of
18455         assinging, probe for the IStackStore/IAssignMethod interfaces.
18456
18457         * typemanager.cs: Load InitializeArray definition.
18458
18459         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18460         static data that can be used to initialize arrays. 
18461
18462 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * expression.cs: Handle operator== and operator!= for booleans.
18465
18466         (Conditioal.Reduce): Implement reducer for the ?: operator.
18467
18468         (Conditional.Resolve): Implement dead code elimination.
18469
18470         (Binary.Resolve): Catch string literals and return a new
18471         concatenated string.
18472
18473         (Unary.Reduce): Implement reduction of unary expressions.
18474
18475         * ecore.cs: Split out the expression core handling here.
18476
18477         (Expression.Reduce): New method used to perform constant folding
18478         and CSE.  This is needed to support constant-expressions. 
18479
18480         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18481         targets, and optimize for !x.
18482
18483 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18484
18485         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18486         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18487         set custom atttributes.
18488
18489         * literal.cs (Literal::GetValue): New abstract method to return the actual
18490         value of the literal, cast as an object.
18491
18492         (*Literal): Implement GetValue method.
18493
18494         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18495         expressions to the arraylist but objects of type Argument.
18496
18497         * class.cs (TypeContainer::Emit): Emit our attributes too.
18498
18499         (Method::Emit, Constructor::Emit): Ditto.
18500
18501         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18502         to be ignoring earlier.
18503
18504 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18505
18506         * attribute.cs (AttributeSection::Define): Implement to do the business
18507         of constructing a CustomAttributeBuilder.
18508
18509         (Attribute): New trivial class. Increases readability of code.  
18510
18511         * cs-parser.jay : Update accordingly.
18512
18513         (positional_argument_list, named_argument_list, named_argument): New rules
18514
18515         (attribute_arguments): Use the above so that we are more correct.
18516
18517 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18518
18519         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18520         to perform all checks for a method with a params parameter.
18521
18522         (Invocation::OverloadResolve): Update to use the above method and therefore
18523         cope correctly with params method invocations.
18524
18525         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18526         params too.
18527
18528         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18529         constructors in our parent too because we can't afford to miss out on 
18530         protected ones ;-)
18531
18532         * attribute.cs (AttributeSection): New name for the class Attribute
18533
18534         Other trivial changes to improve readability.
18535
18536         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18537         use the new class names.
18538
18539 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18540
18541         * class.cs (Method::Define): Complete definition for params types too
18542
18543         (Indexer::Define): Ditto.
18544
18545         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18546         Cope everywhere with a request for info about the array parameter.
18547
18548 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18549
18550         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18551
18552         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18553         local_variable_type to extract the string corresponding to the type.
18554
18555         (local_variable_type): Fixup the action to use the new helper method.
18556
18557         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18558         go.
18559
18560         * expression.cs : Clean out code which uses the above.
18561
18562 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18563
18564         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18565         and bale out if necessary by returning a false.
18566
18567         (RegisterProperty): Ditto.
18568
18569         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18570         and print out appropriate error messages.
18571
18572         * interface.cs (everywhere): Ditto.
18573
18574         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18575         location to constructor.
18576
18577         * class.cs (Property, Event, Indexer): Update accordingly.
18578
18579         * ../errors/cs111.cs : Added.
18580
18581         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18582         of a method, as laid down by the spec.
18583
18584         (Invocation::OverloadResolve): Use the above method.
18585
18586 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18587
18588         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18589         now take a TypeContainer and a Parameters object.
18590
18591         (ParameterData): Modify return type of ParameterModifier method to be 
18592         Parameter.Modifier and not a string.
18593
18594         (ReflectionParameters, InternalParameters): Update accordingly.
18595
18596         * expression.cs (Argument::GetParameterModifier): Same here.
18597
18598         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18599         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18600         symbol in it at all so maybe this is only for now.
18601
18602 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18603
18604         * support.cs (InternalParameters): Constructor now takes an extra argument 
18605         which is the actual Parameters class.
18606
18607         (ParameterDesc): Update to provide info on ref/out modifiers.
18608
18609         * class.cs (everywhere): Update call to InternalParameters to pass in
18610         the second argument too.
18611
18612         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18613         to return the modifier info [ref/out etc]
18614
18615         (InternalParameters, ReflectionParameters): Implement the above.
18616
18617         * expression.cs (Argument::ParameterModifier): Similar function to return
18618         info about the argument's modifiers.
18619
18620         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18621         too.
18622
18623         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18624         a new SetFormalParameters object which we pass to InternalParameters.
18625
18626 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18627
18628         * expression.cs (NewArray): Merge into the ArrayCreation class.
18629
18630 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18631
18632         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18633         NewUserdefinedArray into one as there wasn't much of a use in having
18634         two separate ones.
18635
18636         * expression.cs (Argument): Change field's name to ArgType from Type.
18637
18638         (Type): New readonly property which returns the proper type, taking into 
18639         account ref/out modifiers.
18640
18641         (everywhere): Adjust code accordingly for the above.
18642
18643         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18644         whether we are emitting for a ref or out parameter.
18645
18646         * expression.cs (Argument::Emit): Use the above field to set the state.
18647
18648         (LocalVariableReference::Emit): Update to honour the flag and emit the
18649         right stuff.
18650
18651         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18652
18653         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18654
18655         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18656
18657         (ReflectionParameters, InternalParameters): Implement the above method.
18658
18659         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18660         reporting errors.
18661
18662         (Invocation::FullMethodDesc): Ditto. 
18663
18664 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18665
18666         * cs-parser.jay: Add extra production for the second form of array
18667         creation. 
18668
18669         * expression.cs (ArrayCreation): Update to reflect the above
18670         change. 
18671
18672         * Small changes to prepare for Array initialization.
18673
18674 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18675
18676         * typemanager.cs (ImplementsInterface): interface might be null;
18677         Deal with this problem;
18678
18679         Also, we do store negative hits on the cache (null values), so use
18680         this instead of calling t.GetInterfaces on the type everytime.
18681
18682 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18683
18684         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18685
18686         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18687         split functionality out into different classes.
18688
18689         (New::FormArrayType): Move into NewBuiltinArray.
18690
18691         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18692         quite useless.
18693
18694         (NewBuiltinArray): New class to handle creation of built-in arrays.
18695
18696         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18697         account creation of one-dimensional arrays.
18698
18699         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18700
18701         (NewUserdefinedArray::DoResolve): Implement.
18702
18703         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18704
18705         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18706         we maintain inside the TypeManager. This is necessary to perform lookups on the
18707         module builder.
18708
18709         (LookupType): Update to perform GetType on the module builders too.     
18710
18711         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18712
18713         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18714
18715 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18716
18717         * expression.cs (New::DoResolve): Implement guts of array creation.
18718
18719         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18720
18721 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18722
18723         * expression.cs: Fix bug I introduced lsat night that broke
18724         Delegates. 
18725
18726         (Expression.Resolve): Report a 246 error (can not resolve name)
18727         if we find a SimpleName in the stream.
18728
18729         (Expression.ResolveLValue): Ditto.
18730
18731         (Expression.ResolveWithSimpleName): This function is a variant of
18732         ResolveName, this one allows SimpleNames to be returned without a
18733         warning.  The only consumer of SimpleNames is MemberAccess
18734
18735 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18736
18737         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18738         might arrive here.  I have my doubts that this is correct.
18739
18740         * statement.cs (Lock): Implement lock statement.
18741
18742         * cs-parser.jay: Small fixes to support `lock' and `using'
18743
18744         * cs-tokenizer.cs: Remove extra space
18745
18746         * driver.cs: New flag --checked, allows to turn on integer math
18747         checking. 
18748
18749         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18750         Threading.Monitor.Exit 
18751
18752 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18753
18754         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18755         Expression Class to be IndexerAccess.
18756
18757         Notice that Indexer::DoResolve sets the eclass to Value.
18758
18759 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18760
18761         * class.cs (TypeContainer::Emit): Emit code for indexers.
18762
18763         * assign.cs (IAssignMethod): New interface implemented by Indexers
18764         and Properties for handling assignment.
18765
18766         (Assign::Emit): Simplify and reuse code. 
18767
18768         * expression.cs (IndexerAccess, PropertyExpr): Implement
18769         IAssignMethod, clean up old code. 
18770
18771 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18772
18773         * typemanager.cs (ImplementsInterface): New method to determine if a type
18774         implements a given interface. Provides a nice cache too.
18775
18776         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18777         method.
18778
18779         (ConvertReferenceExplicit): Ditto.
18780
18781         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18782         various methods, with correct names etc.
18783
18784         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18785         Operator.UnaryNegation.
18786
18787         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18788         we have a unary plus or minus operator.
18789
18790         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18791         UnaryMinus.
18792
18793         * everywhere : update accordingly.
18794
18795         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18796         respectively.
18797
18798         * class.cs (Method::Define): For the case where we are implementing a method
18799         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18800         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18801
18802 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18803
18804         * interface.cs (FindMembers): Implement to work around S.R.E
18805         lameness.
18806
18807         * typemanager.cs (IsInterfaceType): Implement.
18808
18809         (FindMembers): Update to handle interface types too.
18810
18811         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18812         use IsAssignableFrom as that is not correct - it doesn't work.
18813
18814         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18815         and accordingly override EmitStatement.
18816
18817         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18818         using the correct logic :-)
18819
18820 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18821
18822         * ../errors/cs-11.cs : Add to demonstrate error -11 
18823
18824 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18825
18826         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18827         then pass this as a hint to ResolveLValue.
18828
18829         * expression.cs (FieldExpr): Add Location information
18830
18831         (FieldExpr::LValueResolve): Report assignment to readonly
18832         variable. 
18833
18834         (Expression::ExprClassFromMemberInfo): Pass location information.
18835
18836         (Expression::ResolveLValue): Add new method that resolves an
18837         LValue. 
18838
18839         (Expression::DoResolveLValue): Default invocation calls
18840         DoResolve. 
18841
18842         (Indexers): New class used to keep track of indexers in a given
18843         Type. 
18844
18845         (IStackStore): Renamed from LValue, as it did not really describe
18846         what this did.  Also ResolveLValue is gone from this interface and
18847         now is part of Expression.
18848
18849         (ElementAccess): Depending on the element access type
18850
18851         * typemanager.cs: Add `indexer_name_type' as a Core type
18852         (System.Runtime.CompilerServices.IndexerNameAttribute)
18853
18854         * statement.cs (Goto): Take a location.
18855
18856 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18857
18858         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18859         if two delegates are compatible.
18860
18861         (NewDelegate::DoResolve): Update to take care of the case when
18862         we instantiate a delegate from another delegate.
18863
18864         * typemanager.cs (FindMembers): Don't even try to look up members
18865         of Delegate types for now.
18866
18867 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18868
18869         * delegate.cs (NewDelegate): New class to take care of delegate
18870         instantiation.
18871
18872         * expression.cs (New): Split the delegate related code out into 
18873         the NewDelegate class.
18874
18875         * delegate.cs (DelegateInvocation): New class to handle delegate 
18876         invocation.
18877
18878         * expression.cs (Invocation): Split out delegate related code into
18879         the DelegateInvocation class.
18880
18881 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18882
18883         * expression.cs (New::DoResolve): Implement delegate creation fully
18884         and according to the spec.
18885
18886         (New::DoEmit): Update to handle delegates differently.
18887
18888         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18889         because of which we were printing out arguments in reverse order !
18890
18891         * delegate.cs (VerifyMethod): Implement to check if the given method
18892         matches the delegate.
18893
18894         (FullDelegateDesc): Implement.
18895
18896         (VerifyApplicability): Implement.
18897
18898         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18899         delegate invocations too.
18900
18901         (Invocation::Emit): Ditto.
18902
18903         * ../errors/cs1593.cs : Added.
18904
18905         * ../errors/cs1594.cs : Added.
18906
18907         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18908
18909 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18910
18911         * typemanager.cs (intptr_type): Core type for System.IntPtr
18912
18913         (InitCoreTypes): Update for the same.
18914
18915         (iasyncresult_type, asynccallback_type): Ditto.
18916
18917         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18918         correct.
18919
18920         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18921         too.
18922
18923         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18924         the builders for the 4 members of a delegate type :-)
18925
18926         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18927         type.
18928
18929         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18930
18931         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18932
18933 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18934
18935         * statement.cs (Break::Emit): Implement.   
18936         (Continue::Emit): Implement.
18937
18938         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18939         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18940         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18941         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18942         end loop
18943
18944         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18945         properties that track the label for the current loop (begin of the
18946         loop and end of the loop).
18947
18948 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18949
18950         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18951         use of emitting anything at all.
18952
18953         * class.cs, rootcontext.cs : Get rid of calls to the same.
18954
18955         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18956
18957         (Populate): Define the constructor correctly and set the implementation
18958         attributes.
18959
18960         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18961         have been defined.
18962
18963         (AddDelegateType): Implement.
18964
18965         (IsDelegateType): Implement helper method.
18966
18967         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18968
18969         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18970         and accordingly handle it.
18971
18972         * delegate.cs (Populate): Take TypeContainer argument.
18973         Implement bits to define the Invoke method. However, I still haven't figured out
18974         how to take care of the native int bit :-(
18975
18976         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18977         Qualify the name of the delegate, not its return type !
18978
18979         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18980         conversion.
18981
18982         (StandardConversionExists): Checking for array types turns out to be recursive.
18983
18984         (ConvertReferenceExplicit): Implement array conversion.
18985
18986         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18987
18988 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18989
18990         * cs-parser.jay (delegate_declaration): Store the fully qualified
18991         name as it is a type declaration.
18992
18993         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18994         readonly.
18995
18996         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18997         as TypeContainer::DefineType.
18998
18999         (Populate): Method in which all the definition of the various methods (Invoke)
19000         etc is done.
19001
19002         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19003         see.
19004
19005         (CloseDelegate): Finally creates the delegate.
19006
19007         * class.cs (TypeContainer::DefineType): Update to define delegates.
19008         (Populate, Emit and CloseType): Do the same thing here too.
19009
19010         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19011         delegates in all these operations.
19012
19013 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19014
19015         * expression.cs: LocalTemporary: a new expression used to
19016         reference a temporary that has been created.
19017
19018         * assign.cs: Handle PropertyAccess back here, so that we can
19019         provide the proper semantic access to properties.
19020
19021         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19022         a few more explicit conversions. 
19023
19024         * modifiers.cs: `NEW' modifier maps to HideBySig.
19025
19026         * expression.cs (PropertyExpr): Make this into an
19027         ExpressionStatement, and support the EmitStatement code path. 
19028
19029         Perform get/set error checking, clean up the interface.
19030
19031         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19032         them into toplevel access objects.
19033
19034 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19035
19036         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19037         SRE.
19038
19039         * typemanager.cs: Keep track here of our PropertyBuilders again to
19040         work around lameness in SRE.
19041
19042 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * expression.cs (LValue::LValueResolve): New method in the
19045         interface, used to perform a second resolution pass for LValues. 
19046
19047         (This::DoResolve): Catch the use of this in static methods.
19048
19049         (This::LValueResolve): Implement.
19050
19051         (This::Store): Remove warning, assigning to `this' in structures
19052         is 
19053
19054         (Invocation::Emit): Deal with invocation of
19055         methods on value types.  We need to pass the address to structure
19056         methods rather than the object itself.  (The equivalent code to
19057         emit "this" for structures leaves the entire structure on the
19058         stack instead of a pointer to it). 
19059
19060         (ParameterReference::DoResolve): Compute the real index for the
19061         argument based on whether the method takes or not a `this' pointer
19062         (ie, the method is static).
19063
19064         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19065         value types returned from functions when we need to invoke a
19066         method on the sturcture.
19067
19068
19069 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19070
19071         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19072         defining the type in the Modulebuilder or Typebuilder. This is to take
19073         care of nested types which need to be defined on the TypeBuilder using
19074         DefineNestedMethod.
19075
19076         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19077         methods in RootContext, only ported to be part of TypeContainer.
19078
19079         (TypeContainer::GetInterfaceOrClass): Ditto.
19080
19081         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19082
19083         * interface.cs (Interface::DefineInterface): New method. Does exactly
19084         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19085         too.
19086
19087         (Interface::GetInterfaces): Move from RootContext here and port.
19088
19089         (Interface::GetInterfaceByName): Same here.
19090
19091         * rootcontext.cs (ResolveTree): Re-write.
19092
19093         (PopulateTypes): Re-write.
19094
19095         * class.cs (TypeContainer::Populate): Populate nested types too.
19096         (TypeContainer::Emit): Emit nested members too.
19097
19098         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19099         instead just use the name argument passed in as it is already fully
19100         qualified.
19101
19102         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19103         to TypeContainer mapping to see if a type is user-defined.
19104
19105         * class.cs (TypeContainer::CloseType): Implement. 
19106
19107         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19108         the default constructor.
19109
19110         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19111         twice.
19112
19113         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19114
19115         * interface.cs (CloseType): Create the type here.
19116
19117         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19118         the hierarchy.
19119
19120         Remove all the methods which are now in TypeContainer.
19121
19122 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19123
19124         * delegate.cs (Define): Re-write bits to define the delegate
19125         correctly.
19126
19127 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19128
19129         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19130
19131         * expression.cs (ImplicitReferenceConversion): handle null as well
19132         as a source to convert to any reference type.
19133
19134         * statement.cs (Return): Perform any implicit conversions to
19135         expected return type.  
19136
19137         Validate use of return statement.  
19138
19139         * codegen.cs (EmitContext): Pass the expected return type here.
19140
19141         * class.cs (Method, Constructor, Property): Pass expected return
19142         type to EmitContext.
19143
19144 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * expression.cs: Make DoResolve take an EmitContext instead of a
19147         TypeContainer.
19148
19149         Replaced `l' and `location' for `loc', for consistency.
19150
19151         (Error, Warning): Remove unneeded Tc argument.
19152
19153         * assign.cs, literal.cs, constant.cs: Update to new calling
19154         convention. 
19155
19156         * codegen.cs: EmitContext now contains a flag indicating whether
19157         code is being generated in a static method or not.
19158
19159         * cs-parser.jay: DecomposeQI, new function that replaces the old
19160         QualifiedIdentifier.  Now we always decompose the assembled
19161         strings from qualified_identifier productions into a group of
19162         memberaccesses.
19163
19164 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19165
19166         * rootcontext.cs: Deal with field-less struct types correctly now
19167         by passing the size option to Define Type.
19168
19169         * class.cs: Removed hack that created one static field. 
19170
19171 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19172
19173         * statement.cs: Moved most of the code generation here. 
19174
19175 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19176
19177         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19178         seem very right.
19179
19180         (ElementAccess): Remove useless bits for now - keep checks as the spec
19181         says.
19182
19183 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19184
19185         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19186         and start performing checks according to the spec.
19187
19188 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19189
19190         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19191         rank_specifiers instead.
19192
19193         (rank_specifiers): Change the order in which the rank specifiers are stored
19194
19195         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19196
19197         * expression.cs (ElementAccess): Implement the LValue interface too.
19198
19199 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19200
19201         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19202         except that user defined conversions are not included.
19203
19204         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19205         perform the conversion of the return type, if necessary.
19206
19207         (New::DoResolve): Check whether we are creating an array or an object
19208         and accordingly do the needful.
19209
19210         (New::Emit): Same here.
19211
19212         (New::DoResolve): Implement guts of array creation.
19213
19214         (New::FormLookupType): Helper function.
19215
19216 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19217
19218         * codegen.cs: Removed most of the code generation here, and move the
19219         corresponding code generation bits to the statement classes. 
19220
19221         Added support for try/catch/finalize and throw.
19222
19223         * cs-parser.jay: Added support for try/catch/finalize.
19224
19225         * class.cs: Catch static methods having the flags override,
19226         virtual or abstract.
19227
19228         * expression.cs (UserCast): This user cast was not really doing
19229         what it was supposed to do.  Which is to be born in fully resolved
19230         state.  Parts of the resolution were being performed at Emit time! 
19231
19232         Fixed this code.
19233
19234 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19235
19236         * expression.cs: Implicity convert the result from UserCast.
19237
19238 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19239
19240         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19241         prevented it from working correctly. 
19242
19243         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19244         merely ConvertImplicit.
19245
19246 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19247
19248         * typemanager.cs: Make the LookupTypeContainer function static,
19249         and not per-instance.  
19250
19251         * class.cs: Make static FindMembers (the one that takes a Type
19252         argument). 
19253
19254         * codegen.cs: Add EmitForeach here.
19255
19256         * cs-parser.jay: Make foreach a toplevel object instead of the
19257         inline expansion, as we need to perform semantic analysis on it. 
19258
19259 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19260
19261         * expression.cs (Expression::ImplicitUserConversion): Rename to
19262         UserDefinedConversion.
19263
19264         (Expression::UserDefinedConversion): Take an extra argument specifying 
19265         whether we look for explicit user conversions too.
19266
19267         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19268
19269         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19270
19271         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19272         with the appropriate arguments.
19273
19274         * cs-parser.jay (cast_expression): Record location too.
19275
19276         * expression.cs (Cast): Record location info.
19277
19278         (Expression::ConvertExplicit): Take location argument.
19279
19280         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19281         to determine if we are doing explicit conversions.
19282
19283         (UserCast::Emit): Update accordingly.
19284
19285         (Expression::ConvertExplicit): Report an error if everything fails.
19286
19287         * ../errors/cs0030.cs : Add.
19288
19289 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19290
19291         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19292         virtual and newslot bits. 
19293
19294         * class.cs (TypeContainer::RegisterRequiredImplementations):
19295         Record methods we need.
19296
19297         (TypeContainer::MakeKey): Helper function to make keys for
19298         MethodBases, since the Methodbase key is useless.
19299
19300         (TypeContainer::Populate): Call RegisterRequiredImplementations
19301         before defining the methods.   
19302
19303         Create a mapping for method_builders_to_methods ahead of time
19304         instead of inside a tight loop.
19305
19306         (::RequireMethods):  Accept an object as the data to set into the
19307         hashtable so we can report interface vs abstract method mismatch.
19308
19309 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19310
19311         * report.cs: Make all of it static.
19312
19313         * rootcontext.cs: Drop object_type and value_type computations, as
19314         we have those in the TypeManager anyways.
19315
19316         Drop report instance variable too, now it is a global.
19317
19318         * driver.cs: Use try/catch on command line handling.
19319
19320         Add --probe option to debug the error reporting system with a test
19321         suite. 
19322
19323         * report.cs: Add support for exiting program when a probe
19324         condition is reached.
19325
19326 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19327
19328         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19329         we do a forcible conversion regardless of type, to check if 
19330         ForceConversion returns a null.
19331
19332         (Binary::error19): Use location to report error.
19333
19334         (Unary::error23): Use location here too.
19335
19336         * ../errors/cs0019.cs : Check in.
19337
19338         * ../errors/cs0023.cs : Check in.
19339
19340         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19341         case of a non-null MethodInfo object with a length of 0 !
19342
19343         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19344         an applicable member - according to the spec :-)
19345         Also fix logic to find members in base types.
19346
19347         (Unary::ResolveOperator): Same here.
19348
19349         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19350         as I was getting thoroughly confused between this and error19 :-)
19351
19352         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19353         (::FindMostEncompassedType): Implement.
19354         (::FindMostEncompassingType): Implement.
19355         (::StandardConversionExists): Implement.
19356
19357         (UserImplicitCast): Re-vamp. We now need info about most specific
19358         source and target types so that we can do the necessary conversions.
19359
19360         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19361         mathematical union with no duplicates.
19362
19363 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19364
19365         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19366         in order from base classes to child classes, so that we can in
19367         child classes look up in our parent for method names and
19368         attributes (required for handling abstract, virtual, new, override
19369         constructs: we need to instrospect our base class, and if we dont
19370         populate the classes in order, the introspection might be
19371         incorrect.  For example, a method could query its parent before
19372         the parent has any methods and would determine that the parent has
19373         no abstract methods (while it could have had them)).
19374
19375         (RootContext::CreateType): Record the order in which we define the
19376         classes.
19377
19378 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19379
19380         * class.cs (TypeContainer::Populate): Also method definitions can
19381         fail now, keep track of this.
19382
19383         (TypeContainer::FindMembers): Implement support for
19384         DeclaredOnly/noDeclaredOnly flag.
19385
19386         (Constructor::Emit) Return the ConstructorBuilder.
19387
19388         (Method::Emit) Return the MethodBuilder. 
19389         Check for abstract or virtual methods to be public.
19390
19391         * rootcontext.cs (RootContext::CreateType): Register all the
19392         abstract methods required for the class to be complete and the
19393         interface methods that must be implemented. 
19394
19395         * cs-parser.jay: Report error 501 (method requires body if it is
19396         not marked abstract or extern).
19397
19398         * expression.cs (TypeOf::Emit): Implement.
19399
19400         * typemanager.cs: runtime_handle_type, new global type.
19401
19402         * class.cs (Property::Emit): Generate code for properties.
19403
19404 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19405
19406         * expression.cs (Unary::ResolveOperator): Find operators on base type
19407         too - we now conform exactly to the spec.
19408
19409         (Binary::ResolveOperator): Same here.
19410
19411         * class.cs (Operator::Define): Fix minor quirk in the tests.
19412
19413         * ../errors/cs0215.cs : Added.
19414
19415         * ../errors/cs0556.cs : Added.
19416
19417         * ../errors/cs0555.cs : Added.
19418
19419 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19420
19421         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19422         single integer which is really efficient
19423
19424 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19425
19426         *  expression.cs (Expression::ImplicitUserConversion): Use location
19427         even in the case when we are examining True operators.
19428  
19429         * class.cs (Operator::Define): Perform extensive checks to conform
19430         with the rules for operator overloading in the spec.
19431
19432         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19433         some of the other conversions mentioned in the spec.
19434
19435         * typemanager.cs (array_type): New static member for the System.Array built-in
19436         type.
19437
19438         (cloneable_interface): For System.ICloneable interface.
19439
19440         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19441         we start resolving the tree and populating types.
19442
19443         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19444  
19445 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19446
19447         * expression.cs (Expression::ExprClassFromMemberInfo,
19448         Expression::Literalize): Create literal expressions from
19449         FieldInfos which are literals.
19450
19451         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19452         type casts, because they were wrong.  The test suite in tests
19453         caught these ones.
19454
19455         (ImplicitNumericConversion): ushort to ulong requires a widening
19456         cast. 
19457
19458         Int32 constant to long requires widening cast as well.
19459
19460         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19461         for integers because the type on the stack is not i4.
19462
19463 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * expression.cs (report118): require location argument. 
19466
19467         * parameter.cs: Do not dereference potential null value.
19468
19469         * class.cs: Catch methods that lack the `new' keyword when
19470         overriding a name.  Report warnings when `new' is used without
19471         anything being there to override.
19472
19473         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19474
19475         * class.cs: Only add constructor to hashtable if it is non-null
19476         (as now constructors can fail on define).
19477
19478         (TypeManager, Class, Struct): Take location arguments.
19479
19480         Catch field instance initialization in structs as errors.
19481
19482         accepting_filter: a new filter for FindMembers that is static so
19483         that we dont create an instance per invocation.
19484
19485         (Constructor::Define): Catch errors where a struct constructor is
19486         parameterless 
19487
19488         * cs-parser.jay: Pass location information for various new
19489         constructs. 
19490
19491         * delegate.cs (Delegate): take a location argument.
19492
19493         * driver.cs: Do not call EmitCode if there were problesm in the
19494         Definition of the types, as many Builders wont be there. 
19495
19496         * decl.cs (Decl::Decl): Require a location argument.
19497
19498         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19499         into integers, and find the most appropiate integer for it.
19500
19501         * literal.cs: Implement ULongLiteral.
19502
19503         * rootcontext.cs: Provide better information about the location of
19504         failure when CreateType fails.
19505
19506 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19507
19508         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19509         as well.
19510
19511         * expression.cs (Binary::CheckShiftArguments): Add missing type
19512         computation.
19513         (Binary::ResolveOperator): Add type to the logical and and logical
19514         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19515         before.
19516
19517         (Binary::DoNumericPromotions): In the case where either argument
19518         is ulong (and most signed types combined with ulong cause an
19519         error) perform implicit integer constant conversions as well.
19520
19521 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19522
19523         * expression.cs (UserImplicitCast): Method should always be
19524         non-null. 
19525         (Invocation::BetterConversion): Simplified test for IntLiteral.
19526
19527         (Expression::ImplicitNumericConversion): Split this routine out.
19528         Put the code that performs implicit constant integer conversions
19529         here. 
19530
19531         (Expression::Resolve): Become a wrapper around DoResolve so we can
19532         check eclass and type being set after resolve.
19533
19534         (Invocation::Badness): Remove this dead function
19535
19536         (Binary::ResolveOperator): Do not compute the expensive argumnets
19537         unless we have a union for it.
19538
19539         (Probe::Emit): Is needs to do an isinst and then
19540         compare against null.
19541
19542         (::CanConvert): Added Location argument.  If the Location argument
19543         is null (Location.Null), then we do not report errors.  This is
19544         used by the `probe' mechanism of the Explicit conversion.  We do
19545         not want to generate an error for something that the user
19546         explicitly requested to be casted.  But the pipeline for an
19547         explicit cast first tests for potential implicit casts.
19548
19549         So for now, if the Location is null, it means `Probe only' to
19550         avoid adding another argument.   Might have to revise this
19551         strategy later.
19552
19553         (ClassCast): New class used to type cast objects into arbitrary
19554         classes (used in Explicit Reference Conversions).
19555
19556         Implement `as' as well.
19557
19558         Reverted all the patches from Ravi below: they were broken:
19559
19560                 * The use of `level' as a mechanism to stop recursive
19561                   invocations is wrong.  That was there just to catch the
19562                   bug with a strack trace but not as a way of addressing
19563                   the problem.
19564
19565                   To fix the problem we have to *understand* what is going
19566                   on and the interactions and come up with a plan, not
19567                   just get things going.
19568
19569                 * The use of the type conversion cache that I proposed
19570                   last night had an open topic: How does this work across
19571                   protection domains.  A user defined conversion might not
19572                   be public in the location where we are applying the
19573                   conversion, a different conversion might be selected
19574                   (ie, private A->B (better) but public B->A (worse),
19575                   inside A, A->B applies, but outside it, B->A will
19576                   apply).
19577
19578                 * On top of that (ie, even if the above is solved),
19579                   conversions in a cache need to be abstract.  Ie, `To
19580                   convert from an Int to a Short use an OpcodeCast', not
19581                   `To convert from an Int to a Short use the OpcodeCast on
19582                   the variable 5' (which is what this patch was doing).
19583
19584 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19585
19586         * expression.cs (Invocation::ConversionExists): Re-write to use
19587         the conversion cache
19588
19589         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19590         cache all conversions done, not just user-defined ones.
19591
19592         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19593         to determine if a conversion exists instead of acutually trying to 
19594         perform the conversion. It's faster too.
19595
19596         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19597         and only then attempt the implicit conversion.
19598
19599 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19600
19601         * expression.cs (ConvertImplicit): Use a cache for conversions
19602         already found. Check level of recursion and bail out if necessary.
19603
19604 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19607         Export standard methods that we expect for string operations.
19608
19609         * statement.cs (Block::UsageWarning): Track usage of variables and
19610         report the errors for not used variables.
19611
19612         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19613         operator. 
19614
19615 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19616
19617         * codegen.cs: remove unnneded code 
19618
19619         * expression.cs: Removed BuiltinTypeAccess class
19620
19621         Fix the order in which implicit conversions are
19622         done.  
19623
19624         The previous fixed dropped support for boxed conversions (adding a
19625         test to the test suite now)
19626
19627         (UserImplicitCast::CanConvert): Remove test for source being null,
19628         that code is broken.  We should not feed a null to begin with, if
19629         we do, then we should track the bug where the problem originates
19630         and not try to cover it up here.
19631
19632         Return a resolved expression of type UserImplicitCast on success
19633         rather than true/false.  Ravi: this is what I was talking about,
19634         the pattern is to use a static method as a "constructor" for
19635         objects. 
19636
19637         Also, do not create arguments until the very last minute,
19638         otherwise we always create the arguments even for lookups that
19639         will never be performed. 
19640
19641         (UserImplicitCast::Resolve): Eliminate, objects of type
19642         UserImplicitCast are born in a fully resolved state. 
19643
19644         * typemanager.cs (InitCoreTypes): Init also value_type
19645         (System.ValueType). 
19646
19647         * expression.cs (Cast::Resolve): First resolve the child expression.
19648
19649         (LValue): Add new method AddressOf to be used by
19650         the `&' operator.  
19651
19652         Change the argument of Store to take an EmitContext instead of an
19653         ILGenerator, because things like FieldExpr need to be able to call
19654         their children expression to generate the instance code. 
19655
19656         (Expression::Error, Expression::Warning): Sugar functions for
19657         reporting errors.
19658
19659         (Expression::MemberLookup): Accept a TypeContainer instead of a
19660         Report as the first argument.
19661
19662         (Expression::ResolvePrimary): Killed.  I still want to improve
19663         this as currently the code is just not right.
19664
19665         (Expression::ResolveMemberAccess): Simplify, but it is still
19666         wrong. 
19667
19668         (Unary::Resolve): Catch errors in AddressOf operators.
19669
19670         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19671         index to a byte for the short-version, or the compiler will choose
19672         the wrong Emit call, which generates the wrong data.
19673
19674         (ParameterReference::Emit, ::Store): same.
19675
19676         (FieldExpr::AddressOf): Implement.
19677
19678         * typemanager.cs: TypeManager: made public variable instead of
19679         property.
19680
19681         * driver.cs: document --fatal.
19682
19683         * report.cs (ErrorMessage, WarningMessage): new names for the old
19684         Error and Warning classes.
19685
19686         * cs-parser.jay (member_access): Turn built-in access to types
19687         into a normal simplename
19688
19689 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19690
19691         * expression.cs (Invocation::BetterConversion): Fix to cope
19692         with q being null, since this was introducing a bug.
19693
19694         * expression.cs (ConvertImplicit): Do built-in conversions first.
19695
19696 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19697
19698         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19699
19700 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19701
19702         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19703         I had introduced long ago (what's new ?).
19704
19705         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19706         the work of all the checking. 
19707         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19708         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19709
19710         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19711         that is the right way. 
19712
19713         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19714         overloading resolution. Use everywhere instead of cutting and pasting code.
19715
19716         (Binary::ResolveOperator): Use MakeUnionSet.
19717
19718         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19719         we have to convert to bool types. Not complete yet.
19720
19721 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19722
19723         * typemanager.cs (TypeManager::CSharpName): support ushort.
19724
19725         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19726         to provide an expression that performsn an implicit constant int
19727         conversion (section 6.1.6).
19728         (Expression::ConvertImplicitRequired): Reworked to include
19729         implicit constant expression conversions.
19730
19731         (Expression::ConvertNumericExplicit): Finished.
19732
19733         (Invocation::Emit): If InstanceExpression is null, then it means
19734         that we perform a call on this.
19735
19736 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19737
19738         * expression.cs (Unary::Emit): Remove some dead code.
19739         (Probe): Implement Resolve and Emit for `is'.
19740         (Expression::ConvertImplicitRequired): Attempt to do constant
19741         expression conversions here.  Maybe should be moved to
19742         ConvertImplicit, but I am not sure.
19743         (Expression::ImplicitLongConstantConversionPossible,
19744         Expression::ImplicitIntConstantConversionPossible): New functions
19745         that tell whether is it possible to apply an implicit constant
19746         expression conversion.
19747
19748         (ConvertNumericExplicit): Started work on explicit numeric
19749         conversions.
19750
19751         * cs-parser.jay: Update operator constants.
19752
19753         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19754         (Parameters::GetSignature): Hook up VerifyArgs here.
19755         (Parameters::VerifyArgs): Verifies that no two arguments have the
19756         same name. 
19757
19758         * class.cs (Operator): Update the operator names to reflect the
19759         ones that the spec expects (as we are just stringizing the
19760         operator names).
19761
19762         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19763         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19764         previous usage did only work for our methods.
19765         (Expression::ConvertImplicit): Handle decimal implicit numeric
19766         conversions as well.
19767         (Expression::InternalTypeConstructor): Used to invoke constructors
19768         on internal types for default promotions.
19769
19770         (Unary::Emit): Implement special handling for the pre/post
19771         increment/decrement for overloaded operators, as they need to have
19772         the same semantics as the other operators.
19773
19774         (Binary::ResolveOperator): ditto.
19775         (Invocation::ConversionExists): ditto.
19776         (UserImplicitCast::Resolve): ditto.
19777
19778 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19779
19780         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19781         operator, return after emitting body. Regression tests pass again !
19782
19783         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19784         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19785         (Invocation::OverloadResolve): Ditto.
19786         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19787
19788         * everywhere : update calls to the above methods accordingly.
19789
19790 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19791
19792         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19793
19794         * expression.cs (ExpressionStatement): New base class used for
19795         expressions that can appear in statements, so that we can provide
19796         an alternate path to generate expression that do not leave a value
19797         on the stack.
19798
19799         (Expression::Emit, and all the derivatives): We no longer return
19800         whether a value is left on the stack or not.  Every expression
19801         after being emitted leaves a single value on the stack.
19802
19803         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19804         facilties of ExpressionStatement if possible.
19805
19806         * cs-parser.jay: Update statement_expression.
19807
19808 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19809
19810         * driver.cs: Change the wording of message
19811
19812 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19813
19814         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19815         the type of the expression to the return type of the method if
19816         we have an overloaded operator match ! The regression tests pass again !
19817         (Unary::ResolveOperator): Ditto.
19818
19819         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19820         to find "op_Implicit", not "implicit" ;-)
19821         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19822         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19823
19824         * everywhere : Correct calls to the above accordingly.
19825
19826         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19827         (ConvertImplicit): Do user-defined conversion if it exists.
19828
19829 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19830
19831         * assign.cs: track location.
19832         (Resolve): Use implicit conversions on assignment.
19833
19834         * literal.cs: Oops.  Not good, Emit of short access values should
19835         pass (Bytes) or the wrong argument will be selected.
19836
19837         * expression.cs (Unary::Emit): Emit code for -expr.
19838
19839         (Unary::ResolveOperator): Handle `Substract' for non-constants
19840         (substract from zero from the non-constants).
19841         Deal with Doubles as well. 
19842
19843         (Expression::ConvertImplicitRequired): New routine that reports an
19844         error if no implicit conversion exists. 
19845
19846         (Invocation::OverloadResolve): Store the converted implicit
19847         expressions if we make them
19848
19849 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19850
19851         * class.cs (ConstructorInitializer): Take a Location argument.
19852         (ConstructorBaseInitializer): Same here.
19853         (ConstructorThisInitializer): Same here.
19854
19855         * cs-parser.jay : Update all calls accordingly.
19856
19857         * expression.cs (Unary, Binary, New): Take location argument.
19858         Update accordingly everywhere.
19859
19860         * cs-parser.jay : Update all calls to the above to take a location
19861         argument.
19862
19863         * class.cs : Ditto.
19864
19865 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19866
19867         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19868         (Invocation::BetterConversion): Same here
19869         (Invocation::ConversionExists): Ditto.
19870
19871         (Invocation::ConversionExists): Implement.
19872
19873 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19874
19875         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19876         Also take an additional TypeContainer argument.
19877
19878         * All over : Pass in TypeContainer as argument to OverloadResolve.
19879
19880         * typemanager.cs (CSharpName): Update to check for the string type and return
19881         that too.
19882
19883         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19884         a given method.
19885
19886 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19887
19888         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19889         (Invocation::BetterFunction): Implement.
19890         (Invocation::BetterConversion): Implement.
19891         (Invocation::ConversionExists): Skeleton, no implementation yet.
19892
19893         Okay, things work fine !
19894
19895 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19896
19897         * typemanager.cs: declare and load enum_type, delegate_type and
19898         void_type. 
19899
19900         * expression.cs (Expression::Emit): Now emit returns a value that
19901         tells whether a value is left on the stack or not.  This strategy
19902         might be reveted tomorrow with a mechanism that would address
19903         multiple assignments.
19904         (Expression::report118): Utility routine to report mismatches on
19905         the ExprClass.
19906
19907         (Unary::Report23): Report impossible type/operator combination
19908         utility function.
19909
19910         (Unary::IsIncrementableNumber): Whether the type can be
19911         incremented or decremented with add.
19912         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19913         complemented. 
19914         (Unary::ResolveOperator): Implement ++, !, ~,
19915
19916         (Invocation::Emit): Deal with new Emit convetion.
19917
19918         * All Expression derivatives: Updated their Emit method to return
19919         whether they leave values on the stack or not.
19920
19921         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19922         stack for expressions that are statements. 
19923
19924 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * expression.cs (LValue): New interface.  Must be implemented by
19927         LValue objects.
19928         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19929         LValue interface.
19930
19931         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19932         interface for generating code, simplifies the code.
19933
19934 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19935
19936         * expression.cs (everywhere): Comment out return statements in ::Resolve
19937         methods to avoid the warnings.
19938
19939 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19940
19941         * driver.cs (parse): Report error 2001 if we can not open the
19942         source file.
19943
19944         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19945         not resolve it.
19946
19947         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19948         object. 
19949
19950         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19951         otherwise nested blocks end up with the same index.
19952
19953         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19954
19955         * expression.cs:  Instead of having FIXMEs in the Resolve
19956         functions, throw exceptions so it is obvious that we are facing a
19957         bug. 
19958
19959         * cs-parser.jay (invocation_expression): Pass Location information.
19960
19961         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19962         Use a basename for those routines because .NET does not like paths
19963         on them. 
19964
19965         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19966         already defined.
19967
19968 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19969
19970         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19971         are loading the correct data types (throws an exception if not).
19972         (TypeManager::InitCoreTypes): Use CoreLookupType
19973
19974         * expression.cs (Unary::ResolveOperator): return the child
19975         expression for expressions which are just +expr.
19976         (Unary::ResolveOperator): Return negative literals for -LITERAL
19977         expressions (otherwise they are Unary {Literal}).
19978         (Invocation::Badness): Take into account `Implicit constant
19979         expression conversions'.
19980
19981         * literal.cs (LongLiteral): Implement long literal class.
19982         (IntLiteral): export the `Value' of the intliteral. 
19983
19984 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19985
19986         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19987
19988         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19989         instead of 'Operator'
19990
19991         * expression.cs (Binary::ResolveOperator): Update accordingly.
19992         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19993         and 'Minus'
19994
19995         * cs-parser.jay (unary_expression): Update to use the new names.
19996
19997         * gen-treedump.cs (GetUnary): Same here.
19998
19999         * expression.cs (Unary::Resolve): Implement.
20000         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20001         operators are found instead of making noise ;-)
20002         (Unary::ResolveOperator): New method to do precisely the same thing which
20003         Binary::ResolveOperator does for Binary expressions.
20004         (Unary.method, .Arguments): Add.
20005         (Unary::OperName): Implement.   
20006         (Unary::ForceConversion): Copy and Paste !
20007
20008         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20009         a unary operator.
20010
20011         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20012         for the inbuilt operators. Only overloading works for now ;-)
20013
20014 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20015
20016         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20017         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20018
20019         * expression.cs (This::Emit): Implement. 
20020         (This::Resolve): Implement.
20021         (TypeOf:Resolve): Implement.
20022         (Expression::ResolveSimpleName): Add an implicit this to instance
20023         field references. 
20024         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20025         Bind instance variable to Field expressions.
20026         (FieldExpr::Instance): New field used to track the expression that
20027         represents the object instance.
20028         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20029         binding 
20030         (FieldExpr::Emit): Implement.
20031
20032         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20033         the last instruction contains a return opcode to avoid generating
20034         the last `ret' instruction (this generates correct code, and it is
20035         nice to pass the peverify output).
20036
20037         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20038         initializer for static and instance variables.
20039         (Constructor::Emit): Allow initializer to be null in the case of
20040         static constructors.  Only emit initializer for instance
20041         constructors. 
20042
20043         (TypeContainer::FindMembers): Return a null array if there are no
20044         matches.
20045
20046         Also fix the code for the MemberTypes.Method branch, as it was not
20047         scanning that for operators (or tried to access null variables before).
20048
20049         * assign.cs (Assign::Emit): Handle instance and static fields. 
20050
20051         * TODO: Updated.
20052
20053         * driver.cs: Stop compilation if there are parse errors.
20054
20055         * cs-parser.jay (constructor_declaration): Provide default base
20056         initializer for non-static constructors.
20057         (constructor_declarator): Do not provide a default base
20058         initializers if none was specified.
20059         Catch the fact that constructors should not have parameters.
20060
20061         * class.cs: Do not emit parent class initializers for static
20062         constructors, that should be flagged as an error.
20063
20064 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20065
20066         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20067         Move back code into TypeContainer::Populate.
20068
20069 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20070
20071         * class.cs (TypeContainer::AddConstructor): Fix the check to
20072         compare against Name, not Basename. 
20073         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20074
20075         * cs-parser.jay : Update accordingly.
20076
20077         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20078         for methods, don't forget to look into the operators too.
20079         (RegisterMethodBuilder): Helper method to take care of this for
20080         methods, constructors and operators.
20081         (Operator::Define): Completely revamp.
20082         (Operator.OperatorMethod, MethodName): New fields.
20083         (TypeContainer::Populate): Move the registering of builders into
20084         RegisterMethodBuilder.
20085         (Operator::Emit): Re-write.
20086
20087         * expression.cs (Binary::Emit): Comment out code path to emit method
20088         invocation stuff for the case when we have a user defined operator. I am
20089         just not able to get it right !
20090
20091 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20092
20093         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20094         argument. 
20095
20096         (Expression::MemberLookup): Provide a version that allows to
20097         specify the MemberTypes and BindingFlags. 
20098
20099         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20100         so it was not fetching variable information from outer blocks.
20101
20102         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20103         Beforefieldinit as it was buggy.
20104
20105         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20106         that Ravi put here.  
20107
20108         * class.cs (Constructor::Emit): Only emit if block is not null.
20109         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20110         deal with this by semantically definining it as if the user had
20111         done it.
20112
20113         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20114         constructors as we now "emit" them at a higher level.
20115
20116         (TypeContainer::DefineDefaultConstructor): Used to define the
20117         default constructors if none was provided.
20118
20119         (ConstructorInitializer): Add methods Resolve and Emit. 
20120
20121         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20122
20123 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20124
20125         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20126         the default constructor builder with our hashtable for methodbuilders
20127         to methodcores.
20128
20129         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20130         and argument_count is 0 in which case we have a match.
20131         (Binary::ResolveOperator): More null checking and miscellaneous coding
20132         style cleanup.
20133
20134 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20135
20136         * rootcontext.cs (IsNameSpace): Compare against null.
20137
20138         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20139
20140         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20141         and Unary::Operator.
20142
20143         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20144         accordingly.
20145
20146         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20147         we have overloaded operators.
20148         (Binary::ResolveOperator): Implement the part which does the operator overload
20149         resolution.
20150
20151         * class.cs (Operator::Emit): Implement.
20152         (TypeContainer::Emit): Emit the operators we have too.
20153
20154         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20155         the case when we have a user-defined operator.
20156
20157 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20158
20159         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20160
20161 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20162
20163         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20164         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20165         (Constructor::Emit): Implement.
20166         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20167         if we have no work to do. 
20168         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20169         Emit method.
20170
20171         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20172         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20173
20174         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20175         of parent.parent.
20176
20177 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20178
20179         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20180         in the source.
20181         (Tree::RecordNamespace): Method to do what the name says ;-)
20182         (Tree::Namespaces): Property to get at the namespaces hashtable.
20183
20184         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20185         keep track.
20186
20187         * rootcontext.cs (IsNamespace): Fixed it :-)
20188
20189 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * class.cs (TypeContainer::FindMembers): Add support for
20192         constructors. 
20193         (MethodCore): New class that encapsulates both the shared aspects
20194         of a Constructor and a Method.  
20195         (Method, Constructor): Factored pieces into MethodCore.
20196
20197         * driver.cs: Added --fatal which makes errors throw exceptions.
20198         Load System assembly as well as part of the standard library.
20199
20200         * report.cs: Allow throwing exceptions on errors for debugging.
20201
20202         * modifiers.cs: Do not use `parent', instead use the real type
20203         container to evaluate permission settings.
20204
20205         * class.cs: Put Ravi's patch back in.  He is right, and we will
20206         have to cope with the
20207
20208 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20209
20210         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20211         FamORAssem, not FamANDAssem.
20212
20213 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20214
20215         * driver.cs: Added --parse option that only parses its input files
20216         and terminates.
20217
20218         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20219         incorrect.  IsTopLevel is not used to tell whether an object is
20220         root_types or not (that can be achieved by testing this ==
20221         root_types).  But to see if this is a top-level *class* (not
20222         necessarly our "toplevel" container). 
20223
20224 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20225
20226         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20227         parent instead of a direct call to GetType.
20228
20229 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20230
20231         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20232         Modifiers.TypeAttr. This should just be a call to that method.
20233
20234         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20235         object so that we can determine if we are top-level or not.
20236
20237         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20238         TypeContainer too.
20239
20240         * enum.cs (Enum::Define): Ditto.
20241
20242         * modifiers.cs (FieldAttr): Re-write.
20243
20244         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20245         (TypeContainer::HaveStaticConstructor): New property to provide access
20246         to precisely that info.
20247
20248         * modifiers.cs (MethodAttr): Re-write.
20249         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20250
20251         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20252         of top-level types as claimed.
20253
20254 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20255
20256         * expression.cs (MemberLookup): Fruitless attempt to lookup
20257         constructors.  Maybe I need to emit default constructors?  That
20258         might be it (currently .NET emits this for me automatically).
20259         (Invocation::OverloadResolve): Cope with Arguments == null.
20260         (Invocation::EmitArguments): new function, shared by the new
20261         constructor and us.
20262         (Invocation::Emit): Handle static and instance methods.  Emit
20263         proper call instruction for virtual or non-virtual invocations.
20264         (New::Emit): Implement.
20265         (New::Resolve): Implement.
20266         (MemberAccess:Resolve): Implement.
20267         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20268         to track instances.
20269         (FieldExpr::Resolve): Set type.
20270
20271         * support.cs: Handle empty arguments.
20272                 
20273         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20274         SimpleLookup): Auxiliary routines to help parse a qualifier
20275         identifier.  
20276
20277         Update qualifier_identifier rule.
20278
20279         * codegen.cs: Removed debugging messages.
20280
20281         * class.cs: Make this a global thing, this acts just as a "key" to
20282         objects that we might have around.
20283
20284         (Populate): Only initialize method_builders_to_methods once.
20285
20286         * expression.cs (PropertyExpr): Initialize type from the
20287         PropertyType. 
20288
20289         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20290         Resolve pattern.  Attempt to implicitly convert value to boolean.
20291         Emit code.
20292
20293         * expression.cs: Set the type for the int32/int32 argument case.
20294         (Binary::ResolveOperator): Set the return type to boolean for
20295         comparission operators
20296
20297         * typemanager.cs: Remove debugging print code.
20298
20299         (Invocation::Resolve): resolve type.
20300
20301         * class.cs: Allocate a MemberInfo of the correct size, as the code
20302         elsewhere depends on the test to reflect the correct contents.
20303
20304         (Method::) Keep track of parameters, due to System.Reflection holes
20305
20306         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20307         mapping here.
20308
20309         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20310         of the exact size and return that.
20311
20312         (Class::LookupMethodByBuilder): New function that maps
20313         MethodBuilders to its methods.  Required to locate the information
20314         on methods because System.Reflection bit us again.
20315
20316         * support.cs: New file, contains an interface ParameterData and
20317         two implementations: ReflectionParameters and InternalParameters
20318         used to access Parameter information.  We will need to grow this
20319         as required.
20320
20321         * expression.cs (Invocation::GetParameterData): implement a cache
20322         and a wrapper around the ParameterData creation for methods. 
20323         (Invocation::OverloadResolve): Use new code.
20324
20325 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20326
20327         * class.cs (TypeContainer::EmitField): Remove and move into 
20328         (Field::Define): here and modify accordingly.
20329         (Field.FieldBuilder): New member.
20330         (TypeContainer::Populate): Update accordingly.
20331         (TypeContainer::FindMembers): Implement.
20332
20333 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20334
20335         * statement.cs: (VariableInfo::VariableType): New field to be
20336         initialized with the full type once it is resolved. 
20337
20338 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20339
20340         * parameter.cs (GetParameterInfo): Use a type cache to compute
20341         things only once, and to reuse this information
20342
20343         * expression.cs (LocalVariableReference::Emit): Implement.
20344         (OpcodeCast::Emit): fix.
20345
20346         (ParameterReference::Resolve): Implement.
20347         (ParameterReference::Emit): Implement.
20348
20349         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20350         that are expressions need to stay as Expressions.
20351
20352         * typemanager.cs (CSharpName): Returns the C# name of a type if
20353         possible. 
20354
20355         * expression.cs (Expression::ConvertImplicit): New function that
20356         implements implicit type conversions.
20357
20358         (Expression::ImplicitReferenceConversion): Implements implicit
20359         reference conversions.
20360
20361         (EmptyCast): New type for transparent casts.
20362
20363         (OpcodeCast): New type for casts of types that are performed with
20364         a sequence of bytecodes.
20365
20366         (BoxedCast): New type used for casting value types into reference
20367         types.  Emits a box opcode.
20368
20369         (Binary::DoNumericPromotions): Implements numeric promotions of
20370         and computation of the Binary::Type.
20371
20372         (Binary::EmitBranchable): Optimization.
20373
20374         (Binary::Emit): Implement code emission for expressions.
20375
20376         * typemanager.cs (TypeManager): Added two new core types: sbyte
20377         and byte.
20378
20379 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20380
20381         * class.cs (TypeContainer::FindMembers): Method which does exactly
20382         what Type.FindMembers does, only we don't have to use reflection. No
20383         implementation yet.
20384
20385         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20386         typecontainer objects as we need to get at them.
20387         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20388
20389         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20390         typecontainer object.
20391
20392         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20393         of just a Report object.
20394
20395 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20396
20397         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20398         "remove_"
20399         (TypeContainer::Populate): Now define the delegates of the type too.
20400         (TypeContainer.Delegates): Property to access the list of delegates defined
20401         in the type.
20402
20403         * delegates.cs (Delegate::Define): Implement partially.
20404
20405         * modifiers.cs (TypeAttr): Handle more flags.
20406
20407 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20408
20409         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20410         and not <=
20411         (Operator::Define): Re-write logic to get types by using the LookupType method
20412         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20413         (Indexer::Define): Ditto.
20414         (Event::Define): Ditto.
20415         (Property::Define): Ditto.
20416
20417 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20418
20419         * class.cs (TypeContainer::Populate): Now define operators too. 
20420         (TypeContainer.Operators): New property to access the list of operators
20421         in a type.
20422         (Operator.OperatorMethodBuilder): New member to hold the method builder
20423         for the operator we are defining.
20424         (Operator::Define): Implement.
20425
20426 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20427
20428         * class.cs (Event::Define): Make the prefixes of the accessor methods
20429         addOn_ and removeOn_ 
20430
20431         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20432         of the location being passed in too. Ideally, this should go later since all
20433         error reporting should be done through the Report object.
20434
20435         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20436         (Populate): Iterate thru the indexers we have and define them too.
20437         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20438         for the get and set accessors.
20439         (Indexer::Define): Implement.
20440
20441 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20442
20443         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20444         my previous implementation, did not work.
20445
20446         * typemanager.cs: Add a couple of missing types (the longs).
20447
20448         * literal.cs: Use TypeManager.bool_type instead of getting it.
20449
20450         * expression.cs (EventExpr): New kind of expressions.
20451         (Expressio::ExprClassFromMemberInfo): finish
20452
20453 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20454
20455         * assign.cs: Emit stores to static fields differently.
20456
20457 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20458
20459         * Merge in changes and adjust code to tackle conflicts. Backed out my
20460         code in Assign::Resolve ;-) 
20461
20462 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20463
20464         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20465         instead Report.Error and also pass in the location.
20466         (CSharpParser::Lexer): New readonly property to return the reference
20467         to the Tokenizer object.
20468         (declare_local_variables): Use Report.Error with location instead of plain 
20469         old error.
20470         (CheckDef): Ditto.
20471
20472         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20473         (Operator.CheckBinaryOperator): Ditto.
20474
20475         * cs-parser.jay (operator_declarator): Update accordingly.
20476
20477         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20478         (CheckBinaryOperator): Same here.
20479
20480         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20481         on the name without any prefixes of namespace names etc. This is because we
20482         already might have something already fully qualified like 
20483         'System.Console.WriteLine'
20484
20485         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20486
20487 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20488
20489         * cs-tokenizer.cs (location): Return a string which also contains
20490         the file name.
20491
20492         * expression.cs (ElementAccess): New class for expressions of the
20493         type 'element access.'
20494         (BaseAccess): New class for expressions of the type 'base access.'
20495         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20496         respectively.
20497
20498         * cs-parser.jay (element_access): Implement action.
20499         (base_access): Implement actions.
20500         (checked_expression, unchecked_expression): Implement.
20501
20502         * cs-parser.jay (local_variable_type): Correct and implement.
20503         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20504
20505         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20506
20507         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20508         name and the specifiers.
20509
20510         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20511
20512         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20513         making them all public ;-)
20514
20515         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20516         class anyways.
20517
20518 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20519
20520         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20521         PropertyExprs.
20522         (FieldExpr, PropertyExprs): New resolved expressions.
20523         (SimpleName::MemberStaticCheck): Perform static checks for access
20524         to non-static fields on static methods. Maybe this should be
20525         generalized for MemberAccesses. 
20526         (SimpleName::ResolveSimpleName): More work on simple name
20527         resolution. 
20528
20529         * cs-parser.jay (primary_expression/qualified_identifier): track
20530         the parameter index.
20531
20532         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20533         (EmitContext::EmitBoolExpression): Chain to expression generation
20534         instead of temporary hack.
20535         (::EmitStatementExpression): Put generic expression code generation.
20536
20537         * assign.cs (Assign::Emit): Implement variable assignments to
20538         local variables, parameters and fields.
20539
20540 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20541
20542         * statement.cs (Block::GetVariableInfo): New method, returns the
20543         VariableInfo for a variable name in a block.
20544         (Block::GetVariableType): Implement in terms of GetVariableInfo
20545
20546         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20547         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20548
20549 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20550
20551         * cs-parser.jay (operator_declaration): Continue on my quest : update
20552         to take attributes argument.
20553         (event_declaration): Ditto.
20554         (enum_declaration): Ditto.
20555         (indexer_declaration): Ditto.
20556
20557         * class.cs (Operator::Operator): Update constructor accordingly.
20558         (Event::Event): Ditto.
20559
20560         * delegate.cs (Delegate::Delegate): Same here.
20561
20562         * enum.cs (Enum::Enum): Same here.
20563
20564 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20565
20566         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20567
20568         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20569
20570         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20571         being passed around as an arraylist.
20572         (Attributes::AddAttribute): Method to add attribute sections.
20573
20574         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20575         (struct_declaration): Update accordingly.
20576         (constant_declaration): Update.
20577         (field_declaration): Update.
20578         (method_header): Update.
20579         (fixed_parameter): Update.
20580         (parameter_array): Ditto.
20581         (property_declaration): Ditto.
20582         (destructor_declaration): Ditto.
20583
20584         * class.cs (Struct::Struct): Update constructors accordingly.
20585         (Class::Class): Ditto.
20586         (Field::Field): Ditto.
20587         (Method::Method): Ditto.
20588         (Property::Property): Ditto.
20589         (TypeContainer::OptAttribute): update property's return type.
20590
20591         * interface.cs (Interface.opt_attributes): New member.
20592         (Interface::Interface): Update to take the extra Attributes argument.
20593
20594         * parameter.cs (Parameter::Parameter): Ditto.
20595
20596         * constant.cs (Constant::Constant): Ditto.
20597
20598         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20599         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20600         the attributes as a parameter.
20601         (InterfaceProperty): Update constructor call.
20602         (InterfaceEvent): Ditto.
20603         (InterfaceMethod): Ditto.
20604         (InterfaceIndexer): Ditto.
20605
20606         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20607         pass the attributes too.
20608         (interface_event_declaration): Ditto.
20609         (interface_property_declaration): Ditto.
20610         (interface_method_declaration): Ditto.
20611         (interface_declaration): Ditto.
20612
20613 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20614
20615         * class.cs (Method::Define): Track the "static Main" definition to
20616         create an entry point. 
20617
20618         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20619         EntryPoint if we find it. 
20620
20621         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20622         (EmitContext::ig): Make this variable public.
20623
20624         * driver.cs: Make the default output file be the first file name
20625         with the .exe extension.  
20626
20627         Detect empty compilations
20628
20629         Handle various kinds of output targets.  Handle --target and
20630         rename -t to --dumper.
20631
20632         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20633         methods inherited from Expression return now an Expression.  This
20634         will is used during the tree rewriting as we resolve them during
20635         semantic analysis.
20636
20637         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20638         the spec.  Missing entirely is the information about
20639         accessability of elements of it.
20640
20641         (Expression::ExprClassFromMemberInfo): New constructor for
20642         Expressions that creates a fully initialized Expression based on
20643         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20644         a Type.
20645
20646         (Invocation::Resolve): Begin implementing resolution of invocations.
20647
20648         * literal.cs (StringLiteral):  Implement Emit.
20649
20650 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20651
20652         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20653         member.
20654
20655 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20656
20657         * cs-parser.jay (attribute_arguments): Implement actions.
20658         (attribute): Fix bug in production. Implement action.
20659         (attribute_list): Implement.
20660         (attribute_target): Implement.
20661         (attribute_target_specifier, opt_target_specifier): Implement
20662         (CheckAttributeTarget): New method to check if the attribute target
20663         is valid.
20664         (attribute_section): Implement.
20665         (opt_attributes): Implement.
20666
20667         * attribute.cs : New file to handle attributes.
20668         (Attribute): Class to hold attribute info.
20669
20670         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20671         (attribute_section): Modify production to use 2 different rules to 
20672         achieve the same thing. 1 s/r conflict down !
20673         Clean out commented, useless, non-reducing dimension_separator rules.
20674
20675         * class.cs (TypeContainer.attributes): New member to hold list
20676         of attributes for a type.
20677         (Struct::Struct): Modify to take one more argument, the attribute list.
20678         (Class::Class): Ditto.
20679         (Field::Field): Ditto.
20680         (Method::Method): Ditto.
20681         (Property::Property): Ditto.
20682
20683         * cs-parser.jay (struct_declaration): Update constructor call to
20684         pass in the attributes too.
20685         (class_declaration): Ditto.
20686         (constant_declaration): Ditto.
20687         (field_declaration): Ditto.
20688         (method_header): Ditto.
20689         (fixed_parameter): Ditto.
20690         (parameter_array): Ditto.
20691         (property_declaration): Ditto.
20692
20693         * constant.cs (Constant::Constant): Update constructor similarly.
20694         Use System.Collections.
20695
20696         * parameter.cs (Parameter::Parameter): Update as above.
20697
20698 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20699
20700         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20701         (TypeContainer.delegates): New member to hold list of delegates.
20702
20703         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20704         this time as I seem to be on crack ;-)
20705
20706 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20707
20708         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20709         tell whether an identifier represents a namespace.
20710
20711         * expression.cs (NamespaceExpr): A namespace expression, used only
20712         temporarly during expression resolution.
20713         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20714         utility functions to resolve names on expressions.
20715
20716 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20717
20718         * codegen.cs: Add hook for StatementExpressions. 
20719
20720         * class.cs: Fix inverted test for static flag in methods.
20721
20722 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20723
20724         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20725         to make it coincide with MS' number.
20726         (Operator::CheckBinaryOperator): Ditto.
20727
20728         * ../errors/errors.txt : Remove error numbers added earlier.
20729
20730         * ../errors/cs1019.cs : Test case for error # 1019
20731
20732         * ../errros/cs1020.cs : Test case for error # 1020
20733
20734         * cs-parser.jay : Clean out commented cruft.
20735         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20736         used anywhere - non-reducing rule.
20737         (namespace_declarations): Non-reducing rule - comment out.
20738
20739         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20740         with TypeContainer::AddEnum.
20741
20742         * delegate.cs : New file for delegate handling classes.
20743         (Delegate): Class for declaring delegates.
20744
20745         * makefile : Update.
20746
20747         * cs-parser.jay (delegate_declaration): Implement.
20748
20749 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20750
20751         * class.cs (Event::Define): Implement.
20752         (Event.EventBuilder): New member.
20753
20754         * class.cs (TypeContainer::Populate): Update to define all enums and events
20755         we have.
20756         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20757         readonly fields for all these cases ?
20758
20759 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20760
20761         * class.cs (Property): Revamp to use the convention of making fields readonly.
20762         Accordingly modify code elsewhere.
20763
20764         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20765         the Define method of the Property class.
20766
20767         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20768         trivial bug.
20769         (TypeContainer::Populate): Update to define all the properties we have. Also
20770         define all enumerations.
20771
20772         * enum.cs (Define): Implement.
20773
20774 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20775
20776         * cs-parser.jay (overloadable_operator): The semantic value is an
20777         enum of the Operator class.
20778         (operator_declarator): Implement actions.
20779         (operator_declaration): Implement.
20780
20781         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20782         validity of definitions.
20783         (Operator::CheckBinaryOperator): Static method to check for binary operators
20784         (TypeContainer::AddOperator): New method to add an operator to a type.
20785
20786         * cs-parser.jay (indexer_declaration): Added line to actually call the
20787         AddIndexer method so it gets added ;-)
20788
20789         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20790         already taken care of by the MS compiler ?  
20791
20792 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20793
20794         * class.cs (Operator): New class for operator declarations.
20795         (Operator::OpType): Enum for the various operators.
20796
20797 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20798
20799         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20800         ostensibly handle this in semantic analysis.
20801
20802         * cs-parser.jay (general_catch_clause): Comment out
20803         (specific_catch_clauses, specific_catch_clause): Ditto.
20804         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20805         (catch_args, opt_catch_args): New productions.
20806         (catch_clause): Rewrite to use the new productions above
20807         (catch_clauses): Modify accordingly.
20808         (opt_catch_clauses): New production to use in try_statement
20809         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20810         and re-write the code in the actions to extract the specific and
20811         general catch clauses by being a little smart ;-)
20812
20813         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20814         Hooray, try and catch statements parse fine !
20815
20816 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20817
20818         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20819         string from the hashtable of variables.
20820
20821         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20822         I end up making that mistake ;-)
20823         (catch_clauses): Fixed gross error which made Key and Value of the 
20824         DictionaryEntry the same : $1 !!
20825
20826 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20827
20828         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20829
20830         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20831         when the add and remove accessors are specified. 
20832
20833 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20834
20835         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20836         information about indexer_declarator.
20837         (indexer_declarator): Implement actions.
20838         (parsing_indexer): New local boolean used to keep track of whether
20839         we are parsing indexers or properties. This is necessary because 
20840         implicit_parameters come into picture even for the get accessor in the 
20841         case of an indexer.
20842         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20843
20844         * class.cs (Indexer): New class for indexer declarations.
20845         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20846         (TypeContainer::indexers): New member to hold list of indexers for the
20847         type.
20848
20849 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20850
20851         * cs-parser.jay (add_accessor_declaration): Implement action.
20852         (remove_accessor_declaration): Implement action.
20853         (event_accessors_declaration): Implement
20854         (variable_declarators): swap statements for first rule - trivial.
20855
20856         * class.cs (Event): New class to hold information about event
20857         declarations.
20858         (TypeContainer::AddEvent): New method to add an event to a type
20859         (TypeContainer::events): New member to hold list of events.
20860
20861         * cs-parser.jay (event_declaration): Implement actions.
20862
20863 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20864
20865         * cs-parser.jay (dim_separators): Implement. Make it a string
20866         concatenating all the commas together, just as they appear.
20867         (opt_dim_separators): Modify accordingly
20868         (rank_specifiers): Update accordingly. Basically do the same
20869         thing - instead, collect the brackets here.
20870         (opt_rank_sepcifiers): Modify accordingly.
20871         (array_type): Modify to actually return the complete type string
20872         instead of ignoring the rank_specifiers.
20873         (expression_list): Implement to collect the expressions
20874         (variable_initializer): Implement. We make it a list of expressions
20875         essentially so that we can handle the array_initializer case neatly too.
20876         (variable_initializer_list): Implement.
20877         (array_initializer): Make it a list of variable_initializers
20878         (opt_array_initializer): Modify accordingly.
20879
20880         * expression.cs (New::NType): Add enumeration to help us
20881         keep track of whether we have an object/delegate creation
20882         or an array creation.
20883         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20884         members to hold data about array creation.
20885         (New:New): Modify to update NewType
20886         (New:New): New Overloaded contructor for the array creation
20887         case.
20888
20889         * cs-parser.jay (array_creation_expression): Implement to call
20890         the overloaded New constructor.
20891
20892 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20893
20894         * class.cs (TypeContainer::Constructors): Return member
20895         constructors instead of returning null.
20896
20897 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20898
20899         * typemanager.cs (InitCoreTypes): Initialize the various core
20900         types after we have populated the type manager with the user
20901         defined types (this distinction will be important later while
20902         compiling corlib.dll)
20903
20904         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20905         on Expression Classification.  Now all expressions have a method
20906         `Resolve' and a method `Emit'.
20907
20908         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20909         generation from working.     Also add some temporary debugging
20910         code. 
20911
20912 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20913
20914         * codegen.cs: Lots of code generation pieces.  This is only the
20915         beginning, will continue tomorrow with more touches of polish.  We
20916         handle the fundamentals of if, while, do, for, return.  Others are
20917         trickier and I need to start working on invocations soon.
20918
20919         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20920         s.InitStatement. 
20921
20922         * codegen.cs (EmitContext): New struct, used during code
20923         emission to keep a context.   Most of the code generation will be
20924         here. 
20925
20926         * cs-parser.jay: Add embedded blocks to the list of statements of
20927         this block.  So code generation proceeds in a top down fashion.
20928
20929 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20930
20931         * statement.cs: Add support for multiple child blocks.
20932
20933 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20934
20935         * codegen.cs (EmitCode): New function, will emit the code for a
20936         Block of code given a TypeContainer and its ILGenerator. 
20937
20938         * statement.cs (Block): Standard public readonly optimization.
20939         (Block::Block constructors): Link children. 
20940         (Block::Child): Child Linker.
20941         (Block::EmitVariables): Emits IL variable declarations.
20942
20943         * class.cs: Drop support for MethodGroups here, delay until
20944         Semantic Analysis.
20945         (Method::): Applied the same simplification that I did before, and
20946         move from Properties to public readonly fields.
20947         (Method::ParameterTypes): Returns the parameter types for the
20948         function, and implements a cache that will be useful later when I
20949         do error checking and the semantic analysis on the methods is
20950         performed.
20951         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20952         and made a method, optional argument tells whether this is a class
20953         or a structure to apply the `has-this' bit.
20954         (Method::GetCallingConvention): Implement, returns the calling
20955         convention. 
20956         (Method::Define): Defines the type, a second pass is performed
20957         later to populate the methods.
20958
20959         (Constructor::ParameterTypes): implement a cache similar to the
20960         one on Method::ParameterTypes, useful later when we do semantic
20961         analysis. 
20962
20963         (TypeContainer::EmitMethod):  New method.  Emits methods.
20964
20965         * expression.cs: Removed MethodGroup class from here.
20966
20967         * parameter.cs (Parameters::GetCallingConvention): new method.
20968
20969 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20970
20971         * class.cs (TypeContainer::Populate): Drop RootContext from the
20972         argument. 
20973
20974         (Constructor::CallingConvention): Returns the calling convention.
20975         (Constructor::ParameterTypes): Returns the constructor parameter
20976         types. 
20977
20978         (TypeContainer::AddConstructor): Keep track of default constructor
20979         and the default static constructor.
20980
20981         (Constructor::) Another class that starts using `public readonly'
20982         instead of properties. 
20983
20984         (Constructor::IsDefault): Whether this is a default constructor. 
20985
20986         (Field::) use readonly public fields instead of properties also.
20987
20988         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20989         track of static constructors;  If none is used, turn on
20990         BeforeFieldInit in the TypeAttributes. 
20991
20992         * cs-parser.jay (opt_argument_list): now the return can be null
20993         for the cases where there are no arguments. 
20994
20995         (constructor_declarator): If there is no implicit `base' or
20996         `this', then invoke the default parent constructor. 
20997
20998         * modifiers.cs (MethodAttr): New static function maps a set of
20999         modifiers flags into a MethodAttributes enum
21000         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21001         MethodAttr, TypeAttr to represent the various mappings where the
21002         modifiers are used.
21003         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21004
21005 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21006
21007         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21008         method arguments.
21009
21010         * interface.cs (PopulateIndexer): Implemented the code generator
21011         for interface indexers.
21012
21013 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21014
21015         * interface.cs (InterfaceMemberBase): Now we track the new status
21016         here.  
21017
21018         (PopulateProperty): Implement property population.  Woohoo!  Got
21019         Methods and Properties going today. 
21020
21021         Removed all the properties for interfaces, and replaced them with
21022         `public readonly' fields. 
21023
21024 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21025
21026         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21027         initialize their hashtables/arraylists only when they are needed
21028         instead of doing this always.
21029
21030         * parameter.cs: Handle refs and out parameters.
21031
21032         * cs-parser.jay: Use an ArrayList to construct the arguments
21033         instead of the ParameterCollection, and then cast that to a
21034         Parameter[] array.
21035
21036         * parameter.cs: Drop the use of ParameterCollection and use
21037         instead arrays of Parameters.
21038
21039         (GetParameterInfo): Use the Type, not the Name when resolving
21040         types. 
21041
21042 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21045         and instead use public readonly fields.
21046
21047         * class.cs: Put back walking code for type containers.
21048
21049 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * class.cs (MakeConstant): Code to define constants.
21052
21053         * rootcontext.cs (LookupType): New function.  Used to locate types 
21054
21055
21056 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21057
21058         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21059         this System.Reflection code is.  Kudos to Microsoft
21060
21061         * typemanager.cs: Implement a type cache and avoid loading all
21062         types at boot time.  Wrap in LookupType the internals.  This made
21063         the compiler so much faster.  Wow.  I rule!
21064
21065         * driver.cs: Make sure we always load mscorlib first (for
21066         debugging purposes, nothing really important).
21067
21068         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21069         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21070
21071         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21072         on namespaces that have been imported using the `using' keyword.
21073
21074         * class.cs (TypeContainer::TypeAttr): Virtualize.
21075         (Class::TypeAttr): Return attributes suitable for this bad boy.
21076         (Struct::TypeAttr): ditto.
21077         Handle nested classes.
21078         (TypeContainer::) Remove all the type visiting code, it is now
21079         replaced with the rootcontext.cs code
21080
21081         * rootcontext.cs (GetClassBases): Added support for structs. 
21082
21083 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21084
21085         * interface.cs, statement.cs, class.cs, parameter.cs,
21086         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21087         Drop use of TypeRefs, and use strings instead.
21088
21089 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21090
21091         * rootcontext.cs: 
21092
21093         * class.cs (Struct::Struct): set the SEALED flags after
21094         checking the modifiers.
21095         (TypeContainer::TypeAttr): new property, returns the
21096         TypeAttributes for a class.  
21097
21098         * cs-parser.jay (type_list): Oops, list production was creating a
21099         new list of base types.
21100
21101         * rootcontext.cs (StdLib): New property.
21102         (GetInterfaceTypeByName): returns an interface by type name, and
21103         encapsulates error handling here.
21104         (GetInterfaces): simplified.
21105         (ResolveTree): Encapsulated all the tree resolution here.
21106         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21107         types. 
21108
21109         * driver.cs: Add support for --nostdlib, to avoid loading the
21110         default assemblies.
21111         (Main): Do not put tree resolution here. 
21112
21113         * rootcontext.cs: Beginning of the class resolution.
21114
21115 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21116
21117         * rootcontext.cs: Provide better error reporting. 
21118
21119         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21120
21121         * rootcontext.cs (CreateInterface): Handle the case where there
21122         are no parent interfaces.
21123
21124         (CloseTypes): Routine to flush types at the end.
21125         (CreateInterface): Track types.
21126         (GetInterfaces): Returns an array of Types from the list of
21127         defined interfaces.
21128
21129         * typemanager.c (AddUserType): Mechanism to track user types (puts
21130         the type on the global type hash, and allows us to close it at the
21131         end). 
21132
21133 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21134
21135         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21136         RecordInterface instead.
21137
21138         * cs-parser.jay: Updated to reflect changes above.
21139
21140         * decl.cs (Definition): Keep track of the TypeBuilder type that
21141         represents this type here.  Not sure we will use it in the long
21142         run, but wont hurt for now.
21143
21144         * driver.cs: Smaller changes to accomodate the new code.
21145
21146         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21147         when done. 
21148
21149         * rootcontext.cs (CreateInterface):  New method, used to create
21150         the System.TypeBuilder type for interfaces.
21151         (ResolveInterfaces): new entry point to resolve the interface
21152         hierarchy. 
21153         (CodeGen): Property, used to keep track of the code generator.
21154
21155 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21156
21157         * cs-parser.jay: Add a second production for delegate_declaration
21158         with `VOID'.
21159
21160         (enum_body): Put an opt_comma here instead of putting it on
21161         enum_body or enum_member_declarations so we can handle trailing
21162         commas on enumeration members.  Gets rid of a shift/reduce.
21163
21164         (type_list): Need a COMMA in the middle.
21165
21166         (indexer_declaration): Tell tokenizer to recognize get/set
21167
21168         * Remove old targets.
21169
21170         * Re-add the parser target.
21171
21172 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21173
21174         * cs-parser.jay: Add precendence rules for a number of operators
21175         ot reduce the number of shift/reduce conflicts in the grammar.
21176
21177 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21180         and put it here.
21181
21182         Get rid of old crufty code.
21183
21184         * rootcontext.cs: Use this to keep track of the parsed
21185         representation and the defined types available to the program. 
21186
21187         * gen-treedump.cs: adjust for new convention.
21188
21189         * type.cs: Split out the type manager, and the assembly builder
21190         from here. 
21191
21192         * typemanager.cs: the type manager will live here now.
21193
21194         * cil-codegen.cs: And the code generator here. 
21195
21196 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21197
21198         * makefile: Fixed up for easy making.
21199
21200 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21201
21202         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21203         the 
21204
21205         (unary_expression): Expand pre_increment_expression and
21206         post_decrement_expression to reduce a shift/reduce.
21207
21208 2001-07-11  Simon Cozens
21209
21210         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21211
21212         Improve allow_keyword_as_indent name.
21213
21214 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21215
21216         * Adjustments for Beta2. 
21217
21218 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21219
21220         * decl.cs: Added `Define' abstract method.
21221         (InTransit): new property, used to catch recursive definitions. 
21222
21223         * interface.cs: Implement `Define'. 
21224
21225         * modifiers.cs: Map Modifiers.constants to
21226         System.Reflection.TypeAttribute flags.
21227
21228         * class.cs: Keep track of types and user-defined types.
21229         (BuilderInit): New method for creating an assembly
21230         (ResolveType): New function to launch the resolution process, only
21231         used by interfaces for now.
21232
21233         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21234         that are inserted into the name space. 
21235
21236 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21237
21238         * ARGH.  I have screwed up my tree so many times due to the use of
21239         rsync rather than using CVS.  Going to fix this at once. 
21240
21241         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21242         load types.
21243
21244 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21245
21246         * Experiment successful: Use System.Type rather that our own
21247         version of Type.  
21248
21249 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21250
21251         * cs-parser.jay: Removed nsAliases from here.
21252
21253         Use new namespaces, handle `using XXX;' 
21254
21255         * namespace.cs: Reimplemented namespace handling, use a recursive
21256         definition of the class.  Now we can keep track of using clauses
21257         and catch invalid using clauses.
21258
21259 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21260
21261         * gen-treedump.cs: Adapted for all the renaming.
21262
21263         * expression.cs (Expression): this class now has a Type property
21264         which returns an expression Type.
21265
21266         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21267         `Type', as this has a different meaning now in the base
21268
21269 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21270
21271         * interface.cs, class.cs: Removed from all the sources the
21272         references to signature computation, as we can not do method
21273         signature computation during the parsing time, as we are not
21274         trying to solve at that point distinguishing:
21275
21276         class X {
21277                 void a (Blah x) {}
21278                 void a (NS.Blah x) {}
21279         }
21280
21281         Which depending on the context might be valid or not, as we do not
21282         know if Blah is the same thing as NS.Blah at that point.
21283
21284         * Redid everything so the code uses TypeRefs now instead of
21285         Types.  TypeRefs are just temporary type placeholders, that need
21286         to be resolved.  They initially have a pointer to a string and the
21287         current scope in which they are used.  This is used later by the
21288         compiler to resolve the reference to an actual Type. 
21289
21290         * DeclSpace is no longer a CIR.Type, and neither are
21291         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21292         are all DeclSpaces, but no Types. 
21293
21294         * type.cs (TypeRefManager): This implements the TypeRef manager,
21295         which keeps track of all the types that need to be resolved after
21296         the parsing has finished. 
21297
21298 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21299
21300         * ARGH.  We are going to have to store `foreach' as a class rather
21301         than resolving it, as we need to verify error 1579 after name
21302         resolution.   *OR* we could keep a flag that says `This request to
21303         IEnumerator comes from a foreach statement' which we can then use
21304         to generate the error.
21305
21306 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21307
21308         * class.cs (TypeContainer.AddMethod): we now add methods to the
21309         MethodGroup instead of the method hashtable.  
21310
21311         * expression.cs: Add MethodGroup abstraction, which gets us one
21312         step closer to the specification in the way we handle method
21313         declarations.  
21314
21315         * cs-parser.jay (primary_expression): qualified_identifier now
21316         tried to match up an identifier to a local variable reference or
21317         to a parameter reference.
21318
21319         current_local_parameters is now a parser global variable that
21320         points to the current parameters for the block, used during name
21321         lookup.
21322
21323         (property_declaration): Now creates an implicit `value' argument to
21324         the set accessor.
21325
21326 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21327
21328         * parameter.cs: Do not use `param' arguments as part of the
21329         signature, per the spec.
21330
21331 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21332
21333         * decl.cs: Base class for classes, structs and interfaces.  This
21334         is the "Declaration Space" 
21335
21336         * cs-parser.jay: Use CheckDef for checking declaration errors
21337         instead of having one on each function.
21338
21339         * class.cs: Factor out some code for handling error handling in
21340         accordance to the "Declarations" section in the "Basic Concepts"
21341         chapter in the ECMA C# spec.
21342
21343         * interface.cs: Make all interface member classes derive from
21344         InterfaceMemberBase.
21345
21346 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21347
21348         * Many things: all interfaces are parsed and generated in
21349         gen-treedump.  Support for member variables, constructors,
21350         destructors, properties, constants is there.
21351
21352         Beginning of the IL backend, but very little done, just there for
21353         testing purposes. 
21354
21355 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21356
21357         * cs-parser.jay: Fix labeled statement.
21358
21359         * cs-tokenizer.cs (escape): Escape " and ' always.
21360         ref_line, ref_name: keep track of the line/filename as instructed
21361         by #line by the compiler.
21362         Parse #line.
21363
21364 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21365
21366         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21367         to match the values in System.CodeDOM.
21368
21369         Divid renamed to Divide.
21370
21371         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21372         statements. 
21373         (Statements.set): remove.
21374
21375         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21376         statements. 
21377
21378         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21379         falseStatements always have valid values. 
21380
21381         * cs-parser.jay: Use System.CodeDOM now.
21382