2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * cs-parser.jay, expression.cs : CS0214 was missing error location
4           for constants. Fixed bug #76404.
5
6 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
7
8         Fix #76370.
9         * convert.cs (ExplicitConversionCore): Fixed object->enum
10         conversion.
11
12 2005-10-10  Raja R Harinath  <rharinath@novell.com>
13
14         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
15         InstanceExpression.
16         (PropertyExpr.EmitCall): Likewise.
17         * expression.cs (Invocation.EmitArguments): Handle case where
18         arguments == null.
19         (Invocation.EmitCall): Avoid allocating temporary variable if
20         there are no arguments.
21
22 2005-10-07  Raja R Harinath  <rharinath@novell.com>
23
24         Fix #76323.
25         * convert.cs (ImplicitConversionStandard): Move conversion of
26         void* to arbitrary pointer types ...
27         (ExplicitConversionStandard): .. here.
28         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
29         error to always print typenames.
30
31 2005-10-07  Raja R Harinath  <rharinath@novell.com>
32
33         * convert.cs (GetConversionOperator): Rename from
34         GetConversionOperators.  Move operator selection code from ...
35         (UserDefinedConversion): ... here.
36
37 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
38
39         * convert.cs (ExplicitConversionCore): Removed duplicate enum
40         conversion.
41
42 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
43
44         * assign.cs (Assign.DoResolve): Error method changed.
45
46         * cfold.cs (DoConstantNumericPromotions): Error method changed.
47         
48         * const.cs (ResolveValue): Reset in_transit immediately.
49         
50         * constant.cs: Error method changed.
51         
52         * convert.cs: Removed useless location parameter.
53         (ExplicitNumericConversion): Don't do double enum check.
54         (ExplicitConversionCore): Renamed from ExplicitConversion.
55         (ExplicitUnsafe): Extracted from ExplicitConversion.
56         (ExplicitConversion): Uses for error reporting.
57         
58         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
59         error messages.
60         (ResolveBoolean): Uses common error method.
61         (CastToDecimal): Get rid of ec.
62         (CastFromDecimal): Optimized.
63         (ConvCast): Get rid of ec.
64         
65         * enum.cs (ResolveValue): Reset in_transit immediately.
66         (Emit): Return after first error.
67         
68         * expression.cs: Convert changes.
69         
70         * literal.cs: Error method changed.
71         
72         * statement.cs: Error method changed.
73
74 2005-10-03  Raja R Harinath  <rharinath@novell.com>
75
76         * support.cs (SeekableStreamReader.Position): Don't error out when
77         the requested position is just beyond the end of the current
78         buffered data.
79
80 2005-09-28  Raja R Harinath  <rharinath@novell.com>
81
82         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
83         try to keep in sync with the byte count of the underlying Stream.
84         However, this limits us to a window size of 2048 characters: i.e.,
85         the maximum lookahead of our lexer/parser can be 2048 characters.
86
87 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
88
89         Fix #76255.
90         * driver.cs: Fix compilation files with full root path.
91
92 2005-09-25  Miguel de Icaza  <miguel@novell.com>
93
94         * report.cs (SymbolRelatedToPreviousError): Format the output so
95         it does not use an open parenthesis that is never closed. 
96
97         * driver.cs: Follow coding guidelines
98
99 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
100
101         Fix #72930.
102         * const.cs (Const.ResolveValue): Check for assigning non-null
103         value to reference type.
104
105 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
106
107         * anonymous.cs: Implemented ExprClassName.
108         
109         * assign.cs (Assign.DoResolve): Don't chrash when type is not
110         delegate.
111         
112         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
113         check.
114         
115         * class.cs (StaticClass.DefineContainerMembers): Report protected
116         members as error.
117         
118         * codegen.cs: if(ed) PRODUCTION.
119         
120         * convert.cs (Error_CannotImplicitConversion): Better error
121         distinction.
122         
123         * cs-parser.jay: More error checks.
124         
125         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
126         
127         * driver.cs (CSCParseOption): Enabled wrong option check.
128         
129         * ecore.cs (Expression.ExprClassName): Turned to property.
130         (MemberExpr.CheckIntermediateModification): For checking boxed
131         value types     modification.
132         
133         * statement.cs (Fixed.Resolve): Expression type must be
134         convertible to fixed type.
135         (CollectionForeach.GetEnumeratorFilter,TryType):
136         Small refactoring for easier error checking.
137
138 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
139
140         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
141         attributes.
142         
143         * class.cs (GeneratedBaseInitializer): New class for customization
144         compiler generated initializers.
145         (MemberBase.DoDefine): Check Obsolete attribute here.
146         (FieldMember.DoDefine): Ditto.
147         
148         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
149         constants.
150         
151         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
152         (MemberCore.GetObsoleteAttribute): Removed argument.
153         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
154         (MemberCore.CheckObsoleteType): New helper.
155         
156         * delegate.cs,
157         * enum.cs,
158         * statement.cs: Updates after MemberCore changes.
159         
160         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
161         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
162         
163         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
164         obsolete attribute for compiler construct.
165         (As.DoResolve): Cache result.
166         
167         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
168
169 2005-09-26  Raja R Harinath  <rharinath@novell.com>
170
171         Fix #76133.
172         * expression.cs (This.VerifyFixed): In a value type T, the type of
173         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
174         value type R, 'this' is treated as a value parameter.
175
176 2005-09-22  Miguel de Icaza  <miguel@novell.com>
177
178         * statement.cs (Lock): Use the TemporaryVariable class instead of
179         manually using local variables as those do not work when variables
180         are captured.
181
182         * ecore.cs: Moved the TemporaryVariable class from being a nested
183         class inside Foreach to be a public class that can be employed in
184         other places. 
185
186 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
187
188         * cs-parser.jay: interface_accessors replaced by
189         accessor_declarations.
190
191         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
192         location.
193         
194         * statement.cs (GotoCase.Resolve): Convert null constant to
195         null case.
196         (SwitchLabel.ResolveAndReduce): Ditto.
197         (SwitchLabel.NullStringCase): Custom null stamp.
198         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
199         
200         typemanager.cs (CSharpSignature): Don't skip first argument
201         for full names.
202
203 2005-09-18  Miguel de Icaza  <miguel@novell.com>
204
205         * driver.cs: Set InEmacs based on the environment variable EMACS. 
206
207         * location.cs (InEmacs): in this mode, do not report column
208         location as it confuses Emacs.
209
210 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
211
212         * cfold.cs, constant.cs, convert.cs, ecore.cs,
213         expression.cs, iterators.cs, literal.cs: Store constants and
214         literals location.
215         
216         * class.cs (MemberBase.ShortName): Pass location.
217         
218         * cs-parser.jay: Some location fixes.
219         
220         * ecore.cs (Expression.Location): Made virtual.
221
222 2005-09-05  Miguel de Icaza  <miguel@novell.com>
223
224         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
225         if the underlying types are the same, otherwise we need to produce
226         code that will do the proper cast.
227
228         This was exposed by Marek's constant rewrite which produced
229         invalid code for the call site:
230
231         enum X : long { a }
232         void Method (X v) {}
233
234         Method ((X) 5)
235
236         This fixes test-49.cs
237
238 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
239
240         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
241           Type/Object should be allowed as well. Fixed bug #75968.
242
243 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
244
245         * expression.cs : (Binary.DoResolve): when one is enum constant and
246           another is constant 0, then return enum one *as enum type*.
247           Fixed bug 74846.
248
249 2005-09-02  Raja R Harinath  <rharinath@novell.com>
250
251         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
252         internal.
253
254         Fix #75941.
255         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
256         flow-branching for LocalVariableReferences in case we were invoked
257         from a MemberAccess.
258         * expression.cs (LocalVariableReference.VerifyAssigned): New.
259         Carved out of ...
260         (LocalVariableReference.DoResolveBase): ... this.
261         (MemberAccess.Resolve): Do the check that was disabled during
262         SimpleNameResolve.
263
264 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
265
266         * class.cs :
267           (PartialContainer.Create): check abstract/sealed/static strictly
268           but abstract/sealed can exist only at one side. Fixed bug #75883.
269
270 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
271
272         Fix #75945.
273         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
274         specified, don't default to UnmanagedType.I4.
275
276 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
277
278         * expression.cs : conditional operator should check possibly
279           incorrect assign expression. Fixed bug #75946.
280
281 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
282
283         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
284           Reverting the change. gmcs is much complex than mcs on this matter.
285
286 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
287
288         * cs-tokenizer.cs : To read another token ahead of the actual 
289           consumption, use new SavedToken and cache token instead of moving
290           back the stream with SeekableStreamReader (it seemed problematic).
291         * cs-parser.jay,
292           driver.cs : Thus use StreamReader directly.
293         * support.cs : Thus removed SeekableStreamReader.
294
295 2005-08-30  Raja R Harinath  <rharinath@novell.com>
296
297         Fix #75934.
298         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
299         (ScopeInfo.EmitScopeType): Use it to construct field names from
300         names of captured locals.
301
302         Fix #75929.
303         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
304         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
305         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
306         (ExplicitConversion): Remove enum cases already handled by
307         implicit conversion.  Move implicit conversion check to the beginning.
308         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
309         * expression.cs (ArrayCreation.EmitDynamicInitializers):
310         Don't treat System.Enum as a struct.
311
312 2005-08-30  Jb Evain  <jbevain@gmail.com>
313
314         * attribute.cs: handles as expression in parameters.
315
316 2005-08-30  Raja R Harinath  <rharinath@novell.com>
317
318         Fix #75802.
319         * class.cs (TypeContainer.VerifyClsName): Don't use a
320         PartialContainer when verifying CLS compliance.
321         (AbstractPropertyEventMethod): Set Parent here, ...
322         (PropertyMethod): ... not here.
323
324 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
325
326         * attribute.cs : escaped attribute name should not be allowed to be
327           resolved (e.g. @class as classAttribute). Fixed bug #75930.
328
329 2005-08-29  Raja R Harinath  <rharinath@novell.com>
330
331         Fix #75927.
332         * convert.cs (ImplicitStandardConversionExists): Allow zero also
333         when converting a long constant to unsigned long.
334         * expression.cs (Invocation.OverloadResolve): Add sanity check to
335         detect where IsApplicable and VerifyArgumentsCompat disagree.
336
337 2005-08-29  Raja R Harinath  <rharinath@novell.com>
338         and Carlos Alberto Cortez  <carlos@unixmexico.org>
339
340         Fix #75848.
341         * class.cs (TypeContainer.CanElideInitializer): New helper.
342         (TypeContainer.EmitFieldInitializers): Use it to determine if we
343         can safely emitting the initializer of a field.
344
345 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
346
347         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
348           allowed inside a switch (without loop). Fixed bug #75433.
349
350 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
351
352         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
353         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
354
355 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
356
357         * driver.cs : kinda reverting the default encoding changes (not exact 
358           revert since I noticed that "codepage:reset" might not work fine).
359
360 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
361
362         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
363           Location. Now getter and setter store location correctly.
364           (errors/cs0111-12.cs now reports the expected location.)
365
366 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
367
368         * driver.cs : Use default encoding on the environment.
369           Removed (now that) extra parameter for SeekableStreamReader.
370         * support.cs : (SeekableStreamReader) third .ctor() argument for
371           StreamReader is not required (always true). preamble size could
372           be acquired in simpler and safe way.
373
374 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
375
376         * cs-parser.jay: report CS0642 at warning level 3
377           and report CS0642 for an if else statement also
378           fixes bug #74745. Patch by John Luke (and a bit
379           modified by me).
380           Removed extra CS0642 warning check for "while",
381           "for" and "fixed".
382         * statement.cs: In Block.Resolve(), CS0642 check
383           is reimplemented to check a sequence of an empty
384           statement and a block.
385
386           Both fix bug #66777.
387
388 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
389
390         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
391         detection until I fix it.
392         
393         * cs-tokenizer.cs: Changed error message.
394         
395         * cs-parser.jay: Fixed 2 error locations.
396         
397         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
398         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
399         properties.
400         
401         * enum.cs (GetSignatureForError): Fixed.
402         
403         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
404         method detection.
405         
406         * class.cs,
407         * typemanager.cs (RegisterProperty): Removed.
408         
409         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
410
411 2005-08-24  Raja R Harinath  <rharinath@novell.com>
412
413         Fix #75874.
414         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
415         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
416
417 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
418
419         * expression.cs : tiny fix is required for not warning positive ulong.
420           See test-441.cs.
421
422 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
423
424         * expression.cs : add CS0652 check for constant and integral
425           expression. Fixed bug #53974.
426
427 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
428
429         * expression.cs : in DoNumericPromotions(), check if there is implicit
430           conversion overload for string (to check CS0034). Fixed bug #52492.
431
432 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
433
434         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
435
436 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
437
438         * ecore.cs : report location when it is *not* Null.
439
440 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
441
442         * codegen.cs,
443           ecore.cs,
444           flowanalysis.cs,
445           expression.cs:
446           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
447           correctly. Fixed bug #75721.
448
449 2005-08-23  Raja R Harinath  <rharinath@novell.com>
450
451         * support.cs (SeekableStreamReader.Position): Avoid an expensive
452         loop that performs 'min (pos, char_count)'.
453
454         Fix #75862.
455         * expression.cs (Unary.ResolveOperator): Don't discard implicit
456         converted value in Operator.OnesComplement.
457
458 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
459
460         * anonymous.cs: If the anon method is pulled into a helper class,
461         it needs to be `internal' not `private'. Fixes runtime behavior on
462         msft. bug #75704
463
464 2005-08-20  Martin Baulig  <martin@ximian.com>
465
466         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
467         scope if we don't already have it.
468
469         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
470         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
471         fixes #75867.
472
473 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
474
475         Fix #75803
476         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
477         is a partial class.
478
479 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
480
481         The big constants rewrite
482         Fix #75746, #75685 and more
483         As a side effect saved 1MB for MWF ;-)
484         
485         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
486         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
487         enum based for corlib compilation.
488         
489         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
490         subtractions.
491         
492         * class.cs (FixedField.Define): Use ResolveAsConstant.
493         
494         * const.cs (IConstant): Interface constants and enums.
495         (Const.ResolveValue): New method for constant resolvning.
496         (ExternalConstant): Constants from imported assemblies.
497         
498         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
499         conversion; like enums.
500         (Constant.ToType): Converts this constant to different type.
501         (Constant.Increment): Adds 1.
502         
503         * convert.cs (ImplicitConversionRequired): Simplified.
504         
505         * cs-parser.jay: Create EnumMember directly.
506         
507         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
508         
509         * doc.cs (GenerateEnumDocComment): Removed.
510         
511         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
512         (ConvertIntLiteral): Removed.
513         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
514         
515         * enum.cs (EnumMember): Implement IConstant.
516         (Enum.IsValidEnumConstant): Removed.
517         (Enum.GetNextDefaultValue): Removed.
518         (Enum.FindMembers): Updated.
519         (Enum.GenerateDocComment): Iterate enum members.
520         
521         * expression.cs (Cast.TryReduce): Handle enums correctly.
522         (New.Constantify): Made public.
523         (MemberAccess.DoResolve): Removed contant specific if(s).
524         
525         * literal.cs (NullLiteral): Implement new abstract methods.
526         
527         * statement.cs (GotoCase.Resolve): Use new constant methods.
528         (SwitchLabel.ResolveAndReduce): Use new constant methods.
529         
530         * typemanager.cs (LookupEnum): Removed.
531         (IsEnumType): Fixed to work with corlib.
532         (RegisterConstant): Removed.
533         (LookupConstant): Removed.
534         (GetConstant): Changed to work with IConstant.
535
536 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
537
538         * location.cs : Fixed overflown (>255) column number.
539
540 2005-08-03  Raja R Harinath  <rharinath@novell.com>
541
542         First cut of the qualified-alias-member feature.
543         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
544         token.
545         * cs-parser.jay (DOUBLE_COLON): New token.
546         (namespace_or_type_name): Add rule for recognizing
547         qualified-alias-members.
548         (primary_expression): Likewise.
549         (element_access): Allow QualifiedAliasMember as a possible
550         type-bearing expression.
551         (local_variable_type, local_variable_pointer_type): Likewise.
552         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
553         aliases in the current and enclosing namespace declarations.
554         (NamespaceEntry.UsingAlias): Add CS0440 warning.
555         * decl.cs (MemberName.is_double_colon): New.
556         (MemberName.MemberName): Add new constructor for alias-member.
557         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
558         * expression.cs (QualifiedAliasMember): New expression type.
559
560 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
561
562         * location.cs : it borked when no argument was specified.
563
564 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
565
566         * location.cs : tiny ToString() format fix.
567
568 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
569
570         * statement.cs : oops, it was missing.
571
572 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
573
574         A set of fixes for precise line/column location.
575
576         * location.cs :
577           "token" field now holds a file/line "delta", a line number offset 
578           from the segment, and a column number. See also:
579           http://lists.ximian.com/pipermail/mono-devel-list/2004-
580           December/009508.html
581           Removed static IsNull. Use instance IsNull property instead.
582         * cs-tokenizer.cs :
583           For some tokens it stores Location. For Identifier it stores
584           LocatedToken which is a pair of string name and location.
585           Column numbers are adjusted only at getChar().
586         * report.cs :
587           Use Location.ToString() for reporting (it now contains column).
588         * cs-parser.jay :
589           Largely modified to use LocatedToken instead of
590           string (IDENTIFIER), and to acquire Location from some tokens.
591         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
592           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
593           codegen.cs :
594           Now MemberName holds Location. DeclSpace.ctor() receives Location
595           as a parameter. Removed extra parameters to all derived classes.
596           Replaced Location.IsNull() with instance property.
597         * assign.cs, expression.cs :
598           Added .ctor() overload that omits Location.
599         * attribute.cs :
600           Added "nameEscaped" flag that indicates the identifier was escaped
601           in the source file. This fixes bug #57047.
602
603 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
604
605         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
606         New method, looking for lo-case imported cls type.
607
608         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
609         here.
610
611         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
612
613         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
614
615         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
616         all_imported_types.
617         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
618
619         Optimized to save 3.5 MB for SWF compilation.
620
621 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
622
623         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
624         (PartialContainer.Create): Moved logic AddToContainer.
625         (PartialContainer.MarkForDuplicationCheck): Shares name.
626         
627         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
628         place.
629         
630         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
631         initialization.
632         (Namespace.GetSignatureForError): New method.
633         
634         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
635         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
636
637 2005-08-01  Raja R Harinath  <rharinath@novell.com>
638
639         Fix #75669.
640         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
641         member lookup rather than qualifier_type, since qualifier_type can
642         be null.
643
644 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
645
646         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
647         enum member.
648
649 2005-07-31  Miguel de Icaza  <miguel@novell.com>
650
651         * statement.cs: Copy the local exception into the exception
652         captured local.  Fixes 75674
653
654 2005-07-31  Raja R Harinath  <harinath@gmail.com>
655
656         Fix #75658.
657         * expression.cs (Invocation.OverloadResolve): Don't report error
658         CS1501 if error CS1502 has been reported.
659         (New.DoResolve): Delegate CS1501 reporting to
660         Invocation.OverloadResolve.
661
662         Fix #75656.
663         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
664         invariant-meaning-in-block property in an enclosing block if
665         necessary.
666
667 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
668
669         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
670         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
671         (Switch.CheckSwitch): Just save 50kb for SWF.
672
673 2005-07-27  Martin Baulig  <martin@ximian.com>
674
675         * anonymous.cs (CaptureContext.AddField): Added
676         `AnonymousContainer am' argument; compute its toplevel scope if
677         it's not already computed.  Fixes #75649.
678
679 2005-07-26  Raja R Harinath  <rharinath@novell.com>
680
681         Fix #75628.
682         * class.cs (Constructor.Emit): Reset block to null if the block
683         resolve fails.
684
685 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
686
687         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
688
689 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
690
691         * class.cs (MethodData.Define): Check whether accessor implementing
692         interface is public.
693
694         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
695
696 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
697
698         Fix #57245
699         * namespace.cs (LookupType): Moved same type check to...
700         
701         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
702         with the same name.
703
704 2005-07-21  Raja R Harinath  <rharinath@novell.com>
705
706         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
707         already found a typebuilder.
708         * class.cs (MethodCore.IsDuplicateImplementation): Compare
709         MemberNames, not strings.
710
711         * const.cs (Error_ExpressionMustBeConst): 
712         Rename from Error_EpressionMustBeConst.
713         * const.cs, class.cs, statement.cd: Update.
714
715 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
716
717         Fix #65573
718
719         * const.cs (Const.LookupConstantValue): Report missing contant expression
720         everytime.
721         (Error_EpressionMustBeConstant): Only one error method.
722
723         * class.cs, statement.c: Updated.
724
725 2005-07-20  Raja R Harinath  <rharinath@novell.com>
726
727         * statement.cs (Block.Flags): Add back HasVarargs.
728         (Block.flags): Make protected.
729         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
730
731         * typemanager.cs (types, typecontainers, user_types): Remove.
732         (UserTypes, TypeContainers): Likewise.
733         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
734         (CleanUp, Reset): Update.
735         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
736         (GetNestedType): Use Type.GetNestedType.
737         (CoreLookupType): Take two arguments, the namespace and the
738         basename of the type.  Update to use the Namespace.Lookup
739         mechanism.
740         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
741         (RealMemberLookup): Use IsNestedChildOf instead of playing with
742         string concatenation and substring matches.
743         * class.cs, enum.cs, delegate.cs: Update to changes.
744
745 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
746
747         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
748         Expression and made virtual.
749
750         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
751         (ImplicitStandardConversionExists): Fixed `byte' typo ?
752
753         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
754
755         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
756         error message.
757
758         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
759         change.
760
761 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
762
763         Fix #57707
764         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
765         AssemblyCultureAttribute is not used on executable.
766
767         * rootcontext.cs,
768         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
769
770 2005-07-16  Raja R Harinath  <rharinath@novell.com>
771
772         Fix #60638.
773         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
774         New.  Reports CS0252/CS0253.
775         Mostly taken from preliminary patch by Duncak Mak.
776         (Binary.DoResolveOperator): Store results of operator lookup.
777         Use them to detect if we need to warn about unintended reference
778         comparisons.
779
780 2005-07-15  Raja R Harinath  <rharinath@novell.com>
781
782         Fix #72969.
783         * namespace.cs (Namespace.Lookup): Add back location parameter.
784         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
785         * delegate.cs, ecore.cs, expression.cs: Update to changes.
786
787         * codegen.cs (EmitContext.DeclSpace): Make readonly.
788         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
789         (Namespace.LookupType): ... this.
790         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
791         of namespaces.
792         * typemanager.cs (LookupTypeReflection): Remove buggy code that
793         purported to handle pointers.
794         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
795         CoreLookupType.
796
797 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
798
799         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
800         type as namespace.
801
802 2005-07-15  Raja R Harinath  <rharinath@novell.com>
803
804         * namespace.cs (Namespace.Lookup): Drop location parameter.
805         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
806         (NamespaceEntry.Lookup): ... this.
807         (NamespaceEntry.Error_AmbiguousTypeReference):
808         Move here from DeclSpace.
809         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
810         names ...
811         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
812         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
813         Move to NamespaceEntry.
814         * delegate.cs, expression.cs: Update to changes.
815
816 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
817
818         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
819         CheckAttributeType and refactored.
820         (Attribute.ResolvePossibleAttributeType): Changed to reuse
821         ResolveAsTypeTerminal error handling.
822         (ResolveAsTypeTerminal): Introduced because of global attributes extra
823         handling.
824         (GetSignatureForError): Print errors in same way.
825
826         * class.cs,
827         * codegen.cs: Reflect attribute GetSignatureForError change.
828
829         * ecore.cs,
830         * expression.cs: Add silent parameter to ResolveAsTypeStep.
831
832         * namespace.cs (UsingEntry): Refactored to make fields private.
833
834         * assign.cs,
835         statement.cs: Error_UnexpectedKind has extra parameter.
836
837 2005-07-14  Raja R Harinath  <rharinath@novell.com>
838
839         * ecore.cs (IAlias): Remove.
840         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
841         that implement the interface.
842         * namespace.cs (Namespace): Likewise.
843         (Namespace.declspaces): Renamed from 'defined_names'.
844         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
845         DeclSpace instead of an IAlias.
846         * tree.cs (Tree.AddDecl): Update.
847
848 2005-07-12  Raja R Harinath  <rharinath@novell.com>
849
850         * statement.cs (Block.Flags); Remove HasVarargs.
851         (Block.HasVarargs): Move to ToplevelBlock.
852         (Block.ThisVariable, Block.AddThisVariable): Likewise.
853         (Block.Variables): Make protected.  Initialize variable hashtable
854         if necessary.
855         (Block.AddVariable): Update.
856         (Block.Resolve): Update to changes.
857         (ToplevelBlock.HasVarargs): New boolean.
858         (ToplevelBlock.ThisVariable): Move here from Block.
859         (ToplevelBlock.AddThisVariable): Likewise.
860         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
861         * expression.cs (This.ResolveBase): Update to changes.
862         (ArglistAccess.DoResolve): Likewise.
863
864 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
865
866         Fix #75321
867         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
868
869         * class.cs (TypeContainer.VerifyMembers): Distinguish between
870         not used and not used & assigned.
871         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
872
873 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
874
875         Fix #75053
876         * expression.cs (Is.DoResolve): null is never provided type.
877
878 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
879
880         Fix #52496
881         * cs-parser.jay: Less strict event error rule to catch more errors.
882
883 2005-07-08  Martin Baulig  <martin@ximian.com>
884
885         Fix test-iter-10.cs - distinguish whether we `yield' in a property
886         gettter (allowed) or setter (not allowed).
887
888         * class.cs (Accessor): Implement IIteratorContainer.
889         (Accessor.Yields): New public field.
890         (PropertyBase.PropertyMethod.Define): Handle iterators on a
891         per-accessor basis.
892
893         * cs-parser.jay
894         (get_accessor_declaration, set_accessor_declaration): Set the
895         `yields' flag on the accessor, not the property.
896         (property_declaration): Do the iterators check on a per-accessor
897         basis and not for the whole property.
898
899 2005-07-08  Martin Baulig  <martin@ximian.com>
900
901         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
902         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
903
904 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
905
906         Fix #74975
907         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
908         (ExtractSecurityPermissionSet): Cope with self referencing security
909         attributes properly.
910
911         * driver.cs (SetOutputFile): Made public property OutputFile.
912
913 2005-07-07  Raja R Harinath  <rharinath@novell.com>
914
915         Fix #75486.
916         * class.cs (TypeContainer.first_nonstatic_field): Rename from
917         has_nonstatic_fields.  Make into a FieldBase pointer.
918         (TypeContainer.AddField): Add CS0282 check.
919         (TypeContainer.EmitType): Update.
920
921 2005-07-06  Miguel de Icaza  <miguel@novell.com>
922
923         * cs-tokenizer.cs (consume_identifier): Do not create strings to
924         compare if they start with __.
925
926 2005-07-06  Raja R Harinath  <rharinath@novell.com>
927
928         * statement.cs (Switch.SwitchGoverningType): Only look at
929         UserCasts that don't need implicit standard conversions to one of
930         the allowed switch types (Fixes test-322.cs).
931         (LocalInfo.Resolve): Re-enable sanity-test.
932
933 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
934
935         * cs-tokenizer.cs (consume_identifier): Detect double undescores
936         
937         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
938         
939         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
940
941 2005-07-06  Raja R Harinath  <rharinath@novell.com>
942
943         Fix #75472.
944         * ecore.cs (SimpleName.GetSignatureForError): Add.
945         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
946         (MemberAccess.GetSignatureForError): Add.
947
948 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
949  
950         The big error and warning messages review.
951         
952         * anonymous.cs,
953         * assign.cs,
954         * attribute.cs,
955         * class.cs,
956         * codegen.cs,
957         * convert.cs,
958         * cs-parser.jay,
959         * cs-tokenizer.cs,
960         * decl.cs,
961         * delegate.cs,
962         * doc.cs,
963         * driver.cs,
964         * ecore.cs,
965         * enum.cs,
966         * expression.cs,
967         * flowanalysis.cs,
968         * iterators.cs,
969         * literal.cs,
970         * location.cs,
971         * modifiers.cs,
972         * namespace.cs,
973         * parameter.cs,
974         * pending.cs,
975         * report.cs,
976         * rootcontext.cs,
977         * statement.cs,
978         * support.cs,
979         * tree.cs,
980         * typemanager.cs: Updated.
981         
982         * class.cs: (MethodCore.SetYields): Moved here to share.
983         (PropertyMethod.Define): Moved iterator setup here.
984         
985         * iterators.cs: Add orig_method to have full access to parent
986         container.
987
988 2005-07-05  Raja R Harinath  <rharinath@novell.com>
989
990         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
991         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
992         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
993         variable of struct type.
994         * expression.cs (Unary.ResolveOperator): Update to change.
995         (Indirection.VerifyFixed): Likewise.
996         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
997         (ParameterReference.VerifyFixed): Value parameters are fixed.
998         (This.VerifyFixed): Treat 'this' as a value parameter.
999         * statement.cs (LocalInfo.IsFixed): Remove.
1000
1001 2005-07-01  Martin Baulig  <martin@ximian.com>
1002
1003         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1004         `ec.EmitThis ()' to get the correct scope.
1005
1006 2005-07-01  Martin Baulig  <martin@ximian.com>
1007
1008         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1009         instance is a ParameterReference; fixes #75299.
1010
1011 2005-07-01  Martin Baulig  <martin@ximian.com>
1012
1013         Reverted Marek's latest patch (r46725):
1014         - it contains structural changes which are neither mentioned in
1015           the ChangeLog nor explained anywhere; for example the additional
1016           argument of EmitContext's and Iterator's .ctor's and the
1017           TypeContainer.DefineMembers() change.
1018         - structural changes like this should go in in seperate patches
1019           and not be hidden in a huge patch which just seems to affect
1020           warnings and errors.
1021           a big and hard to understand patch.
1022         - it breaks iterators and causes regressions, for instance in
1023           test-iter-03.cs.      
1024
1025 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1026
1027         Fix #75412.
1028         * expression.cs (Indexers.map): Remove.
1029         (Indexers.Append): Filter out inaccessible setters and getters.
1030         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1031
1032         Fix #75283.
1033         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1034         Refactored from ...
1035         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1036         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1037         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1038         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1039
1040 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1041
1042         Fix #75322
1043         * class.cs (FieldBase.GetInitializerExpression): One more field
1044         for backup.
1045
1046 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1047
1048         * pending.cs: Do not define a proxy if the base method is virtual,
1049         it will be picked up by the runtime (bug 75270).
1050
1051 2005-06-08  Martin Baulig  <martin@ximian.com>
1052
1053         The big Iterators rewrite :-)
1054
1055         * iterators.cs: Rewrite this to use the anonymous methods framework.
1056
1057         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1058         before the TypeContainers; see 2test-21.cs.
1059
1060         * class.cs
1061         (TypeContainer.DefineType): Don't create a new EmitContext if we
1062         already have one (this only happens if we're an Iterator).
1063         (TypeContainer.Define): Also call Define() on all our iterators.
1064         (Method.CreateEmitContext): Added support for iterators.
1065
1066         * anonymous.cs
1067         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1068         (AnonymousContainer.CreateMethodHost): Moved here from
1069         AnonymousMethod and made abstract.
1070         (AnonymousContainer.CreateScopeType): New abstract method.
1071         (AnonymousContainer.IsIterator): New public property.
1072         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1073         get the ScopeTypeBuilder rather than manually defining it here. 
1074         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1075         iterators here.
1076
1077         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1078         before RootContext.DefineTypes().
1079
1080         * codegen.cs (EmitContext.RemapToProxy): Removed.
1081         (EmitContext.CurrentAnonymousMethod): Changed type from
1082         AnonymousMethod -> AnonymousContainer.
1083         (EmitContext.ResolveTopBlock): Protect from being called twice.
1084         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1085         (EmitContext.EmitThis): Removed the iterators hacks; use the
1086         anonymous methods framework for that.
1087
1088         * statement.cs
1089         (ToplevelBlock.Container): Make this a property, not a field.
1090         (ToplevelBlock.ReParent): New public method; move the
1091         ToplevelBlock into a new container.
1092         (Foreach.TemporaryVariable): Simplify.
1093
1094 2005-06-05  Martin Baulig  <martin@ximian.com>
1095
1096         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1097         (Block.AddTemporaryVariable): New public method; creates a new
1098         `LocalInfo' for a temporary variable.
1099         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1100         variables here.
1101         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1102         non-iterator variables.
1103
1104 2005-06-05  Martin Baulig  <martin@ximian.com>
1105
1106         * statement.cs (Foreach.TemporaryVariable): Create the
1107         LocalBuilder in the Emit phase and not in Resolve since in some
1108         situations, we don't have an ILGenerator during Resolve; see
1109         2test-19.cs for an example.
1110
1111 2005-06-04  Martin Baulig  <martin@ximian.com>
1112
1113         **** Merged r45395 from GCS ****
1114
1115         The big Foreach rewrite - Part II.
1116
1117         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1118         with `PropertyInfo ienumerator_getcurrent'.
1119
1120         * codegen.cs (VariableStorage): Removed.
1121
1122         * statement.cs
1123         (Foreach): Derive from Statement, not ExceptionStatement.
1124         (Foreach.CollectionForeach): New nested class.  Moved all the code
1125         dealing with collection foreach here.
1126         (Foreach.ForeachHelperMethods): Removed.
1127         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1128
1129 2005-05-23  Martin Baulig  <martin@ximian.com>
1130
1131         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1132         don't need to.  Fix #75014.
1133
1134 2005-05-20  Martin Baulig  <martin@ximian.com>
1135
1136         Merged r44808 from GMCS.
1137
1138         * class.cs (TypeContainer.CircularDepException): Removed.
1139         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1140         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1141         (CS0146) and interface (CS0529) dependencies here.
1142
1143 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1144
1145         * expression.cs (Invocation.EmitCall): Fix initialization
1146         'this_call' to reflect current behaviour.  Fix indentation.
1147
1148         * convert.cs (FindMostEncompassedType): Add two trivial special
1149         cases (number_of_types == 0 || number_of_types == 1).
1150         (FindMostEncompasingType): Likewise.
1151
1152 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1153
1154         Some cleanups preparing for the fix of #75283.
1155         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1156         error testing.
1157         (EventExpr.InstanceResolve): Likewise.
1158         (EventExpr.DoResolve): Remove redundant checks.
1159
1160 2005-06-10  Duncan Mak  <duncan@novell.com>
1161
1162         * cs-tokenizer.cs (process_directives): New flag for controlling
1163         the processing of preprocessor directives.
1164         (x_token): After seeing a '#', return Token.NONE instead of going
1165         to handle_preprocessing_directive() when not processing
1166         directives. This avoids unnecessary processing during the token peek in
1167         is_punct().
1168
1169         This fixes #74939.
1170
1171         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1172         the existing error reporting methods instead of Report.Error.
1173
1174         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1175         after Raja's rewrite.
1176
1177 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1178
1179         * class.cs: Small fix.
1180
1181 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1182
1183         Fix #75160.
1184         * class.cs (GetPartialBases): Fix return value check of
1185         part.GetClassBases.
1186
1187 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1188
1189         Ensure that partial classes are registered in their enclosing
1190         namespace.  Initial part of fix of #75160.
1191         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1192         Register declspace with namespace here, not in
1193         DeclSpace.RecordDecl.
1194         * cs-parser.jay: Pass namespace to RecordDecl.
1195         * class.cs (PartialContainer.Create): Likewise.
1196         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1197         called.
1198         * decl.cs (Declspace.RecordDecl): Remove.
1199         * namespace.cs (NamespaceEntry.DefineName): Remove.
1200
1201 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1202
1203         * rootcontext.cs: Reset TargetExt as well.
1204
1205 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1206
1207         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1208         -langversion:ISO-1.
1209
1210 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1211
1212         Fix #75080, cs0119.cs.
1213         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1214         of ...
1215         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1216         allowing ExprClass.Type and ExprClass.Namespace for
1217         ResolveFlags.VariableOrValue.
1218         (Expression.Resolve) [1-argument variant]: Change default resolve
1219         flags based on language version.
1220         (Expression.Error_UnexpectedKind): Use a simple string array
1221         rather than an ArrayList.
1222         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1223         not ExprClass.Type.
1224         (TypeOfVoid.DoResolve): Likewise.
1225         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1226         flags argument -- it always has the same value.
1227
1228 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1229
1230         Fix #75081.
1231         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1232         Use it in the error message.
1233         * assign.cs, expression.cs, statement.cs: Update.
1234
1235 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1236
1237         Fix #75088.
1238         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1239         the "almostMatchedMember" case too.
1240         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1241         that failed the accessibility checks to 'almost_match'.
1242
1243 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1244
1245         * attribute.cs: Use internal MethodBuilder methods to set
1246         ExactSpelling and SetLastError on PInvoke methods, instead
1247         of passing them via charset.  Fixes #75060.
1248
1249 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1250
1251         * parameter.cs (Parameter): Remove TODO comment.
1252         (Parameter.DefineParameter): Remove Location parameter.
1253         (Parameters.LabelParameters): Likewise.
1254         * class.cs (Constructor.Emit): Update to change.
1255         (MethodData.Emit): Likewise.
1256         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1257         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1258
1259 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1260
1261         * parameter.cs,
1262           Removed Parameters.Location and added Parameter.Location instead.
1263           Removed Location parameter from Emit() and GetSignature().
1264         * anonymous.cs,
1265           class.cs,
1266           cs-parser.jay,
1267           delegate.cs,
1268           iterators.cs,
1269           statement.cs :
1270           Modified all related calls.
1271
1272 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1273
1274         Improve user-defined conversion handling.
1275         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1276         applicable operators.
1277         (AddConversionOperators): New.  Helper for GetConversionOperators.
1278         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1279         there is only one most encompassed/encompassing type.
1280         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1281         "applicable operator" handling.
1282         (UserConversion): Move cache here from GetConversionOperators.
1283         Directly cache the chosen operator, rather than the whole
1284         MethodGroup.
1285         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1286         case.  Allow conversion of decimal to sbyte and byte too.
1287         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1288         New static methods.  Used to avoid allocating EmptyExpressions in
1289         convert.cs.
1290
1291 2005-05-24  Duncan Mak  <duncan@novell.com>
1292
1293         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1294         another class, used in Convert.ExplicitNumericConversion.
1295         (CastToDecimal): New class, similar to above, but casts to
1296         System.Decimal, used in Convert.ImplicitNumericConversion and also
1297         in explicit convesion from double/float to decimal.
1298
1299         * convert.cs (ImplicitNumericConversion): Handle implicit
1300         conversions to System.Decimal.
1301         (ExplicitNumericConversion): handle explicit conversions to
1302         System.Decimal.
1303
1304         This fixes #68711.
1305         
1306 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1307
1308         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1309         know the type at this stage, just break through.   Fixes #75008 
1310
1311 2005-05-19  Martin Baulig  <martin@ximian.com>
1312
1313         * delegate.cs
1314         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1315         to disable error reporting.
1316
1317         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1318         here since we don't want to report an error; see the new test-336.cs.
1319
1320 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1321
1322         * statement.cs (ToplevelBlock.GetParameterReference)
1323         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1324         Move here from class Block.
1325         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1326         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1327
1328 2005-05-18  Martin Baulig  <martin@ximian.com>
1329
1330         Fix #74978.
1331
1332         * flowanalysis.cs
1333         (FlowBranching.Reachability): Add non-static public And() and Or()
1334         methods.
1335         (FlowBranchingSwitch): New class; do the `break_origins' thing
1336         like in FlowBranchingLoop.
1337         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1338         reachability, not just locals and parameters.
1339         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1340         switch; MergeBreakOrigins() now takes care of that.
1341
1342 2005-05-18  Martin Baulig  <martin@ximian.com>
1343
1344         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1345         a loop and may leave it, reset the barrier; fixes #74974.
1346
1347 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1348         
1349         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1350         is back.
1351         
1352         * cs-parser.jay: Catch more lexical errors.
1353         
1354         * report.cs: Add one more Error method.
1355         
1356         * rootcontext.cs,
1357         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1358
1359 2005-05-17  Martin Baulig  <martin@ximian.com>
1360
1361         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1362         #70970. 
1363
1364 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1365
1366         Fix test-382.cs.  Emit values of decimal constants.
1367         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1368         Carved out of ...
1369         (TypeContainer.AddField): ... this.
1370         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1371         with initializers to include 'Const's.
1372         (ClassPart.RegisterFieldForInitialization): Forward to
1373         PartialContainer.
1374         * const.cs (Const.Const): Pass initializer to base class.
1375         (Const.Define): In case of decimal constants, register them for
1376         initialization in a static constructor.
1377
1378 2005-05-14  Martin Baulig  <martin@ximian.com>
1379
1380         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1381         do not call ResolveUnreachable() on unreachable statements in
1382         here, see the comment in the source code.
1383
1384 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1385
1386         Fix #74934.
1387         * expression.cs (BinaryResolveOperator): If one of the operands of
1388         an equality comparison is 'null' and the other is a pointer type,
1389         convert the null to a NullPointer.
1390         * convert.cs (ImplicitReferenceConversion): If the expression is a
1391         NullLiteral and the target type is a pointer type, return a
1392         NullPointer instead.
1393         (ImplicitConversionStandard): Likewise.
1394
1395 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1396         
1397         * cs-parser.jay: Set readonly context based on special constructs.
1398         
1399         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1400         readonly variable error handling.
1401         
1402         * rootcontext.cs (EmitCode): Don't verify members when error
1403         occurred.
1404         
1405         * statement.cs (LocalInfo): Add reaodnly context information.
1406         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1407
1408 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1409
1410         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1411         for #74041 to initialize 'resolved' to false only for explicit
1412         blocks.  Fixes #74873.
1413
1414 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1415
1416         Fix #74920.
1417         * typemanager.cs (unmanaged_enclosing_types): New.
1418         (IsUnmanagedType): Avoid infloops by using
1419         'unmanaged_enclosing_types' to talk with recursive invocations.
1420
1421 2005-05-13  Martin Baulig  <martin@ximian.com>
1422
1423         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1424         instance variable, not a local.  Fix #74873.
1425         (Block.ResolveUnreachable): Set it to true here.
1426
1427 2005-05-11  Duncan Mak  <duncan@novell.com>
1428
1429         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1430         continuing to process for 'arg'.
1431         (handle_preprocessing_directive): Check the argument of the #endif
1432         directive and report error CS1025 if there are any trailing
1433         characters.
1434
1435         According to the C# spec, having even whitespace after the #endif
1436         directive is illegal; however, because we call arg.TrimEnd ()
1437         beforehand, we have the same behavior as csc, allowing whitespace
1438         after the directive.
1439
1440         Fixes #74892.
1441
1442 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1443
1444         Fix #74863.
1445         
1446         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1447         (Constructor.GetObsoleteAttribute): Implemented correctly.
1448
1449 2005-05-10  Martin Baulig  <martin@ximian.com>
1450
1451         * support.cs (ReflectionParameters.ParameterModifier): Use
1452         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1453         and `ParameterAttributes.In'.  Fixes #74884.
1454
1455 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1456
1457         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1458         
1459         * expression.cs (Argument.GetParameterModifier): Turned to property.
1460         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1461         
1462         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1463         its C# equivalent.
1464         
1465 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1466
1467         Fix #74852.
1468         * decl.cs (MemberCache.AddMethods): Register override methods,
1469         rather than non-override methods.
1470         * typemanager.cs (RegisterOverride): New.
1471         (IsOverride): Update.
1472
1473 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1474
1475         Fix #73105.
1476         
1477         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1478         recursive declaration.
1479         
1480         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1481         
1482 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1483
1484         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1485         
1486         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1487
1488 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1489
1490         Fix #74797.
1491         * decl.cs (DeclSpace.FamilyAccessible): 
1492         Use TypeManager.IsNestedFamilyAccessible.
1493
1494         Fix reopened #64812.
1495         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1496         internal'.
1497
1498 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1499             Abin Thomas  <projectmonokochi@rediffmail.com>
1500             Anoob V E  <projectmonokochi@rediffmail.com>
1501             Harilal P R  <projectmonokochi@rediffmail.com>
1502
1503         Fix #64812.
1504         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1505         allow access to all static members.
1506
1507 2005-05-04  Martin Baulig  <martin@ximian.com>
1508
1509         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1510
1511 2005-05-04  Martin Baulig  <martin@ximian.com>
1512
1513         Fix #74655.
1514
1515         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1516         section at the end; make things work if `default' is not the last
1517         section.        
1518
1519 2005-05-04  Martin Baulig  <martin@ximian.com>
1520
1521         Fix #70400.
1522
1523         * statement.cs (Switch): Replaced the `got_default' field with a
1524         `default_section' one.
1525         (Switch.CheckSwitch): Set `default_section' here.
1526         (Switch.Resolve): If we're a constant switch and the constant is
1527         not found, use the default section.
1528
1529 2005-05-03  Martin Baulig  <martin@ximian.com>
1530
1531         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1532
1533         * statement.cs (Foreach.ArrayForeach): New nested class.
1534         (Foreach.TemporaryVariable): New nested class.
1535         (Foreach.EmitArrayForeach): Removed; this is now in the new
1536         ArrayForeach class.
1537
1538 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1539
1540         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1541         more conservative.
1542         (VerifyPendingMethods): Revert change below.
1543
1544         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1545         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1546         that used to trigger warning -28.  Remove warning -28.
1547         * expression.cs (Invocation.OverloadResolve): Use
1548         TypeManager.IsOverride to distinguish override methods.
1549
1550         Fix #74773.
1551         * pending.cs (VerifyPendingMethods): If a base type implements the
1552         requested interface, don't bother checking individual methods of
1553         the base type.  As a side-effect, this prevents the creation of
1554         unnecessary proxies.
1555
1556 2005-05-02  Martin Baulig  <martin@ximian.com>
1557
1558         Fix #70182.
1559
1560         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1561         Also `And' the locals if the old vector is null.
1562         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1563         null; in this case we basically reset all the variables.        
1564
1565 2005-05-02  Martin Baulig  <martin@ximian.com>
1566
1567         Fix #74529.
1568
1569         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1570         Added `FlowBranching branching' argument; always `and' the
1571         variables instead of `or'ing them unless we're an infinite loop.
1572
1573         * statement.cs (While.Resolve): Create a new sibling unless we're
1574         infinite.       
1575
1576 2005-05-02  Martin Baulig  <martin@ximian.com>
1577
1578         Fix #70140.
1579
1580         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1581         arguments; use it instead of creating a new TopLevelBlock.
1582         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1583         our ConstructorInitializer.
1584
1585         * statement.cs
1586         (TopLevelBlock.TopLevelBranching): New public property.
1587         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1588         and create our `TopLevelBranching'.
1589
1590         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1591         anonymous method host, use `block.TopLevelBranching' rather than
1592         creating a new branching.
1593
1594 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1595
1596         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1597         a ScopeInfo, if any of the current children is a child of the new
1598         entry, move those children there.
1599
1600 2005-04-30  Martin Baulig  <martin@ximian.com>
1601
1602         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1603         at the beginning of a SwitchSection.  Fix #73335.
1604
1605 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1606
1607         Fix #74378
1608         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1609         
1610         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1611         (FieldExpr.DoResolve): Obsolete members are ignored for field
1612         initializers.
1613         
1614 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1615
1616         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1617         of arrays detection.
1618
1619         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1620         verification.
1621         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1622
1623         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1624         arrays report.
1625
1626 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1627
1628         * cs-parser.jay: Use the prefered version of -unsafe in error
1629         message.
1630
1631 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1632
1633         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1634         circumstances.
1635
1636 2005-04-20  John Luke  <john.luke@gmail.com>
1637
1638         * driver.cs: fix typo in error message, --outout to --output
1639
1640 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1641
1642         * codegen.cs (InRefOutArgumentResolving): New field.
1643         
1644         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1645         fields outside contructor.
1646         
1647         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1648         
1649 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1650
1651         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1652         parameter code was not completed ever, so it was not as up-to-date
1653         as local variables.  Must finish it.
1654
1655         The bug fix was to compare the Toplevel of the block, not the
1656         current block.  Thanks for Ben for pointing this out. 
1657
1658 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1659
1660         * decl.cs (AddMethods): Use the declaring type of the problem
1661         method to determine if we want to squash a warning.
1662
1663 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1664
1665         * attribute.cs: Removed debug output.
1666
1667         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1668         
1669         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1670         Report.Stderr.
1671         
1672 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1673
1674         Fix #74481.
1675         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1676         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1677         all null comparisons against reference types.
1678
1679 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1680
1681         Fix# 74565
1682         * class.cs (TypeContainer.CircularDepException) New nested
1683         exception class.
1684         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1685         (TypeContainer.DefineType): Removed error, reset InTransit before
1686         exit.
1687         (Class.DefineType): Throw exception when is in Transit.
1688         Catch exception and report error.
1689         (Struct.DefineType): Throw exception when is in Transit.
1690         Catch exception and report error.
1691         (Interface.DefineType): Throw exception when is in Transit.
1692         Catch exception and report error.
1693
1694         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1695         handle nested exception handlers.
1696
1697         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1698         a catch.
1699
1700         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1701         InFinally and InCatch storage.
1702
1703         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1704         (Catch.Resolve): Set and Restore ec.InCatch.
1705         (Try.Resolve): Set and Restore ec.InFinally.
1706         (Try.HasCatch): True when try has catch.
1707
1708 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1709
1710         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1711           for the same event member, so exclude such cases from warning 419.
1712           Fixed bug #74633.
1713
1714 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1715
1716         * expression.cs (Binary.ResolveOperator): Apply patch from John
1717         Luke to fix bug 59864: operators &, | and ^ on enumerations
1718         require that the same enum type on both sides.
1719
1720         * driver.cs: Add warnings to old flag usage, this is to assist
1721         people who produce Makefiles and hope that the Makefiles will be
1722         used on Windows.
1723
1724         * class.cs (TypeContainer.EmitType): Moved the definition of the
1725         special $PRIVATE$ field from the resolve phase to the Emit phase.
1726         During resolve we do not know if we are a struct with
1727         HasExplicitLayout, we know this only after the attributes for the
1728         type are emitted.
1729
1730         Set the FieldOffset to zero on the dummy field that we create for
1731         the class.   Fixes 74590.
1732
1733 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1734
1735         Fix #73834.
1736         * ecore.cs (PropertyExpr.resolved): New.
1737         (DoResolve): Use it to handle a case of double resolution here.
1738         Handle a case of identical-name-and-type-name.
1739         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1740         resolution by storing the results of expression resolution back
1741         into the "probes" array.
1742
1743 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1744
1745         Fix cs0208-7.cs and cs0208-8.cs.
1746         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1747         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1748         error reporting to point out the reason a struct is not unmanaged.
1749
1750 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1751
1752         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1753           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1754
1755 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1756
1757         Fix #74528.
1758         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1759         IdenticalNameAndTypeName here.
1760         (EventExpr.InstanceResolve): Likewise.
1761
1762 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1763
1764         C# 2.0 DefaultCharSetAttribute implementation
1765         
1766         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1767         which allows us to set GlobalNamespace for every resolve.
1768         (Attribute.ResolveArguments): Cut from Resolve.
1769         (Attribute.GetCharSetValue): Returns CharSet named argument.
1770         (Attribute.DefinePInvokeMethod): Gets default charset from
1771         module settings.
1772         (GlobalAttribute.ResolveAsTypeStep): Override.
1773         (GlobalAttribute.ResolveArguments): Override.
1774         
1775         * class.cs (TypeAttr): Is protected.
1776         
1777         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1778         (ModuleClass.DefaultCharSetType): New memeber.
1779         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1780         
1781         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1782         charset from module.
1783         
1784         * delegate.cs (TypeAttr): Override.
1785         (Delegate.DefineType): Use this TypeAttr.
1786         
1787         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1788         at very early stage (before types are defined) to resolve model
1789         module attributes. It will probably not work with corlib but it
1790         should be ok.
1791         
1792         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1793         charset from module.
1794         
1795         * typemanager.cs (default_charset_type): New type.
1796
1797 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1798
1799         * decl.cs (MemberCache.AddMethods): Don't warn if
1800         System.Object.Finalize has buggy MethodAttributes.
1801
1802         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1803         removed below.
1804
1805 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1806
1807         * doc.cs : detect ambiguous reference to overloaded members.
1808           Fixed bug #71603. MS 1.1 csc does not detect it.
1809
1810 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1811
1812         * doc.cs : delegates must not be referenced with parameters.
1813           Fixed bug #71605.
1814
1815 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1816
1817         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1818
1819 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1820
1821         * driver.cs (MainDriver): Stop processing if the CLS stage found
1822         errors. 
1823
1824         (CompilerCallableEntryPoint.InvokeCompiler): Always
1825         reset after execution;   Take a TextWriter argument for the
1826         output.
1827
1828         * report.cs: Use the error stream instead of hardcoding stderr. 
1829
1830 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1831
1832         * class.cs: Reduce code paths to test, too small of an
1833         optimization to make it worth the extra testing.  Always perform
1834         it. 
1835
1836 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1837
1838         Fix #74510.
1839         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1840         operators that had errors reported on them.
1841
1842 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1843
1844         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1845         argument types.
1846         (Attribute.Resolve): Add named argument type checking.
1847         
1848         * class.cs (FixedField.Define): Use IsPrimitiveType
1849         
1850         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1851         
1852         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1853         unsafe parameter types.
1854         
1855         * statement.cs (Using.ResolveExpression): Add better error description.
1856         
1857         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1858         
1859 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1860
1861         Fix #74484.
1862         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1863         AttributeUsageAttribute in the emitcontext of the attribute class,
1864         not in the emitcontext of the attributable entity it was attached to.
1865         * cs-parser.jay: Use 'current_class', not 'current_container',
1866         when creating a GlobalAttribute.
1867
1868 2005-04-08  Alp Toker  <alp@atoker.com>
1869
1870         * pending.cs: The fix to #58413 failed to compile methods implementing
1871         interfaces with/without params modifiers and vice versa, even though
1872         params modifiers aren't part of the signature. Make the modifier check
1873         less strict as in csc.
1874
1875 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1876             Anoob V E  <projectmonokochi@rediffmail.com>
1877             Harilal P R  <projectmonokochi@rediffmail.com>
1878
1879         Fix #58413.
1880         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1881         modifiers of pending methods.
1882         (PendingImplementation.PendingImplementation): Initialize it.
1883         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1884         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1885         with ParameterData.  Add check for modifiers.
1886         * class.cs (MethodData.Define): Update to changes.
1887
1888 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1889
1890         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1891
1892 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1893
1894         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1895         property.
1896         
1897         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1898         
1899         * rootcontext.cs,
1900         * typemanager.cs: Registered RequiredAttributeAttribute.
1901         
1902 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1903
1904         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1905         Warning CS0169 is back at level 3.
1906         (IMethodData.SetMemberIsUsed): New method.
1907         
1908         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1909         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1910         
1911         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1912
1913         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1914         contants.
1915         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1916         is used.
1917         
1918         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1919         is used.
1920         
1921         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1922         to avoid the problems with nested types.
1923
1924 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1925             Anoob V.E  <projectmonokochi@rediffmail.com>
1926             Harilal P.R  <projectmonokochi@rediffmail.com>
1927             Raja R Harinath  <rharinath@novell.com>
1928
1929         Fix #73820.
1930         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1931         attribute.
1932         * typemanager (GetConstructor): Make public.
1933
1934 2005-04-05  John Luke  <john.luke@gmail.com>
1935             Raja R Harinath  <rharinath@novell.com>
1936
1937         Fix #62232.
1938         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1939         struct too.  Return false quicker in a few cases.
1940         (VerifyUnManaged): Use it.
1941
1942 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1943
1944         Fix #74041.
1945         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1946         not 'unreachable_seen'.
1947
1948 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1949
1950         * attribute.cs (Attribute.GetValue): Removed unused.
1951         
1952         * codegen.cs (CodeGen.TrimExt): Removed unused.
1953         
1954         * cs-parser.jay (output): Removed unused.
1955         
1956         * cs-tokenizer.cs (hex_digits): Removed unused.
1957         
1958         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1959         
1960         * expression.cs (Indirection.LoadExprValue): Removed unused.
1961         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1962         
1963         * iterators.cs (Iterator.param_types): Removed unused.
1964         
1965         * statement.cs (Goto.block): Removed unused.
1966         (ToplevelBlock.did): Removed unused.
1967         (Switch.ResolveConstantSwitch): Removed unused.
1968
1969 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1970
1971         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1972         resetting thingy.
1973
1974 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1975
1976         Fix #74232 and cs0208-3.cs.
1977         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1978         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1979         unmanaged type.  Don't use FieldBuilders when 't' is a
1980         TypeBuilder.  Use ModFlags and MemberType fields.
1981         * class.cs (MemberBase.member_type): Rename from MemberType.
1982         (MemberBase.MemberType): New property.  Determines member_type on
1983         demand.
1984         (MemberBase.DoDefine): Don't initialize MemberType here.
1985         (FieldMember.Define): Likewise.
1986
1987 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1988
1989         Fix #74241
1990         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1991         Attributes are emitted there.
1992         
1993 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1994
1995         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1996         keyword in 'partial enum' too.
1997         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1998         is not allowed).
1999         Report from Kamil Skalski <nazgul@omega.pl>.
2000
2001         Fix #74309.
2002         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2003         have partial containers too.
2004
2005         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2006         in block' checks to Block.CheckInvariantMeaningInBlock.
2007         * statement.cs (Block.GetKnownVariableInfo): Make private.
2008         (Block.IsVariableUsedInChildBlock): Remove.
2009         (Block.IsVariableUsedInBlock): Likewise.
2010         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2011         conflicting declaration.
2012         (Block.AddVariable): Make error messages less long-winded and more
2013         specific.  Show location of conflicting declaration.
2014         * parameter.cs (Parameters.Location): New readonly property.
2015
2016 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2017
2018         Clean up semantics of invoking ResolveMemberAccess.
2019         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2020         can have an instance, ensure that we pass in a non-TypeExpression
2021         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2022         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2023         argument.  Update to changes and simplify.
2024         (FieldExpr.Emitinstance): Remove CS0120 check.
2025         (PropertyExpr.EmitInstance): Likewise.
2026         * expression.cs (Argument.Resolve): Likewise.
2027         (Invocation.DoResolve): Update to changes in semantics of
2028         InstanceExpression.
2029
2030 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2031
2032         Fix #74241
2033         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2034         customization.
2035         
2036         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2037
2038 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2039
2040         Fix difference in behaviour with commandline invocation.
2041         * driver.cs (Driver.Reset): New.
2042         (CompilerCallableEntryPoint): Call it.
2043
2044         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2045         variable" warnings if the boolean expression failed to resolve.
2046
2047 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2048
2049         * attribute.cs: Fix the union of several permissions when some of them
2050         are unrestricted (so the result isn't an unrestricted permission set).
2051         Fix #74036.
2052
2053 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2054
2055         * ecore.cs (MemberExpr): New class.  Convert from interface
2056         IMemberExpr.
2057         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2058         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2059         error checks.
2060         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2061         (MethodGroupExpr.IsExplicitImpl): Remove.
2062         (Expression.GetFieldFromEvent): Remove.
2063         (SimpleName.MemberStaticCheck): Remove.
2064         (SimpleName.DoSimpleNameResolve): Update to changes.
2065         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2066         (MemberAccess.IdenticalNameAndTypeName): Remove.
2067         (MemberAccess.error176): Move to MemberExpr.
2068         (MemberAccess.DoResolve): Update to changes.
2069         (BaseAccess.DoResolve): Likewise.
2070
2071 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2072
2073         C# 2.0 Conditional attribute class implementation
2074         
2075         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2076         Analyzes class whether it has attribute which has ConditionalAttribute
2077         and its condition is not defined.
2078         
2079         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2080         (Class.IsExcluded): New method. Search for at least one defined
2081         condition in ConditionalAttribute of attribute class.
2082
2083 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2084
2085         * ecore.cs (PropertyExpr): Derive from Expression, not
2086         ExpressionStatement.
2087         (PropertyExpr.EmitStatement): Remove.
2088
2089 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2090
2091         Fix #74060.
2092         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2093         internal field "value__" of an enum be private.  The examples for
2094         "value__" that I found on MSDN all used FieldAttributes.Private.
2095
2096         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2097         Don't mention IL method attribute names.
2098
2099         Fix #47991.  Remove a TODO.
2100         * statement.cs (Block.Toplevel): Make into a field.
2101         (Block.Parameters): Move into ToplevelBlock.
2102         (Block.known_variables): Rename from child_variable_names.
2103         (Block.Block): Remove variants that take Parameters.  Initialize
2104         'Toplevel' with the immediately surrounding toplevel block.
2105         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2106         LocalInfo parameter.
2107         (Block.GetKnownVariableInfo): New.
2108         (Block.IsVariableNameUsedInChildBlock): Update.
2109         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2110         the block, even though it may not be in scope.
2111         (Block.AddVariable): Remove Parameters parameter.  Use
2112         Toplevel.Parameters instead.
2113         (Block.AddConstant): Remove Parameters parameter.
2114         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2115         (Block.IsParamaterReference): Likewise.
2116         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2117         (ToplevelBlock.Parameters): New.  Moved from Block.
2118         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2119         initialize Parameters to a non-null value.
2120         * cs-parser.jay: Update to changes.
2121         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2122         simple names that mean different things in the same block.  Use
2123         Block.IsVariableNameUsedInBlock.
2124
2125 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2126
2127         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2128         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2129         GetTypeHandle.  It is possible for a reflected type to derive from
2130         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2131         System.Array during mscorlib compilation).
2132         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2133         contain a method_hash, don't create one either.  Don't create a
2134         deep copy of the base cache's method_hash.
2135         (MemberCache.SetupCache): Rename back from DeepCopy.
2136         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2137         already initialized.  If we see an override function, add its
2138         underlying base virtual function to the member_hash too.
2139
2140         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2141
2142 2005-03-26  Raja R Harinath  <harinath@acm.org>
2143
2144         Fix #73038.
2145         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2146         fails to resolve, ensure that the LHS is still resolved as an
2147         lvalue.
2148
2149 2005-03-25  Raja R Harinath  <harinath@acm.org>
2150
2151         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2152         ec.ContainerType.
2153         (Enum.current_ec): Remove.
2154         (Enum.LookupEnumValue): Remove EmitContext argument.
2155         Just uses the one created during DefineType.
2156         (Enum.FindMembers): Update.
2157         * expression.cs (MemberAccess.DoResolve): Update.
2158
2159 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2160
2161         * assign.cs (Assign.DoResolve): Check for CS1717 when
2162         source and target are same (uses Equals).
2163
2164         * expression.cs (LocalVariableReference, ParameterReference,
2165         This): Implemented Equals, GetHashCode.
2166
2167         * statement.cs (Block.GetParameterReference): Removed useless
2168         local variable.
2169
2170 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2171
2172         Fix cs0128.cs
2173         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2174         blocks before deciding whether the error is cs0136 or cs0128.
2175
2176         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2177         (using_alias_directive, using_namespace_directive): Pass
2178         MemberName, not an expression to Namespace.UsingAlias and
2179         Namespace.Using.
2180         (MakeName): Use the MemberName of the namespace.
2181         * namespace.cs (Namespace.MemberName): New.
2182         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2183         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2184         Likewise.
2185         * decl.cs (MemberName.Name): Make readonly.
2186         (MemberName.FromDotted): New "constructor".
2187         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2188         (MemberCore.Name): Compute from MemberName on demand.
2189         (MemberCore.SetMemberName): Provide a way to change the
2190         MemberName.
2191         (MemberCore.AddToContainer): Don't take a fullname parameter.
2192         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2193         fully qualified name of the container to the member name.
2194         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2195         only if the type is a member of the root container.
2196         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2197         MemberName.Left rather than searching for an embedded ".".
2198         (PartialContainer.CreatePart): Update to changes in RootContext.
2199         (MemberBase.ShortName): Turn into a property.  Use
2200         MemberCore.SetMemberName.
2201         (MemberBase.ExplicitInterfaceName): Remove.
2202         (MemberBase.UpdateMemberName): Remove.
2203         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2204         (PropertyBase.SetMemberName): New override.
2205         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2206         (Tree.GetDecl): New.
2207         (Tree.AllDecls): Rename from Decls.
2208         * attribute.cs, enum.cs, report.cs: Update to changes.
2209         * driver.cs (MainDriver): Use MemberName.FromDotted on
2210         RootContext.MainClass.
2211
2212 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2213
2214         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2215         checks.
2216
2217         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2218
2219 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2220
2221         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2222         property accessor modifiers.
2223
2224         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2225         fixed buffer attribute (CS1716).
2226         (PropertyMethod.HasCustomAccessModifier): When property accessor
2227         has custom modifier.
2228
2229         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2230         modifiers.
2231         (PropertyExpr.DoResolveLValue): Add CS0272.
2232
2233 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2234
2235         * convert.cs: When converting to a pointer, use the proper Conv.U
2236         or Conv.I depending on the source data type.
2237
2238         * cs-tokenizer.cs: Make the size for large decimal constants,
2239         fixes #72957.
2240
2241 2005-03-17  Martin Baulig  <martin@ximian.com>
2242
2243         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2244         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2245
2246 2005-03-17  Martin Baulig  <martin@ximian.com>
2247
2248         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2249         to bool so we can return an error condition.
2250         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2251         returned an error.
2252
2253 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2254
2255         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2256         attributes.
2257
2258 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2259
2260         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2261         Refactor to avoid traversing the list of assemblies, and to avoid
2262         string concatenation.
2263         * typemanager.cs (guid_attr_type): Remove.
2264         (negative_hits, pointers, references): Remove hashes.
2265         (type_hash): New.
2266         (GetConstructedType): New.  Uses type_hash to handle constructed
2267         types (arrays, references, pointers).
2268         (GetReferenceType, GetPointerType): Use it.
2269         (GetNestedType): New.  Uses type_hash to handle nested types of
2270         reflected types.
2271         (LookupType, LookupTypeDirect): Remove.
2272         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2273         'types' hash and LookupTypeReflection directly.
2274         (params_string, params_object): Use GetConstructedType.
2275         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2276         top-level types.
2277         (Namespace.Lookup): Use cached_types.
2278         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2279         provided by old TypeManager.LookupType.
2280         * rootcontext.cs (MakeFQN): Remove.
2281         * decl.cs (DeclSpace.MakeFQN): Likewise.
2282         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2283         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2284         TypeManager.GetConstructedType.
2285         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2286
2287 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2288
2289         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2290         indexers.
2291
2292         * cs-parser.jay: Reports CS1527 for any namespace element.
2293
2294         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2295         Added CS0407.
2296
2297         * expression.cs (ParameterReference.IsAssigned): Changed error to
2298         CS0269.
2299         (Error_WrongNumArguments): Moved CS0245 detection here.
2300
2301         * statement.cs (Return.Resolve): Add CS1622 report.
2302
2303 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2304
2305         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2306
2307 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2308
2309         * attribute.cs expression.cs: Get rid of some allocations.
2310
2311 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2312
2313         * doc.cs : just eliminate the latest change.
2314
2315 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2316
2317         * doc.cs : commented out the latest change. It breaks xml-030.cs
2318
2319 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2320
2321         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2322           fail. So invoke CreateType() in FindDocumentedType().
2323
2324 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2325
2326         * cs-tokenizer.cs : added IsKeyword().
2327         * doc.cs : Detect keyword incorrectly used as identifier.
2328           Allow identifiers prefixed by @.
2329
2330 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2331
2332         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2333         It caused exception in namespace resolving (again!).
2334         
2335         * class.cs (Class.ctor): Removed exit.
2336         (PropertyMethod.ctor): ditto.
2337         
2338         * codegen.cs (Codegen.Reset): Reset static data.
2339         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2340         
2341         * cs-tokenizer.cs (Cleanup): Removed.
2342         
2343         * driver.cs (GetSystemDir): Rewrote to one line command.
2344         It caused problem with unloaded dynamic modules.
2345         (UnixParseOption): Removed Exit.
2346         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2347         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2348         Now can be mcs used as library.
2349         
2350         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2351         empty location.
2352         
2353         * location.cs (Reset): Reset static data.
2354         
2355         * namespace.cs (Reset): Reset static data.
2356         
2357         * report.cs (Report.Reset): Reset static data.
2358         
2359         * rootcontext.cs (RootContext.Reset): Reset static data.
2360         
2361         * tree.cs (RootTypes.ctor): Use Location.Null
2362         
2363         * typemanager.cs (TypeManager.Reset): Reset static data.
2364         (CoreLookupType): Removed Exit.
2365         (TypeHandle.Reset): Reset static data.
2366         
2367 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2368
2369         Fix #73516.
2370         * typemanager.cs (ComputeNamespaces): Import namespaces from
2371         referenced modules too.
2372
2373 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2374
2375         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2376         than '.'.
2377
2378 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2379
2380         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2381         enclosing DeclSpace.  This ensures that a name-lookup populates
2382         more caches and there are fewer 'TypeExpression's.  Carve out
2383         nested type lookup into ...
2384         (LookupNestedTypeInHierarchy): ... this.
2385
2386 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2387
2388         Clean up a few partial-class semantics.  
2389         Fixes test-357.cs and cs1618-2.cs.
2390         * cs-parser.jay (struct_declaration): Use 'current_class' as
2391         parent of newly-created struct.  Remove call to Register ().
2392         Use 'pop_current_class' to complete handing the current struct.
2393         (interface_declaration): Likewise.
2394         (class_declaration): Likewise.
2395         (enum_declaration): Use 'current_class' as parent of newly created
2396         enum.
2397         (delegate_declaration): Likewise.
2398         (pop_current_class): New function.  This is used to handle closing
2399         up the 'current_class' and 'current_container', and pointing them
2400         to the enclosing class/container.
2401         (CSharpParser): Initialize 'current_class' too.
2402         * decl.cs (MemberCore): Add check for invariant: a partial
2403         container is not a parsed entity, and thus does not enclose any
2404         parsed members.
2405         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2406         (DeclSpace.BaseTypeExpr): Use it.
2407         (DeclSpace.LookupType): Add check for invariant.
2408         * class.cs (TypeContainer): Add check for invariant: a nested
2409         class should have the same NamespaceEntry as its enclosing class.
2410         (TypeContainer.EmitFieldInitializers): Make virtual.
2411         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2412         MemberCore.
2413         (TypeContainer.Register): Remove.
2414         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2415         null.  Use TypeResolveEmitContext for resolving base types and
2416         interfaces.  Move initialization of Parts.TypeBuilder here from
2417         ...
2418         (TypeContainer.DefineNestedTypes): ... here.
2419         (PartialContainer): Take a Namespace not a NamespaceEntry.
2420         (PartialContainer.Create): Don't use Register.  Call the
2421         appropriate Add... function directly.
2422         (ClassPart): Take both the PartialContainer and the enclosing
2423         class as constructor arguments.
2424         (ClassPart.EmitFieldInitializers): Override.
2425         (ClassPart.PartFindNestedTypes): Remove.
2426         (FieldBase.GetInitializerExpression): Resolve the initializer
2427         expression in the emit context of the enclosing class.
2428         * tree.cs (RootTypes): Remove Register ().
2429         
2430 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2431
2432         * cs-parser.jay: Removed CS0134.
2433         
2434         * driver.cs: Removed CS1901.
2435         
2436         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2437         for predefined types.
2438
2439 2005-03-07  Duncan Mak  <duncan@novell.com>
2440
2441         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2442         well. Fixes bug #73454.
2443
2444 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2445
2446         * cs-tokenizer.cs (xtoken): Add CS1035.
2447         
2448         * class.cs (MethodData.Define): Add CS0683.
2449         (FieldMember.ctor): Add CS0681.
2450
2451 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2452
2453         * ecore.cs (SimpleName.DoResolve): Rename from
2454         SimpleName.DoResolveAllowStatic.
2455         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2456         Pass 'intermediate' flag to MemberStaticCheck.
2457         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2458         of "intermediate" lookups via MemberAccess.
2459         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2460         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2461
2462 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2463
2464         Fix #73394.
2465         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2466         slipped in because of variable names that are identical to a
2467         builtin type's BCL equivalent ('string String;', 'int Int32;').
2468         (PropertyExpr.EmitInstance): Likewise.
2469
2470 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2471
2472         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2473         
2474         * report.cs (warning_ignore_table): Made public.
2475
2476 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2477
2478         Fix #73282.
2479         * class.cs (MethodData.Emit): Pass 'container' to
2480         container.GetObsoleteAttribute instead of 'container.Parent'.
2481
2482 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2483
2484         * cs-parser.jay: Add 1534 error test.
2485
2486         * iterators.cs (Yield.CheckContext): Add error 1629.
2487         (Iterator.ctor): Save unsafe modifier.
2488         (MoveNextMethod.DoEmit): Restore unsafe context.
2489
2490         * namespace.cs (UsingAlias): Better error message.
2491
2492 2005-03-03  Dan Winship  <danw@novell.com>
2493
2494         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2495         the warning message [#73219]
2496
2497 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2498
2499         Fix compile with MCS 1.0.0.0.
2500         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2501         w_restore to not depend on string constant folding.
2502
2503 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2504
2505         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2506         CS0246 check to users who passed 'silent = false'.
2507         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2508         check.
2509         (SimpleName.SimpleNameResolve): Update.
2510         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2511         (MemberAccess.IdenticalNameAndTypeName): Update.
2512         * doc.cs (FindDocumentedTypeNonArray): Update.
2513
2514 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2515
2516         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2517         * parameters.cs (ComputeAndDefineParameters): Remove.
2518         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2519         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2520         Use GetParameterInfo.
2521
2522 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2523
2524         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2525
2526 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2527
2528         Unify DeclSpace.LookupType and DeclSpace.FindType.
2529         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2530         is in charge of defining nested types on demand.
2531         (DeclSpace.LookupType): Use it when the current_type is a
2532         TypeBuilder.  Use LookupTypeDirect for reflected types.
2533         (DeclSpace.FindType): Remove.
2534         (DeclSpace.LookupInterfaceOrClass): Likewise.
2535         (DeclSpace.DefineTypeAndParents): Likewise.
2536         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2537         DeclSpace.LookupType.
2538         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2539         * typemanager.cs (LookupType): Simplify.
2540         (AddUserType): Remove type from negative_hits.
2541         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2542         * class.cs (TypeContainer.FindMembers): Move handling of nested
2543         types ...
2544         (TypeContainer.FindMembers_NestedTypes): ... here.
2545         (TypeContainer.FindNestedType): Implement override.
2546         (ClassPart.FindNestedType): Delegate to PartialContainer.
2547         (ClassPart.PartFindNestedType): Looks up the nested types of the
2548         part alone.
2549
2550 2005-03-02  Martin Baulig  <martin@ximian.com>
2551
2552         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2553         static constructor in static classes.
2554
2555 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2556
2557         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2558         sizeParamIndex is not specified.
2559
2560 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2561
2562         Fix #73117
2563         * report.cs (WarningMessage.IsEnabled): Missing null check.
2564
2565 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2566
2567         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2568         in the fields and not in the properties.
2569
2570 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2571
2572         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2573         fields as well.
2574
2575 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2576
2577         * attribute.cs: Small refactoring (improved robustness).
2578         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2579         (ValidateGuid): Removed.
2580         (Resolve): Removed referenced to above mentioned.
2581         (GetAttributeUsage): Made private and changed to work without
2582         class assistance.
2583         (GetIndexerAttributeValue): Don't crash.
2584         (GetConditionalAttributeValue): Ditto.
2585         (GetClsCompliantAttributeValue): Ditto.
2586         (ExtractSecurityPermissionSet): All attributes exceptions are
2587         error 648.
2588         (GetPropertyValue): New helper.
2589         (GetMethodImplOptions): New method.
2590         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2591         some missing properties.
2592         
2593         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2594         (Method.ApplyAttributeBuilder): Updated.
2595         
2596         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2597         exception.
2598
2599 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2600
2601         Fix #73052.
2602         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2603         non-simple types (array, pointer, reference).
2604
2605 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2606
2607         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2608
2609         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2610         for operators.
2611         (Method.CheckBase): Catch wrong destructor here.
2612         (MethodData.Define): Add errors 550, 668.
2613
2614         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2615
2616         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2617
2618         * pending.cs (VerifyPendingMethods): Add error 551.
2619
2620         * typemanager.cs (CSharpName): Next error report helper.
2621
2622 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2623
2624         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2625         attributes. Removed useless attribute double check.
2626         It saves almost 2MBs for corlib.
2627
2628 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2629
2630         Fix #72924.
2631         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2632         called twice in case of error.
2633
2634 2005-02-23  Chris Toshok  <toshok@ximian.com>
2635
2636         Fix compiler portions of #72827.
2637         * statement.cs (Block.Emit): call Begin/EndScope on the
2638         EmitContext instead of the ILGenerator.
2639
2640         * codegen.cs (EmitContext.BeginScope): new method, call
2641         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2642         we have one.)
2643         (EmitContext.BeginScope): same, but EndScope and CloseScope
2644
2645         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2646         offset and call the superclass's OpenScope(int) with it.
2647         (SymbolWriter.CloseScope): get the current il
2648         offset and call superclass's CloseScope(int) with it.
2649
2650 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2651
2652         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2653         CS1677 for out and ref as well.
2654
2655         * class.cs (Method.Define): Add error CS1599 detection.
2656         
2657         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2658         
2659         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2660         
2661         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2662         
2663         * support.cs.cs (ModifierDesc): New helper method.
2664
2665 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2666             Abin Thomas  <projectmonokochi@rediffmail.com>
2667             Anoob V E  <projectmonokochi@rediffmail.com>
2668             Harilal P R  <projectmonokochi@rediffmail.com>
2669
2670         Fix #57851, #72718.
2671         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2672         MemberLookup (used for error reporting) actually returns a result.
2673         Fix error report number (122, not 112).
2674
2675 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2676             Anoob V E  <projectmonokochi@rediffmail.com>
2677             Harilal P R  <projectmonokochi@rediffmail.com>
2678
2679         Fix #71134.
2680         * pending.cs (PendingImplementation.GetAbstractMethods):
2681         Find NonPublic members too.
2682
2683 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2684
2685         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2686         Fixed error 217.
2687         
2688         * class.cs (MethodCore.CheckMethodAgainstBase):
2689         Add error 239 report.
2690
2691 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2692
2693         Fix #68955.
2694         * expression.cs (Invocation.IsApplicable): Make public.
2695         (Invocation.IsParamsMethodApplicable): Likewise.
2696         * delegate.cs (Delegate.VerifyApplicability): Don't use
2697         Invocation.VerifyArgumentCompat for parameter applicability
2698         testing.  Use Invocation.IsApplicable and
2699         Invocation.IsParamsMethodApplicable.
2700
2701 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2702
2703         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2704         
2705         * class.cs (Operator.Define): Add error 217 report.
2706         
2707 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2708
2709         * namespace.cs (UsingEntry.Resolve): Undo change below.
2710
2711 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2712
2713         Fix #72756.
2714         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2715         disable the error message when the extended MemberLookup also
2716         fails.
2717         (Expression.MemberLookupFinal): Update.
2718         (SimpleName.DoSimpleNameResolve): Update.
2719         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2720         Don't use MemberLookupFinal.
2721         (New.DoResolve): Update.
2722         (BaseAccess.CommonResolve): Update.
2723
2724 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2725
2726         Fix #72732.
2727         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2728         occured previously, don't resolve again.
2729
2730 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2731
2732         Fix #69949
2733         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2734         argument. Call ResolveAttributeUsage for unresolved.
2735         when types doesn't match ctor arguments.
2736         
2737         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2738         for nested attribute classes.
2739         (Class.attribute_usage): Removed.
2740         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2741         for attribute class.
2742         
2743         * ecore.cs (IsAttribute): Removed.
2744         
2745         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2746         
2747         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2748         now normal types.
2749         (attribute_types): Removed.
2750         (EmitCode): Global attributes are emited as the latest.
2751
2752 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2753
2754         * class.cs (EmitFieldInitializers): Don't emit field initializer
2755         for default values when optimilization is on.
2756         
2757         * constant.cs (Constant.IsDefaultValue): New property.
2758         
2759         * driver.cs: Add /optimize handling.
2760         
2761         * constant.cs,
2762         * ecore.cs,
2763         * literal.cs: Implement new IsDefaultValue property.
2764         
2765         * rootcontext.cs (Optimize): New field, holds /optimize option.
2766
2767 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2768
2769         Fix crasher in re-opened #72347.
2770         * namespace.cs (Namespace.Lookup): Return null if
2771         DeclSpace.DefineType returns null.
2772
2773         Fix #72678.
2774         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2775
2776 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2777
2778         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2779         now returns null if it cannot resolve to an lvalue.
2780         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2781         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2782         returned null.  Remove check for SimpleName.
2783         (EventExpr.DoResolveLValue): New.
2784         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2785         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2786         error from ...
2787         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2788         avoid CS0131 error.
2789         (Unary.ResolveOperator): Move CS0211 check ...
2790         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2791         CS0131 error.
2792         (Unary.DoResolveLValue): Simplify.
2793         (AddressOf.DoResolveLValue): New.
2794         (ArrayAccess.DoResolveLValue): New.
2795
2796 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2797
2798         * attribute.cs (Attribute.Resolve): Add arguments casting for
2799         when types doesn't match ctor arguments.
2800
2801 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2802
2803         Fix parts of #63202.
2804         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2805         lookup of operator in base type.  Ensure that all checks happen
2806         when the operator resolves to an "op_..." method.
2807
2808 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2809
2810         Fix #71992.
2811         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2812         'ignore_cs0104' parameter.  Pass it to ...
2813         (NamespaceEntry.Lookup): ... this.
2814         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2815         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2816         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2817         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2818         Update.  Request that cs0104 errors be ignored.
2819         (ComposedCast.ResolveAsTypeStep): Update.
2820
2821 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2822
2823         Fix #59209.
2824         * expression.cs (Invocation.BetterFunction): Remove support for
2825         comparing virtual functions and their overrides.
2826         (Invocation.IsOverride): New.
2827         (Invocation.OverloadResolve): Don't consider 'override' functions
2828         during candidate selection.  Store them in a lookaside list.
2829         If the selected method is a 'virtual' function, use the list to
2830         find any overrides that are closer to the LHS type.
2831
2832 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2833
2834         * expression.cs (New.DoResolve): Add complex core type reduction.
2835         (New.Constantify): Converts complex core type syntax like 'new int ()'
2836         to simple constant.
2837         
2838 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2839
2840         * decl.cs (EntryType.EntryType): New constructor to create an
2841         updated copy of a cache entry.
2842         (MemberCache.AddMethods): Use it.
2843         (MemberCache.ClearDeclaredOnly): Remove.
2844         (MemberCache.MemberCache): Update.
2845
2846 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2847
2848         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2849         variable.  This one is represents the actual low-level declaration
2850         of the method, as opposed to the semantic level `IsStatic'.   
2851
2852         An anonymous method which is hosted into a static method might be
2853         actually an instance method.  IsStatic would reflect the
2854         container, while MethodIsStatic represents the actual code
2855         generated.
2856
2857         * expression.cs (ParameterReference): Use the new MethodIsStatic
2858         instead of IsStatic.
2859
2860         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2861         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2862         set on the current EmitContext. 
2863
2864         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2865         resolve our casted expression as an LValue.  This triggers the
2866         proper LValue processing that is later required by Assign.
2867
2868         This fixes 72347.
2869
2870         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2871
2872 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2873
2874         C# 2.0 Fixed buffer implementation
2875
2876         * anonymous.cs: Update after RegisterHelperClass renaming.
2877
2878         * attribute.cs (AttributeTester.fixed_buffer_cache):
2879         Cache of external fixed buffers.
2880         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2881         implementation if field is fixed buffer else null.
2882
2883         * class.cs
2884         (TypeContainer.AddField): Accept FieldMember instead of Field.
2885         (FieldBase.IsFieldClsCompliant): Extracted code from
2886         VerifyClsCompliance descendant customization.
2887         (FixedField): New class handles fixed buffer fields.
2888         (FixedFieldExternal): Keeps information about imported fixed
2889         buffer.
2890         (IFixedField): Make access to internal or external fixed buffer
2891         same.
2892
2893         * cs-parser.jay: Add fixed buffer parsing.
2894
2895         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2896         buffer.
2897
2898         * expression.cs (Indirection): Extended implementation to accept
2899         fixed buffer field.
2900         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2901         (ElementAccess.MakePointerAccess): Get type as parameter.
2902         (DoResolve): Add fixed buffer field expression conversion.
2903         (DoResolveLValue): Ditto.
2904         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2905         (ArrayPtr): Derives from FixedBufferPtr.
2906         (ArrayPtr.Emit): Add extra emit for array elements.
2907
2908         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2909
2910         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2911         for compiler generated types.
2912         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2913
2914         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2915         and consume less memory.
2916         (Fixed.Resolve): Add fixed buffer case.
2917
2918         * typemanager.cs (compiler_generated_attr_ctor,
2919         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2920         (HasElementType): Add our own implementation to work on every
2921         runtime.
2922
2923 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2924
2925         * anonymous.cs (CaptureContext): Track whether `this' has been
2926         referenced.   
2927
2928         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2929         only captured `this' if it was implicitly done (instance
2930         methods/variables were used). 
2931
2932         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2933         `this' must be captured.
2934
2935 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2936  
2937         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2938         is null it means that there has been no need to capture anything,
2939         so we just create a sibling.
2940
2941         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2942
2943         Just a partial fix.  The other half is fairly elusive.
2944         
2945 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2946
2947         Fix #52586, cs0121-4.cs.
2948         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2949         and return a hashtable.
2950         (MemberCache.ClearDeclaredOnly): New.
2951         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2952         the method_hash of a base type too.
2953         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2954         type methods.  Overwrite entries with the same MethodHandle so
2955         that the ReflectedType is correct.  The process leaves in base
2956         virtual functions and their overrides as distinct entries.
2957         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2958         matters since it was boxed in a ArrayList before.
2959         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2960         modifier.
2961         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2962         case of a virtual function and its override (choose the overload
2963         as better).
2964         (Invocation.OverloadResolve): Avoid 'override' members during
2965         'applicable_type' calculation.
2966
2967 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2968
2969         Combine two near-redundant caches.
2970         * typemanager.cs (method_params): Rename from method_internal_params.
2971         (TypeManager.GetParameterData): New.  Replace
2972         Invocation.GetParameterData.
2973         (TypeManager.LookupParametersByBuilder): Remove.
2974         * expression.cs (Invocation.method_parameter_cache): Remove.
2975         (Invocation.GetParameterData): Remove.
2976         Update to changes.
2977         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2978         Update to changes.
2979
2980 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2981
2982         Fix #72015.
2983         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2984         TypeManager.multicast_delegate_type is null, resolve it by looking
2985         up "System.MulticastDelegate".
2986         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2987
2988 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2989             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2990             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2991
2992         Fix cs0164.cs.
2993         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2994         (LabeledStatement.AddReference): New.  Set 'referenced'.
2995         (Goto.Resolve): Use it.
2996
2997 2005-02-05  John Luke  <john.luke@gmail.com>
2998
2999         * driver.cs: remove duplicate -doc line in Usage ()
3000
3001 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3002
3003         * location.cs (Location.AddFile): Fix CS2002 error report.
3004
3005 2005-02-02  Martin Baulig  <martin@ximian.com>
3006
3007         * delegate.cs (Delegate.DefineType): Report an internal error if
3008         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3009         details.        
3010
3011 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3012
3013         Fix a crasher in a variant of #31984.
3014         * const.cs (Constant.CheckBase): New override that defers the
3015         new-or-override check in case the base type hasn't been populated
3016         yet.
3017         (Constant.Define): Ensure the new-or-override check is performed.
3018
3019 2005-02-01  Duncan Mak  <duncan@ximian.com>
3020
3021         * const.cs (LookupConstantValue): Check that `ce' is not null
3022         before calling GetValue ().
3023
3024 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3025
3026         Fix test-334.cs (#69519).
3027         * cs-parser.jay (using_alias_directive): Pass in an expression to
3028         NamespaceEntry.UsingAlias.
3029         (using_namespace_directive): Pass in an expression to
3030         NamespaceEntry.Using.
3031         (namespace_name): Don't flatten to a string.
3032         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3033         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3034         ResolveAsTypeStep.
3035         (NamespaceEntry.UsingEntry): Likewise.
3036         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3037         changes.
3038         (NamespaceEntry.LookupForUsing): Remove.
3039         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3040         names.
3041         (NamespaceEntry.Lookup): Remove support for dotted names.
3042
3043 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3044
3045         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3046         split into two.
3047         (NamespaceEntry.ImplicitParent): Compute on demand.
3048         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3049         parallels the current.
3050         (NamespaceEntry.LookupForUsing): Use it.
3051         (NamespaceEntry.Lookup): If the current namespace-entry is
3052         implicit, don't search aliases and using tables.
3053
3054 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3055
3056         Fix #31984.
3057         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3058         BaseCache here.
3059         (TypeContainer.BaseCache): Compute on demand.
3060         (TypeContainer.FindMembers): Define constants and types if they're
3061         not already created.
3062         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3063         check.
3064         * const.cs (Constant.Define): Make idempotent.
3065
3066 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3067
3068         * pending.cs: Produce better code (no nops produced by using Ldarg
3069         + value).
3070         
3071         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3072         i - 1' it should be arg + 1.
3073
3074         Fixes bug #71819.
3075
3076 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3077
3078         * attribute.cs (Attribute.CheckAttributeType): Make private
3079         non-virtual.
3080         (Attribute.ResolveType): Make virtual.
3081         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3082         handling of RootContext.Tree.Types.
3083
3084 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3085
3086         Update attribute-handling to use the SimpleName/MemberAccess
3087         mechanisms.
3088         * cs-parser.jay (attribute): Pass in an expression to the
3089         constructors of Attribute and GlobalAttribute.
3090         * attribute.cs (Attribute): Take an expression for the name.
3091         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3092         passed in attribute name expression.
3093         (Attribute.CheckAttributeType): Use it.
3094         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3095         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3096         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3097         argument to prevent error messages if the lookup fails.
3098
3099 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3100
3101         * expression.cs (Indirection): Implemented IVariable interface
3102         to support indirection in AddressOf operator.
3103         (PointerArithmetic.Emit): Add optimalization for case where
3104         result can be precomputed.
3105
3106 2005-01-26  Martin Baulig  <martin@ximian.com>
3107
3108         * class.cs (TypeContainer.AttributeTargets): Return the correct
3109         AttributeTargets depending on our `Kind' instead of throwing an
3110         exception; fixes #71632.
3111
3112 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3113
3114         Fix #71257
3115         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3116         constant members.
3117
3118 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3119
3120         Fix #71602.
3121         * expression.cs (MemberAccess.DoResolve): Don't complain with
3122         cs0572 when the LHS of a member access has identical name and type
3123         name.
3124
3125 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3126
3127         Fix #71651, #71675
3128         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3129         CreatePermission.
3130         Create custom PermissionSet only for PermissionSetAttribute.
3131
3132 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3133
3134         Fix #71649
3135         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3136         delegates in static class.
3137
3138 2005-01-24  Martin Baulig  <martin@ximian.com>
3139
3140         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3141         merging an implicit block, just use its reachability.
3142
3143         * statement.cs (Block.Resolve): Make the unreachable code check
3144         work wrt. implicit blocks; see test-337 from #63842.
3145
3146 2005-01-21  Alp Toker  <alp@atoker.com>
3147  
3148         * cs-parser.jay: destructor_declaration's container is PartialContainer
3149         not Class when partial types are used, so use Kind prop instead of
3150         'is'.
3151         
3152 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3153
3154         * cs-parser.jay: Improve error reporting when an interface
3155         declares new types.
3156
3157 2005-01-20  Dick Porter  <dick@ximian.com>
3158
3159         * support.cs: SeekableStreamReader fix from Sandor Dobos
3160         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3161         chars are read.  Fixes bug 70369.
3162
3163 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3164
3165         * cs-parser.jay (catch_clause): Simplify current_block handling
3166         somewhat.
3167
3168 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3169
3170         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3171         code with ImplicitStandardConversion to handle the implicit
3172         conversion of method groups into valid delegate invocations. 
3173
3174         The problem is that in parameter handling we were using this code
3175         path.  Fixes bug #64698
3176
3177 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3178
3179         * cs-parser.jay: Fix several infelicities.
3180         - Avoid assigning to the parser value stack.  Code like 
3181           '$3 = null' is unclean.  Synthesize a value for the code block
3182           instead. 
3183         - Avoid using oob_stack for storing location information.  Use ...
3184         (_mark_): ... this.  New (empty) rule.  Saves the current location
3185         in $$.
3186         (foreach_statement): Avoid using oob_stack for current_block
3187         handling.  Use technique used in for_statement and
3188         using_statement.  Synthesize a value for the code block to store
3189         additional intermediate information.
3190
3191 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3192
3193         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3194         of a different type is only allowed to private fields of a
3195         containing type, not on fields of a base class.
3196
3197         See test-174.cs and error cs0122-9.cs
3198
3199 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3200
3201         Fix test-335.cs (bug #58126).
3202         * cs-parser.jay (argument): Split out non-expression parts of the
3203         rule into 'non_simple_argument'.
3204         (invocation_expression): Support parenthesized invocations with
3205         multiple arguments, and with single non-simple arguments.
3206
3207 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3208
3209         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3210         places.
3211
3212 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3213
3214         Fix cs0038-1.cs, cs1640-6.cs.
3215         * ecore.cs (Expression.Resolve): Remove special-case for
3216         SimpleName in error-handling.
3217         (Expression.almostMatchedMembers): Relax access permission to
3218         protected.
3219         (Expression.MemberLookupFailed): Handle duplicates in
3220         almostMatchedMembers list.
3221         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3222         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3223         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3224         overload if the passed in MemberInfo is a MethodBase.
3225
3226 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3227
3228         Fix #70749
3229         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3230         for non-CAS & merge permission sets properly.
3231
3232 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3233
3234         Improve standard-compliance of simple name and member access 
3235         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3236         * ecore.cs (FullNamedExpression): New abstract base class 
3237         for Namespaces and TypeExpressions.
3238         (ResolveFlags.SimpleName): Remove.
3239         (SimpleName): Remove support for dotted names.
3240         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3241         DeclSpace.FindType and DeclSpace.LookupType.
3242         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3243         (Expression.ExprClassName): Make member function.
3244         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3245         a namespace.  Remove creation of dotted "SimpleName"s.
3246         (MemberAccess.DoResolve): Likewise.
3247         * decl.cs (DeclSpace.Cache): Make private.
3248         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3249         (DeclSpace.FindType): Update.
3250         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3251         FullNamedExpression.
3252         * namespace.cs (Namespace): Derive from FullNamedExpression
3253         so that it can be part of expression resolution.
3254         (Namespace.Lookup): Return an FullNamedExpression.
3255         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3256         namespace.
3257         * rootcontext.cs (NamespaceLookup): Remove.
3258         (LookupType): Move to DeclSpace.
3259         * attribute.cs (CheckAttributeType): Update.
3260         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3261         (FindDocumentedTypeNonArray): Likewise.
3262
3263 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3264
3265         Fix cs0509.cs, cs1632.cs.
3266         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3267         is the same as IsInterface.
3268         (TypeContainer.GetClassBases): Likewise.
3269         * statement.cs (LabeledStatement.ig): New field.
3270         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3271         label.
3272         (LabeledStatement.DoEmit): Check that the label was created with
3273         the same ILGenerator.
3274
3275 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3276
3277         Fix #71058
3278         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3279         accessors to its properties.
3280
3281         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3282         from accessors to property.
3283         
3284 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3285
3286         Fix #70722
3287         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3288         only for overrides.
3289         
3290 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3291
3292         * attribute.cs: Check for null and empty strings.  
3293
3294         I have lost another battle to Paolo.
3295
3296 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3297
3298         Fix #70942
3299         * class.cs (PropertyMethod): Set Parent field in ctors.
3300         (SetMethod.InternalParameters): Add unsafe switch hack.
3301         Override MarkForDuplicationCheck where it is appropriate.
3302
3303         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3304         It says whether container allows members with the same name.
3305         Base default is no.
3306         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3307         Removed is_method parameter.
3308
3309 2005-01-06  Duncan Mak  <duncan@ximian.com>
3310
3311         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3312         because the previous change led to incorrect reporting of CS1032
3313         ("Cannot define/undefine preprocessor symbols after first token in
3314         file"). Instead of using `tokens_seen' as the only flag that
3315         triggers CS1040, introduce `comments_seen'. This new flag is used
3316         to signify having seen comments on the current line, so it is
3317         unset after a newline.
3318
3319 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3320
3321         * doc.cs : When searching for a type, find nested type too.
3322           This fixes bug #71040.
3323
3324 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3325
3326         * doc.cs :
3327           - Warn missing member comment on those classes which also does not
3328             have doc comments. Fixed bug #71041.
3329           - Don't warn missing doc comment on default constructor.
3330             Fixed bug #71042.
3331
3332 2005-01-06  Duncan Mak  <duncan@ximian.com>
3333
3334         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3335         comments, set `tokens_seen' to true. This allows us to detect
3336         misplaced preprocessor directives (i.e. not at the beginning of
3337         the a line, nor after whitespaces). In that case, report error
3338         CS1040. This fixes bug #56460.
3339
3340         * cs-parser.jay (interface_member_declaration): Add checks for
3341         IsExplicitImpl, and report CS0541 error if an interface member is
3342         defined as an explicit interface declaration.
3343
3344 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3345
3346         Fix #70817
3347         * class.cs (PropertyMethod): Set Parent field in ctors.
3348         (SetMethod.InternalParameters): Add unsafe switch hack.
3349         
3350         * decl.cs (MemberCore.Parent): Cannot be readonly.
3351
3352 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3353
3354         * decl.cs (DeclSpace.ResolveType): Remove.
3355         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3356         Merge in code from ...
3357         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3358         * class.cs, enum.cs: Update to changes.
3359
3360 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3361
3362         * anonymous.cs: Ensure that we init the scope of our parent if it
3363         has not been initialized yet.
3364
3365 2004-12-30  Duncan Mak  <duncan@ximian.com>
3366
3367         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3368         if field.FieldBuilder is null. Fixes #70758.
3369
3370         * convert.cs: Fixed some typos and updated some of the comments.
3371         (ImplicitStandardConversionExists):
3372         (TryImplicitIntConversion): If `target_type' is an interface and
3373         the type of `ic' implements this interface, return true or a new
3374         BoxedCast instead of null. This fixes #70468.
3375
3376 2004-12-29  Duncan Mak  <duncan@ximian.com>
3377
3378         * expression.cs (Argument.Emit): Check that Expr is
3379         IMemoryLocation before casting to it, and report CS1510 otherwise.
3380
3381         This fixes #70402.
3382
3383 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3384
3385         * statement.cs (Block.ThisVariable): remove the recursion here, to
3386         make the --profile more sane.
3387
3388 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3389
3390         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3391         assembly, by JB Evain.
3392
3393 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3394
3395         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3396           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3397         "parent" refers to enclosing type/class.  "base" refers to superclass.
3398
3399 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3400
3401         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3402         Ensure that we only have GlobalAttributes.
3403         * attribute.cs (Attribute.Emit): Make non-virtual.
3404         (GlobalAttribute.Emit): Remove.
3405         (Attribute.Resolve): Make virtual.
3406         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3407         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3408         the argument. Don't create one.
3409         (Attribute.GetObsoleteAttribute): Likewise.
3410         (Attribute.GetClsCompliantAttributeValue): Likewise.
3411         * class.cs, decl.cs: Update to changes.
3412
3413 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3414
3415         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3416         
3417         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3418         
3419         * statement.cs (Foreach.Resolve): Add error 186 report.
3420
3421 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3422
3423         * expression.cs (Conditional.DoResolve): Add warning 429.
3424         
3425         * statement.cs (If.Resolve): Add warning 665.
3426
3427 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3428
3429         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3430         except when in the parser, and in GlobalAttribute.
3431         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3432         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3433         RootContext.Tree.Types.NamespaceEntry once work is done.
3434         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3435         and resets RootContext.Tree.Types.NamespaceEntry.
3436
3437 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3438
3439         * cs-parser.jay: Don't create a block for every variable.
3440
3441 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3442
3443         * location.cs: Provide extra information.
3444
3445         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3446         variables from the captured environment, it is the ldarg_0.
3447
3448 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3449
3450         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3451         find a conclusion.
3452         
3453         * class.cs: Changed warning level for 169 to avoid developer
3454         displeasure from warning flooding. It will be changed back when they
3455         fix most of current BCL warnings.
3456         
3457         * RootContext.cs: Pushed default WarningLevel to 3.
3458         
3459         * statement.cs: Removed unused variable.
3460
3461 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3462
3463         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3464         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3465         Add error 502 report.
3466         (StaticClass.DefineType): Add error 441 report.
3467         (Class.AllowedModifiersProp): New virtual property as temporary
3468         extension to AllowedModifiers.
3469         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3470         to share implementation with StaticClass and don't call virtual
3471         methods from ctor.
3472         
3473         * driver.cs (MainDriver): Add error 1558 test.
3474
3475         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3476         report. Moved error 36 test here.
3477
3478         * statement.cs (Throw.Resolve): Add error 724 report.
3479
3480         * typemanager.cs: Add out_attribute_type core type.
3481         
3482 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3483
3484         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3485         3018 report.
3486         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3487
3488         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3489         3017 report.
3490         
3491         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3492
3493         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3494         Add error 3023 report.
3495         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3496
3497         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3498         implementation.
3499
3500 2004-12-12  John Luke  <john.luke@gmail.com>
3501
3502         * driver.cs (AddArgs): take -- into account when
3503         adding arguments, fixes bug 65710 
3504
3505 2004-12-12  Martin Baulig  <martin@ximian.com>
3506
3507         * expression.cs (Unary.TryReduceNegative): Added support for
3508         SByteConstant and ByteConstant.
3509         (Unary.Reduce): Check error values from TryReduceNegative().
3510
3511 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3512
3513         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3514         and report exception as error 182.
3515
3516 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3517
3518         * driver.cs (Main): Fix message when there are warnings.
3519
3520 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3521
3522         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3523
3524 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3525
3526         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3527         Reduced number of warnings.
3528         
3529         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3530
3531 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3532
3533         * driver.cs: Removed message.
3534
3535         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3536
3537 2004-12-08    <vargaz@freemail.hu>
3538
3539         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3540
3541 2004-12-08  Martin Baulig  <martin@ximian.com>
3542
3543         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3544         instead of a CS3002 for properties and indexer.
3545
3546 2004-12-08  Martin Baulig  <martin@ximian.com>
3547
3548         * decl.cs (MemberName.ToString): Make this work again.
3549
3550 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3551
3552         * attribute.cs (Resolve): Add error 591 detection.
3553
3554         * class.cs (FieldMember.Define): Add error 1547 detection.
3555         (Indexer.Define): Add error 620 detection.
3556         (Operator.Define): Add error 590 detection.
3557
3558         * ecore.cs: Missing argument for error 79.
3559
3560         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3561         detection.
3562
3563 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3564
3565         Fix #70106
3566         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3567         only.
3568
3569 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3570
3571         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3572           Some operator comments were suppressed.
3573         * doc.cs : Implicit/explicit operator name in doc comments are like
3574           "op_Explicit(type)~returnType", so added suffix handling.
3575
3576 2004-12-07  Martin Baulig  <martin@ximian.com>
3577
3578         * decl.cs
3579         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3580         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3581         (DeclSpace.ec): New protected field; store the EmitContext here.
3582         (DeclSpace.EmitContext): New public property; moved here from
3583         `TypeContainer'.
3584         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3585         EmitContext.
3586
3587         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3588         (Enum.Emit): Don't create a new EmitContext.
3589
3590         * delegate.cs (Delegate.DefineType): Always create the
3591         EmitContext.
3592
3593         * iterators.cs (Iterators.DefineIterator): Create a new
3594         EmitContext and store it in `ec'.
3595
3596 2004-08-24  Martin Baulig  <martin@ximian.com>
3597
3598         * typemanager.cs
3599         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3600         this for accessibility checks.
3601         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3602         IsNestedFamilyAccessible.
3603         (TypeManager.IsSubclassOf): New method, do what the name actually
3604         says.   
3605
3606 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3607
3608         Fix crash on cs0657-17.cs.
3609         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3610         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3611         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3612         the case where the NamespaceEntry gets overwritten.
3613
3614 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3615
3616         Fixed #69195, #56821
3617         * ecore.cs (ResolveBoolean): Tiny refactoring.
3618
3619         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3620         of right expression resolving when left is false constant and
3621         operator is LogicalAnd OR true constant and operator is LogicalOr.
3622
3623         * statement.cs (ResolveUnreachable): Always reports warning.
3624
3625 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3626
3627         * class.cs: Distinguish between 1721 and 1722 (just a little help
3628         for the programmer).
3629
3630 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3631
3632         * delegate.cs: Only allow this on new versions of the language. 
3633
3634 2004-12-02  Duncan Mak  <duncan@ximian.com>
3635
3636         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3637         Expression class.
3638         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3639         here as a static method. Take an additional bool out parameter
3640         `must_do_cs1540_check' for signaling to InstanceResolve.
3641         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3642         member field from PropertyExpr class and made it an argument of
3643         the method instead.
3644         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3645         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3646         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3647         and `remove_accessor' as well as InstanceResolve: report CS0122
3648         where applicable.
3649
3650         Fixes #70129.
3651
3652 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3653
3654         Fix test-327.cs, test-328.cs, and put in early infrastructure
3655         for eventually fixing #52697.
3656         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3657         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3658         from other methods.
3659         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3660         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3661         (VerifyUsing, error246): Update.
3662         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3663         'NamespaceEntry.LookupNamespaceOrType'.
3664
3665 2004-12-03  Martin Baulig  <martin@ximian.com>
3666
3667         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3668         method as our child, call AnonymousMethod.Compatible() on it.
3669
3670 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3671
3672         Disable XML documentation support in 'basic' profile.
3673         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3674         Redirect XmlElement to System.Object.
3675         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3676         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3677         * mcs.exe.sources: Add doc-bootstrap.cs.
3678         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3679         of doc.cs.
3680
3681 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3682
3683         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3684           comments are allowed.
3685
3686 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3687
3688         * delegate.cs: Add checks for subtypes in paramaters and return values
3689         in VerifyMethod () to add support for Covariance/Contravariance
3690         in delegates.
3691         
3692 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3693
3694         * report.cs: Remove extra closing parenthesis.
3695
3696         * convert.cs (Error_CannotImplicitConversion): If the name of the
3697         types are the same, provide some extra information.
3698
3699         * class.cs (FieldBase): Use an unused bit field from the field to
3700         encode the `has_offset' property from the FieldMember.  This saves
3701         a couple of Ks on bootstrap compilation.
3702
3703         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3704         method as our child, return the AnonymousMethod resolved
3705         expression.
3706
3707         * expression.cs (New.DoResolve): Allow return values from
3708         NewDelegate to also include AnonymousMethods.
3709
3710         Fixes #70150.
3711
3712 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3713
3714         Fix bug #70102
3715         * attribute.cs (Resolve): Improved implementation of params
3716         attribute arguments.
3717
3718         * support.cs (ParameterData): Add HasParams to be faster.
3719
3720 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3721
3722         all things are for /doc support:
3723
3724         * doc.cs: new file that supports XML documentation generation.
3725         * mcs.exe.sources: added doc.cs.
3726         * driver.cs:
3727           Handle /doc command line option.
3728           Report error 2006 instead of 5 for missing file name for /doc.
3729           Generate XML documentation when required, after type resolution.
3730         * cs-tokenizer.cs:
3731           Added support for picking up documentation (/// and /** ... */),
3732           including a new XmlCommentState enumeration.
3733         * cs-parser.jay:
3734           Added lines to fill Documentation element for field, constant,
3735           property, indexer, method, constructor, destructor, operator, event
3736           and class, struct, interface, delegate, enum.
3737           Added lines to warn incorrect comment.
3738         * rootcontext.cs :
3739           Added Documentation field (passed only when /doc was specified).
3740         * decl.cs:
3741           Added DocComment, DocCommentHeader, GenerateDocComment() and
3742           OnGenerateDocComment() and some supporting private members for
3743           /doc feature to MemberCore.
3744         * class.cs:
3745           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3746         * delegate.cs:
3747           Added overriden DocCommentHeader.
3748         * enum.cs:
3749           Added overriden DocCommentHeader and GenerateDocComment().
3750
3751 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3752
3753         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3754         unwrapping the enumeration values, chain to
3755         DoConstantNumericPromotions again, so we can promote things to the
3756         fundamental types (takes care of enums that are bytes, sbytes).
3757
3758         Fixes bug #62054.
3759
3760 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3761
3762         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3763         Fix long-standing bug in type-lookup.  Use FindType instead of
3764         LookupType when ec.ResolvingTypeTree.
3765         (Attribute.ResolveType, Attribute.Resolve)
3766         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3767         Update to changes.
3768         (Attributes.Search): Remove internal version.  Update.
3769         (Attributes.SearchMulti): Update.
3770         (Attributes.GetClsCompliantAttribute): Remove.
3771         (Attributes.GetIndexerNameAttribute): Remove.
3772         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3773         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3774         * class.cs (Indexer.Define): Likewise.
3775
3776 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3777
3778         Fix bug #68790
3779         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3780         MarshallByReference members access.
3781
3782         * expression.cs: Use CheckMarshallByRefAccess;
3783         Better error CS0197 message.
3784
3785         * report.cs: Print whole related error message.
3786
3787 2004-11-30  Raja R Harinath  <rharinath@novell.com>
3788
3789         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
3790         the current directory to help debugging.
3791
3792 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3793
3794         * class (GetClassBases): Better error 60 report.
3795         (EventProperty): Disabled warning 67 detection.
3796
3797 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3798
3799         Fix bug #60324
3800         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3801
3802         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3803         precise values.
3804
3805 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3806
3807         Fix bug #49488
3808         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3809
3810         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3811
3812 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3813
3814         * attribute.cs (Attribute.Resolve): Refine error reporting and
3815         report a cs0117 if the identifier does not exist, to distinguish
3816         from 0617 which is a miss-use of the actual identifier.
3817
3818         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3819         between cs0070 and cs0079.
3820
3821         * class.cs (MemberBase.DoDefine): When reporting a wrong
3822         accessibility level, we use MethodCore to compare instead of
3823         Method (this was a regression in some refactoring effort).
3824
3825         So now we correctly report cs0056 again.
3826
3827         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3828         testing the target_type (which was known to be object_type) and
3829         not the source type (which is anonymous_method).
3830
3831         Fixed reporting of error cs1660.
3832
3833         * expression.cs (UserCast.Source): Expose the underlying cast.
3834
3835         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3836         allowed types to find a match to int32 first (most common).
3837
3838         In addition, it ignores any ImplicitUserConversions that did an
3839         internal implicit conversion (as the switch statement allows only
3840         one integral conversion to exist).
3841
3842         * class.cs (PartialContainer.Create): rename `name' to
3843         `member_name' for clarity.  Then replace the string calls with a
3844         call to MemberName.GetPartialName, as now using
3845         MemberName.ToString is an error (this is due to the side effects
3846         it had, that were fixed in the past).
3847
3848         This will restore the error reporting on a number of partial class
3849         errors that were missusing this (and getting an exception as a
3850         results, which is now just a plain textual warning, because
3851         yyparse debug output would crash otherwise).
3852
3853 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3854
3855         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3856
3857 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3858
3859         * rootcontext.cs (LookupType): Make sure to cache lookups that
3860         don't give us a negative result. This saves about 5% of corlib
3861         compilation time.
3862
3863 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3864
3865         * report.cs (AbstractMessage.Print): messages are sent to stderr
3866
3867         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3868         non-interface in the list of interfaces (at this point, either
3869         parent was properly set, or a base class is being listed in the
3870         interfaces section).
3871
3872         This flags error 1722, and resolves the crash from bug 69259.
3873
3874 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3875
3876         * statement.cs (Using.EmitExpressionFinally): make this work right
3877         for valuetypes. Fixes 69926.
3878
3879 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3880
3881         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3882         converted to an enum" here, before we try to change the underlying
3883         type.  This code exists, but it is a different code path than the
3884         one used while encoding constants.
3885
3886         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3887         old bug: when converting from the null literal to a pointer,
3888         return an EmptyCast, not the NullLiteral.
3889
3890         This fixes #69921, the recent null_type changes probably made this
3891         bug more prominent.
3892
3893         (ImplicitReferenceConversionExists): In addition, resynchronized
3894         the code here, so it matches the same code in
3895         ImplicitReferenceConversionExists for the `from any class-type S
3896         to any interface-type T'.
3897         
3898
3899 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3900
3901         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3902
3903 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3904
3905         * cs-parser.jay: Use verbosity accordingly. 
3906
3907 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3908
3909         * expression.cs (Unary.ResolveOperator): Do not report warning;
3910         AddressOf reads from variable.
3911         
3912         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3913
3914 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3915
3916         Fix bug #69462
3917
3918         * attribute.cs (Attributable): Removed CheckTargets.
3919         (Attributes.Emit): Explicit attribute targets are tested here.
3920
3921         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3922         not enabled for interfaces.
3923
3924         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3925         (GetAssemblyName): Ouch next bug there.
3926
3927 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3928
3929         * expression.cs: Error 275 added.
3930         
3931 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3932
3933         Fix bug #69177 (Implemented decimal constant support)
3934
3935         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3936         (BinaryFold): Add DecimalConstant.
3937
3938         * const.cs (Define): Decimal constant 
3939         (is not constant.
3940         (ChangeType): Add decimal type handling.
3941         (LookupConstantValue): Don't set value for decimal type but
3942         emit DecimalConstantAttribute. Needed for constant optimization.
3943
3944         * constant.cs (ToDecimal): New method.
3945         (ConvertToDecimal): New method.
3946         (IntConstant): Implemented ConvertToDecimal.
3947         (DecimalConstant.Emit): Emit optimized version for decimals in
3948         int range.
3949
3950         * expression.cs (ResolveOperator): Changed order of constant
3951         reduction to work correctly with native types which have
3952         overloaded operators.
3953         (ResolveMemberAccess): Extract constant value from attribute
3954         for decimal type.
3955
3956         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3957
3958         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3959         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3960         (ChangeType): Decimal is special.
3961         (TypeToCoreType): Add decimal type.
3962
3963 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3964
3965         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3966         decimal types.
3967
3968 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3969
3970         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3971         test cs1667-5.cs.
3972
3973 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3974
3975         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3976
3977         * pending.cs (PendingImplementation): Grab only interfaces.
3978
3979 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3980
3981         * statement.cs (ForeachHelperMethods): Add location member and
3982         error 202 detection.
3983
3984 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3985
3986         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
3987         automatically handled by executable.make.
3988         (PROGRAM): Make profile-specific.
3989
3990 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3991
3992         * expression.cs (DoResolveBase): Fixed wrong warning for out
3993         variables.
3994
3995 2004-11-18  Martin Baulig  <martin@ximian.com>
3996
3997         Merged latest changes into gmcs.  Please keep this comment in
3998         here, it makes it easier for me to see what changed in MCS since
3999         the last time I merged.
4000
4001 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4002
4003         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4004         (TypeHandle.GetMemberCache): New.
4005         (TypeHandle.TypeHandle): Update.
4006         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4007         (TypeManager.LookupParentInterfacesCache):
4008         Rename from LookupInterfaceCache.  Optimize slightly.
4009         (TypeManager.MemberLookup_FindMembers): Update.
4010         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4011         multi-type variant.
4012         (AddCacheContents): Rename from AddHashtable.
4013         * class.cs (TypeContainer.parent_container): Remove.
4014         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4015         (TypeContainer.DoDefineMembers): Don't initialize it.
4016         Update to name changes.
4017         
4018 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4019
4020         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4021         that factors the code to check access modifiers on override.  
4022
4023         (PropertyBase): Use the code here.
4024
4025         Patch from Lluis S'anchez, fixes bug #69361.
4026
4027 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4028
4029         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4030         routine that is used to report the use of a captured variable
4031         whose address has been taken.
4032
4033         There are two checks: one when variables are being captured and
4034         the other check is when the address of a variable is taken. 
4035         
4036         (because an anonymous methods might be resolved before *or* after
4037         the address has been taken) and 
4038
4039         * expression.cs (Conditional.DoResolve): Remove the special
4040         casing that Martin added to trueExpr and falseExpr being both
4041         NullLiteral.  We get the right behavior now just by introducing
4042         the null_type into the compiler. 
4043
4044         * convert.cs (ExplicitConversion): Change the code to use
4045         null_type instead of testing `expr is NullLiteral'.
4046         (ImplicitConversionStandard): use null_type too.
4047         (ImplicitReferenceConversionExists): use null_type too.
4048         (ImplicitReferenceConversion): use null_type too.
4049
4050         * literal.cs: The type of `NullLiteral' is now null_type instead
4051         of object_type. 
4052         (Resolve): Set the type here.
4053
4054         * typemanager.cs: Introduce null_type.
4055
4056 2004-11-17  Martin Baulig  <martin@ximian.com>
4057
4058         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4059         direction, like FindMembers() does.  Fixes #69546, testcase is in
4060         test-315.cs.    
4061
4062 2004-11-16  Martin Baulig  <martin@ximian.com>
4063
4064         This is based on a patch from Marek Safar, see bug #69082.
4065         Fixes bugs #63705 and #67130.
4066
4067         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4068         method; create a MemberCache for an interface type and cache the
4069         result.
4070
4071         * decl.cs (IMemberContainer.ParentContainer): Removed.
4072         (IMemberContainer.ParentCache): New property.
4073         (MemberCache.SetupCacheForInterface): Removed.
4074         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4075         to create a cache for an interface's "parent".
4076
4077         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4078         interfaces too.
4079
4080 2004-11-16  Martin Baulig  <martin@ximian.com>
4081
4082         Merged back from gmcs; these changes already went into gmcs a
4083         couple of weeks ago.
4084
4085         * typemanager.cs
4086         (TypeManager.AddUserType): Removed the `ifaces' argument.
4087         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4088         `TypeExpr []'.
4089         (TypeManager.AddUserInterface): Removed.
4090         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4091         `TypeExpr []'.
4092         (TypeManager.GetInterfaces): Likewise.
4093         (TypeManager.GetExplicitInterfaces): Likewise.
4094
4095         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4096
4097         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4098         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4099
4100 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4101
4102         * statement.cs: Avoid adding bools to a hashtable.
4103
4104 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4105
4106         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4107         calling an unsafe method from a safe location.
4108
4109 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4110
4111         Fix #69167
4112         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4113
4114 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4115
4116         * namespace.cs (VerifyUsing): use GetPartialName instead of
4117         ToString. 
4118
4119 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4120
4121         * statement.cs (Return.Resolve): Fix regression in typo: if
4122         `in_exc', we have to request a NeedReturnLabel, this was a typo
4123         introduced in the anonymous method check-in.  Fixes #69131.
4124
4125         * Indexers were using the ShortName when defining themselves,
4126         causing a regression in the compiler bootstrap when applying the
4127         patch from 2004-11-02 (first part), now they use their full name
4128         and the bug is gone.
4129
4130 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4131
4132         * driver.cs: Strip the path from the names of embedded resources. Fixes
4133         #68519.
4134
4135 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4136
4137         Fix error message regression: cs0104-2.cs.
4138         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4139         (AliasEntry.Resolve): Update.
4140         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4141         'silent' flag.
4142         (RootContext.LookupType): Update.
4143
4144 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4145
4146         * cs-parser.jay: Add support for handling accessor modifiers
4147         * class: Add support port accessor modifiers and error checking,
4148         define PropertyMethod.Define as virtual (not abstract anymore)
4149         * ecore.cs: Add checking for proeprties access with access modifiers
4150         * iterators.cs: Modify Accessor constructor call based in the modified
4151         constructor
4152 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4153
4154         * expression.cs (StringConcat): Handle being called twice,
4155         as when we have a concat in a field init with more than two
4156         ctors in the class
4157
4158 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4159
4160         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4161         special case explicit implementations, we should always produce
4162         the .property or .event declaration.
4163         
4164         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4165         since it will not return correct data if people use this
4166         unresolved in the presence of using statements (see test-313).
4167
4168         * class.cs (MethodData.Define): If we are an explicit interface
4169         implementation, set the method name to the full name of the
4170         interface plus the name of the method.  
4171
4172         Notice that using the method.MethodName.GetFullName() does not
4173         work, as it will only contain the name as declared on the source
4174         file (it can be a shorthand in the presence of using statements)
4175         and not the fully qualifed type name, for example:
4176
4177         using System;
4178
4179         class D : ICloneable {
4180                 object ICloneable.Clone ()  {
4181                 }
4182         }
4183
4184         Would produce a method called `ICloneable.Clone' instead of
4185         `System.ICloneable.Clone'.
4186
4187         * namespace.cs (Alias.Resolve): Use GetPartialName.
4188         
4189 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4190
4191         * cs-parser.jay: Add error 1055 report.
4192
4193 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4194
4195         * assign.cs (Assign.DoResolve): Only do the transform of
4196         assignment into a New if the types are compatible, if not, fall
4197         through and let the implicit code deal with the errors and with
4198         the necessary conversions. 
4199
4200 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4201
4202         * cs-parser.jay: Add error 1031 report.
4203
4204         * cs-tokenizer.cs: Add location for error 1038.
4205
4206 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4207
4208         * cs-parser.jay: Add error 1016 report.
4209
4210 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4211
4212         * cs-parser.jay: Add errors 1575,1611 report.
4213
4214 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4215
4216         * cs-parser.jay: Add error 1001 report.
4217
4218 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4219
4220         Fix #68850
4221         * attribute.cs (GetMarshal): Add method argument for
4222         caller identification.
4223
4224         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4225         agument for GetMarshal and RuntimeMissingSupport.
4226
4227 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4228
4229         * attribute.cs (ExtractSecurityPermissionSet): Removed
4230         TypeManager.code_access_permission_type.
4231
4232         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4233
4234 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4235
4236         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4237         for obsolete use of a variable here.   Fixes regression on errors
4238         cs0619-25 and cs0619-26.
4239
4240 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4241
4242         Fix #62358, implemented security attribute encoding.
4243
4244         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4245         Tests permitted SecurityAction for assembly or other types.
4246         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4247         data from SecurityPermissionAttribute to PermisionSet class.
4248
4249         * class.cs (ApplyAttributeBuilder): Added special handling
4250         for System.Security.Permissions.SecurityAttribute based types.
4251
4252         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4253         special handling for System.Security.Permissions.SecurityAttribute
4254         based types.
4255
4256         * enum.cs (ApplyAttributeBuilder): Added special handling
4257         for System.Security.Permissions.SecurityAttribute based types.
4258
4259         * parameter.cs (ApplyAttributeBuilder): Added special handling
4260         for System.Security.Permissions.SecurityAttribute based types.
4261
4262         * rootcontext.cs: Next 2 core types.
4263
4264         * typemanager.cs (TypeManager.security_permission_attr_type):
4265         Built in type for the SecurityPermission Attribute.
4266         (code_access_permission_type): Build in type.
4267
4268 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4269
4270         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4271         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4272         all of this information into
4273         EmitContext.EmitCapturedVariableInstance.
4274         
4275         * codegen.cs (EmitCapturedVariableInstance): move here the
4276         funcionality of emitting an ldarg.0 in the presence of a
4277         remapping.   This centralizes the instance emit code.
4278
4279         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4280         then emit a load of this: it means that we have reached the
4281         topmost ScopeInfo: the one that contains the pointer to the
4282         instance of the class hosting the anonymous method.
4283
4284         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4285         captures to the topmost CaptureContext.
4286
4287 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4288
4289         * expression.cs (LocalVariableReference): Move the knowledge about
4290         the iterators into codegen's EmitCapturedVariableInstance.
4291
4292 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4293
4294         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4295         all code paths return a value from an anonymous method (it is the
4296         same as the 161 error, but for anonymous methods).
4297
4298 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4299
4300         The introduction of anonymous methods in the compiler changed
4301         various ways of doing things in the compiler.  The most
4302         significant one is the hard split between the resolution phase
4303         and the emission phases of the compiler.
4304
4305         For instance, routines that referenced local variables no
4306         longer can safely create temporary variables during the
4307         resolution phase: they must do so from the emission phase,
4308         since the variable might have been "captured", hence access to
4309         it can not be done with the local-variable operations from the runtime.
4310         
4311         * statement.cs 
4312
4313         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4314         is a toplevel block.
4315
4316         (ToplevelBlock): A new kind of Block, these are the blocks that
4317         are created by the parser for all toplevel method bodies.  These
4318         include methods, accessors and anonymous methods.
4319
4320         These contain some extra information not found in regular blocks:
4321         A pointer to an optional CaptureContext (for tracking captured
4322         local variables and parameters).  A pointer to the parent
4323         ToplevelBlock.
4324         
4325         (Return.Resolve): Catch missmatches when returning a value from an
4326         anonymous method (error 1662).
4327         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4328         phase.
4329
4330         (Break.Resolve): ditto.
4331
4332         (SwitchLabel): instead of defining the labels during the
4333         resolution phase, we now turned the public ILLabel and ILLabelCode
4334         labels into methods called GetILLabelCode() and GetILLabel() that
4335         only define the label during the Emit phase.
4336
4337         (GotoCase): Track the SwitchLabel instead of the computed label
4338         (its contained therein).  Emit the code by using
4339         SwitchLabel.GetILLabelCode ().
4340
4341         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4342         whether the Local has been captured or not.
4343
4344         (LocalInfo.IsCaptured): New property, used to tell whether the
4345         local has been captured.
4346         
4347         * anonymous.cs: Vastly updated to contain the anonymous method
4348         support.
4349
4350         The main classes here are: CaptureContext which tracks any
4351         captured information for a toplevel block and ScopeInfo used to
4352         track the activation frames for various local variables.   
4353
4354         Each toplevel block has an optional capture context associated
4355         with it.  When a method contains an anonymous method both the
4356         toplevel method and the anonymous method will create a capture
4357         context.   When variables or parameters are captured, they are
4358         recorded on the CaptureContext that owns them, for example:
4359
4360         void Demo () {
4361              int a;
4362              MyDelegate d = delegate {
4363                  a = 1;
4364              }
4365         }
4366
4367         Here `a' will be recorded as captured on the toplevel
4368         CapturedContext, the inner captured context will not have anything
4369         (it will only have data if local variables or parameters from it
4370         are captured in a nested anonymous method.
4371
4372         The ScopeInfo is used to track the activation frames for local
4373         variables, for example:
4374
4375         for (int i = 0; i < 10; i++)
4376                 for (int j = 0; j < 10; j++){
4377                    MyDelegate d = delegate {
4378                         call (i, j);
4379                    }
4380                 }
4381
4382         At runtime this captures a single captured variable `i', but it
4383         captures 10 different versions of the variable `j'.  The variable
4384         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4385         recorded on a child.  
4386
4387         The toplevel ScopeInfo will also track information like the `this'
4388         pointer if instance variables were referenced (this is necessary
4389         as the anonymous method lives inside a nested class in the host
4390         type of the method). 
4391
4392         (AnonymousMethod): Expanded to track the Toplevel, implement
4393         `AnonymousMethod.Compatible' to tell whether an anonymous method
4394         can be converted to a target delegate type. 
4395
4396         The routine now also produces the anonymous method content
4397
4398         (AnonymousDelegate): A helper class that derives from
4399         DelegateCreation, this is used to generate the code necessary to
4400         produce the delegate for the anonymous method that was created. 
4401
4402         * assign.cs: API adjustments for new changes in
4403         Convert.ImplicitStandardConversionExists.
4404
4405         * class.cs: Adjustments to cope with the fact that now toplevel
4406         blocks are of type `ToplevelBlock'. 
4407
4408         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4409         insteda of standard blocks.
4410
4411         Flag errors if params arguments are passed to anonymous methods.
4412
4413         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4414         `CurrentAnonymousMethod' which points to the current Anonymous
4415         Method.  The variable points to the AnonymousMethod class that
4416         holds the code being compiled.  It is set in the new EmitContext
4417         created for the anonymous method.
4418
4419         (EmitContext.Phase): Introduce a variable and an enumeration to
4420         assist in enforcing some rules about when and where we are allowed
4421         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4422         only one that enfonces this right now).
4423
4424         (EmitContext.HaveCaptureInfo): new helper method that returns
4425         whether we have a CapturedContext initialized.
4426
4427         (EmitContext.CaptureVariable): New method used to register that a
4428         LocalInfo must be flagged for capturing. 
4429
4430         (EmitContext.CapturedParameter): New method used to register that a
4431         parameters must be flagged for capturing. 
4432         
4433         (EmitContext.CapturedField): New method used to register that a
4434         field must be flagged for capturing. 
4435
4436         (EmitContext.HaveCapturedVariables,
4437         EmitContext.HaveCapturedFields): Return whether there are captured
4438         variables or fields. 
4439
4440         (EmitContext.EmitMethodHostInstance): This is used to emit the
4441         instance for the anonymous method.  The instance might be null
4442         (static methods), this (for anonymous methods that capture nothing
4443         and happen to live side-by-side with the current method body) or a
4444         more complicated expression if the method has a CaptureContext.
4445
4446         (EmitContext.EmitTopBlock): Routine that drives the emission of
4447         code: it will first resolve the top block, then emit any metadata
4448         and then emit the code.  The split is done so that we can extract
4449         any anonymous methods and flag any captured variables/parameters.
4450         
4451         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4452         during this phase, the ILGenerator should not be used as labels
4453         and local variables declared here might not be accessible to any
4454         code that is part of an anonymous method.  
4455
4456         Exceptions to this include the temporary variables that are
4457         created by some statements internally for holding temporary
4458         variables. 
4459         
4460         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4461         metadata for a cb
4462
4463         (EmitContext.TemporaryReturn): This method is typically called
4464         from the Emit phase, and its the only place where we allow the
4465         ReturnLabel to be defined other than the EmitMeta.  The reason is
4466         that otherwise we would have to duplicate a lot of logic in the
4467         Resolve phases of various methods that today is on the Emit
4468         phase. 
4469
4470         (EmitContext.NeedReturnLabel): This no longer creates the label,
4471         as the ILGenerator is not valid during the resolve phase.
4472
4473         (EmitContext.EmitThis): Extended the knowledge in this class to
4474         work in anonymous methods in addition to iterators. 
4475
4476         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4477         code is necessary on the stack to access the instance to a local
4478         variable (the variable will be accessed as a field).
4479
4480         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4481         EmitContext.EmitAddressOfParameter): Routines to support
4482         parameters (not completed at this point). 
4483         
4484         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4485         will also remove the parameters.
4486
4487         * convert.cs (Convert): Define a `ConstantEC' which points to a
4488         null.  This is just to prefity some code that uses
4489         ImplicitStandardConversion code and do not have an EmitContext
4490         handy.
4491
4492         The idea is to flag explicitly that at that point in time, it is
4493         known that the conversion will not trigger the delegate checking
4494         code in implicit conversions (which requires a valid
4495         EmitContext). 
4496
4497         Everywhere: pass new EmitContext parameter since
4498         ImplicitStandardConversionExists now requires it to check for
4499         anonymous method conversions. 
4500
4501         (Convert.ImplicitStandardConversionExists): If the type of an
4502         expression is the anonymous_method_type, and the type is a
4503         delegate, we invoke the AnonymousMethod.Compatible method to check
4504         whether an implicit conversion is possible. 
4505
4506         (Convert.ImplicitConversionStandard): Only do implicit method
4507         group conversions if the language level is not ISO_1.
4508
4509         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4510         MethodInfo for the Invoke method.  used by Delegate and
4511         AnonymousDelegate.
4512
4513         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4514         method conversions if the target type is a delegate.
4515
4516         Removed extra debugging nops.
4517
4518         (LocalVariableReference): Turn the `local_info' into a public
4519         field. 
4520
4521         Add `prepared' field, the same hack used for FieldExprs to cope
4522         with composed assignments, as Local variables do not necessarily
4523         operate purely on the stack as they used to: they can be captured
4524         fields. 
4525
4526         Add `temp' for a temporary result, like fields.
4527
4528         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4529
4530         It now copes with Local variables that are captured and emits the
4531         proper instance variable to load it from a field in the captured
4532         case. 
4533
4534         (ParameterReference.DoResolveBase): During the resolve phase,
4535         capture parameters if we are in an anonymous method.
4536
4537         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4538         anonymous method, use the EmitContext helper routines to emit the
4539         parameter reference.
4540
4541         * iterators.cs: Set RemapToProxy to true/false during the
4542         EmitDispose class.
4543
4544         * parameters.cs (GetParameterByName): New helper method. 
4545
4546         * typemanager.cs (anonymous_method_type) a new type that
4547         represents an anonyous method.  This is always an internal type,
4548         used as a fencepost to test against the anonymous-methodness of an
4549         expression. 
4550         
4551 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4552
4553         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4554         561 report.
4555         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4556
4557 2004-10-18  Martin Baulig  <martin@ximian.com>
4558
4559         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4560         `Type' directly, but call ResolveType() on it.
4561         (Catch.Resolve): Likewise.
4562         (Foreach.Resolve): Likewise.
4563
4564 2004-10-18  Martin Baulig  <martin@ximian.com>
4565
4566         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4567         `Type' directly, but call ResolveType() on it.
4568         (Probe.DoResolve): Likewise.
4569         (ArrayCreation.LookupType): Likewise.
4570         (TypeOf.DoResolve): Likewise.
4571         (SizeOf.DoResolve): Likewise.
4572
4573 2004-10-18  Martin Baulig  <martin@ximian.com>
4574
4575         * expression.cs (Invocation.BetterFunction): Put back
4576         TypeManager.TypeToCoreType().
4577
4578 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4579
4580         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4581         the ResolveType.
4582
4583 2004-10-18  Martin Baulig  <martin@ximian.com>
4584
4585         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4586         `Type' directly, but call ResolveType() on it.
4587
4588 2004-10-18  Martin Baulig  <martin@ximian.com>
4589
4590         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4591         `Type' directly, but call ResolveType() on it.
4592         (MemberBase.DoDefine): Likewise.
4593
4594         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4595         `Type' directly, but call ResolveType() on it.
4596         (ComposedCast.DoResolveAsTypeStep): Likewise.
4597
4598         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4599         `Type' directly, but call ResolveType() on it.
4600
4601 2004-10-17  John Luke  <john.luke@gmail.com>
4602
4603         * class.cs (Operator.GetSignatureForError): use CSharpName
4604
4605         * parameter.cs (Parameter.GetSignatureForError): Returns
4606         correct name even if was not defined.
4607
4608 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4609
4610         Fix #65816.
4611         * class.cs (TypeContainer.EmitContext): New property.
4612         (DefineNestedTypes): Create an emitcontext for each part.
4613         (MethodCore.DoDefineParameters): Use container's emitcontext.
4614         Pass type array to InternalParameters.
4615         (MemberBase.DoDefine): Use container's emitcontext.
4616         (FieldMember.Define): Likewise.
4617         (Event.Define): Likewise.
4618         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4619         Pass type array to InternalParameters.
4620         (SetIndexerMethod.GetParameterInfo): Likewise.
4621         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4622         * delegate.cs (Define): Pass emitcontext to
4623         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4624         array to InternalParameters.
4625         * expression.cs (ParameterReference.DoResolveBase): Pass
4626         emitcontext to GetParameterInfo.
4627         (ComposedCast.DoResolveAsTypeStep): Remove check on
4628         ec.ResolvingTypeTree.
4629         * parameter.cs (Parameter.Resolve): Change argument to
4630         EmitContext.  Use ResolveAsTypeTerminal.
4631         (Parameter.GetSignature): Change argument to EmitContext.
4632         (Parameters.ComputeSignature): Likewise.
4633         (Parameters.ComputeParameterTypes): Likewise.
4634         (Parameters.GetParameterInfo): Likewise.
4635         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4636         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4637         * support.cs (InternalParameters..ctor): Remove variant that takes
4638         a DeclSpace.
4639         * typemanager.cs (system_intptr_expr): New.
4640         (InitExpressionTypes): Initialize it.
4641
4642 2004-10-12  Chris Toshok  <toshok@ximian.com>
4643
4644         * cs-parser.jay: fix location for try_statement and catch_clause.
4645
4646 2004-10-11  Martin Baulig  <martin@ximian.com>
4647
4648         * report.cs: Don't make --fatal abort on warnings, we have
4649         -warnaserror for that.
4650
4651 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4652
4653         More DeclSpace.ResolveType avoidance.
4654         * decl.cs (MemberCore.InUnsafe): New property.
4655         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4656         with newly created EmitContext.
4657         (FieldMember.Define): Likewise.
4658         * delegate.cs (Delegate.Define): Likewise.
4659         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4660         only if normal name-lookup fails.
4661         (TypeExpr.DoResolve): Enable error-checking.
4662         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4663         (SizeOf.DoResolve): Likewise.
4664         (ComposedCast.DoResolveAsTypeStep): Likewise.
4665         (StackAlloc.DoResolve): Likewise.
4666         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4667         (Block.Unsafe): New property.
4668         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4669         (Unsafe): Set 'unsafe' flag of contained block.
4670         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4671         (Fixed.Resolve): Likewise.
4672         (Catch.Resolve): Likewise.
4673         (Using.ResolveLocalVariableDecls): Likewise.
4674         (Foreach.Resolve): Likewise.
4675
4676 2004-10-05  John Luke <john.luke@gmail.com>
4677
4678         * cs-parser.jay: add location to error CS0175
4679
4680 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4681
4682         * ecore.cs (Expression.Constantity): Add support for turning null
4683         into a constant.
4684
4685         * const.cs (Const.Define): Allow constants to be reference types
4686         as long as the value is Null.
4687
4688 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4689
4690         * namespace.cs (NamespaceEntry.Using): No matter which warning
4691         level is set, check if this namespace name has already been added.
4692
4693 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4694
4695         * expression.cs: reftype [!=]= null should always use br[true,false].
4696         # 67410
4697
4698 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4699
4700         Fix #67108
4701         * attribute.cs: Enum conversion moved to 
4702         GetAttributeArgumentExpression to be applied to the all
4703         expressions.
4704
4705 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4706
4707         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4708         * class.c (TypeContainer.DefineType): Flag error if
4709         base types aren't accessible due to access permissions.
4710         * decl.cs (DeclSpace.ResolveType): Move logic to
4711         Expression.ResolveAsTypeTerminal.
4712         (DeclSpace.ResolveTypeExpr): Thin layer over
4713         Expression.ResolveAsTypeTerminal.
4714         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4715         Refactor code into NestedAccess.  Use it.
4716         (DeclSpace.NestedAccess): New.
4717         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4718         argument to silence errors.  Check access permissions.
4719         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4720         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4721         (Cast.DoResolve): Likewise.
4722         (New.DoResolve): Likewise.
4723         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4724         (TypeOf.DoResolve): Likewise.
4725
4726         * expression.cs (Invocation.BetterConversion): Return the Type of
4727         the better conversion.  Implement section 14.4.2.3 more faithfully.
4728         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4729         section 14.4.2.2 explicit.
4730         (Invocation.OverloadResolve): Update.
4731         (Invocation): Remove is_base field.
4732         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4733         (Invocation.Emit): Likewise.
4734
4735 2004-09-27  Raja R Harinath  <rharinath@novell.com>
4736
4737         * README: Update to changes.
4738
4739 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4740
4741         * cs-parser.jay: Reverted 642 warning fix.
4742
4743 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4744
4745         Fix bug #66615
4746         * decl.cs (FindMemberWithSameName): Indexer can have more than
4747         1 argument.
4748
4749 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4750
4751         * expression.cs (LocalVariableReference.DoResolveLValue):
4752         Do not report warning 219 for out values.
4753         (EmptyExpression.Null): New member to avoid extra allocations.
4754
4755 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4756
4757         * cs-parser.jay: Fix wrong warning 642 report.
4758
4759         * cs-tokenizer.cs (CheckNextToken): New helper;
4760         Inspect next character if is same as expected.
4761
4762 2004-09-23  Martin Baulig  <martin@ximian.com>
4763
4764         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4765         (Convert.ImplicitReferenceConversionExists): Likewise.
4766
4767 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4768
4769         * class.cs (Operator.Define): Add error 448 and 559 report.
4770
4771 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4772
4773         * class.cs (MemberBase.IsTypePermitted): New protected
4774         method for checking error CS0610.
4775
4776 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4777
4778         * class.cs (TypeContainer.HasExplicitLayout): New property
4779         Returns whether container has StructLayout attribute set Explicit.
4780         (FieldMember): New abstract class for consts and fields.
4781         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4782         (Field): Reuse FieldMember.
4783
4784         * const.cs (Const): Reuse FieldMember.
4785
4786         * rootcontext.cs: EmitConstants call moved to class.
4787
4788 2004-09-22  Martin Baulig  <martin@ximian.com>
4789
4790         Thanks to Peter Sestoft for this bug report.
4791
4792         * expression.cs (Conditional): If both the `trueExpr' and the
4793         `falseExpr' is a NullLiteral, return a NullLiteral.
4794
4795 2004-09-22  Martin Baulig  <martin@ximian.com>
4796
4797         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4798         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4799         for the "get_Current" call.
4800
4801 2004-09-22  Martin Baulig  <martin@ximian.com>
4802
4803         Marek and me just fixed one of our oldest bugs: #28562 :-)
4804
4805         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4806
4807         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4808         we're an EnumConstant, just return that.
4809         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4810         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4811         to get the value which'll actually be written into the attribute.
4812         However, we have to use GetValue() to access the attribute's value
4813         in the compiler.        
4814
4815 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4816
4817         * constant.cs (Constant.IsNegative): New abstract property
4818         IsNegative.
4819
4820         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4821         (StackAlloc.DoResolve): Reused IsNegative.
4822
4823 2004-09-21  Martin Baulig  <martin@ximian.com>
4824
4825         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
4826         if we're used in an iterator, we may be called from different
4827         methods.
4828
4829         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
4830         we actually have an exception block.
4831
4832 2004-09-20  John Luke <jluke@cfl.rr.com>
4833
4834         * class.cs, cs-parser.jay: Improve the error report for 1520:
4835         report the actual line where the error happens, not where the
4836         class was declared.
4837
4838         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
4839         Pass location information that was available elsewhere.
4840
4841 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
4842
4843         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
4844         runtime to delay sign assemblies.
4845
4846 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4847
4848         * cs-parser.jay: Do not report the stack trace, this is barely
4849         used nowadays.
4850
4851 2004-08-22  John Luke  <john.luke@gmail.com>
4852  
4853         * driver.cs : check that a resource id is not already used
4854         before adding it, report CS1508 if it is, bug #63637
4855
4856 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
4857
4858         * ecore.cs: Removed dead code.
4859
4860 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
4861
4862         * class.cs: Do not report warning CS0067 on the interfaces.
4863
4864 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4865
4866         * cs-parser.jay: Add error 504 report.
4867
4868 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4869
4870         * rootcontext.cs: WarningLevel is 4 by default now.
4871
4872         * statement.cs (Fixed.Resolve): Do not null
4873         VariableInfo.
4874
4875 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
4876
4877         Fixed bug #55780
4878         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
4879         deep search when property is not virtual.
4880         (PropertyExpr.ResolveAccessors): Make one call for both
4881         accessors.
4882
4883 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4884
4885         Fixed bug #65766
4886         * statement.cs: Error 152 report constains also location.
4887
4888 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4889
4890         Fixed bug #65766
4891         * const.cs: Explicitly set constant as static.
4892
4893 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4894
4895         Fixed bug #64226
4896         * cs-parser.jay: Add error 1017 report.
4897
4898 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
4899
4900         Fixed bug #59980, #64224
4901         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
4902
4903         * typemanager.cs (IsSpecialMethod): Simplified
4904
4905 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4906
4907         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
4908         condition with better params.
4909
4910 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4911
4912         Fixed bug #65238
4913         * attribute.cs (Resolve): Property has to have both
4914         accessors.
4915
4916 2004-09-14  Martin Baulig  <martin@ximian.com>
4917
4918         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4919
4920 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4921
4922         Fixed bug #61902
4923         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4924         called and is obsolete then this member suppress message
4925         when call is inside next [Obsolete] method or type.
4926
4927         * expression.cs: Use TestObsoleteMethodUsage member.
4928
4929 2004-09-14  Martin Baulig  <martin@ximian.com>
4930
4931         * cs-parser.jay: Sync a bit with the GMCS version.
4932
4933 2004-09-14  Martin Baulig  <martin@ximian.com>
4934
4935         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
4936         (CSharpParser.yacc_verbose_flag): New public field.
4937
4938         * genericparser.cs: Removed.
4939
4940 2004-09-14  Raja R Harinath  <rharinath@novell.com>
4941
4942         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
4943
4944 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4945
4946         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4947
4948 2004-09-10  Martin Baulig  <martin@ximian.com>
4949
4950         Backported my MemberName changes from GMCS into MCS.
4951
4952         - we are now using a special `MemberName' class instead of using
4953         strings; in GMCS, the `MemberName' also contains the type
4954         arguments.
4955
4956         - changed the grammar rules a bit:
4957           * the old `member_name' is now a `namespace_or_type_name':
4958             The rule is that we use `namespace_or_type_name' everywhere
4959             where we expect either a "member name" (GetEnumerator) or a
4960             "member name" with an explicit interface name
4961             (IEnumerable.GetEnumerator).
4962             In GMCS, the explicit interface name may include type arguments
4963             (IEnumerable<T>.GetEnumerator).
4964           * we use `member_name' instead of just `IDENTIFIER' for
4965             "member names":
4966             The rule is that we use `member_name' wherever a member may
4967             have type parameters in GMCS.       
4968
4969         * decl.cs (MemberName): New public class.
4970         (MemberCore.MemberName): New public readonly field.
4971         (MemberCore.ctor): Take a `MemberName' argument, not a string.
4972         (DeclSpace): Likewise.
4973
4974         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
4975         * enum.cs (Enum.ctor): Likewise.
4976
4977         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
4978         MemberName.     
4979         (AliasEntry.ctor): Take a MemberName, not an Expression.
4980         (AliasEntry.UsingAlias): Likewise.
4981
4982         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
4983         (IMethodData.MemberName): Changed type from string to MemberName.
4984         (MemberBase.ExplicitInterfaceName): Likewise.
4985         (AbstractPropertyEventMethod.SetupName): Make this private.
4986         (AbstractPropertyEventMethod.ctor): Added `string prefix'
4987         argument; compute the member name here.
4988         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
4989         on the `member.MemberName' and the `prefix'.
4990
4991         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
4992         not `type_name'.
4993         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
4994         thus, we get a `MemberName' instead of a `string'.  These
4995         declarations may have type parameters in GMCS.
4996         (interface_method_declaration, delegate_declaration): Likewise.
4997         (class_declaration, interface_declaration): Likewise.
4998         (method_header): Use `namespace_or_type_name' instead of
4999         `member_name'.  We may be an explicit interface implementation.
5000         (property_declaration, event_declaration): Likewise.
5001         (member_name): This is now just an `IDENTIFIER', not a
5002         `namespace_or_type_name'.
5003         (type_name, interface_type): Removed.
5004         (namespace_or_type_name): Return a MemberName, not an Expression.
5005         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5006         call GetTypeExpression() on the MemberName to get an expression.
5007         (IndexerDeclaration.interface_type): Changed type from string to
5008         MemberName.
5009         (MakeName): Operate on MemberName's instead of string's.
5010
5011 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5012
5013         Fix bug #55770.
5014         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5015         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5016         lookup to avoid symbols introduced by 'using'.
5017         * rootcontext.cs (NamespaceLookup): Update.
5018
5019 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5020
5021         * class.cs (TypeContainer.DoDefineMembers): Do not call
5022         DefineDefaultConstructor for static classes.
5023
5024 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5025
5026         * attribute.cs (Attribute.Resolve): Add error 653 report.
5027
5028         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5029         report.
5030         (Method.ApplyAttributeBuilder): Add error 685 report.
5031         (Operator.Define): Add error 564 report.
5032
5033         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5034
5035         * expression.cs (Invocation.DoResolve): Add error
5036         245 and 250 report.
5037
5038         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5039         error 674 report.
5040
5041 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5042
5043         * class.cs (ConstructorInitializer.Resolve):
5044         Wrong error number (515->516).
5045
5046 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5047
5048         * class.cs (Indexer.Define): Add error 631 report.
5049
5050 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5051
5052         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5053
5054 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5057
5058 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5059
5060         * cs-parser.jay: Added error CS0241 report.
5061
5062 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5063
5064         * cs-parser.jay (fixed_statement): Introduce a scope for the
5065         declaration in the 'fixed' statement.
5066
5067 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5068
5069         * cs-parser.jay: Added CS0230 error report.
5070
5071 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5072
5073         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5074
5075 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5076
5077         * expression.cs (Argument.Resolve): Added error CS0192 and
5078         CS0199 report.
5079
5080 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5081
5082         C# 2.0 #pragma warning feature
5083
5084         * cs-tokenizer.cs (PreProcessPragma): New method; 
5085         Handles #pragma directive.
5086
5087         * report.cs (WarningRegions): New class; Support
5088         class for #pragma warning directive. It tests whether
5089         warning is enabled for a given line.
5090
5091 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5092
5093         * const.cs: Add more descriptive error report, tahnks to
5094         Sebastien. 
5095
5096 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5097
5098         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5099
5100 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5101
5102         * expression.cs: Apply patch from Ben: Remove dead code from
5103         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5104         as that code just threw an exception anwyays.
5105
5106         * const.cs: Remove the call to the turnintoconstant, for details
5107         see bug: #63144
5108         
5109         * literal.cs: The type of the null-literal is the null type;  So
5110         we use a placeholder type (literal.cs:System.Null, defined here)
5111         for it.
5112
5113         * expression.cs (Conditional.DoResolve): Remove some old code that
5114         is no longer needed, conversions have been fixed.
5115
5116         (ArrayCreationExpression.DoResolve): Return false if we fail to
5117         resolve the inner expression.
5118
5119 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5120
5121         Fix test-290.cs.
5122         * cs-parser.jay (delegate_declaration): Record a delegate
5123         declaration as a type declaration.
5124         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5125
5126 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5127
5128         * parameter.cs: Do not crash if the type can not be resolved. 
5129
5130         * expression.cs: Report errors with unsafe pointers, fixes #64896
5131
5132 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5133
5134         * expression.cs: Pointer arith always needs to do a conv.i
5135         if the operand is a long. fix 65320
5136
5137 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5138
5139         Fixed cs0619-37.cs, cs0619-38.cs
5140
5141         * enum.cs (GetObsoleteAttribute): Removed.
5142
5143         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5144         on Enum member is double staged. The first is tested member
5145         and then enum.
5146
5147 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5148
5149         Fixed #56986, #63631, #65231
5150
5151         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5152         adds member to name container.
5153         (TypeContainer.AddToTypeContainer): New method, adds type to
5154         name container.
5155         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5156         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5157         AddOperator): Simplified by reusing AddToMemberContainer.
5158         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5159         instead of field.
5160         (Method.CheckForDuplications): Fixed implementation to test all
5161         possibilities.
5162         (MemberBase): Detection whether member is explicit interface
5163         implementation is now in constructor.
5164         (MemberBase.UpdateMemberName): Handles IndexerName.
5165         (Accessor): Changed to keep also location information.
5166         (AbstractPropertyEventMethod): Is derived from MemberCore.
5167         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5168         will be emited or not.
5169         (PropertyBase.AreAccessorsDuplicateImplementation):
5170         Tests whether accessors are not in collision with some method.
5171         (Operator): Is derived from MethodCore to simplify common
5172         operations.
5173
5174         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5175         must be performed.
5176         (DeclSpace.AddToContainer): Adds the member to defined_names
5177         table. It tests for duplications and enclosing name conflicts.
5178
5179         * enum.cs (EnumMember): Clean up to reuse the base structures
5180
5181 2004-09-03  Martin Baulig  <martin@ximian.com>
5182
5183         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5184         into TypeContainer, to make partial classes work again.
5185
5186 2004-09-03  Martin Baulig  <martin@ximian.com>
5187
5188         * rootcontext.cs (RootContext.V2): Removed.
5189
5190 2004-03-23  Martin Baulig  <martin@ximian.com>
5191
5192         * expression.cs (Invocation.OverloadResolve): Added `bool
5193         may_fail' argument and use it instead of the Location.IsNull() hack.
5194
5195 2004-09-03  Martin Baulig  <martin@ximian.com>
5196
5197         Merged latest changes into gmcs.  Please keep this comment in
5198         here, it makes it easier for me to see what changed in MCS since
5199         the last time I merged.
5200
5201 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5202
5203         Fix #61128.
5204         * expression.cs (BetterConversion): Don't allow either conversion 
5205         to be null.  Remove redundant implicit conversion test when 'q ==
5206         null' -- when this function is invoked, we already know that the
5207         implicit conversion exists.
5208         (BetterFunction): Assume that 'best' is non-null.  Remove
5209         redundant reimplementation of IsApplicable when 'best' is null.
5210         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5211         number of arguments.
5212         (IsAncestralType): Extract from OverloadResolve.
5213         (OverloadResolve): Make robust to the MethodGroupExpr being
5214         unsorted.  Implement all the logic of Section 14.5.5.1, and
5215         support overloading of methods from multiple applicable types.
5216         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5217
5218         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5219         (RealError, Warning): Append type of report to related symbol.
5220
5221 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5222
5223         * enum.cs: Fixed CLS-Compliance checks for enum members.
5224         Error tests cs3008-8.cs, cs3014-8.cs
5225
5226 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5227
5228         Fixed bug #62342, #63102
5229         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5230         like ImplementMethod.
5231
5232 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5233
5234         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5235         Fixed bug #65170.
5236
5237 2004-09-02  Martin Baulig  <martin@ximian.com>
5238
5239         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5240         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5241         on the MethodBase.
5242
5243 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5244
5245         C# 2.0 Static classes implemented
5246
5247         * class.cs (TypeContainer): instance_constructors,
5248         initialized_fields, initialized_static_fields,
5249         default_constructor, base_inteface_types are protected to be
5250         accessible from StaticClass.
5251         (TypeContainer.DefineDefaultConstructor): New virtual method
5252         for custom default constructor generating
5253         (StaticClass): New class to handle "Static classes" feature.
5254
5255         * cs-parser.jay: Handle static keyword on class like instance
5256         of StaticClass.
5257
5258         * driver.cs: Added "/langversion" command line switch with two
5259         options (iso-1, default).
5260
5261 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5262
5263         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5264
5265 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5266
5267         * delegate.cs: Style.
5268
5269 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5270
5271         * delegate.cs: Add seperate instance expr field for miguel.
5272
5273 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5274
5275         * PointerArithmetic (Resolve): make sure we are not doing
5276         pointer arith on void*. Also, make sure we are resolved
5277         by not setting eclass until resolve.
5278
5279         All callers: Make sure that PointerArithmetic gets resolved.
5280
5281 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5282
5283         * ArrayCreation (LookupType): If the type does not resolve 
5284         to an array, give an error.
5285
5286 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5287
5288         * statement.cs (Try.Resolve): Fixed bug #64222
5289
5290 2004-08-27  Martin Baulig  <martin@ximian.com>
5291
5292         * class.cs
5293         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5294         crash here.     
5295
5296 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5297
5298         * ecore.cs (Constantify): Get underlying type via
5299         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5300         Windows in special cases.
5301
5302 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5303
5304         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5305         for obtaining also private methods.
5306         (GetRemoveMethod): Used GetRemoveMethod (true)
5307         for obtaining also private methods.
5308
5309 2004-08-24  Martin Baulig  <martin@ximian.com>
5310
5311         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5312         MethodAttributes.HideBySig for operators.
5313
5314 2004-08-23  Martin Baulig  <martin@ximian.com>
5315
5316         Back to the old error reporting system :-)
5317
5318         * report.cs (Message): Removed.
5319         (Report.MessageData, ErrorData, WarningData): Removed.
5320         (Report.Error, Warning): Back to the old system.
5321
5322 2004-08-23  Martin Baulig  <martin@ximian.com>
5323
5324         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5325
5326         * class.cs (TypeContainer.ParentContainer): New public virtual
5327         method; replaces the explicit interface implementation.
5328         (ClassPart.ParentContainer): Override.
5329
5330 2004-08-23  Martin Baulig  <martin@ximian.com>
5331
5332         * statement.cs (Switch): Added support for constant switches; see
5333         #59428 or test-285.cs.
5334
5335 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5336
5337         Fixed bug #62740.
5338         * statement.cs (GetEnumeratorFilter): Removed useless
5339         logic because C# specs is strict. GetEnumerator must be
5340         public.
5341
5342 2004-08-22  Martin Baulig  <martin@ximian.com>
5343
5344         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5345         a switch and may break, reset the barrier.  Fixes #59867.
5346
5347 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5348
5349         CLS-Compliance speed up (~5% for corlib)
5350
5351         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5352         New method. Tests container for CLS-Compliant names
5353
5354         * class.cs (TypeContainer.VerifyClsName): New method.
5355         Checks whether container name is CLS Compliant.
5356         (Constructor): Implements IMethodData.
5357
5358         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5359         low-case table for CLS Compliance test.
5360         (MemberCache.VerifyClsParameterConflict): New method.
5361         Checks method parameters for CS3006 error.
5362
5363         * enum.cs (EnumMember): Is derived from MemberCore.
5364         (Enum.VerifyClsName): Optimized for better performance.
5365
5366 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5367
5368         * report.cs: Renamed Error_T to Error and changed all
5369         references.
5370
5371 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5372
5373         * class.cs (TypeContainer.IndexerArrayList): New inner class
5374         container for indexers.
5375         (TypeContainer.DefaultIndexerName): New constant for default
5376         indexer name. Replaced all "Item" with this constant.
5377         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5378
5379         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5380         DefaultMemberAttribute constructor.
5381
5382 2004-08-05  Martin Baulig  <martin@ximian.com>
5383
5384         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5385         Fix bug #59429.
5386
5387 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5388
5389         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5390         multi platforms problem.
5391
5392         * compiler.csproj: Included shared files.
5393
5394 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5395
5396         Fix bug 60333, 55971 in the more general way
5397         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5398         Added arg_type argument for constant conversion.
5399         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5400
5401 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5402
5403         Fix bug #59760
5404         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5405         OperatorArrayList, MethodCoreArrayList for typecontainer
5406         containers. Changed class member types to these new types.
5407         (MethodArrayList.DefineMembers): Added test for CS0659.
5408
5409 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5410
5411         * cfold.cs: Synchronize the folding with the code in expression.cs
5412         Binary.DoNumericPromotions for uint operands.
5413
5414         * attribute.cs: Revert patch from Raja, it introduced a regression
5415         while building Blam-1.2.1 (hard to isolate a test case).
5416
5417 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5418
5419         Fix for #55382
5420         * class.cs:
5421         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5422         name collision.
5423         (MethodCore.parent_method): New member. The method we're overriding
5424         if this is an override method.
5425         (MethodCore.CheckBase): Moved from Method class and made common.
5426         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5427         private.
5428         (MethodCore.CheckForDuplications): New abstract method. For custom
5429         member duplication search in a container
5430         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5431         method and its return type.
5432         (Event.conflict_symbol): New member. Symbol with same name in the
5433         parent class.
5434
5435         * decl.cs:
5436         (MemberCache.FindMemberWithSameName): New method. The method
5437         is looking for conflict with inherited symbols.
5438
5439 2004-08-04  Martin Baulig  <martin@ximian.com>
5440
5441         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5442
5443         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5444
5445 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5446
5447         * report.cs (Message): New enum for better error, warning reference in
5448         the code.
5449         (MessageData): New inner abstract class. It generally handles printing of
5450         error and warning messages.
5451         Removed unused Error, Warning, Message methods.
5452
5453 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5454
5455         Fix for cs0592-8.cs test
5456         * attribute.cs
5457         (Attributable.ValidAttributeTargets): Made public.
5458         (Attribute.ExplicitTarget): New member for explicit target value.
5459         (Attribute.CheckTargets): Now we translate explicit attribute
5460         target to Target here.
5461
5462 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5463
5464         * ecore.cs (MethodGroupExpr): new IsBase property.
5465
5466         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5467
5468         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5469         rather than an instance expr.
5470
5471         (DelegateCreation.Emit): Use the method group rather than
5472         the instance expression. Also, if you have base.Foo as the
5473         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5474
5475         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5476
5477         (NewDelegate.DoResolve): Only check for the existance of Invoke
5478         if the method is going to be needed. Use MethodGroupExpr.
5479
5480         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5481
5482         * expression.cs: For pointer arith., make sure to use
5483         the size of the type, not the size of the pointer to
5484         the type.
5485
5486 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5487
5488         Fix for #60722
5489         * class.cs (Class): Added error CS0502 test.
5490
5491 2004-08-03  John Luke  <jluke@cfl.rr.com>
5492             Raja R Harinath  <rharinath@novell.com>
5493
5494         Fix for #60997.
5495         * attribute.cs (Attribute.complained_before): New flag.
5496         (Attribute.ResolveType, Attribute.Resolve),
5497         (Attribute.DefinePInvokeMethod): Set it.
5498         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5499         
5500 2004-08-03  Martin Baulig  <martin@ximian.com>
5501
5502         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5503         use a user-defined operator; we still need to do numeric
5504         promotions in case one argument is a builtin type and the other
5505         one has an implicit conversion to that type.  Fixes #62322.
5506
5507 2004-08-02  Martin Baulig  <martin@ximian.com>
5508
5509         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5510         (LocalInfo.IsThis): New public property.
5511         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5512
5513 2004-08-01  Martin Baulig  <martin@ximian.com>
5514
5515         * class.cs (TypeContainer.GetClassBases): Don't set the default
5516         here since we may get called from GetPartialBases().
5517         (TypeContainer.DefineType): If GetClassBases() didn't return a
5518         parent, use the default one.
5519
5520 2004-07-30  Duncan Mak  <duncan@ximian.com>
5521
5522         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5523
5524 2004-07-30  Martin Baulig  <martin@ximian.com>
5525
5526         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5527
5528         * class.cs (SourceMethod): New public class, derive from the
5529         symbol writer's ISourceMethod.
5530         (Method): Use the new symbol writer API.
5531
5532         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5533         as argument and use the new symbol writer.
5534
5535         * location.cs
5536         (SourceFile): Implement the symbol writer's ISourceFile.
5537         (Location.SymbolDocument): Removed.
5538         (Location.SourceFile): New public property.
5539
5540         * symbolwriter.cs: Use the new symbol writer API.
5541
5542 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5543
5544         * Makefile (install-local): Remove.  Functionality moved to
5545         executable.make.
5546
5547 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5548
5549         * Makefile: Install mcs.exe.config file together with mcs.exe.
5550         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5551         correct runtime version.
5552         
5553 2004-07-25  Martin Baulig  <martin@ximian.com>
5554
5555         * class.cs
5556         (TypeContainer.RegisterOrder): Removed, this was unused.
5557         (TypeContainer, interface_order): Removed.
5558         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5559         TypeContainer as argument since we can also be called with a
5560         `PartialContainer' for a partial class/struct/interface.
5561         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5562         of checking whether we're an `Interface' - we could be a
5563         `PartialContainer'.
5564         (PartialContainer.Register): Override; call
5565         AddClass()/AddStruct()/AddInterface() on our parent.
5566
5567         * cs-parser.jay (interface_member_declaration): Add things to the
5568         `current_container', not the `current_class'.
5569
5570         * rootcontext.cs (RegisterOrder): The overloaded version which
5571         takes an `Interface' was unused, removed.
5572
5573         * typemanager.cs (TypeManager.LookupInterface): Return a
5574         `TypeContainer', not an `Interface'.
5575         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5576         contain a `PartialContainer' for an interface, so check it's
5577         `Kind' to figure out what it is.
5578
5579 2004-07-25  Martin Baulig  <martin@ximian.com>
5580
5581         * class.cs (Class.DefaultTypeAttributes): New public constant.
5582         (Struct.DefaultTypeAttributes): Likewise.
5583         (Interface.DefaultTypeAttributes): Likewise.
5584         (PartialContainer.TypeAttr): Override this and add the
5585         DefaultTypeAttributes.
5586
5587 2004-07-25  Martin Baulig  <martin@ximian.com>
5588
5589         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5590         we can just use the `Parent' field instead.
5591
5592 2004-07-25  Martin Baulig  <martin@ximian.com>
5593
5594         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5595
5596 2004-07-25  Martin Baulig  <martin@ximian.com>
5597
5598         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5599         our parts before defining any methods.
5600         (TypeContainer.VerifyImplements): Make this virtual.
5601         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5602         on our PartialContainer.
5603
5604 2004-07-25  Martin Baulig  <martin@ximian.com>
5605
5606         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5607
5608         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5609         argument, we can just use the `Parent' field instead.
5610
5611         * class.cs
5612         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5613         (MemberBase.DoDefine): Likewise.
5614
5615 2004-07-24  Martin Baulig  <martin@ximian.com>
5616
5617         * decl.cs (MemberCore.Parent): New public field.
5618         (DeclSpace.Parent): Moved to MemberCore.
5619
5620         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5621         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5622         parent's .ctor.
5623         (FieldBase, Field, Operator): Likewise.
5624         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5625         (EventField, Event): Likewise.
5626
5627 2004-07-23  Martin Baulig  <martin@ximian.com>
5628
5629         * class.cs (PartialContainer): New public class.
5630         (ClassPart): New public class.
5631         (TypeContainer): Added support for partial classes.
5632         (TypeContainer.GetClassBases): Splitted some of the functionality
5633         out into GetNormalBases() and GetPartialBases().
5634
5635         * cs-tokenizer.cs (Token.PARTIAL): New token.
5636         (Tokenizer.consume_identifier): Added some hacks to recognize
5637         `partial', but only if it's immediately followed by `class',
5638         `struct' or `interface'.
5639
5640         * cs-parser.jay: Added support for partial clases.
5641
5642 2004-07-23  Martin Baulig  <martin@ximian.com>
5643
5644         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5645         a `DeclSpace' and also made it readonly.
5646         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5647         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5648         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5649
5650         * cs-parser.jay: Pass the `current_class', not the
5651         `current_container' (at the moment, this is still the same thing)
5652         to a new Method, Property, Event, Indexer or Constructor.
5653
5654 2004-07-23  Martin Baulig  <martin@ximian.com>
5655
5656         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5657         and removed the `current_interface' one.
5658         (struct_declaration, class_declaration, interface_declaration):
5659         Set `current_class' to the newly created class/struct/interface;
5660         set their `Bases' and call Register() before parsing their body.
5661
5662 2004-07-23  Martin Baulig  <martin@ximian.com>
5663
5664         * class.cs (Kind): New public enum.
5665         (TypeContainer): Made this class abstract.
5666         (TypeContainer.Kind): New public readonly field.
5667         (TypeContainer.CheckDef): New public method; moved here from
5668         cs-parser.jay.
5669         (TypeContainer.Register): New public abstract method.
5670         (TypeContainer.GetPendingImplementations): New public abstract
5671         method.
5672         (TypeContainer.GetClassBases): Removed the `is_class' and
5673         `is_iface' parameters.
5674         (TypeContainer.DefineNestedTypes): Formerly known as
5675         DoDefineType().
5676         (ClassOrStruct): Made this class abstract.
5677
5678         * tree.cs (RootTypes): New public type. 
5679
5680 2004-07-20  Martin Baulig  <martin@ximian.com>
5681
5682         * tree.cs (Tree.RecordNamespace): Removed.
5683         (Tree.Namespaces): Removed.
5684
5685         * rootcontext.cs (RootContext.IsNamespace): Removed.
5686
5687         * cs-parser.jay (namespace_declaration): Just create a new
5688         NamespaceEntry here.
5689
5690 2004-07-20  Martin Baulig  <martin@ximian.com>
5691
5692         * statement.cs (ExceptionStatement): New abstract class.  This is
5693         now used as a base class for everyone who's using `finally'.
5694         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5695         our local variables before using them.
5696
5697         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5698         virtual method.  This is used by Yield.Resolve() to "steal" an
5699         outer block's `finally' clauses.
5700         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5701         argument.
5702
5703         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5704         version which takes an ExceptionStatement.  This version must be
5705         used to create exception branchings.
5706
5707         * iterator.cs
5708         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5709         (Iterator.EmitMoveNext): Added exception support; protect the
5710         block with a `fault' clause, properly handle 'finally' clauses.
5711         (Iterator.EmitDispose): Run all the `finally' clauses here.
5712
5713 2004-07-20  Martin Baulig  <martin@ximian.com>
5714
5715         * iterator.cs: This is the first of a set of changes in the
5716         iterator code.  Match the spec more closely: if we're an
5717         IEnumerable, then GetEnumerator() must be called.  The first time
5718         GetEnumerator() is called, it returns the current instance; all
5719         subsequent invocations (if any) must create a copy.
5720
5721 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
5722
5723         * expression.cs: Resolve the constant expression before returning
5724         it. 
5725
5726 2004-07-19  Martin Baulig  <martin@ximian.com>
5727
5728         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
5729         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
5730         the return type of the new EmitContext.
5731
5732 2004-07-18  Martin Baulig  <martin@ximian.com>
5733
5734         * class.cs (Property.Define): Fix iterators.
5735
5736         * iterators.cs (Iterator.Define): Moved the
5737         `container.AddInterator (this)' call here from the .ctor; only do
5738         it if we resolved successfully.
5739
5740 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
5741
5742         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
5743         `true' for preprocessing directives that we parse.  The return
5744         value indicates whether we should return to regular tokenizing or
5745         not, not whether it was parsed successfully.
5746
5747         In the past if we were in: #if false ... #line #endif, we would
5748         resume parsing after `#line'.  See bug 61604.
5749
5750         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
5751         building: IsEnumType should return true only for enums, not for
5752         enums or System.Enum itself.  This fixes #61593.
5753
5754         Likely what happened is that corlib was wrong: mcs depended on
5755         this bug in some places.  The bug got fixed, we had to add the
5756         hack, which caused bug 61593.
5757
5758         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
5759         that was a workaround for the older conditions.
5760
5761 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
5762
5763         * assign.cs: IAssignMethod has a new interface, as documented
5764         inline. All assignment code now uses this new api.
5765
5766         * ecore.cs, expression.cs: All classes which implement
5767         IAssignMethod now use the new interface.
5768
5769         * expression.cs (Invocation): add a hack to EmitCall so that
5770         IndexerAccess can be the target of a compound assignment without
5771         evaluating its arguments twice.
5772
5773         * statement.cs: Handle changes in Invocation api.
5774
5775 2004-07-16  Martin Baulig  <martin@ximian.com>
5776
5777         * iterators.cs: Rewrote this.  We're now using one single Proxy
5778         class for both the IEnumerable and the IEnumerator interface and
5779         `Iterator' derives from Class so we can use the high-level API.
5780
5781         * class.cs (TypeContainer.AddIterator): New method.
5782         (TypeContainer.DoDefineType): New protected virtual method, which
5783         is called from DefineType().
5784         (TypeContainer.DoDefineMembers): Call DefineType() and
5785         DefineMembers() on all our iterators.
5786         (TypeContainer.Emit): Call Emit() on all our iterators.
5787         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5788
5789         * codegen.cs (EmitContext.CurrentIterator): New public field.
5790
5791 2004-07-15  Martin Baulig  <martin@ximian.com>
5792
5793         * typemanager.cs
5794         (TypeManager.not_supported_exception_type): New type.   
5795
5796 2004-07-14  Martin Baulig  <martin@ximian.com>
5797
5798         * iterators.cs: Use real error numbers.
5799
5800 2004-07-14  Martin Baulig  <martin@ximian.com>
5801
5802         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5803         requires this to be a System.Collection.IEnumerable and not a
5804         class implementing that interface.
5805         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5806
5807 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5808
5809         * class.cs: Fixed previous fix, it broke some error tests.
5810
5811 2004-07-12  Martin Baulig  <martin@ximian.com>
5812
5813         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5814         Fixes #61293.
5815
5816 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5817
5818         * assign.cs (LocalTemporary): Add new argument: is_address,If
5819         `is_address' is true, then the value that we store is the address
5820         to the real value, and not the value itself.
5821         
5822         * ecore.cs (PropertyExpr): use the new local temporary
5823         stuff to allow us to handle X.Y += z (where X is a struct)
5824
5825 2004-07-08  Martin Baulig  <martin@ximian.com>
5826
5827         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5828         not always return, just like we're doing in Using.Resolve().
5829
5830 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5831
5832         * cs-parser.jay (fixed_statement): flag this as Pinned.
5833
5834 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5835
5836         * typemanager.cs (TypeManager): Removed MakePinned method, this
5837         mechanism is replaced with the .NET 2.x compatible mechanism of
5838         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5839
5840         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5841         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5842         `IsFixed' property which has a different meaning.
5843
5844 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5845
5846         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5847         visible from inside a nested class, not just the names of the
5848         immediately enclosing class.
5849         Fix for bug #60730.
5850
5851 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5852
5853         * expression.cs (BetterConversion): Remove buggy special-case
5854         handling of "implicit constant expression conversions".  At this
5855         point, we already know that the conversion is possible -- we're
5856         only checking to see which is better.
5857
5858 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5859
5860         * cs-parser.jay: Added error CS0210 test.
5861
5862 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5863
5864         * cs-parser.jay: Added error CS0134 test.
5865
5866 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5867
5868         Fix bug #52507
5869         * cs-parser.jay: Added error CS0145 test.
5870
5871 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5872
5873         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5874
5875 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5876         
5877         * expression.cs (StackAlloc.Resolve): The argument may not
5878         be a constant; deal with this case.
5879         
5880 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5881
5882         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5883         GetIndexerAttributeValue.
5884         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5885
5886         * class.cs (Indexer.Define): Added error tests for CS0415,
5887         CS0609.
5888
5889 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5890
5891         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5892         property code.
5893
5894 2004-06-23  Martin Baulig  <martin@ximian.com>
5895
5896         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5897         neither return nor throw, reset the barrier as well.  Fixes #60457.
5898
5899 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5900
5901         * class.cs : EventAttributes is now set to None by default.
5902           This fixes bug #60459.
5903
5904 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5905
5906         Fix bug #60219
5907         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5908         Don't throw exception but return null (it's sufficient now).
5909
5910 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5911
5912         * typemanager.cs (GetArgumentTypes): Faster implementation.
5913
5914 2004-06-18  Martin Baulig  <martin@ximian.com>
5915
5916         * attribute.cs (Attribute.Resolve): Check whether we're an
5917         EmptyCast which a Constant child.  Fixes #60333.
5918
5919 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5920
5921         * statement.cs (EmitCollectionForeach): Account for the fact that
5922         not all valuetypes are in areas which we can take the address of.
5923         For these variables, we store to a temporary variable. Also, make
5924         sure that we dont emit a `callvirt' on a valuetype method.
5925
5926 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5927
5928         * expression.cs (StackAlloc.DoReSolve): Added test for
5929         negative parameter (CS0247).
5930
5931 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5932
5933         Fix bug #59792
5934         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5935
5936 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5937
5938         Fix bug #59781
5939         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5940         ulong.
5941
5942 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5943
5944         Fix bug #58254 & cs1555.cs, cs1556.cs
5945         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5946
5947 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5948
5949         * cs-parser.jay: Added error CS1669 test for indexers.
5950
5951 2004-06-11  Martin Baulig  <martin@ximian.com>
5952
5953         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5954         call this twice: for params and varargs methods.
5955
5956 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5957
5958         * class.cs:
5959         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5960
5961 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5962
5963         * attribute.cs (Attribute.GetValidTargets): Made public.
5964
5965         * class.cs: 
5966         (AbstractPropertyEventMethod): New class for better code sharing.
5967         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5968         CS1667 report.
5969         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5970
5971 2004-06-11  Raja R Harinath  <rharinath@novell.com>
5972
5973         Fix bug #59477.
5974         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
5975         that the call to Resolve is part of a MemberAccess.
5976         (Expression.Resolve): Use it for SimpleName resolution.
5977         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
5978         Add 'intermediate' boolean argument.
5979         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
5980         error message when the SimpleName can be resolved ambiguously
5981         between an expression and a type.
5982         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
5983         public.
5984         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
5985         call on the left-side.
5986
5987 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5988
5989         * class.cs:
5990         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
5991
5992 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5993
5994         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
5995
5996 2004-06-11  Martin Baulig  <martin@ximian.com>
5997
5998         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
5999         varargs methods if applicable.
6000
6001 2004-06-11  Martin Baulig  <martin@ximian.com>
6002
6003         * expression.cs (Invocation.EmitCall): Don't use
6004         `method.CallingConvention == CallingConventions.VarArgs' since the
6005         method could also have `CallingConventions.HasThis'.
6006
6007 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6008
6009         * class.cs (Event.GetSignatureForError): Implemented.
6010         Fixed crash in error test cs3010.cs
6011
6012 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6013
6014         * cs-tokenizer.cs: Change the way we track __arglist to be
6015         consistent with the other keywords.
6016
6017 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6018
6019         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6020         tomorrow.
6021
6022 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6023
6024         * codegen.cs: Check that all referenced assemblies have a strongname
6025         before strongnaming the compiled assembly. If not report error CS1577.
6026         Fix bug #56563. Patch by Jackson Harper.
6027         * typemanager.cs: Added a method to return all referenced assemblies.
6028         Fix bug #56563. Patch by Jackson Harper.
6029
6030 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6031
6032         * class.cs:
6033         (Method.ApplyAttributeBuilder): Moved and added conditional
6034         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6035
6036         * delegate.cs:
6037         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6038
6039 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6040
6041         Fixed #59640
6042         * class.cs: (EventField.attribute_targets): Changed default target.
6043
6044 2004-06-08  Martin Baulig  <martin@ximian.com>
6045
6046         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6047
6048 2004-06-08  Martin Baulig  <martin@ximian.com>
6049
6050         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6051
6052 2004-06-07  Martin Baulig  <martin@ximian.com>
6053
6054         Added support for varargs methods.
6055
6056         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6057         keyword.
6058
6059         * cs-parser.jay: Added support for `__arglist'.
6060
6061         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6062
6063         * expression.cs (Argument.AType): Added `ArgList'.
6064         (Invocation): Added support for varargs methods.
6065         (ArglistAccess): New public class.
6066         (Arglist): New public class.
6067
6068         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6069
6070         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6071         a method's top-level block if the method has varargs.
6072
6073         * support.cs (ReflectionParameters, InternalParameters): Added
6074         support for varargs methods.    
6075
6076 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6077
6078         * class.cs: Provide location in indexer error report.
6079
6080         * driver.cs: Use standard names.
6081
6082         * namespace.cs: Catch the use of using after a namespace has been
6083         declared also on using aliases.
6084
6085 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6086
6087         Bug #50820.
6088         * typemanager.cs (closure_private_ok, closure_invocation_type)
6089         (closure_qualifier_type, closure_invocation_assembly)
6090         (FilterWithClosure): Move to ...
6091         (Closure): New internal nested class.
6092         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6093         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6094         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6095         (MemberLookup, MemberLookupFailed): Use it.
6096         * expression.cs (New.DoResolve): Treat the lookup for the
6097         constructor as being qualified by the 'new'ed type.
6098         (Indexers.GetIndexersForTypeOrInterface): Update.
6099
6100 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6101
6102         * attribute.cs
6103         (GetConditionalAttributeValue): New method. Returns
6104         condition of ConditionalAttribute.
6105         (SearchMulti): New method.  Returns all attributes of type 't'.
6106         Use it when attribute is AllowMultiple = true.
6107         (IsConditionalMethodExcluded): New method.
6108
6109         * class.cs
6110         (Method.IsExcluded): Implemented. Returns true if method has conditional
6111         attribute and the conditions is not defined (method is excluded).
6112         (IMethodData): Extended interface for ConditionalAttribute support.
6113         (PropertyMethod.IsExcluded): Implemented.
6114
6115         * decl.cs
6116         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6117
6118         * expression.cs
6119         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6120         on the method.
6121
6122 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6123
6124         * expression.cs (ArrayCreationExpression): Make this just an
6125         `expression'. It can't be a statement, so the code here was
6126         dead.
6127
6128 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6129
6130         Fixed #59072
6131         * typemanager.cs (GetFullNameSignature): New method for
6132         MethodBase types.
6133
6134 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6135
6136         Fixed #56452
6137         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6138         Use this method when MethodBuilder is null.
6139         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6140         Added test for error CS0626 (MONO reports error for this situation).
6141         (IMethodData.GetSignatureForError): Extended interface.
6142
6143 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6144
6145         * attribute.cs
6146         (AttributeTester.GetObsoleteAttribute): Returns instance of
6147         ObsoleteAttribute when type is obsolete.
6148
6149         * class.cs
6150         (TypeContainer.VerifyObsoleteAttribute): Override.
6151         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6152         (MethodCode.VerifyObsoleteAttribute): Override.
6153         (MemberBase.VerifyObsoleteAttribute): Override.
6154
6155         * decl.cs
6156         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6157         and report proper error.
6158
6159         *delegate.cs
6160         Delegate.VerifyObsoleteAttribute): Override.
6161
6162         * ecore.cs
6163         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6164         and report proper error.
6165         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6166
6167         * enum.cs
6168         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6169         and enum member.
6170
6171         * expression.cs
6172         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6173         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6174         Added test for ObsoleteAttribute.
6175
6176         * statement.cs
6177         (Catch): Derived from Statement.
6178
6179 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6180  
6181         Fixed bug #59071 & cs0160.cs
6182  
6183         * statement.cs (Try.Resolve): Check here whether order of catch
6184         clauses matches their dependencies.
6185
6186 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6187
6188         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6189         caused a regression: #59343.  Referencing nested classes from an
6190         assembly stopped working.
6191
6192 2004-05-31  Martin Baulig  <martin@ximian.com>
6193
6194         MCS is now frozen for beta 2.
6195
6196 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6197
6198         * convert.cs: add a trivial cache for overload operator resolution.
6199
6200 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6201
6202         * decl.cs: If possible, use lookuptypedirect here. We can only do
6203         this if there is no `.' after the namespace. Avoids using
6204         LookupType, which does lots of slow processing.
6205         (FindNestedType) New method, does what it says :-).
6206         * namespace.cs: use LookupTypeDirect.
6207         * rootcontext.cs: use membercache, if possible.
6208         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6209
6210 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6211
6212         * expression.cs:
6213         According to the spec, 
6214
6215         In a member access of the form E.I, if E is a single identifier,
6216         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6217         field, property, localvariable, or parameter with the same type as
6218         the meaning of E as a type-name (§3.8), then both possible
6219         meanings of E are permitted.
6220
6221         We did not check that E as a simple-name had the same type as E as
6222         a type name.
6223
6224         This trivial check gives us 5-7% on bootstrap time.
6225
6226 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6227
6228         * expression.cs (Invocation.OverloadResolve): Avoid the
6229         use of hashtables and boxing here by allocating on demand.
6230
6231 2004-05-30  Martin Baulig  <martin@ximian.com>
6232
6233         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6234         we're doing a silent lookup.  Don't try to lookup nested types in
6235         TypeManager.object_type (thanks to Ben Maurer).
6236
6237 2004-05-30  Martin Baulig  <martin@ximian.com>
6238
6239         Committing a patch from Ben Maurer.
6240
6241         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6242
6243 2004-05-29  Martin Baulig  <martin@ximian.com>
6244
6245         * class.cs (IMethodData.ShouldIgnore): New method.
6246
6247         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6248         `Location' argument, we don't need it anywhere.  Use
6249         `IMethodData.ShouldIgnore ()' instead of
6250         `MethodData.GetMethodFlags ()'.
6251         (TypeManager.AddMethod): Removed.
6252         (TypeManager.AddMethod2): Renamed to AddMethod.
6253
6254 2004-05-29  Martin Baulig  <martin@ximian.com>
6255
6256         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6257
6258         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6259         converting from a class type S to an interface type and we already
6260         have an object on the stack, don't box it again.  Fixes #52578.
6261
6262 2004-05-29  Martin Baulig  <martin@ximian.com>
6263
6264         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6265         Added support for `params' parameters.  Fixes #59267.
6266
6267 2004-05-29  Martin Baulig  <martin@ximian.com>
6268
6269         * literal.cs (NullPointer): Provide a private .ctor which sets
6270         `type' to TypeManager.object_type.  Fixes #59048.
6271
6272 2004-05-29  Martin Baulig  <martin@ximian.com>
6273
6274         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6275         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6276
6277         * ecore.cs (EventExpr.instance_expr): Make the field private.
6278
6279 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6280
6281         Fixed bug #50080 & cs0214-2.cs
6282         * expression.cs (Cast.DoResolve): Check unsafe context here.
6283         
6284         * statement.cs (Resolve.DoResolve): Likewise.
6285
6286 2004-05-26  Martin Baulig  <martin@ximian.com>
6287
6288         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6289
6290         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6291         (RootContext.LookupType): Pass down the `silent' flag.
6292
6293 2004-05-25  Martin Baulig  <martin@ximian.com>
6294
6295         * expression.cs
6296         (MethodGroupExpr.IdenticalTypeName): New public property.
6297         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6298         expression actually refers to a type.
6299
6300 2004-05-25  Martin Baulig  <martin@ximian.com>
6301
6302         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6303         for #56176 and made it actually work.
6304
6305 2004-05-25  Martin Baulig  <martin@ximian.com>
6306
6307         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6308         (FieldExpr, PropertyExpr): Override and implement
6309         CacheTemporaries.  Fixes #52279.
6310
6311 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6312
6313         * location.cs: In the new compiler listing a file twice is a
6314         warning, not an error.
6315
6316 2004-05-24  Martin Baulig  <martin@ximian.com>
6317
6318         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6319         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6320
6321 2004-05-24  Martin Baulig  <martin@ximian.com>
6322
6323         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6324         walking the `using' list.  Fixes #53921.
6325
6326 2004-05-24  Martin Baulig  <martin@ximian.com>
6327
6328         * const.cs (Const.LookupConstantValue): Added support for
6329         EmptyCast's; fixes #55251.
6330
6331 2004-05-24  Martin Baulig  <martin@ximian.com>
6332
6333         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6334         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6335         which does the CS0135 check.  The reason is that we first need to
6336         check whether the variable actually exists.
6337
6338 2004-05-24  Martin Baulig  <martin@ximian.com>
6339
6340         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6341         than RootContext.LookupType() to find the explicit interface
6342         type.  Fixes #58584.
6343
6344 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6345
6346         * Makefile: Simplify.  Use executable.make.
6347         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6348
6349 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6350
6351         * decl.cs:
6352         * enum.cs:
6353         Use the invariant culture when doing String.Compare for CLS case
6354         sensitivity.
6355         
6356 2004-05-23  Martin Baulig  <martin@ximian.com>
6357
6358         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6359         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6360
6361         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6362         
6363 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6364
6365         * class.cs (MemberBase.Define): Reuse MemberType member for 
6366         resolved type. Other methods can use it too.
6367
6368 2004-05-23  Martin Baulig  <martin@ximian.com>
6369
6370         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6371         the variable also exists in the current block (otherwise, we need
6372         to report a CS0103).  Fixes #58670.
6373
6374 2004-05-23  Martin Baulig  <martin@ximian.com>
6375
6376         * flowanalysis.cs (Reachability.Reachable): Compute this
6377         on-the-fly rather than storing it as a field.
6378
6379 2004-05-23  Martin Baulig  <martin@ximian.com>
6380
6381         * flowanalysis.cs (Reachability.And): Manually compute the
6382         resulting `barrier' from the reachability.      
6383        
6384 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6385
6386         Fix bug #57835
6387         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6388         instance of ObsoleteAttribute when symbol is obsolete.
6389
6390         * class.cs
6391         (IMethodData): Extended interface for ObsoleteAttribute support.
6392
6393 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6394
6395         * attribute.cs: Fix bug #55970
6396
6397 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6398
6399         Fix bug #52705
6400         * attribute.cs
6401         (GetObsoleteAttribute): New method. Creates the instance of
6402         ObsoleteAttribute.
6403         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6404         ObsoleteAttribute when member is obsolete.
6405         (AttributeTester.Report_ObsoleteMessage): Common method for
6406         Obsolete error/warning reporting.
6407
6408         * class.cs
6409         (TypeContainer.base_classs_type): New member for storing parent type.
6410
6411         * decl.cs
6412         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6413         for this MemberCore.
6414
6415 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6416
6417         * attribute.cs, const.cs: Fix bug #58590
6418
6419 2004-05-21  Martin Baulig  <martin@ximian.com>
6420
6421         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6422         out parameters if the end of the method is unreachable.  Fixes
6423         #58098. 
6424
6425 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6426
6427         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6428         Hari was right, why extra method.
6429
6430 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6431
6432         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6433
6434 2004-05-20  Martin Baulig  <martin@ximian.com>
6435
6436         Merged this back from gmcs to keep the differences to a minumum.
6437
6438         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6439         instead of a Declspace.
6440         (Attribute.ResolveType): Likewise.
6441         (Attributes.Search): Likewise.
6442         (Attributes.Contains): Likewise.
6443         (Attributes.GetClsCompliantAttribute): Likewise.
6444
6445         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6446         argument.
6447         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6448         DeclSpace.
6449
6450 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6451
6452         Fix bug #58688 (MCS does not report error when the same attribute
6453         is assigned twice)
6454
6455         * attribute.cs (Attribute.Emit): Distinction between null and default.
6456
6457 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6458
6459         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6460         of a top-level attribute without an attribute target.
6461         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6462         Make non-static.
6463         (Attribute.Conditional_GetConditionName), 
6464         (Attribute.Obsolete_GetObsoleteMessage): Update.
6465         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6466         part of ScanForIndexerName.
6467         (Attribute.CanIgnoreInvalidAttribute): New function.
6468         (Attribute.ScanForIndexerName): Move to ...
6469         (Attributes.ScanForIndexerName): ... here.
6470         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6471         (Attributes.Search): New internal variant that can choose not to
6472         complain if types aren't resolved.  The original signature now
6473         complains.
6474         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6475         complaints suppressed.
6476         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6477         only if it not useful.
6478         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6479         top-level for attributes that are shared between the assembly
6480         and a top-level class.
6481         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6482         * class.cs: Update to reflect changes.
6483         (DefineIndexers): Fuse loops.
6484         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6485         a couple more variants of attribute names.
6486
6487 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6488
6489         Fix bug #52585 (Implemented explicit attribute declaration)
6490
6491         * attribute.cs:
6492         (Attributable.ValidAttributeTargets): New abstract method. It gets
6493         list of valid attribute targets for explicit target declaration.
6494         (Attribute.Target): It holds target itself.
6495         (AttributeSection): Removed.
6496         (Attribute.CheckTargets): New method. It checks whether attribute
6497         target is valid for the current element.
6498
6499         * class.cs:
6500         (EventProperty): New class. For events that are declared like
6501         property (with add and remove accessors).
6502         (EventField): New class. For events that are declared like field.
6503         class.cs
6504
6505         * cs-parser.jay: Implemented explicit attribute target declaration.
6506
6507         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6508         Override ValidAttributeTargets.
6509
6510         * parameter.cs:
6511         (ReturnParameter): Class for applying custom attributes on 
6512         the return type.
6513         (ParameterAtribute): New class. Class for applying custom
6514         attributes on the parameter type.
6515
6516 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6517
6518         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6519         definitions. 
6520
6521         (Method): Allow UNSAFE here.
6522
6523         * modifiers.cs: Support unsafe reporting.
6524
6525 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6526
6527         * decl.cs: Fix bug #58478.
6528
6529 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6530
6531         * statement.cs: When checking for unreachable code on an EmptyStatement,
6532         set the location. Fixes bug #58488.
6533
6534 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6535
6536         * driver.cs: Add -pkg handling.
6537
6538         From Gonzalo: UseShelLExecute=false
6539
6540 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6541
6542         * attribute.cs:
6543         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6544         for attribute.
6545         (Attribute.IsClsCompliaceRequired): Moved to base for better
6546         accesibility.
6547         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6548         when attribute is AttributeUsageAttribute.
6549         (Attribute.GetValidTargets): Simplified.
6550         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6551         attribute for this type.
6552         (Attribute.ApplyAttributes): Method renamed to Emit and make
6553         non-static.
6554         (GlobalAttributeSection): New class for special handling of global
6555         attributes (assembly, module).
6556         (AttributeSection.Emit): New method.
6557
6558         * class.cs: Implemented Attributable abstract methods.
6559         (MethodCore.LabelParameters): Moved to Parameter class.
6560         (Accessor): Is back simple class.
6561         (PropertyMethod): Implemented Attributable abstract class.
6562         (DelegateMethod): Implemented Attributable abstract class.
6563         (Event): New constructor for disctintion between normal Event
6564         and Event with accessors.
6565
6566         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6567
6568         * codegen.cs, const.cs, decl.cs, delegate.cs:
6569         (CommonAssemblyModulClass): Implemented Attributable abstract class
6570         and simplified.
6571
6572         * enum.cs: Implement IAttributeSupport interface.
6573         (EnumMember): New class for emum members. Implemented Attributable
6574         abstract class
6575
6576         * parameter.cs:
6577         (ParameterBase): Is abstract.
6578         (ReturnParameter): New class for easier [return:] attribute handling.
6579
6580         * typemanager.cs: Removed builder_to_attr.
6581
6582 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6583
6584         Fix bug #57151.
6585         * attribute.cs (Attribute.GetPositionalValue): New function.
6586         * class.cs (TypeContainer.VerifyMembers): New function.
6587         (TypeContainer.Emit): Use it.
6588         (ClassOrStruct): New base class for Class and Struct.
6589         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6590         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6591         class.
6592         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6593         then each non-static field should have a FieldOffset attribute.
6594         Otherwise, none of the fields should have a FieldOffset attribute.
6595         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6596         and FieldOffset attributes.
6597         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6598         (TypeManager.field_offset_attribute_type): New core types.
6599         (TypeManager.InitCoreTypes): Initialize them.
6600
6601 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6602
6603         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6604         Return correct type.
6605         From bug #58270.
6606
6607 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6608
6609         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6610         be implicitly converted to ulong.
6611         
6612         * expression.cs: The logic for allowing operator &, | and ^ worked
6613         was wrong, it worked before because we did not report an error in
6614         an else branch.  Fixes 57895.
6615
6616         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6617         allow volatile fields to be reference types.
6618
6619 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6620
6621         * driver.cs: Add support for /debug-
6622
6623 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6624
6625         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6626         Add a 'complain' parameter to silence errors.
6627         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6628         silently overlooked type-resolutions.
6629         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6630         to reflect changes.
6631         (Attributes.Search): New function.
6632         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6633         (Attributes.GetAttributeFullName): Remove hack.
6634         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6635         Update to reflect changes.
6636         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6637         Use Attributes.Search instead of nested loops.
6638
6639 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6640
6641         * decl.cs:
6642         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6643         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6644         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6645
6646         * report.cs: (Report.Warning): Renamed to Warning_T because of
6647         parameter collision.
6648
6649 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6650
6651         * expression.cs (MemberAccess.ResolveMemberAccess):
6652         Exit with non-zero status after Report.Error.
6653         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6654         Likewise.
6655         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6656
6657 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6658
6659         * support.cs: Don't hang when the file is empty.
6660
6661 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6662
6663         * support.cs: In SeekableStreamReader, compute the preamble size of the
6664           underlying stream. Position changes should take into account that initial
6665           count of bytes.
6666
6667 2004-05-03  Todd Berman  <tberman@sevenl.net>
6668
6669         * driver.cs: remove unused GetSysVersion function.
6670
6671 2004-05-03  Todd Berman  <tberman@sevenl.net>
6672
6673         * driver.cs: Remove the hack from saturday, as well as the hack
6674         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6675         link_paths to get that bit proper.
6676
6677 2004-05-01  Todd Berman  <tberman@sevenl.net>
6678
6679         * driver.cs: Try a LoadFrom before a Load, this checks the current
6680         path. This is currently a bug in mono that is be fixed, however, this
6681         provides a workaround for now. This will be removed when the bug
6682         is fixed.
6683
6684 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6685
6686         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6687         incomplete key pairs (#57941).
6688
6689 2004-05-01  Todd Berman  <tberman@sevenl.net>
6690
6691         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6692         from the GAC
6693
6694 2004-04-30  Jackson Harper  <jackson@ximian.com>
6695
6696         * codegen.cs: Open keys readonly.
6697         
6698 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6699
6700         * typemanager.cs: don't report cyclic struct layout when a struct
6701         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6702         which has 2 Pango.Rectangle fields.
6703
6704 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6705
6706         * expression.cs: Handle IntPtr comparisons with IL code
6707         rather than a method call.
6708
6709 2004-04-29  Martin Baulig  <martin@ximian.com>
6710
6711         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6712         the list of PropertyInfo's in class hierarchy and find the
6713         accessor.  Fixes #56013.
6714
6715 2004-04-29  Martin Baulig  <martin@ximian.com>
6716
6717         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6718
6719 2004-04-29  Martin Baulig  <martin@ximian.com>
6720
6721         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6722
6723         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6724
6725 2004-04-29  Martin Baulig  <martin@ximian.com>
6726
6727         * class.cs (ConstructorInitializer.Resolve): Check whether the
6728         parent .ctor is accessible.  Fixes #52146.
6729
6730 2004-04-29  Martin Baulig  <martin@ximian.com>
6731
6732         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6733
6734         * statement.cs (Using.EmitLocalVariableDecls): Use
6735         TypeManager.idisposable_type, not typeof (IDisposable).
6736         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6737
6738 2004-04-29  Martin Baulig  <martin@ximian.com>
6739
6740         * class.cs (Event.Define): Don't emit the field and don't set
6741         RTSpecialName and SpecialName for events on interfaces.  Fixes
6742         #57703. 
6743
6744 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6745
6746         Refactor Attribute.ApplyAttributes.
6747         * attribute.cs (Attributable): New base class for objects that can
6748         have Attributes applied on them.
6749         (Attribute): Make AttributeUsage fields public.
6750         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6751         (Attribute.IsInternalCall): New property.
6752         (Attribute.UsageAttr): Convert to a public read-only property.
6753         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6754         (Attribute.ResolveType, Attribute.Resolve)
6755         (Attribute.ScanForIndexerName): Update to reflect changes.
6756         (Attribute.CheckAttributeTarget): Re-format.
6757         (Attribute.ApplyAttributes): Refactor, to various
6758         Attributable.ApplyAttributeBuilder methods.
6759         * decl.cs (MemberCore): Make Attributable.
6760         * class.cs (Accessor): Make Attributable.
6761         (MethodData.ApplyAttributes): Use proper attribute types, not
6762         attribute names.
6763         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6764         (TypeContainer.ApplyAttributeBuilder)
6765         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6766         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6767         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6768         (Operator.ApplyAttributeBuilder): New factored-out methods.
6769         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6770         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6771         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6772         * parameter.cs (ParameterBase): New Attributable base class
6773         that can also represent Return types.
6774         (Parameter): Update to the changes.
6775
6776 2004-04-29  Jackson Harper  <jackson@ximian.com>
6777
6778         * driver.cs: Prefer the corlib system version when looking for
6779         assemblies in the GAC. This is still a hack, but its a better hack
6780         now.
6781         
6782 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6783
6784         * decl.cs, enum.cs: Improved error 3005 reporting.
6785   
6786         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6787         (related_symbols): New private member for list of symbols
6788         related to reported error/warning.
6789         
6790         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6791
6792 2004-04-29  Martin Baulig  <martin@ximian.com>
6793
6794         * ecore.cs (Expression.Constantify): If we're an enum and
6795         TypeManager.TypeToCoreType() doesn't give us another type, use
6796         t.UnderlyingSystemType.  Fixes #56178.  
6797
6798 2004-04-29  Martin Baulig  <martin@ximian.com>
6799
6800         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6801         interfaces and for each interface, only add members directly
6802         declared in that interface.  Fixes #53255.
6803
6804 2004-04-28  Martin Baulig  <martin@ximian.com>
6805
6806         * expression.cs (ConditionalLogicalOperator): Use a temporary
6807         variable for `left' to avoid that we evaluate it more than once;
6808         bug #52588.
6809
6810 2004-04-28  Martin Baulig  <martin@ximian.com>
6811
6812         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6813         `void[]' (CS1547).
6814
6815 2004-04-28  Martin Baulig  <martin@ximian.com>
6816
6817         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6818         void (CS1547).
6819
6820         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6821         whether the type is not void (CS1547).
6822
6823 2004-04-28  Martin Baulig  <martin@ximian.com>
6824
6825         * expression.cs (Unary.DoResolveLValue): Override this and report
6826         CS0131 for anything but Operator.Indirection.
6827
6828 2004-04-28  Martin Baulig  <martin@ximian.com>
6829
6830         Committing a patch from Ben Maurer; see bug #50820.
6831
6832         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6833         check for classes.
6834
6835         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6836         classes.        
6837
6838 2004-04-28  Martin Baulig  <martin@ximian.com>
6839
6840         Committing a patch from Ben Maurer; see bug #50820.
6841
6842         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6843         check for classes.
6844
6845         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6846         classes.        
6847
6848 2004-04-28  Martin Baulig  <martin@ximian.com>
6849
6850         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6851         (Block.AddLabel): Call DoLookupLabel() to only search in the
6852         current block.
6853
6854 2004-04-28  Martin Baulig  <martin@ximian.com>
6855
6856         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6857         comparing StringConstants and NullLiterals in Equality and Inequality.
6858
6859 2004-04-28  Jackson Harper  <jackson@ximian.com>
6860
6861         * driver.cs: Attempt to load referenced assemblies from the
6862         GAC. This is the quick and dirty version of this method that
6863         doesnt take into account versions and just takes the first
6864         canidate found. Will be good enough for now as we will not have more
6865         then one version installed into the GAC until I update this method.
6866
6867 2004-04-28  Martin Baulig  <martin@ximian.com>
6868
6869         * typemanager.cs (TypeManager.CheckStructCycles): New public
6870         static method to check for cycles in the struct layout.
6871
6872         * rootcontext.cs (RootContext.PopulateTypes): Call
6873         TypeManager.CheckStructCycles() for each TypeContainer.
6874         [Note: We only need to visit each type once.]
6875
6876 2004-04-28  Martin Baulig  <martin@ximian.com>
6877
6878         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6879
6880         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6881         success and added `out object value'.  Use a `bool resolved' field
6882         to check whether we've already been called rather than
6883         `ConstantValue != null' since this breaks for NullLiterals.
6884
6885 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6886
6887         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6888         setting of this flag, since the 'set' method may be non-public.
6889
6890 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6891
6892         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6893         check on current_vector.Block.
6894
6895 2004-04-27  Martin Baulig  <martin@ximian.com>
6896
6897         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6898         a field initializer.  Fixes #56459.
6899
6900 2004-04-27  Martin Baulig  <martin@ximian.com>
6901
6902         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6903         we're not attempting to use an indexer.  Fixes #52154.
6904
6905 2004-04-27  Martin Baulig  <martin@ximian.com>
6906
6907         * statement.cs (Return): Don't create a return label if we don't
6908         need it; reverts my change from January 20th.  Thanks to Ben
6909         Maurer for this.
6910
6911 2004-04-27  Martin Baulig  <martin@ximian.com>
6912
6913         According to the spec, `goto' can only leave a nested scope, but
6914         never enter it.
6915
6916         * statement.cs (Block.LookupLabel): Only lookup in the current
6917         block, don't recurse into parent or child blocks.
6918         (Block.AddLabel): Check in parent and child blocks, report
6919         CS0140/CS0158 if we find a duplicate.
6920         (Block): Removed this indexer for label lookups.
6921         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6922         this already does the error reporting for us.
6923
6924         * flowanalysis.cs
6925         (FlowBranching.UsageVector.Block): New public variable; may be null.
6926         (FlowBranching.CreateSibling): Added `Block' argument.
6927         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6928         label for the target of a `goto' and check whether we're not
6929         leaving a `finally'.
6930
6931 2004-04-27  Martin Baulig  <martin@ximian.com>
6932
6933         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6934         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6935         just for returns).
6936
6937 2004-04-27  Martin Baulig  <martin@ximian.com>
6938
6939         * statement.cs (Block.AddLabel): Also check for implicit blocks
6940         and added a CS0158 check.
6941
6942 2004-04-27  Martin Baulig  <martin@ximian.com>
6943
6944         * flowanalysis.cs (FlowBranchingLoop): New class.
6945         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6946         UsageVector's instead of an ArrayList.
6947         (FlowBranching.Label): Likewise.
6948         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6949         (FlowBranching.AddBreakVector): New method.
6950
6951 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6952
6953         * attribute.cs: Small regression fix: only convert the type if we
6954         the type is different, fixes System.Drawing build.
6955
6956 2004-04-27  Martin Baulig  <martin@ximian.com>
6957
6958         * attribute.cs (Attribute.Resolve): If we have a constant value
6959         for a named field or property, implicity convert it to the correct
6960         type.
6961
6962 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6963
6964         * statement.cs (Block.Block): Implicit blocks share
6965         'child_variable_names' fields with parent blocks.
6966         (Block.AddChildVariableNames): Remove.
6967         (Block.AddVariable): Mark variable as "used by a child block" in
6968         every surrounding block.
6969         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6970         been used in a child block, complain about violation of "Invariant
6971         meaning in blocks" rule.
6972         * cs-parser.jay (declare_local_variables): Don't use
6973         AddChildVariableNames.
6974         (foreach_statement): Don't create an implicit block: 'foreach'
6975         introduces a scope.
6976
6977 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6978
6979         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6980         converting from 0L to ulong.  Fixes 57522.
6981
6982 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6983
6984         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6985         derived class hides via 'new' keyword field from base class (test-242.cs).
6986         TODO: Handle this in the more general way.
6987         
6988         * class.cs (CheckBase): Ditto.
6989
6990 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6991
6992         * decl.cs (caching_flags): New member for storing cached values
6993         as bit flags.
6994         (MemberCore.Flags): New enum where bit flags for caching_flags
6995         are defined.
6996         (MemberCore.cls_compliance): Moved to caching_flags.
6997         (DeclSpace.Created): Moved to caching_flags.
6998
6999         * class.cs: Use caching_flags instead of DeclSpace.Created
7000         
7001 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7002
7003         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7004         if we are only a derived class, not a nested class.
7005
7006         * typemanager.cs: Same as above, but do this at the MemberLookup
7007         level (used by field and methods, properties are handled in
7008         PropertyExpr).   Allow for the qualified access if we are a nested
7009         method. 
7010
7011 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7012
7013         * class.cs: Refactoring.
7014         (IMethodData): New inteface; Holds links to parent members
7015         to avoid member duplication (reduced memory allocation).
7016         (Method): Implemented IMethodData interface.
7017         (PropertyBase): New inner classes for get/set methods.
7018         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7019         (Event): New inner classes for add/remove methods.
7020         (Event.DelegateMethod): Implemented IMethodData interface.
7021
7022         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7023         EmitContext (related to class.cs refactoring).
7024
7025 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7026
7027         * delegate.cs (Delegate.VerifyApplicability): If the number of
7028         arguments are the same as the number of parameters, first try to
7029         verify applicability ignoring  any 'params' modifier on the last
7030         parameter.
7031         Fixes #56442.
7032
7033 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7034
7035         * class.cs (TypeContainer.AddIndexer): Use
7036         'ExplicitInterfaceName' to determine if interface name was
7037         explicitly specified.  'InterfaceType' is not initialized at this time.
7038         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7039         Indexers array is already in the required order.  Initialize
7040         'IndexerName' only if there are normal indexers.
7041         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7042         (TypeContainer.Emit): Emit DefaultMember attribute only if
7043         IndexerName is initialized.
7044         Fixes #56300.
7045
7046 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7047
7048         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7049         Fixes #57007
7050
7051 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7052
7053         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7054         attributes.
7055         Fix for #56456.
7056
7057         * attribute.cs (Attribute.Resolve): Check for duplicate named
7058         attributes.
7059         Fix for #56463.
7060
7061 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7062
7063         * iterators.cs (MarkYield): track whether we are in an exception,
7064         and generate code accordingly.  Use a temporary value to store the
7065         result for our state.
7066
7067         I had ignored a bit the interaction of try/catch with iterators
7068         since their behavior was not entirely obvious, but now it is
7069         possible to verify that our behavior is the same as MS .NET 2.0
7070
7071         Fixes 54814
7072
7073 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7074
7075         * iterators.cs: Avoid creating temporaries if there is no work to
7076         do. 
7077
7078         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7079         Enumerations, use TypeManager.EnumToUnderlying and call
7080         recursively. 
7081
7082         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7083         bug #57013
7084
7085         (This.Emit): Use EmitContext.EmitThis to emit our
7086         instance variable.
7087
7088         (This.EmitAssign): Ditto.
7089
7090         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7091         codepaths, we will move all the functionality into
7092         Mono.CSharp.This 
7093
7094         (FieldExpr.EmitAssign): Ditto.
7095
7096         This fixes several hidden bugs that I uncovered while doing a code
7097         review of this today.
7098
7099         * codegen.cs (EmitThis): reworked so the semantics are more clear
7100         and also support value types "this" instances.
7101
7102         * iterators.cs: Changed so that for iterators in value types, we
7103         do not pass the value type as a parameter.  
7104
7105         Initialization of the enumerator helpers is now done in the caller
7106         instead of passing the parameters to the constructors and having
7107         the constructor set the fields.
7108
7109         The fields have now `assembly' visibility instead of private.
7110
7111 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7112
7113         * expression.cs (Argument.Resolve): Check if fields passed as ref
7114         or out are contained in a MarshalByRefObject.
7115
7116         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7117         another compiler type.
7118
7119 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7120
7121         * class.cs (Indexer.Define): use the new name checking method.
7122         Also, return false on an error.
7123         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7124         (is_identifier_[start/part]_character): make static.
7125
7126 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7127
7128         * expression.cs (Binary.ResolveOperator): Do no append strings
7129         twice: since we can be invoked more than once (array evaluation)
7130         on the same concatenation, take care of this here.  Based on a fix
7131         from Ben (bug #56454)
7132
7133 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7134
7135         * codegen.cs: Fix another case where CS1548 must be reported (when 
7136         delay-sign isn't specified and no private is available #56564). Fix
7137         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7138         error when MCS is used on the MS runtime and we need to delay-sign 
7139         (which seems unsupported by AssemblyBuilder - see #56621).
7140
7141 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7142
7143         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7144         (TypeManager.ComputeNamespaces): Faster implementation for
7145         Microsoft runtime.
7146
7147         * compiler.csproj: Updated AssemblyName to mcs.
7148
7149 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7150
7151         * rootcontext.cs: Add new types to the boot resolution.
7152
7153         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7154         MulticastDelegate is not allowed.
7155
7156         * typemanager.cs: Add new types to lookup: System.TypedReference
7157         and ArgIterator.
7158
7159         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7160         check for TypedReference or ArgIterator, they are not allowed. 
7161
7162         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7163         makes us properly catch 1510 in some conditions (see bug 56016 for
7164         details). 
7165
7166 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7167
7168         * CryptoConvert.cs: update from corlib version
7169         with endian fixes.
7170
7171 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7172
7173         * class.cs (Indexer.Define): Check indexername declaration
7174
7175 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7176
7177         * attribute.cs (IsClsCompliant): Fixed problem with handling
7178         all three states (compliant, not-compliant, undetected).
7179
7180 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7181
7182         * attribute.cs (Attribute): Location is now public.
7183         (Resolve): Store resolved arguments (pos_values) in attribute class.
7184         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7185         (GetClsCompliantAttributeValue): New method that gets
7186         CLSCompliantAttribute value.
7187         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7188         if exists else null.
7189         (AttributeTester): New class for CLS-Compliant verification routines.
7190
7191         * class.cs (Emit): Add CLS-Compliant verification.
7192         (Method.GetSignatureForError): Implemented.
7193         (Constructor.GetSignatureForError): Implemented
7194         (Constructor.HasCompliantArgs): Returns if constructor has
7195         CLS-Compliant arguments.
7196         (Constructor.Emit): Override.
7197         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7198         is needed to test only parameters.
7199         (FieldBase.GetSignatureForError): Implemented.
7200         (TypeContainer): New member for storing base interfaces.
7201         (TypeContainer.FindMembers): Search in base interfaces too.
7202
7203         * codegen.cs (GetClsComplianceAttribute): New method that gets
7204         assembly or module CLSCompliantAttribute value.
7205         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7206         for assembly.
7207         (ModuleClass.Emit): Add error 3012 test.
7208
7209         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7210
7211         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7212         state for all decl types.
7213         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7214         if CLS-Compliant tests are required.
7215         (IsClsCompliaceRequired): New method. Analyze whether code
7216         must be CLS-Compliant.
7217         (IsExposedFromAssembly): New method. Returns true when MemberCore
7218         is exposed from assembly.
7219         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7220         value or gets cached value.
7221         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7222         is explicitly marked with CLSCompliantAttribute.
7223         (IsIdentifierClsCompliant): New abstract method. This method is
7224         used to testing error 3005.
7225         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7226         for identifier and parameters CLS-Compliant testing.
7227         (VerifyClsCompliance): New method. The main virtual method for
7228         CLS-Compliant verifications.
7229         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7230         null. I don't know why is null (too many public members !).
7231         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7232         and get value of first CLSCompliantAttribute that found.
7233
7234         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7235         (VerifyClsCompliance): Override and add extra tests.
7236
7237         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7238         clscheck- disable CLS-Compliant verification event if assembly is has
7239         CLSCompliantAttribute(true).
7240
7241         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7242         ApllyAttribute is now called in emit section as in the other cases.
7243         Possible future Emit integration.
7244         (IsIdentifierClsCompliant): New override.
7245         (VerifyClsCompliance): New override.
7246         (GetEnumeratorName): Returns full enum name.
7247
7248         * parameter.cs (GetSignatureForError): Implemented.
7249
7250         * report.cs (WarningData): New struct for Warning message information.
7251         (LocationOfPreviousError): New method.
7252         (Warning): New method. Reports warning based on the warning table.
7253         (Error_T): New method. Reports error based on the error table.
7254
7255         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7256         verifications are done here.
7257
7258         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7259
7260         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7261         CLSCompliantAttribute.
7262         (all_imported_types): New member holds all imported types from other
7263         assemblies.
7264         (LoadAllImportedTypes): New method fills static table with exported types
7265         from all referenced assemblies.
7266         (Modules): New property returns all assembly modules.
7267
7268 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7269
7270         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7271         throwing a parser error.
7272
7273         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7274         which removes the hardcoded get_/set_ prefixes for properties, as
7275         IL allows for the properties to be named something else.  
7276
7277         Bug #56013
7278
7279         * expression.cs: Do not override operand before we know if it is
7280         non-null.  Fix 56207
7281
7282 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7283
7284         * typemanager.cs: support for pinned variables.
7285
7286 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7287
7288         * decl.cs, typemanager.cs: Avoid using an arraylist
7289         as a buffer if there is only one result set.
7290
7291 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7292
7293         * expression.cs: Make sure you cant call a static method
7294         with an instance expression, bug #56174.
7295
7296 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7297
7298         * class.cs (IsDuplicateImplementation): Improve error reporting to
7299         flag 663 (method only differs in parameter modifier).
7300
7301         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7302         in preprocessor directives.
7303
7304         * location.cs (LookupFile): Allow for the empty path.
7305
7306         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7307         better approach for some of that patch, but its failing with the
7308         CharSet enumeration.  For now try/catch will do.
7309
7310         * typemanager.cs: Do not crash if a struct does not have fields.
7311         Fixes 56150.
7312
7313 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7314
7315         * expression.cs: cs0213, cant fix a fixed expression.
7316         fixes 50231.
7317
7318 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7319
7320         * cs-parser.jay: detect invalid embeded statements gracefully.
7321         bug #51113.
7322
7323 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7324
7325         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7326         As a regex:
7327         s/
7328         the invocation type may not be a subclass of the tye of the item/
7329         The type of the item must be a subclass of the invocation item.
7330         /g
7331
7332         Fixes bug #50820.
7333
7334 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7335
7336         * attribute.cs: Added methods to get a string and a bool from an
7337         attribute. Required to information from AssemblyKeyFileAttribute,
7338         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7339         * codegen.cs: Modified AssemblyName creation to include support for
7340         strongnames. Catch additional exceptions to report them as CS1548.
7341         * compiler.csproj: Updated include CryptoConvert.cs.
7342         * compiler.csproj.user: Removed file - user specific configuration.
7343         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7344         Mono.Security assembly. The original class is maintained and tested in
7345         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7346         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7347         like CSC 8.0 (C# v2) supports.
7348         * Makefile: Added CryptoConvert.cs to mcs sources.
7349         * rootcontext.cs: Added new options for strongnames.
7350
7351 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7352
7353         * driver.cs: For --expect-error, report error code `2'
7354         if the program compiled with no errors, error code `1' if
7355         it compiled with an error other than the one expected.
7356
7357 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7358
7359         * compiler.csproj: Updated for Visual Studio .NET 2003.
7360         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7361         * compiler.sln: Updated for Visual Studio .NET 2003.
7362
7363 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7364
7365         * expression.cs: Fix bug #47234. We basically need to apply the
7366         rule that we prefer the conversion of null to a reference type
7367         when faced with a conversion to 'object' (csc behaviour).
7368
7369 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7370
7371         * statement.cs: Shorter form for foreach, eliminates
7372         a local variable. r=Martin.
7373
7374 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7375
7376         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7377         checks if we can use brtrue/brfalse to test for 0.
7378         * expression.cs: use the above in the test for using brtrue/brfalse.
7379         cleanup code a bit.
7380
7381 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7382
7383         * expression.cs: Rewrite string concat stuff. Benefits:
7384
7385         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7386         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7387         rather than a concat chain.
7388
7389         * typemanager.cs: Add lookups for more concat overloads.
7390
7391 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7392
7393         * expression.cs: Emit shorter il code for array init.
7394
7395         newarr
7396         dup
7397         // set 1
7398
7399         // set 2
7400
7401         newarr
7402         stloc.x
7403
7404         ldloc.x
7405         // set 1
7406
7407         ldloc.x
7408         // set 2
7409
7410 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7411
7412         * statement.cs: Before, two switch blocks would be merged if the
7413         total size of the blocks (end_item - begin_item + 1) was less than
7414         two times the combined sizes of the blocks.
7415
7416         Now, it will only merge if after the merge at least half of the
7417         slots are filled.
7418
7419         fixes 55885.
7420
7421 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7422
7423         * class.cs : csc build fix for GetMethods(). See bug #52503.
7424
7425 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7426
7427         * expression.cs: Make sure fp comparisons work with NaN.
7428         This fixes bug #54303. Mig approved this patch a long
7429         time ago, but we were not able to test b/c the runtime
7430         had a related bug.
7431
7432 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7435
7436 2004-03-19  Martin Baulig  <martin@ximian.com>
7437
7438         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7439         error here and not in our caller.
7440
7441 2004-03-19  Martin Baulig  <martin@ximian.com>
7442
7443         * interface.cs: Completely killed this file.
7444         (Interface): We're now a TypeContainer and live in class.cs.
7445
7446         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7447         argument; we're now also called for interfaces.
7448         (TypeContainer.DefineMembers): Allow this method being called
7449         multiple times.
7450         (TypeContainer.GetMethods): New public method; formerly known as
7451         Interface.GetMethod().  This is used by PendingImplementation.
7452         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7453         it's now private and non-static.
7454         (Interface): Moved this here; it's now implemented similar to
7455         Class and Struct.
7456         (Method, Property, Event, Indexer): Added `bool is_interface'
7457         argument to their .ctor's.
7458         (MemberBase.IsInterface): New public field.
7459
7460         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7461         instances instead of InterfaceMethod, InterfaceProperty, etc.
7462         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7463         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7464
7465 2004-03-19  Martin Baulig  <martin@ximian.com>
7466
7467         * class.cs (MethodCore.IsDuplicateImplementation): New private
7468         method which does the CS0111 checking.
7469         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7470         Use IsDuplicateImplementation().
7471
7472 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7473
7474         * decl.cs (FindMemberToOverride): New method to find the correct
7475         method or property to override in the base class.
7476         * class.cs
7477             - Make Method/Property use the above method to find the
7478               version in the base class.
7479             - Remove the InheritableMemberSignatureCompare as it is now
7480               dead code.
7481
7482         This patch makes large code bases much faster to compile, as it is
7483         O(n) rather than O(n^2) to do this validation.
7484
7485         Also, it fixes bug 52458 which is that nested classes are not
7486         taken into account when finding the base class member.
7487
7488         Reviewed/Approved by Martin.
7489
7490 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7491
7492         * interface.cs: In all interface classes removed redundant
7493         member initialization.
7494
7495 2004-03-16  Martin Baulig  <martin@ximian.com>
7496
7497         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7498
7499 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7500
7501         * decl.cs (DefineTypeAndParents): New helper method to define a
7502         type's containers before the type itself is defined;  This is a
7503         bug exposed by the recent changes to Windows.Forms when an
7504         implemented interface was defined inside a class that had not been
7505         built yet.   
7506
7507         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7508
7509         (Check): Loop correctly to report errors modifiers
7510         (UNSAFE was not in the loop, since it was the same as TOP).
7511
7512         * interface.cs: Every interface member now takes a ModFlags,
7513         instead of a "is_new" bool, which we set on the base MemberCore. 
7514
7515         Every place where we called "UnsafeOk" in the interface, now we
7516         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7517         the unsafe settings from the member declaration instead of the
7518         container interface. 
7519
7520         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7521
7522         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7523         `set_indexer_name' to the pending bits (one per type).
7524
7525         We fixed a bug today that was picking the wrong method to
7526         override, since for properties the existing InterfaceMethod code
7527         basically ignored the method name.  Now we make sure that the
7528         method name is one of the valid indexer names.
7529
7530 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7531  
7532         * support.cs (SeekableStreamReader): Keep track of stream byte
7533         positions and don't mix them with character offsets to the buffer.
7534
7535         Patch from Gustavo Giráldez
7536
7537 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7538
7539         * interface.cs (InterfaceSetGetBase): Removed double member
7540         initialization, base class does it as well.
7541
7542 2004-03-13  Martin Baulig  <martin@ximian.com>
7543
7544         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7545         when compiling corlib.
7546
7547 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7548
7549         * convert.cs (ExplicitConversion): We were reporting an error on
7550         certain conversions (object_type source to a value type, when the
7551         expression was `null') before we had a chance to pass it through
7552         the user defined conversions.
7553
7554         * driver.cs: Replace / and \ in resource specifications to dots.
7555         Fixes 50752
7556
7557         * class.cs: Add check for duplicate operators.  Fixes 52477
7558
7559 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7560
7561         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7562         that are in the middle of the statements, not only at the end.
7563         Fixes #54987
7564
7565         * class.cs (TypeContainer.AddField): No longer set the
7566         `HaveStaticConstructor' flag, now we call it
7567         `UserDefineStaticConstructor' to diferentiate the slightly
7568         semantic difference.
7569
7570         The situation is that we were not adding BeforeFieldInit (from
7571         Modifiers.TypeAttr) to classes that could have it.
7572         BeforeFieldInit should be set to classes that have no static
7573         constructor. 
7574
7575         See:
7576
7577         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7578
7579         And most importantly Zoltan's comment:
7580
7581         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7582
7583         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7584          before its static fields are used', i.e. initialization does not need
7585          to be triggered by the first access to the type. Setting this flag
7586          helps the JIT to compile better code, since it can run the static
7587          constructor at JIT time, and does not need to generate code to call it
7588          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7589          this flag for lots of classes like String. 
7590          
7591          csc sets this flag if the type does not have an explicit static 
7592          constructor. The reasoning seems to be that if there are only static
7593          initalizers for a type, and no static constructor, then the programmer
7594          does not care when this initialization happens, so beforefieldinit
7595          can be used.
7596          
7597          This bug prevents the AOT compiler from being usable, since it 
7598          generates so many calls to mono_runtime_class_init that the AOT code
7599          is much slower than the JITted code. The JITted code is faster, 
7600          because it does not generate these calls if the vtable is type is
7601          already initialized, which is true in the majority of cases. But the
7602          AOT compiler can't do this."
7603
7604 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7605
7606         * class.cs (MethodData.Emit): Refactor the code so symbolic
7607         information is generated for destructors;  For some reasons we
7608         were taking a code path that did not generate symbolic information
7609         before. 
7610
7611 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7612
7613         * class.cs: Create a Constructor.CheckBase method that
7614         takes care of all validation type code. The method
7615         contains some code that was moved from Define.
7616
7617         It also includes new code that checks for duplicate ctors.
7618         This fixes bug #55148.
7619
7620 2004-03-09  Joshua Tauberer <tauberer@for.net>
7621
7622         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7623         a { ... }-style array creation invokes EmitStaticInitializers
7624         which is not good for reference-type arrays.  String, decimal
7625         and now null constants (NullCast) are not counted toward
7626         static initializers.
7627
7628 2004-03-05  Martin Baulig  <martin@ximian.com>
7629
7630         * location.cs (SourceFile.HasLineDirective): New public field;
7631         specifies whether the file contains or is referenced by a "#line"
7632         directive.
7633         (Location.DefineSymbolDocuments): Ignore source files which
7634         either contain or are referenced by a "#line" directive.        
7635
7636 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7637
7638         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7639         direct access to our parent, so check the method inline there.
7640
7641 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7642
7643         * expression.cs (Invocation.EmitCall): Miguel's last commit
7644         caused a regression. If you had:
7645
7646             T t = null;
7647             t.Foo ();
7648
7649         In Foo the implict this would be null.
7650
7651 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7652
7653         * expression.cs (Invocation.EmitCall): If the method is not
7654         virtual, do not emit a CallVirt to it, use Call.
7655
7656         * typemanager.cs (GetFullNameSignature): Improve the method to
7657         cope with ".ctor" and replace it with the type name.
7658
7659         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7660         as an argument the ConstructorBuilder where it is being defined,
7661         to catch the recursive constructor invocations.
7662
7663 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7664
7665         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7666         routines to check if a type is an enumerable/enumerator allow
7667         classes that implement the IEnumerable or IEnumerator interfaces.
7668
7669         * class.cs (Property, Operator): Implement IIteratorContainer, and
7670         implement SetYields.
7671
7672         (Property.Define): Do the block swapping for get_methods in the
7673         context of iterators.   We need to check if Properties also
7674         include indexers or not.
7675
7676         (Operator): Assign the Block before invoking the
7677         OperatorMethod.Define, so we can trigger the Iterator code
7678         replacement. 
7679
7680         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7681         Property and Operator classes are not created when we parse the
7682         declarator but until we have the block completed, so we use a
7683         singleton SimpleIteratorContainer.Simple to flag whether the
7684         SetYields has been invoked.
7685
7686         We propagate this setting then to the Property or the Operator to
7687         allow the `yield' to function.
7688
7689 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7690
7691         * codegen.cs: Implemented attribute support for modules.
7692         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7693         Assembly/Module functionality.
7694
7695         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7696         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7697         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7698
7699 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7700
7701         * interface.cs (FindMembers): The operation is performed on all base
7702         interfaces and not only on the first. It is required for future CLS Compliance patch.
7703
7704 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7705
7706         * statement.cs, codegen.cs:
7707         This patch deals with patterns such as:
7708
7709         public class List : IEnumerable {
7710
7711                 public MyEnumerator GetEnumerator () {
7712                         return new MyEnumerator(this);
7713                 }
7714
7715                 IEnumerator IEnumerable.GetEnumerator () {
7716                         ...
7717                 }
7718                 
7719                 public struct MyEnumerator : IEnumerator {
7720                         ...
7721                 }
7722         }
7723
7724         Before, there were a few things we did wrong:
7725         1) we would emit callvirt on a struct, which is illegal
7726         2) we emited ldarg when we needed to emit ldarga
7727         3) we would mistakenly call the interface methods on an enumerator
7728         type that derived from IEnumerator and was in another assembly. For example:
7729
7730         public class MyEnumerator : IEnumerator
7731
7732         Would have the interface methods called, even if there were public impls of the
7733         method. In a struct, this lead to invalid IL code.
7734
7735 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7736
7737         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7738           renamed to Emit.
7739
7740         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7741
7742 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7743
7744         * cs-parser.jay: Fix small regression: we were not testing V2
7745         compiler features correctly.
7746
7747         * interface.cs: If the emit context is null, then create one
7748
7749 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7750
7751         * decl.cs (GetSignatureForError): New virtual method to get full name
7752           for error messages.
7753
7754         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7755           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7756
7757         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7758           Duplicated members and code in these classes has been removed.
7759           Better encapsulation in these classes.
7760
7761 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7762
7763         * assign.cs (Assign.DoResolve): When dealing with compound
7764         assignments, there is a new rule in ECMA C# 2.4 (might have been
7765         there before, but it is documented here) that states that in:
7766
7767         a op= b;
7768
7769         If b is of type int, and the `op' is a shift-operator, then the
7770         above is evaluated as:
7771
7772         a = (int) a op b 
7773
7774         * expression.cs (Binary.ResolveOperator): Instead of testing for
7775         int/uint/long/ulong, try to implicitly convert to any of those
7776         types and use that in pointer arithmetic.
7777
7778         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7779         method to print information for from the type, not from the
7780         null-method we were given.
7781
7782 2004-02-01  Duncan Mak  <duncan@ximian.com>
7783
7784         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7785         parsing for cmd, fixes bug #53694.
7786
7787 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7788
7789         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7790         in the member name duplication tests. Property and operator name duplication
7791         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7792
7793 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7794
7795         * interface.cs (PopulateMethod): Fixed crash when interface method
7796         returns not existing type (error test cs0246-3.cs).
7797
7798 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7799
7800         * cs-parser.jay (interface_accessors): Re-write actions to also
7801         store attributes attached to get and set methods. Fix spelling
7802         while at it.
7803
7804         (inteface_property_declaration): Modify accordingly.
7805
7806         (InterfaceAccessorInfo): New helper class to store information to pass
7807         around between rules that use interface_accessors.
7808
7809         * interface.cs (Emit): Apply attributes on the get and set
7810         accessors of properties and indexers too.
7811
7812         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7813         right MethodBuilder when applying attributes to the get and set accessors.
7814
7815 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7816
7817         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7818
7819 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7820
7821         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7822
7823 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7824
7825         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7826         changes that treat `yield' specially when present before `break'
7827         or `return' tokens.
7828
7829         * cs-tokenizer.cs: yield is no longer a keyword.
7830
7831 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7832
7833         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7834         setting for default constructors.
7835         For default constructors are almost every time set wrong Modifier. The
7836         generated IL code has been alright. But inside mcs this values was
7837         wrong and this was reason why several of my CLS Compliance tests
7838         failed.
7839
7840 2004-01-22  Martin Baulig  <martin@ximian.com>
7841
7842         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7843         not a QualifiedIdentifier.  This is what `type_name_expression'
7844         was previously doing.
7845         (type_name_expression): Removed; the code is now in
7846         `namespace_or_type_name'.
7847         (qualified_identifier): Removed, use `namespace_or_type_name'
7848         instead.
7849         (QualifiedIdentifier): Removed this class.      
7850
7851 2004-01-22  Martin Baulig  <martin@ximian.com>
7852
7853         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7854         not a string as alias name.
7855
7856 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7857
7858         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7859         #52730 bug, and instead compute correctly the need to use a
7860         temporary variable when requesting an address based on the
7861         static/instace modified of the field and the constructor.
7862  
7863 2004-01-21  Martin Baulig  <martin@ximian.com>
7864
7865         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7866         class and namespace before looking up aliases.  Fixes #52517.
7867
7868 2004-01-21  Martin Baulig  <martin@ximian.com>
7869
7870         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7871         assinged in a 'try'; fixes exception4.cs.
7872
7873 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7874         * class.cs : Implemented parameter-less constructor for TypeContainer
7875
7876         * decl.cs: Attributes are now stored here. New property OptAttributes
7877
7878         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7879
7880         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7881
7882 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7883
7884         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7885           (CSharpSignature): New method for indexer and property signature.
7886
7887 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7888
7889         * pending.cs (IsVirtualFilter): Faster implementation.
7890
7891 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7892
7893         * typemanager.cs: Avoid inclusion of same assembly more than once.
7894
7895 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7896
7897         * cs-parser.jay: Fixed problem where the last assembly attribute
7898           has been applied also to following declaration (class, struct, etc.)
7899           
7900 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7901
7902         * class.cs: Added error CS0538, CS0539 reporting.
7903         Fixed crash on Microsoft runtime when field type is void.
7904
7905         * cs-parser.jay: Added error CS0537 reporting.
7906
7907         * pending.cs: Added error CS0535 reporting.
7908         Improved error report for errors CS0536, CS0534.
7909
7910 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7911
7912         Merge a few bits from the Anonymous Method MCS tree.
7913
7914         * statement.cs (ToplevelBlock): New class for toplevel methods,
7915         will hold anonymous methods, lifted variables.
7916
7917         * cs-parser.jay: Create toplevel blocks for delegates and for
7918         regular blocks of code. 
7919
7920 2004-01-20  Martin Baulig  <martin@ximian.com>
7921
7922         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7923         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7924         and `NeedExplicitReturn'; added `IsLastStatement'.
7925         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7926         have a `ReturnLabel' or we're not unreachable.
7927
7928         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7929         child's reachability; don't just override ours with it.  Fixes
7930         #58058 (lluis's example).
7931         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7932         InFinally(), InLoop(), InSwitch() and
7933         BreakCrossesTryCatchBoundary() methods.
7934
7935         * statement.cs (Return): Do all error checking in Resolve().
7936         Unless we are the last statement in a top-level block, always
7937         create a return label and jump to it.
7938         (Break, Continue): Do all error checking in Resolve(); also make
7939         sure we aren't leaving a `finally'.
7940         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7941         statement in a top-level block.
7942         (Block.Flags): Added `IsDestructor'.
7943         (Block.IsDestructor): New public property.
7944
7945 2004-01-20  Martin Baulig  <martin@ximian.com>
7946
7947         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7948
7949 2004-01-20  Martin Baulig  <martin@ximian.com>
7950
7951         * statement.cs (Statement.ResolveUnreachable): New public method.
7952         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7953         (Block.Resolve): Resolve unreachable statements.
7954
7955 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7956
7957         * expression.cs: We need to fix the case where we do
7958         not have a temp variable here.
7959
7960         * assign.cs: Only expression compound assignments need
7961         temporary variables.
7962
7963 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7964
7965         * flowanalysis.cs: Reduce memory allocation in a few ways:
7966           - A block with no variables should not allocate a bit
7967             vector for itself.
7968           - A method with no out parameters does not need any tracking
7969             for assignment of the parameters, so we need not allocate
7970             any data for it.
7971           - The arrays:
7972                 public readonly Type[] VariableTypes;
7973                 public readonly string[] VariableNames;
7974             Are redundant. The data is already stored in the variable
7975             map, so we need not allocate another array for it.
7976           - We need to add alot of checks for if (params | locals) == null
7977             due to the first two changes.
7978
7979 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7980
7981         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7982         implement IMemoryLocation, we store a copy on a local variable and
7983         take the address of it.  Patch from Benjamin Jemlich
7984
7985         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7986         to use a special "type_name_expression" rule which reduces the
7987         number of "QualifiedIdentifier" classes created, and instead
7988         directly creates MemberAccess expressions.
7989
7990 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7991
7992         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7993         that fixes #52853.  Null literal assignment to ValueType
7994
7995         * class.cs (MethodData.Emit): Instead of checking the name of the
7996         method to determine if its a destructor, create a new derived
7997         class from Method called Destructor, and test for that.  
7998
7999         * cs-parser.jay: Create a Destructor object instead of a Method.  
8000
8001         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8002
8003         Fixes: 52933
8004
8005 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8006
8007         * expression.cs (Binary.ResolveOperator): Perform an implicit
8008         conversion from MethodGroups to their delegate types on the
8009         Addition operation.
8010
8011         * delegate.cs: Introduce a new class DelegateCreation that is the
8012         base class for `NewDelegate' and `ImplicitDelegateCreation',
8013         factor some code in here.
8014
8015         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8016         conversion from MethodGroups to compatible delegate types. 
8017
8018         * ecore.cs (Expression.Resolve): Do not flag error 654
8019         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8020         we allow conversions from MethodGroups to delegate types now.
8021
8022         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8023         assignments in v2 either.
8024
8025 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8026
8027         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8028         static read-only fields in ctors.
8029
8030         Applied patch from Benjamin Jemlich 
8031
8032         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8033
8034 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8035
8036         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8037         here to return true, as they can be used like this:
8038
8039                 (XXX) int.MEMBER ()
8040
8041         Fixed 49836 and all the other dups
8042
8043 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8044
8045         * driver.cs: Implement /win32res and /win32icon.
8046
8047 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8048
8049         * cs-parser.jay: Add a rule to improve error handling for the
8050         common mistake of placing modifiers after the type.
8051
8052 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8053
8054         * cs-parser.jay (interface_event_declaration): Catch
8055         initialization of events on interfaces, and report cs0068
8056
8057         * cs-parser.jay (interface_event_declaration): Catch
8058         initialization of events. 
8059
8060         * ecore.cs: Better report missing constructors.
8061
8062         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8063         the error reporting done in the wrong place.  Fix.
8064
8065         * expression.cs (Binary.ResolveOperator): Catch the 
8066         operator + (E x, E y) error earlier, and later allow for implicit
8067         conversions in operator +/- (E e, U x) from U to the underlying
8068         type of E.
8069
8070         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8071         52596, if the container class is abstract, the default constructor
8072         is protected otherwise its public (before, we were always public).
8073
8074         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8075         fixed statement.
8076
8077         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8078         Jemlich that fixes bug #52597, MCS was generating invalid code for
8079         idisposable structs.   Thanks to Ben for following up with this
8080         bug as well.
8081
8082 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8083
8084         * driver.cs: Allow assemblies without code to be generated, fixes
8085         52230.
8086
8087 2004-01-07  Nick Drochak <ndrochak@gol.com>
8088
8089         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8090
8091 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8092
8093         * cs-parser.jay: Add rules to improve error reporting if fields or
8094         methods are declared at the namespace level (error 116)
8095
8096         * Add rules to catch event add/remove
8097
8098 2004-01-04  David Sheldon <dave-mono@earth.li>
8099
8100   * expression.cs: Added matching ")" to error message for 
8101   CS0077
8102
8103 2004-01-03 Todd Berman <tberman@gentoo.org>
8104
8105         * ecore.cs, attribute.cs:
8106         Applying fix from #52429.
8107
8108 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8109
8110         * ecore.cs, expression.cs, statement.cs:
8111         Total rewrite of how we handle branching. We
8112         now handle complex boolean expressions with fewer
8113         jumps. As well if (x == 0) no longer emits a ceq.
8114
8115         if (x is Foo) is much faster now, because we generate
8116         better code.
8117
8118         Overall, we get a pretty big improvement on our benchmark
8119         tests. The code we generate is smaller and more readable.
8120
8121         I did a full two-stage bootstrap. The patch was reviewed
8122         by Martin and Miguel.
8123
8124 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8125
8126         * cs-parser.jay: Make primary_expression not take a QI.
8127         we dont need this because the member_access rule covers
8128         us here. So we replace the rule with just IDENTIFIER.
8129
8130         This has two good effects. First, we remove a s/r conflict.
8131         Second, we allocate many fewer QualifiedIdentifier objects.
8132
8133 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8134
8135         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8136         set the correct information via SRE. This prevents
8137         hanging on the MS runtime. Fixes #29374.
8138
8139 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8140
8141         * convert.cs: correctly handle conversions to value types
8142         from Enum and ValueType as unboxing conversions.
8143
8144         Fixes bug #52569. Patch by Benjamin Jemlich.
8145
8146 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8147
8148         * expression.cs (BetterConversion): Prefer int -> uint
8149         over int -> ulong (csc's behaviour). This fixed bug #52046.
8150
8151 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8152
8153         * decl.cs (MemberCache.FindMembers): now returns a
8154         MemberInfo [].
8155
8156         * typemanager.cs: In general, go with with ^^.
8157         (CopyNewMethods): take an IList.
8158         (RealMemberLookup): Only allocate an arraylist
8159         if we copy from two sets of methods.
8160
8161         This change basically does two things:
8162         1) Fewer array lists allocated due to CopyNewMethods.
8163         2) the explicit cast in MemberList costed ALOT.
8164
8165 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8166
8167         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8168         a hashtable to avoid needless string allocations when an identifier is
8169         used more than once (the common case).
8170
8171 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8172
8173         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8174         is broken, it will not return anything. So, we
8175         have to use the information we have in mcs to
8176         do the task.
8177
8178         * typemanager.cs: Add a cache for GetInterfaces,
8179         since this will now be used more often (due to ^^)
8180
8181         (GetExplicitInterfaces) New method that gets the
8182         declared, not effective, interfaces on a type
8183         builder (eg, if you have interface IFoo, interface
8184         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8185         { IBar }.
8186
8187         This patch makes MCS able to bootstrap itself on
8188         Windows again.
8189
8190 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8191
8192         * expression.cs: Remove the Nop's that Miguel put
8193         in by mistake.
8194
8195 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8196
8197         * report.cs, codegen.cs: Give the real stack trace to
8198         the error when an exception is thrown.
8199
8200 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8201
8202         * decl.cs: only allocate hashtables for ifaces if 
8203         it is an iface!
8204
8205 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8206
8207         * expression.cs: fix the error from cs0121-2.cs
8208         (a parent interface has two child interfaces that
8209         have a function with the same name and 0 params
8210         and the function is called through the parent).
8211
8212 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8213
8214         * class.cs, rootcontext.cs, typmanager.cs: do not
8215         leak pointers.
8216
8217 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8218
8219         * codegen.cs: remove stack for the ec flow branching.
8220         It is already a linked list, so no need.
8221
8222 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8223
8224         * Makefile: Allow custom profiler here.
8225
8226 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8227
8228         * typemanager.cs (LookupType):
8229           - Use a static char [], because split takes
8230             a param array for args, so it was allocating
8231             every time.
8232           - Do not store true in a hashtable, it boxes.
8233
8234 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8235
8236         * flowanalysis.cs: bytify common enums.
8237
8238 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8239
8240         * modifiers.cs: Add a new set of flags for the
8241         flags allowed on explicit interface impls.
8242         * cs-parser.jay: catch the use of modifiers in
8243         interfaces correctly.
8244         * class.cs: catch private void IFoo.Blah ().
8245
8246         All related to bug #50572.
8247
8248 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8249
8250         * decl.cs: Rewrite the consistant accessability checking.
8251         Accessability is not linear, it must be implemented in
8252         a tableish way. Fixes #49704.
8253
8254 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8255
8256         * expression.cs: Handle negation in a checked context.
8257         We must use subtraction from zero. Fixes #38674.
8258
8259 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8260
8261         * class.cs: Ignore static void main in DLLs.
8262         * rootcontext.cs: Handle the target type here,
8263         since we are have to access it from class.cs
8264         * driver.cs: account for the above.
8265
8266 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8267
8268         * report.cs: Give line numbers and files if available.
8269
8270 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8271
8272         * driver.cs: Implement /addmodule.
8273
8274         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8275         ModuleBuilders.
8276
8277 2003-12-20  Martin Baulig  <martin@ximian.com>
8278
8279         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8280         (FieldBase.IsAssigned): Removed this field.
8281         (FieldBase.SetAssigned): New public method.
8282         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8283
8284 2003-12-20  Martin Baulig  <martin@ximian.com>
8285
8286         * expression.cs (LocalVariableReference.DoResolve): Don't set
8287         `vi.Used' if we're called from DoResolveLValue().
8288
8289         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8290         returns the usage vector it just merged into the current one -
8291         pass this one to UsageWarning().
8292         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8293         of the `EmitContext', don't call this recursively on our children.
8294
8295 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8296
8297         * driver.cs: Implement /target:module.
8298
8299 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8300
8301         * support.cs (CharArrayHashtable): New helper class.
8302
8303         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8304         char arrays, not strings, so we can avoid creating a string in
8305         consume_identifier if the identifier is a keyword.
8306
8307 2003-12-16  Martin Baulig  <martin@ximian.com>
8308
8309         * statement.cs (LocalInfo.Assigned): Removed this property.
8310         (LocalInfo.Flags): Removed `Assigned'.
8311         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8312         and uses flow analysis.
8313         (Block.UsageWarning): Made this method private.
8314         (Block.Resolve): Call UsageWarning() if appropriate.
8315
8316         * expression.cs (LocalVariableReference.DoResolve): Always set
8317         LocalInfo.Used here.
8318
8319 2003-12-13  Martin Baulig  <martin@ximian.com>
8320
8321         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8322         any value here; we're now using flow analysis to figure out
8323         whether a statement/block returns a value.
8324
8325 2003-12-13  Martin Baulig  <martin@ximian.com>
8326
8327         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8328         working again.
8329         (FlowBranching.MergeFinally): Don't call
8330         `branching.CheckOutParameters()' here, this is called in
8331         MergeTopBlock().
8332         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8333         when adding the `finally' vector.       
8334
8335 2003-12-13  Martin Baulig  <martin@ximian.com>
8336
8337         * flowanalysis.cs
8338         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8339         actually work and also fix #48962.
8340
8341 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8342
8343         * decl.cs: Do not check System.Object for nested types,
8344         since we know it does not have any. Big bang for buck:
8345
8346         BEFORE:
8347            Run 1:   8.35 seconds
8348            Run 2:   8.32 seconds
8349            corlib:  17.99 seconds
8350         AFTER:
8351            Run 1:   8.17 seconds
8352            Run 2:   8.17 seconds
8353            corlib:  17.39 seconds
8354
8355 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8356
8357         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8358         time we are returning 0 members, so we save alot here.
8359
8360 2003-12-11  Martin Baulig  <martin@ximian.com>
8361
8362         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8363         `MergeChild()', also just take the `FlowBranching' as argument;
8364         call Merge() on it and return the result.
8365         (FlowBranching.Merge): We don't need to do anything if we just
8366         have one sibling.
8367
8368 2003-12-11  Martin Baulig  <martin@ximian.com>
8369
8370         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8371         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8372         Maurer for this idea.
8373
8374 2003-12-11  Martin Baulig  <martin@ximian.com>
8375
8376         * flowanalysis.cs (MergeResult): This class is now gone; we now
8377         use the `UsageVector' for this.  The reason for this is that if a
8378         branching just has one sibling, we don't need to "merge" them at
8379         all - that's the next step to do.
8380         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8381         `MergeResult'.
8382
8383 2003-12-11  Martin Baulig  <martin@ximian.com>
8384
8385         Reworked flow analyis and made it more precise and bug-free.  The
8386         most important change is that we're now using a special `Reachability'
8387         class instead of having "magic" meanings of `FlowReturns'.  I'll
8388         do some more cleanups and optimizations and also add some more
8389         documentation this week.
8390
8391         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8392         largely reworked this class.
8393         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8394         the new `Reachability' class instead of having "magic" values here.
8395         (FlowBranching): We're now using an instance of `Reachability'
8396         instead of having separate `Returns', `Breaks' etc. fields.
8397
8398         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8399         based on flow analysis; ignore the return value of block.Emit ().
8400
8401 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8402
8403         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8404         if they are private.
8405
8406 2003-12-09  Martin Baulig  <martin@ximian.com>
8407
8408         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8409         call them directly on the UsageVector.
8410
8411 2003-12-09  Martin Baulig  <martin@ximian.com>
8412
8413         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8414         Changed return type from `FlowReturns' to `Reachability'.
8415
8416 2003-12-09  Martin Baulig  <martin@ximian.com>
8417
8418         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8419         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8420         `Reachable' fields with a single `Reachability' one.
8421
8422 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8423
8424         * class.cs (FindMembers): Remove foreach's.
8425
8426         Bootstrap times:
8427
8428         BEFORE
8429                 Run 1:   8.74 seconds
8430                 Run 2:   8.71 seconds
8431
8432         AFTER
8433                 Run 1:   8.64 seconds
8434                 Run 2:   8.58 seconds
8435
8436
8437 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8438
8439         * cs-parser.jay:
8440         * gen-treedump.cs:
8441         * statement.cs:
8442         This patch does a few things:
8443                 1. EmptyStatement is now a singleton, so it is never reallocated.
8444                 2. All blah is EmptyStatement constructs have been changed to
8445                    blah == EmptyStatement.Value, which is much faster and valid
8446                    now that EmptyStatement is a singleton.
8447                 3. When resolving a block, rather than allocating a new array for
8448                    the non-empty statements, empty statements are replaced with
8449                    EmptyStatement.Value
8450                 4. Some recursive functions have been made non-recursive.
8451         Mainly the performance impact is from (3), however (1) and (2) are needed for
8452         this to work. (4) does not make a big difference in normal situations, however
8453         it makes the profile look saner.
8454
8455         Bootstrap times:
8456
8457         BEFORE
8458         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8459         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8460         Total memory allocated: 56397 KB
8461
8462         AFTER
8463         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8464         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8465         Total memory allocated: 55666 KB
8466
8467 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8468
8469         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8470         than the hashtable in a hashtable version
8471
8472         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8473         we always end up concating a string. This results in a huge perf
8474         loss, because many strings have to be tracked by the GC. In this
8475         patch, we first use a hashtable that works with two keys, so that
8476         the strings do not need to be concat'ed.
8477
8478         Bootstrap times:
8479         BEFORE
8480                 Run 1:   8.74 seconds
8481                 Run 2:   8.71 seconds
8482
8483         AFTER
8484                 Run 1:   8.65 seconds
8485                 Run 2:   8.56 seconds
8486
8487 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8488
8489         * Makefile: Add a new target `do-time' that does a quick and simple
8490         profile, leaving easy to parse output.
8491
8492 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8493
8494         * codegen.cs (Init): Create the dynamic assembly with 
8495         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8496
8497 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8498
8499         * support.cs: Make the PtrHashtable use only one
8500         instance of its comparer.
8501
8502 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8503
8504         * typemanager.cs: Fix lookup of GetNamespaces.
8505
8506 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8507
8508         * expression.cs: Removed redundant line.
8509
8510         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8511         ArrayLists, use for loops with bounds.  
8512
8513         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8514         arraylist.
8515
8516         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8517         arraylists, use for loop with bounds.
8518
8519         The above three changes give us a 0.071 second performance
8520         improvement out of 3.294 seconds down to 3.223.  On my machine
8521         the above changes reduced the memory usage by 1,387 KB during
8522         compiler bootstrap.
8523
8524         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8525         QualifiedIdentifiers.  Before we created a new string through
8526         concatenation, and mostly later on, the result would be
8527         manipulated by DecomposeQI through string manipulation.
8528
8529         This reduced the compiler memory usage for bootstrapping from
8530         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8531         compile times in 0.05 seconds.
8532
8533 2003-11-28  Dick Porter  <dick@ximian.com>
8534
8535         * support.cs: Do string compares with the Invariant culture.
8536
8537         * rootcontext.cs: 
8538         * gen-treedump.cs: 
8539         * expression.cs: 
8540         * driver.cs: 
8541         * decl.cs: 
8542         * codegen.cs: 
8543         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8544         the comparison is done with the Invariant culture.
8545
8546 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8547
8548         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8549         GetEnumerator method.
8550
8551         (ProbeCollectionType): Iterate starting at the most specific type
8552         upwards looking for a GetEnumerator
8553
8554         * expression.cs: Shift count can be up to 31 for int/uint and 63
8555         for long/ulong.
8556
8557 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8558
8559         * statement.cs (Block.LookupLabel): Also look for the label on the
8560         children blocks.  Use a hash table to keep track of visited
8561         nodes. 
8562
8563         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8564         we actually did transform the other operand, otherwise fall back
8565         to the common codepath that casts to long.
8566
8567         * cs-tokenizer.cs: Use the same code pattern as the int case.
8568         Maybe I should do the parsing myself, and avoid depending on the
8569         Parse routines to get this done.
8570
8571 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8572
8573         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8574         which fixes bug 51347.  This time test it.
8575
8576         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8577         attributes for example can not tell the difference between these.
8578         The difference was only a syntax feature of the language. 
8579
8580         * attribute.cs: Apply attributes to delegates.
8581
8582         * delegate.cs: Call the apply attributes method.
8583
8584 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8585
8586         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8587         comparing 0 vs Byte.MinValue, not the value
8588
8589         (ImplicitConversionRequired): When reporting a conversion error,
8590         use error 31 to print out the constant error instead of the
8591         simpler 29.
8592
8593         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8594         which fixes bug 51347.
8595
8596 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8597
8598         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8599         which fixes the -warnaserror command line option.
8600
8601 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8602
8603         * cfold.cs (DoNumericPromotions): During constant folding of
8604         additions on UIntConstant, special case intconstants with
8605         IntConstants like we do on the expression binary operator. 
8606
8607 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8608
8609         * convert.cs (ImplicitReferenceConversion): We were missing a case
8610         (System.Enum are not value types or class types, so we need to
8611         classify them separatedly).
8612
8613         * driver.cs: We do not support error 2007.
8614
8615 2003-11-12 Jackson Harper <jackson@ximian.com>
8616
8617         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8618         system directory. Also use the full file name so users can
8619         libraries names mscorlib-o-tron.dll in a non system dir.
8620
8621 2003-11-10  Martin Baulig  <martin@ximian.com>
8622
8623         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8624         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8625         calling `ResolveType()' on them, directly assign their `Type'.
8626
8627 2003-11-08  Martin Baulig  <martin@ximian.com>
8628
8629         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8630         return value and the `out parent' parameter.
8631         (TypeContainer.DefineType): Moved the CS0644 check into
8632         GetClassBases().  Don't pass the interface types to the
8633         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8634         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8635
8636         * ecore.cs (TypeExpr.IsAttribute): New property.
8637         (TypeExpr.GetInterfaces): New method.
8638
8639         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8640         TypeExpr instead of a Type.
8641         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8642         (Interface.DefineType): Don't pass the interface types to the
8643         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8644         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8645
8646         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8647         instead of a `Type[]'.
8648         (TypeManager.RegisterBuilder): Likewise.
8649         (TypeManager.AddUserInterface): Likewise.
8650         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8651         `Type[]' and also return a `TypeExpr[]'.
8652         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8653
8654 2003-11-08  Martin Baulig  <martin@ximian.com>
8655
8656         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8657         Expression.     
8658
8659 2003-11-08  Martin Baulig  <martin@ximian.com>
8660
8661         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8662         TypeManager.ResolveExpressionTypes().
8663
8664         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8665         instead of an Expression.
8666         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8667         (TypeExpression): New public class; formerly known as `TypeExpr'.
8668
8669         * expression.cs (ComposedCast): Derive from TypeExpr.
8670
8671         * typemanager.cs (TypeManager.system_*_expr): These are now
8672         TypExpr's instead of Expression's.
8673         (TypeManager.ResolveExpressionTypes): New public static function;
8674         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8675         of them.        
8676
8677 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8678
8679         * expression.cs (New.DoResolve): Do not dereference value that
8680         might be a null return.
8681
8682         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8683         sure that the constant value has the right type.  Fixes an
8684         unreported bug, similar to 50425.
8685
8686         * const.cs (Const.LookupConstantValue): Call
8687         ImplicitStandardConversionExists before doing a conversion to
8688         avoid havng the TypeManager.ChangeType do conversions.
8689
8690         Reduced the number of casts used
8691
8692         (Const.ChangeType): New routine to enable reuse of the constant
8693         type changing code from statement.
8694
8695         * typemanager.cs (ChangeType): Move common initialization to
8696         static global variables.
8697
8698         Fixes #50425.
8699
8700         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8701         every value type to go through, even if it was void.  Fix that. 
8702
8703         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8704         character of the define, and the is_identifier_part_character for
8705         the rest of the string.
8706
8707 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8708
8709         * expression.cs (UnaryMutator.EmitCode): When I updated
8710         LocalVariableReference.DoResolve, I overdid it, and dropped an
8711         optimization done on local variable references.
8712
8713 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8714
8715         * ecore.cs: Convert the return from Ldlen into an int.
8716
8717 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8718
8719         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8720         the accessibility, this is a special case for toplevel non-public
8721         classes (internal for instance).
8722
8723 2003-10-20  Nick Drochak <ndrochak@gol.com>
8724
8725         * ecore.cs: Fix typo and build.  Needed another right paren.
8726
8727 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8728
8729         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8730         `internal' case regular and protected, but not allowing protected
8731         to be evaluated later.  Bug 49840
8732
8733 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8734
8735         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8736         to kb.Nlast, and not the kb.nFirst to isolate the switch
8737         statement.
8738
8739         Extract the underlying type, so enumerations of long/ulong are
8740         treated like long/ulong.
8741
8742 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8743
8744         * expression.cs (New): Overload the meaning of RequestedType to
8745         track the possible creation of the NewDelegate type, since
8746         DoResolve is invoked more than once for new constructors on field
8747         initialization.
8748
8749         See bugs: #48800 and #37014
8750
8751         * cs-parser.jay (declare_local_constants): Take an arraylist
8752         instead of a single constant.
8753
8754         (local_constant_declaration): It should take a
8755         constant_declarators, not a constant_declarator.  Fixes 49487
8756
8757         * convert.cs: Fix error report.
8758
8759 2003-10-13 Jackson Harper <jackson@ximian.com>
8760
8761         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8762         bug #49611
8763
8764 2003-10-09  Martin Baulig  <martin@ximian.com>
8765
8766         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8767         to the .ctor.
8768         (MethodCore.DoDefineParameters): Removed the TypeContainer
8769         argument; use the DeclSpace which was passed to the .ctor instead.
8770         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8771         TypeContainer; we only need a DeclSpace here.
8772
8773 2003-10-09  Martin Baulig  <martin@ximian.com>
8774
8775         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8776         to the .ctor.
8777         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8778         EmitContext's .ctor.    
8779
8780 2003-10-09  Martin Baulig  <martin@ximian.com>
8781
8782         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8783         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8784         AsAccessible(), moved them as well.
8785
8786         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8787
8788 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8789
8790         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8791
8792 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8793
8794         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8795         generation for >=, as spotted by Paolo, bug 48679.  
8796         Patch from David Waite.
8797
8798         * cs-tokenizer.cs: Add handling for #pragma.
8799
8800         * cs-parser.jay: Allow for both yield and yield return in the
8801         syntax.  The anti-cobolization of C# fight will go on!
8802
8803         * class.cs (TypeBuilder.DefineType): Catch error condition here
8804         (Parent.DefineType erroring out and returning null).
8805
8806         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8807         coping with enumerations variables, we were mistakenly processing
8808         them as a regular value type instead of built-in types.  Fixes the
8809         bug #48063
8810
8811         * typemanager.cs (IsBuiltinOrEnum): New method.
8812
8813 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8814
8815         * cs-parser.jay: Upgrade: yield now needs the return clause.
8816
8817 2003-09-19  Martin Baulig  <martin@ximian.com>
8818
8819         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8820         `MemberCache parent' argument.  Normally, an interface doesn't
8821         have a parent type except System.Object, but we use this in gmcs
8822         for generic type parameters.
8823
8824 2003-09-18  Martin Baulig  <martin@ximian.com>
8825
8826         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8827         on `type.IsInterface'; don't check whether the type has a parent
8828         to determine whether it's an interface.
8829
8830 2003-09-15  Martin Baulig  <martin@ximian.com>
8831
8832         * class.cs (TypeContainer.DefineType): Added an error flag to
8833         avoid reporting duplicate CS0146's ("class definition is
8834         circular.").
8835
8836         * driver.cs (Driver.MainDriver): Abort if
8837         RootContext.ResolveTree() reported any errors.
8838
8839 2003-09-07  Martin Baulig  <martin@ximian.com>
8840
8841         * report.cs (Error, Warning): Added overloaded versions which take
8842         a `params object[] args' and call String.Format().
8843
8844 2003-09-07  Martin Baulig  <martin@ximian.com>
8845
8846         * decl.cs (DeclSpace..ctor): Don't call
8847         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8848         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8849         (DeclSpace.RecordDecl): New method.
8850
8851         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8852
8853 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8854
8855         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8856         value attributes to be applied to ParameterBuilders.
8857
8858         * class.cs (MethodCore.LabelParameters): Make static and more
8859         generic so that it can be used from other places - like interface
8860         methods, for instance.
8861
8862         * interface.cs (Interface.Emit): Call LabelParameters before
8863         emitting attributes on the InterfaceMethod.
8864
8865 2003-08-26  Martin Baulig  <martin@ximian.com>
8866
8867         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
8868         resolving aliases; fixes #47927.
8869
8870 2003-08-26  Martin Baulig  <martin@ximian.com>
8871
8872         * statement.cs (Using.DoResolve): This is internally emitting a
8873         try/finally clause, so we need to set ec.NeedExplicitReturn if we
8874         do not always return.  Fixes #47681.
8875
8876 2003-08-26  Martin Baulig  <martin@ximian.com>
8877
8878         * decl.cs (MemberCore): Moved WarningNotHiding(),
8879         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
8880         into MemberBase.
8881         (AdditionResult): Make this nested in DeclSpace.
8882         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
8883         argument; call NamespaceEntry.Define() unless we're nested in a
8884         class or struct.
8885
8886         * namespace.cs (Namespace.DefineName): New public function.  This
8887         is called from DeclSpace's .ctor to add 
8888         (Namespace.Lookup): Include DeclSpaces in the lookup.
8889
8890         * class.cs (Operator): Derive from MemberBase, not MemberCore.
8891
8892         * const.cs (Const): Derive from MemberBase, not MemberCore.     
8893
8894 2003-08-25  Martin Baulig  <martin@ximian.com>
8895
8896         * convert.cs (Convert.ExplicitReferenceConversion): When
8897         converting from an interface type to a class, unbox if the target
8898         type is a struct type.  Fixes #47822.
8899
8900 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8901
8902         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
8903         #47854.
8904
8905 2003-08-22  Martin Baulig  <martin@ximian.com>
8906
8907         * class.cs (TypeManager.DefineType): When defining a nested type,
8908         call DefineType() on our parent; fixes #47801.
8909
8910 2003-08-22  Martin Baulig  <martin@ximian.com>
8911
8912         * class.cs (MethodData.Define): While checking if a method is an
8913         interface implementation, improve the test a bit more to fix #47654.
8914
8915 2003-08-22  Martin Baulig  <martin@ximian.com>
8916
8917         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
8918         correctly; fixes #47722.
8919
8920 2003-08-22  Martin Baulig  <martin@ximian.com>
8921
8922         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
8923         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
8924
8925         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
8926
8927 2003-08-22  Martin Baulig  <martin@ximian.com>
8928
8929         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
8930         can only be assigned in static constructors.  Fixes #47161.
8931
8932 2003-08-22  Martin Baulig  <martin@ximian.com>
8933
8934         Rewrote and improved the flow analysis code.
8935
8936         * flowbranching.cs (FlowBranching): Make this class abstract.
8937         (FlowBranching.CreateBranching): New static function to create a
8938         new flow branching.
8939         (FlowBranchingBlock, FlowBranchingException): New classes.
8940         (FlowBranching.UsageVector.Type): New public readonly field.
8941         (FlowBranching.UsageVector.Breaks): Removed the setter.
8942         (FlowBranching.UsageVector.Returns): Removed the setter.
8943         (FlowBranching.UsageVector): Added Break(), Return(),
8944         NeverReachable() and Throw() methods to modify the reachability.
8945         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8946         done by FlowBranching.Merge().
8947         (FlowBranching.UsageVector.MergeChild): New method; merges the
8948         merge result into the current vector.
8949         (FlowBranching.Merge): New abstract method to merge a branching.
8950
8951 2003-08-12  Martin Baulig  <martin@ximian.com>
8952
8953         * expression.cs (Indirection.CacheTemporaries): Create the
8954         LocalTemporary with the pointer type, not its element type.
8955
8956 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8957
8958         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8959         token was a keyword or not.
8960
8961         Add `error' options where an IDENTIFIER was expected;  Provide
8962         CheckToken and CheckIdentifierToken convenience error reporting
8963         functions. 
8964
8965         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8966
8967         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8968         NameSpaceEntry NameSpaceEntry.
8969
8970         (LookupInterfaceOrClass): Avoid creating a full qualified name
8971         from namespace and name: avoid doing lookups when we know the
8972         namespace is non-existant.   Use new Tree.LookupByNamespace which
8973         looks up DeclSpaces based on their namespace, name pair.
8974
8975         * driver.cs: Provide a new `parser verbose' to display the
8976         exception thrown during parsing.  This is turned off by default
8977         now, so the output of a failure from mcs is more graceful.
8978
8979         * namespace.cs: Track all the namespaces defined in a hashtable
8980         for quick lookup.
8981
8982         (IsNamespace): New method
8983
8984 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8985
8986         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8987         we know that we need to concatenate (full typename can never be
8988         null). 
8989
8990         * class.cs: ditto.
8991
8992         * statement.cs: Use a bitfield;  Do not initialize to null things
8993         which are done by the constructor by default.
8994
8995         * cs-parser.jay: bug fix, parameter was 4, not 3.
8996
8997         * expression.cs: Just use the property;
8998
8999         * statement.cs: No need for GetVariableInfo method.
9000
9001 2003-08-08  Martin Baulig  <martin@ximian.com>
9002
9003         * flowanalysis.cs (FlowReturns): This is now nested in the
9004         `FlowBranching' class.
9005         (MyBitVector): Moved this here from statement.cs.
9006         (FlowBranching.SiblingType): New enum type.
9007         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9008
9009 2003-08-07  Martin Baulig  <martin@ximian.com>
9010
9011         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9012         `FlowBranching' class and called `BranchingType'.
9013
9014 2003-08-07  Martin Baulig  <martin@ximian.com>
9015
9016         * flowanalysis.cs: Moved all the control flow analysis code into
9017         its own file.
9018
9019 2003-08-07  Martin Baulig  <martin@ximian.com>
9020
9021         * assign.cs (Assign.DoResolve): `target' must either be an
9022         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9023         #37319.
9024
9025 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9026
9027         * expression.cs (BinaryMethod): This kind of expression is created by the
9028         Binary class if it determines that the operator has to be handled
9029         by a method.
9030
9031         (BinaryDelegate): This kind of expression is created if we are
9032         dealing with a + or - operator on delegates.
9033
9034         (Binary): remove method, argumetns, and DelegateOperator: when
9035         dealing with methods, 
9036
9037         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9038
9039         * statement.cs (Block): use bitfields for the three extra booleans
9040         we had in use.   Remove unused topblock parameter.
9041
9042         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9043
9044         * assign.cs: Drop extra unneeded tests.
9045
9046 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9047
9048         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9049
9050         * statement.cs (Foreach): Use VariableStorage instead of
9051         LocalBuilders.   
9052
9053         * codegen.cs (VariableStorage): New class used by clients that
9054         require a variable stored: locals or fields for variables that
9055         need to live across yield.
9056
9057         Maybe provide a convenience api for EmitThis+EmitLoad?
9058
9059         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9060         these bad boys.
9061
9062 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9063
9064         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9065         RemapParameterLValue): New methods that are used to turn a
9066         precomputed FieldInfo into an expression like this:
9067
9068                 instance.FieldInfo
9069
9070         The idea is to use this instead of making LocalVariableReference
9071         have more than one meaning.
9072
9073         * cs-parser.jay: Add error production to BASE.
9074
9075         * ecore.cs: Deal with TypeManager.GetField returning null, which
9076         is now a valid return value.
9077
9078         (FieldExprNoAddress): New expression for Fields whose address can
9079         not be taken.
9080
9081         * expression.cs (LocalVariableReference): During the resolve
9082         phases, create new expressions if we are in a remapping context.
9083         Remove code that dealt with remapping here.
9084
9085         (ParameterReference): same.
9086
9087         (ProxyInstance): New expression, like the `This' expression, but
9088         it is born fully resolved.  We know what we are doing, so remove
9089         the errors that are targeted to user-provided uses of `this'.
9090
9091         * statement.cs (Foreach): our variable is now stored as an
9092         Expression;  During resolution, follow the protocol, dont just
9093         assume it will return this.
9094
9095 2003-08-06  Martin Baulig  <martin@ximian.com>
9096
9097         * support.cs (SeekableStreamReader.cs): New public class.
9098
9099         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9100         SeekableStreamReader instead of the normal StreamReader.
9101
9102 2003-08-04  Martin Baulig  <martin@ximian.com>
9103
9104         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9105         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9106         deambiguate casts and delegate invocations.
9107         (parenthesized_expression): Use the new tokens to ensure this is
9108         not a cast of method invocation.
9109
9110         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9111         when reading a `)' and Deambiguate_CloseParens () was previously
9112         called.
9113
9114         * expression.cs (ParenthesizedExpression): New class.  This is
9115         just used for the CS0075 test.
9116         (Binary.DoResolve): Check for CS0075.   
9117
9118 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9119
9120         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9121         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9122         reference comparison.
9123
9124         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9125         examine the ReturnType for equality - this is necessary in the
9126         cases of implicit and explicit operators whose signature also
9127         includes the return type.
9128
9129 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9130
9131         * namespace.cs: Cache the result of the namespace computation,
9132         instead of computing it every time.
9133
9134 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9135
9136         * decl.cs: Use a global arraylist that we reuse over invocations
9137         to avoid excesive memory consumption.  Reduces memory usage on an
9138         mcs compile by one meg (45 average).
9139
9140         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9141         private, work around that.
9142
9143 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9144
9145         * literal.cs (IntLiteral): Define Zero and One static literals. 
9146
9147         * cs-parser.jay (integer_literal): use static literals to reduce
9148         memory usage for the most used literals (0, 1 and -1).  211kb
9149         reduced in memory usage.
9150
9151         Replace all calls to `new ArrayList' with `new
9152         ArrayList(4)' which is a good average number for most allocations,
9153         and also requires only 16 bytes of memory for its buffer by
9154         default. 
9155
9156         This reduced MCS memory usage in seven megabytes for the RSS after
9157         bootstrapping.
9158
9159 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9160
9161         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9162         handle params methods the correct way by forming only one
9163         applicable set with params and normal methods in them. Earlier we
9164         were looking at params methods only if we found no normal methods
9165         which was not the correct thing to do.
9166
9167         (Invocation.BetterFunction): Take separate arguments indicating
9168         when candidate and the best method are params methods in their
9169         expanded form.
9170
9171         This fixes bugs #43367 and #46199.
9172
9173         * attribute.cs: Documentation updates.
9174
9175         (CheckAttribute): Rename to CheckAttributeTarget.
9176         (GetValidPlaces): Rename to GetValidTargets.
9177
9178         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9179         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9180
9181         Fixes bug #44468.
9182
9183 2003-07-28  Martin Baulig  <martin@ximian.com>
9184
9185         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9186         name when looking up the base class of a nested class.  Fixes #46977.
9187
9188 2003-07-26  Martin Baulig  <martin@ximian.com>
9189
9190         * expression.cs (Indexers.Indexer): New nested struct; contains
9191         getter, setter and the indexer's type.
9192         (Indexers.Properties): This is now an ArrayList of
9193         Indexers.Indexer's.
9194         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9195         indexer doesn't have any getters.
9196
9197         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9198         for embedded property and indexer assignments.
9199
9200 2003-07-26  Martin Baulig  <martin@ximian.com>
9201
9202         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9203         preprocessor directive is not the first non-whitespace character
9204         on a line.
9205
9206 2003-07-26  Martin Baulig  <martin@ximian.com>
9207
9208         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9209         namespace parsing, follow the spec more closely.
9210
9211         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9212         NamespaceEntry.Lookup().
9213
9214 2003-07-25  Martin Baulig  <martin@ximian.com>
9215
9216         * MethodCore.cs (OverridesSomething): New public field; it's set
9217         from TypeContainer.DefineMembers if this method overrides
9218         something (which doesn't need to be a method).  Fix #39462.
9219
9220 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9221
9222         * typemanager.cs (GetMembers): Ensure that the list of members is
9223         reversed. This keeps things in sync.
9224
9225         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9226         find an AttributeUsage attribute.
9227
9228         * expression.cs (Invocation.OverloadResolve): Perform the check
9229         which disallows Invoke to be directly called on a Delegate.
9230
9231         (Error_InvokeOnDelegate): Report error cs1533.
9232
9233 2003-07-25  Martin Baulig  <martin@ximian.com>
9234
9235         * expression.cs (Indexers.GetIndexersForType): Only look in the
9236         interface hierarchy if the requested type is already an
9237         interface.  Fixes #46788 while keeping #46502 fixed.
9238
9239 2003-07-25  Martin Baulig  <martin@ximian.com>
9240
9241         * class.cs (TypeContainer.DefineMembers): Check whether all
9242         readonly fields have been assigned and report warning CS0649 if
9243         not.
9244
9245         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9246         a valuetype.
9247
9248 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9249
9250         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9251         returned from GetMethods to make things consistent with the
9252         assumptions MCS makes about ordering of methods.
9253
9254         This should comprehensively fix bug #45127 and it does :-)
9255
9256         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9257         ordering is actually reverse.
9258
9259         * Clean up some debug messages I left lying around.
9260
9261         * interface.cs (Populate*): Get rid of code which emits attributes
9262         since the stage in which we emit attributes is the 'Emit' stage,
9263         not the define stage.
9264
9265         (Emit): Move attribute emission for interface members here.
9266
9267 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9268
9269         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9270         closely: we eliminate methods in base types when we have an
9271         applicable method in a top-level type.
9272
9273         Please see section 14.5.5.1 for an exact description of what goes
9274         on. 
9275
9276         This fixes bug #45127 and a host of other related to corlib compilation.
9277
9278         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9279         array is the method corresponding to the top-level type (this is
9280         because of the changes made to icall.c) so we change this
9281         accordingly.
9282
9283         (MethodGroupExpr.Name): This too.
9284
9285         * typemanager.cs (GetElementType): New method which does the right
9286         thing when compiling corlib. 
9287
9288         * everywhere: Make use of the above in the relevant places.
9289
9290 2003-07-22  Martin Baulig  <martin@ximian.com>
9291
9292         * cs-parser.jay (invocation_expression): Moved
9293         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9294         `cast_expression', but create a InvocationOrCast which later
9295         resolves to either an Invocation or a Cast.
9296
9297         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9298         method; call this before EmitStatement() to make sure that this
9299         expression can be used as a statement.
9300
9301         * expression.cs (InvocationOrCast): New class; resolves to either
9302         an Invocation or a Cast.
9303
9304         * statement.cs (StatementExpression): Call ResolveStatement() on
9305         the ExpressionStatement before emitting it.
9306
9307 2003-07-21  Martin Baulig  <martin@ximian.com>
9308
9309         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9310         `ref' and `out' attributes match; fixes #46220.
9311         (MemberAccess.ResolveMemberAccess): You can't reference a type
9312         through an expression; fixes #33180.
9313         (Indexers.GetIndexersForType): Don't return the indexers from
9314         interfaces the class implements; fixes #46502.
9315
9316 2003-07-21  Martin Baulig  <martin@ximian.com>
9317
9318         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9319         CS0661 checks; fixes bug #30442.
9320
9321 2003-07-21  Martin Baulig  <martin@ximian.com>
9322
9323         * decl.cs (AdditionResult): Added `Error'.
9324
9325         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9326
9327         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9328         makes cs0031.cs actually work.
9329
9330 2003-07-20  Martin Baulig  <martin@ximian.com>
9331
9332         * namespace.cs: Fixed that bug which caused a crash when compiling
9333         the debugger's GUI.
9334
9335 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9336
9337         * typemanager.cs (LookupTypeReflection): Never expose types which
9338         are NotPublic, NestedPrivate, NestedAssembly, or
9339         NestedFamANDAssem.  We used to return these, and later do a check
9340         that would report a meaningful error, but the problem is that we
9341         would not get the real match, if there was a name override.
9342
9343 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * namespace.cs (Namespace, Name): Do not compute the namespace
9346         name dynamically, compute it in the constructor.  This reduced
9347         memory usage by 1697 KB.
9348
9349         * driver.cs: Use --pause to pause at the end.
9350
9351 2003-07-17  Peter Williams  <peter@newton.cx>
9352
9353         * Makefile: Change the name of the test target so that it doesn't
9354         conflict with the recursive test target.
9355
9356 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9357
9358         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9359         AddressOf): Do not use EmitThis, that was wrong, use the actual
9360         this pointer.
9361
9362 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9363
9364         * class.cs (MethodData.Define): While checking if a method is an
9365         interface implementation, improve the test: If we are not public
9366         (use new test here: use the computed MethodAttributes directly,
9367         instead of the parsed modifier flags) check if the `implementing'
9368         method comes from an interface or not.
9369
9370         * pending.cs (VerifyPendingMethods): Slightly better error
9371         message.
9372
9373         * makefile: add test target that does the mcs bootstrap.
9374
9375 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9376
9377         * interface.cs (Define): Do nothing here since there are no
9378         members to populate etc. Move the attribute emission out of here
9379         since this was just totally the wrong place to put it. Attribute
9380         application happens during the 'Emit' phase, not in the 'Define'
9381         phase.
9382
9383         (Emit): Add this method and move the attribute emission here
9384
9385         * rootcontext.cs (EmitCode): Call the Emit method on interface
9386         types too.
9387
9388 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9389
9390         * expression.cs (OverloadResolve): Report error only if Location
9391         is not 'Null' which means that there was a probe going on.
9392
9393 2003-07-14  Martin Baulig  <martin@ximian.com>
9394
9395         * expression.cs (ConditionalLogicalOperator): New public class to
9396         implement user defined conditional logical operators.
9397         This is section 14.11.2 in the spec and bug #40505.
9398
9399 2003-07-14  Martin Baulig  <martin@ximian.com>
9400
9401         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9402
9403 2003-07-14  Martin Baulig  <martin@ximian.com>
9404
9405         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9406
9407         * ecore.cs (IVariable.VerifyFixed): New interface method.
9408
9409         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9410         operator, check whether the variable is actually fixed.  Fixes bug
9411         #36055.  Set a variable definitely assigned when taking its
9412         address as required by the spec.
9413
9414         * statement.cs (LocalInfo.IsFixed): New field.
9415         (LocalInfo.MakePinned): Set `IsFixed' to true.
9416
9417 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9418
9419         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9420         for .ctors, ensure that we only ask for members declared in the
9421         attribute type (BindingFlags.DeclaredOnly).
9422
9423         Fixes bug #43632.
9424
9425         * expression.cs (Error_WrongNumArguments): Report error 1501
9426         correctly the way CSC does.
9427
9428 2003-07-13  Martin Baulig  <martin@ximian.com>
9429
9430         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9431         lookup on the fully qualified name, to make things like "X.X" work
9432         where "X.X" is a fully qualified type name, but we also have a
9433         namespace "X" in the using list.  Fixes #41975.
9434
9435 2003-07-13  Martin Baulig  <martin@ximian.com>
9436
9437         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9438         function. If we're a CompoundAssign, we need to create an embedded
9439         CompoundAssign, not an embedded Assign.
9440         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9441         Fixes #45854.
9442
9443 2003-07-13  Martin Baulig  <martin@ximian.com>
9444
9445         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9446         work to fix bug #46088.
9447
9448 2003-07-13  Ravi Pratap <ravi@ximian.com>
9449
9450         * class.cs (Operator.Emit): Do not emit attributes here - it is
9451         taken care of by the Method class that we delegate too. This takes
9452         care of bug #45876.
9453
9454 2003-07-10  Martin Baulig  <martin@ximian.com>
9455
9456         * expression.cs (TypeOfVoid): New class.
9457         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9458
9459 2003-07-10  Martin Baulig  <martin@ximian.com>
9460
9461         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9462         bug #35957.
9463
9464 2003-07-10  Martin Baulig  <martin@ximian.com>
9465
9466         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9467         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9468
9469         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9470
9471         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9472
9473 2003-07-10  Martin Baulig  <martin@ximian.com>
9474
9475         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9476         of decimal.  Fixes #42850.
9477
9478         NOTE: I also fixed the created byte blob, but this doesn't work on
9479         the MS runtime and csc never produces any byte blobs for decimal
9480         arrays.
9481
9482 2003-07-10  Martin Baulig  <martin@ximian.com>
9483
9484         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9485         structs; fixes #32068.
9486         (Block.AddChildVariableNames): Fixed #44302.
9487
9488 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9489
9490         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9491
9492 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9493
9494         * attribute.cs: And this test is onger needed.
9495
9496 2003-07-08  Martin Baulig  <martin@ximian.com>
9497
9498         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9499         inaccessible types.  Fixes #36313.
9500
9501         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9502
9503         * namespace.cs (NamespaceEntry): Create implicit entries for all
9504         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9505         implicit entries for N1.N2 and N1.
9506
9507 2003-07-08  Martin Baulig  <martin@ximian.com>
9508
9509         Rewrote the handling of namespaces to fix a lot of the issues
9510         wrt. `using' aliases etc.
9511
9512         * namespace.cs (Namespace): Splitted this class into a
9513         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9514
9515         * typemanager.cs (TypeManager.IsNamespace): Removed.
9516         (TypeManager.ComputeNamespaces): Only compute namespaces from
9517         loaded assemblies here, not the namespaces from the assembly we're
9518         currently compiling.
9519
9520 2003-07-08  Martin Baulig  <martin@ximian.com>
9521
9522         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9523
9524 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9525
9526         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9527         already fixed it.  
9528
9529         I thought about the memory savings here, but LookupTypeReflection
9530         is used under already very constrained scenarios.  Compiling
9531         corlib or mcs only exposes one hit, so it would not really reduce
9532         any memory consumption.
9533
9534 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9535
9536         * typemanager.cs: fixes bug #45889 by only adding public types from
9537         other assemblies to the list of known types.
9538
9539 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9540
9541         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9542         on the type we resolved.
9543
9544 2003-07-05  Martin Baulig  <martin@ximian.com>
9545
9546         * pending.cs (PendingImplementation.ParentImplements): Don't
9547         create the proxy if the parent is abstract.
9548
9549         * class.cs (TypeContainer.DefineIndexers): Process explicit
9550         interface implementations first.  Fixes #37714.
9551
9552 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9553
9554         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9555         defined recursively;  but since we modify the input parameters
9556         (left is set to `this' temporarily), we reset this value if the
9557         left_is_explicit is false, which gives the original semantics to
9558         the code.  
9559
9560         * literal.cs (NullPointer): new class used to represent a null
9561         literal in a pointer context.
9562
9563         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9564         type is a pointer, use a NullPointer object instead of a
9565         NullLiteral.   Closes 43687
9566
9567         (ExplicitConversion): Convert pointer values using
9568         the conv opcode to the proper type.
9569
9570         * ecore.cs (New): change ValueTypeVariable property into a method,
9571         that returns whether the valuetype is suitable for being used.
9572
9573         * expression.cs (Binary.DoNumericPromotions): Only return if we
9574         the int constant was a valid uint, and we can return both left and
9575         right as uints.  If not, we continue processing, to trigger the
9576         type conversion.  This fixes 39018.
9577
9578         * statement.cs (Block.EmitMeta): During constant resolution, set
9579         the CurrentBlock property on the emitcontext, so that we resolve
9580         constants propertly.
9581
9582 2003-07-02  Martin Baulig  <martin@ximian.com>
9583
9584         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9585         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9586
9587         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9588         than emitting it here.
9589
9590         * statement.cs: Fixed some more flow analysis bugs.
9591
9592 2003-07-02  Martin Baulig  <martin@ximian.com>
9593
9594         * class.cs (MethodData.Define): When implementing interface
9595         methods, set Final unless we're Virtual.
9596
9597         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9598         check work for interface methods.
9599
9600 2003-07-01  Martin Baulig  <martin@ximian.com>
9601
9602         * ecore.cs (EmitContext.This): Replaced this property with a
9603         GetThis() method which takes a Location argument.  This ensures
9604         that we get the correct error location for a CS0188.
9605
9606 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9607
9608         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9609         ImplicitStandardConversion.
9610
9611         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9612
9613 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9614
9615         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9616         optimization.
9617
9618 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9619
9620         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9621         constructors.
9622
9623         (MethodData.Define): Turn off initlocals for unsafe methods.
9624
9625 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9626
9627         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9628         complete;  Fixes #37521.
9629
9630         * delegate.cs: Use Modifiers.TypeAttr to compute the
9631         TypeAttributes, instead of rolling our own.  This makes the flags
9632         correct for the delegates.
9633
9634 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9635
9636         * class.cs (Constructor.Define): Set the private flag for static
9637         constructors as well.
9638
9639         * cs-parser.jay (statement_expression): Set the return value to
9640         null, to avoid a crash when we catch an error.
9641
9642 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9643
9644         * cs-parser.jay: Applied patch from Jackson that adds support for
9645         extern and unsafe modifiers to destructor declarations.
9646
9647         * expression.cs: Report error 21 if the user is trying to index a
9648         System.Array.
9649
9650         * driver.cs: Add an error message, suggested by the bug report.
9651
9652         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9653         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9654
9655 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9656
9657         * namespace.cs: Add some information to reduce FAQs.
9658
9659 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9660
9661         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9662         underlying enumeration types.  Fixes #43915.
9663
9664         * expression.cs: Treat ushort/short as legal values to be used in
9665         bitwise operations.
9666
9667 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9668
9669         * delegate.cs: transfer custom attributes for paramenters from
9670         the delegate declaration to Invoke and BeginInvoke.
9671
9672 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9673
9674         * attribute.cs: handle custom marshalers and emit marshal info
9675         for fields, too.
9676
9677 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9678
9679         * makefile.gnu: Added anonymous.cs to the compiler sources.
9680
9681 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9682
9683         * iterators.cs: Change the name of the proxy class to include two
9684         underscores.
9685
9686         * cs-parser.jay: Update grammar to include anonymous methods.
9687
9688         * anonymous.cs: new file.
9689
9690 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9691
9692         * class.cs (Field.Define): Add missing test for pointers and
9693         safety. 
9694
9695 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9696
9697         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9698         we use the stobj opcode.
9699
9700         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9701         since it wasn't the correct fix. 
9702
9703         It still is puzzling that we are required to use stobj for IntPtr
9704         which seems to be a ValueType.
9705
9706 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9707
9708         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9709         during regular simple name resolution.   Now, the trick is that
9710         instead of returning for processing the simplename, we do a
9711         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9712         contextual lookup type).   If a match is found, return that, if
9713         not, return for further composition.
9714
9715         This fixes long-standing 30485.
9716
9717         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9718         using the address to initialize an object, do an Stobj instead of
9719         using the regular Stelem.
9720
9721         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9722         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9723         Because if we are a BaseIndexerAccess that value will be true.
9724         Fixes 43643.
9725
9726         * statement.cs (GotoCase.Resolve): Return after reporting an
9727         error, do not attempt to continue. 
9728
9729         * expression.cs (PointerArithmetic.Emit): If our operand is a
9730         long, convert our constants to match the operand before
9731         multiplying.  Convert to I type before adding.   Fixes 43670.
9732
9733 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9734
9735         * enum.cs (ImplicitConversionExists) : Rename to
9736         ImplicitEnumConversionExists to remove ambiguity. 
9737
9738         * ecore.cs (NullCast): New type of cast expression class which
9739         basically is very similar to EmptyCast with the difference being
9740         it still is a constant since it is used only to cast a null to
9741         something else
9742         (eg. (string) null)
9743
9744         * convert.cs (ImplicitReferenceConversion): When casting a null
9745         literal, we return a NullCast.
9746
9747         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9748         should be around anymore.
9749
9750         The renaming (reported was slightly wrong). Corrections:
9751
9752         ConvertImplicitStandard -> ImplicitConversionStandard
9753         ConvertExplicitStandard -> ExplicitConversionStandard
9754
9755         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9756         before passing them in !
9757
9758         * convert.cs (ImplicitConversionStandard): When comparing for
9759         equal expr and target types, ensure that expr is not a
9760         NullLiteral.
9761
9762         In general, we must not be checking (expr_type ==
9763         target_type) in the top level conversion methods
9764         (ImplicitConversion, ExplicitConversion etc). This checking is
9765         done in the methods that they delegate to.
9766
9767 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9768
9769         * convert.cs: Move Error_CannotConvertType,
9770         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9771         ImplicitNumericConversion, ImplicitConversionExists,
9772         ImplicitUserConversionExists, StandardConversionExists,
9773         FindMostEncompassedType, FindMostSpecificSource,
9774         FindMostSpecificTarget, ImplicitUserConversion,
9775         ExplicitUserConversion, GetConversionOperators,
9776         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9777         TryImplicitIntConversion, Error_CannotConvertImplicit,
9778         ConvertImplicitRequired, ConvertNumericExplicit,
9779         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9780         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9781         its own file.
9782
9783         Perform the following renames:
9784
9785         StandardConversionExists -> ImplicitStandardConversionExists
9786         ConvertImplicit -> ImplicitConversion
9787         ConvertImplicitStandard -> ImplicitStandardConversion
9788         TryImplicitIntConversion -> ImplicitIntConversion
9789         ConvertImplicitRequired -> ImplicitConversionRequired
9790         ConvertNumericExplicit -> ExplicitNumericConversion
9791         ConvertReferenceExplicit -> ExplicitReferenceConversion
9792         ConvertExplicit -> ExplicitConversion
9793         ConvertExplicitStandard -> ExplicitStandardConversion
9794
9795 2003-05-19  Martin Baulig  <martin@ximian.com>
9796
9797         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9798         (TypeInfo): Added support for structs having structs as fields.
9799
9800         * ecore.cs (FieldExpr): Implement IVariable.
9801         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9802         VariableInfo for the field.
9803
9804 2003-05-18  Martin Baulig  <martin@ximian.com>
9805
9806         * expression.cs (This.DoResolve): Report a CS0027 if we're
9807         emitting a field initializer.
9808
9809 2003-05-18  Martin Baulig  <martin@ximian.com>
9810
9811         * expression.cs (This.ResolveBase): New public function.
9812         (This.DoResolve): Check for CS0188.
9813
9814         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
9815         This.Resolve().
9816
9817         * ecore.cs (MethodGroupExpr.DoResolve): Set the
9818         `instance_expression' to null if we don't have any non-static
9819         methods.
9820
9821 2003-05-18  Martin Baulig  <martin@ximian.com>
9822
9823         Reworked the way how local variables and parameters are handled by
9824         the flow analysis code.
9825
9826         * statement.cs (TypeInfo, VariableMap): New public classes.
9827         (VariableInfo): New public class.  This is now responsible for
9828         checking whether a variable has been assigned.  It is used for
9829         parameters and local variables.
9830         (Block.EmitMeta): Take the InternalParameters as argument; compute
9831         the layout of the flow vectors here.
9832         (Block.LocalMap, Block.ParameterMap): New public properties.
9833         (FlowBranching): The .ctor doesn't get the InternalParameters
9834         anymore since Block.EmitMeta() now computes the layout of the flow
9835         vector.
9836         (MyStructInfo): This class is now known as `StructInfo' and nested
9837         in `TypeInfo'; we don't access this directly anymore.
9838
9839         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
9840         property and removed IsAssigned(), IsFieldAssigned(),
9841         SetAssigned() and SetFieldAssigned(); we now call them on the
9842         VariableInfo so we don't need to duplicate this code everywhere.
9843
9844         * expression.cs (ParameterReference): Added `Block block' argument
9845         to the .ctor.
9846         (LocalVariableReference, ParameterReference, This): The new
9847         VariableInfo class is now responsible for all the definite
9848         assignment stuff.
9849
9850         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
9851         IsParameterAssigned, SetParameterAssigned): Removed.
9852
9853 2003-05-18  Martin Baulig  <martin@ximian.com>
9854
9855         * typemanager.cs (InitCoreTypes): Try calling
9856         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
9857         the 3-args-version.  Corlib now also needs our `void_type'.
9858         (GetMethod): Added overloaded version which takes an optional
9859         `bool report_errors' to allow lookups of optional methods.
9860
9861 2003-05-12  Martin Baulig  <martin@ximian.com>
9862
9863         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
9864         only used for locals and not for parameters.
9865
9866 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
9867
9868         * support.cs (InternalParameters.ParameterType): Return the
9869         ExternalType of the parameter.
9870
9871         * parameter.cs (Parameter.ExternalType): drop the two arguments,
9872         they were unused.
9873
9874 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
9875
9876         * class.cs (MethodData.Define): Do not set the `newslot' on
9877         interface members, if they are also flagged as "override".
9878
9879         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
9880         better code for ++i and i++.  This only works for static fields
9881         and local variables.
9882
9883         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
9884         want to pull the DeclSpace out of the builder_to_declspace instead
9885         of the TypeBuilder (like in TypeContainer.FindMembers).
9886
9887         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
9888         instead of LookupTypeContainer.  Fixes the crash on .NET for
9889         looking up interface members.
9890
9891         * const.cs: Create our own emit context during the Definition
9892         stage, so that constants are evaluated in the proper context, when
9893         a recursive definition happens.
9894
9895 2003-05-11  Martin Baulig  <martin@ximian.com>
9896
9897         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
9898         new block for a switch section.
9899         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
9900         the adding/lookup in the switch block.  Fixes #39828.
9901
9902 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
9903
9904         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
9905         functionality: I needed to convert the data after I had performed
9906         the add/sub operation into the operands type size.
9907
9908         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
9909         pass the type for the box operation, otherwise the resulting
9910         object would have been of type object.
9911
9912         (BoxedCast): Add constructor to specify the type to box as.
9913
9914 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
9915
9916         * iterators.cs: I was reusing the `count' variable inadvertently,
9917         take steps to not allow this to happen.
9918
9919 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
9920
9921         * attribute.cs (Attribute.Resolve): Params attributes are encoded
9922         by creating an array at the point where the params starts and
9923         putting all those arguments there, then adjusting the size of the
9924         array.
9925
9926 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9927
9928         * expression.cs (New.AddressOf): Implement interface
9929         IMemoryLocation.  This is used when the `new' operator is used in
9930         the context of an invocation to a method on a value type.
9931
9932         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9933         example. 
9934
9935         * namespace.cs: Also check the using aliases here.
9936
9937         * driver.cs: Move the test for using validity after the types have
9938         been entered, so we do a single pass that also includes the using
9939         aliases. 
9940
9941         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9942         in the regular case.   CreateSiblingForFinally is doing extra
9943         error checking.
9944
9945         * attribute.cs (GetAttributeArgumentExpression): Store the result
9946         on an out value, and use the return value to indicate failure
9947         instead of using null (which is a valid return for Constant.GetValue).
9948
9949         * statement.cs: Perform the analysis flow for the increment
9950         portion after the statement, because this will be the real flow of
9951         execution.  Fixes #42385
9952
9953         * codegen.cs (EmitContext.EmitArgument,
9954         EmitContext.EmitStoreArgument): New helper functions when the
9955         RemapToProxy flag is set.
9956
9957         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9958         function.
9959
9960         Add support for remapping parameters. 
9961
9962         * iterators.cs: Propagate parameter values;  Store parameter
9963         values in the proxy classes.
9964
9965 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9966
9967         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9968         need a proxy reference;  I do not know what I was thinking
9969
9970         * cs-parser.jay (constructor_initializer): catch another error,
9971         and display nice message.
9972
9973         (field_declaration): catch void field declaration
9974         to flag a better error. 
9975
9976         * class.cs (MemberBase.CheckBase): Report an error instead of a
9977         warning if a new protected member is declared in a struct. 
9978         (Field.Define): catch the error of readonly/volatile.
9979
9980         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9981
9982         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9983         volatile variable is taken
9984
9985 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9986
9987         * statement.cs (Fixed.Resolve): Report an error if we are not in
9988         an unsafe context.
9989
9990 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9991
9992         * typemanager.cs: reuse the code that handles type clashes for
9993         delegates and enumerations.
9994
9995         * class.cs (Report28): Always report.
9996
9997         * expression.cs (EncodeAsAttribute): Allow nulls here.
9998
9999 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10000
10001         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10002         the functionality for testing whether an expression is valid for
10003         an attribute here.  Also handle the case of arrays of elements
10004         being stored. 
10005
10006         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10007         encoding a linear array into an array of objects that are suitable
10008         to be passed to an CustomAttributeBuilder.
10009
10010         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10011
10012         * ecore.cs: (FieldExpr): Handle field remapping here.
10013
10014         * iteratators.cs: Pass the instance variable (if the method is an
10015         instance method) to the constructors, so we can access the field
10016         variables on the class.
10017
10018         TODO: Test this with structs.  I think the THIS variable on
10019         structs might have to be a pointer, and not a refenrece
10020
10021 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10022
10023         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10024         local variables to fields in a proxy class.
10025
10026         * iterators.cs (PopulateProxy): Rename our internal fields to
10027         <XXX>.  
10028         Create a <THIS> field if we are an instance method, so we can
10029         reference our parent container variables.
10030         (MapVariable): Called back from the EmitContext code to enter a
10031         new variable to field mapping into the proxy class (we just create
10032         a FieldBuilder).
10033
10034         * expression.cs
10035         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10036         for using the remapped locals to fields.
10037
10038         I placed the code here, because that gives the same semantics to
10039         local variables, and only changes the Emit code.
10040
10041         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10042         statements inside iterators.
10043         (VariableInfo): Add a FieldBuilder for the cases when we are
10044         remapping local variables to fields in a proxy class
10045
10046         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10047         current_block != null.
10048
10049         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10050         not cope with strings, as it has been moved to the
10051         TableSwitchEmit.  Fixed bug in switch generation.
10052
10053         * expression.cs (New.DoResolve): Provide more context for the user
10054         when reporting an error.
10055
10056         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10057         pointers. 
10058
10059         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10060         check the permissions for it.  Note than in a type-resolution
10061         context the check was already present in DeclSpace.ResolveType,
10062         but was missing from the MemberAccess.
10063
10064         (ArrayCreation.CheckIndices): warn if the user has
10065         more nested levels of expressions, but there are no more
10066         dimensions specified.  Avoids crash on bug 41906.
10067
10068 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10069
10070         * statement.cs (Block): replace Implicit bool, for a generic
10071         flags.   
10072         New flag: `Unchecked'.  This is used during the EmitMeta phase
10073         (which is out-of-line with the regular Resolve/Emit process for a
10074         statement, as this is done ahead of time, but still gets a chance
10075         to call constant resolve).
10076
10077         (Block.Flags): new enum for adding a new flag.
10078
10079         (Block.EmitMeta): track the state of unchecked.
10080
10081         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10082         to enable constant resolution to work there as well.
10083
10084 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10085
10086         * typemanager.cs (ienumerable_type): Also look up
10087         System.Collections.IEnumerable. 
10088
10089 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10090
10091         TODO: Test more than one conditional per method.
10092
10093         * class.cs (Indexer.Define): Report the location where the user is
10094         referencing the unsupported feature.
10095
10096         (MethodData): Overload the use of `conditionals' to
10097         minimize the creation of needless ArrayLists.   This saves roughly
10098         212kb on my machine.
10099
10100         (Method): Implement the new IIteratorContainer interface.
10101         (Method.SetYields): Implement the method by setting the ModFlags
10102         to contain METHOD_YIELDS.
10103
10104         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10105         which just got set to null.
10106
10107         * iterators.cs: New file.
10108
10109         (Yield, YieldBreak): New statements.
10110
10111         * statement.cs (Return.Resolve): Flag an error if we are used in
10112         an iterator method.
10113
10114         * codegen.cs (InIterator): New flag set if the code is being
10115         compiled in an iterator method.
10116
10117         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10118         internal modifier, and we just use it to avoid adding extra
10119         fields, as this is seldom used.  
10120
10121         * cs-parser.jay: Add yield_statement (yield and yield break).
10122
10123         * driver.cs: New flag -v2 to turn on version 2 features. 
10124
10125         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10126         hashtable when v2 is enabled.
10127
10128 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10129
10130         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10131         there is already a namespace defined with this name.
10132
10133         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10134         people upgraded their corlibs.
10135
10136         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10137         always use fully qualified types, no need to use the compiler
10138         front end.
10139
10140         (TypeManager.IsNamespace): Use binarysearch.
10141
10142         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10143         AddDelegate): I did not quite use the new IsValid API properly: I
10144         have to pass the short-name and the fullname.  I was passing only
10145         the basename instead of the fullname sometimes. 
10146
10147         (TypeContainer.DefineType): call NamespaceClash.
10148
10149         * interface.cs (Interface.DefineType): use NamespaceClash before
10150         defining the type.
10151
10152         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10153         defining the type.
10154
10155         * enum.cs: (Enum.DefineType): use NamespaceClash before
10156         defining the type.
10157
10158         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10159         speed increase.  First, use the negative_hits cache when we get a
10160         negative.  Second, add the type with its full original name
10161         instead of the new . and + encoded name (reflection uses + to
10162         separate type from a nested type).  Use LookupTypeReflection
10163         directly which bypasses the type->name hashtable (that we already
10164         know does not contain the type.
10165
10166         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10167         location/container type. 
10168
10169         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10170
10171 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10172
10173         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10174
10175         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10176         method is being referenced in the method group from a static
10177         context, and report error 120 if so.
10178
10179         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10180         Error118. 
10181
10182         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10183         is created, we create the A namespace).
10184
10185         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10186         Fixes #41591
10187
10188 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10189
10190         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10191         invocation to ModuleBuilder.GetType with the same values will
10192         return a new type instance, so we need to cache its return
10193         values. 
10194
10195         * expression.cs (Binary.ResolveOperator): Only allow the compare
10196         operators on enums if they are of the same type.
10197
10198         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10199         types of ValueType on their own case.  Before we were giving them
10200         the same treatment as objects.
10201
10202         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10203         fullname.  Short name is used to compare against container name.
10204         Fullname is used to check against defined namespace names.
10205
10206         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10207         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10208
10209         (Method.CheckBase): Call parent.
10210         (MemberBase.CheckBase): Check for protected members on sealed
10211         classes.
10212         (PropertyBase.CheckBase): Call parent.
10213         (Field.Define): Call parent.
10214
10215         * report.cs: Negative error codes are now mapped to 8000 - code,
10216         so that the display is render more nicely.
10217
10218         * typemanager.cs: Do not use try/catch, instead report a regular
10219         error. 
10220
10221         (GetPointerType, GetReferenceType): These methods provide
10222         mechanisms to obtain the T* and T& from a T.  We had the code
10223         previously scattered around the code base, and it also used
10224         TypeManager.LookupType that would go through plenty of caches.
10225         This one goes directly to the type source.
10226
10227         In some places we did the Type.GetType followed by
10228         ModuleBuilder.GetType, but not in others, so this unifies the
10229         processing as well.
10230
10231         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10232         statements now that we have namespace information.
10233
10234         * typemanager.cs (IsNamespace): New method, returns whether the
10235         string presented is a namespace or not.
10236
10237         (ComputeNamespaces): New public entry point, computes the list of
10238         available namespaces, using the GetNamespaces API call in Mono, or
10239         the slower version in MS.NET.   
10240
10241         Now before we start the semantic analysis phase, we have a
10242         complete list of namespaces including everything that the user has
10243         provided.
10244
10245         Deleted old code to cache namespaces in .nsc files.
10246
10247 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10248
10249         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10250         class/struct location definition Location for the implicit
10251         constructor location.
10252
10253         (Operator.Define): Use the location of the operator for the
10254         implicit Method definition.
10255
10256         (Constructor.Emit): use the constructor location for the implicit
10257         base initializer constructor.
10258
10259         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10260         and the Expression class now contains two new methods:
10261
10262         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10263         isolate type lookup from the rest of the resolution process.
10264
10265         Since we use Expressions to hold type definitions due to the way
10266         we parse the input we have historically overloaded Resolve to
10267         perform the Type lookups if a special flag is passed.  Now this is
10268         eliminated and two methods take their place. 
10269
10270         The differences in the two methods between xStep and xTerminal is
10271         that xStep is involved in our current lookup system that uses
10272         SimpleNames to compose a name, while xTerminal is used just to
10273         catch the case where the simplename lookup failed.
10274
10275 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10276
10277         * expression.cs (ResolveMemberAccess): Remove redundant code.
10278         TypeExpr expressions are always born fully resolved.
10279
10280         * interface.cs (PopulateMethod): Do not lookup the types twice.
10281         We were doing it once during SemanticAnalysis and once during
10282         PopulateMethod.
10283
10284         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10285         in local variable type definitions, were being returned as a
10286         SimpleName (we decomposed everything into a string), that is
10287         because primary_expression was being used instead of a type in the
10288         grammar (reduce/reduce conflicts).
10289
10290         The part that was wrong is that we converted the expression into a
10291         string (an oversimplification in one hand, compounded with primary
10292         expressions doing string concatenation).
10293
10294         So things like:
10295
10296         A.B.C [] x;
10297
10298         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10299         using clauses from working on this particular context.  And a type
10300         was being matched directly against "A.B.C[]".
10301
10302         We now use the correct approach, and allow for ComposedCast to be
10303         part of the unary expression.  So the "A.B.C []" become a composed
10304         cast of "A.B.C" (as a nested group of MemberAccess with a
10305         SimpleName at the end) plus the rank composition "[]". 
10306
10307         Also fixes 35567
10308
10309 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10310
10311         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10312         for the access level checking.
10313
10314         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10315         `TypeContainer container', because I kept getting confused when I
10316         was debugging this code.
10317
10318         * expression.cs (Indexers): Instead of tracking getters/setters,
10319         we now track them in parallel.  We create one arraylist less, but
10320         most importantly it is possible now for the LValue code to find a
10321         matching get for a set.
10322
10323         (IndexerAccess.DoResolveLValue): Update the code.
10324         GetIndexersForType has been modified already to extract all the
10325         indexers from a type.  The code assumed it did not.
10326
10327         Also make the code set the correct return type for the indexer.
10328         This was fixed a long time ago for properties, but was missing for
10329         indexers.  It used to be void_type.
10330
10331         (Binary.Emit): Test first for doubles instead of
10332         floats, as they are more common.
10333
10334         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10335         when dealing with floats and the <=, >= operators.  This fixes bug
10336         #39314 
10337
10338         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10339         to load the array value by emitting a load on the foreach variable
10340         type.  This was incorrect.  
10341
10342         We now emit the code to load an element using the the array
10343         variable type, and then we emit the conversion operator.
10344
10345         Fixed #40176
10346
10347 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10348
10349         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10350
10351 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10352
10353         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10354         test for protection before we test for signatures. 
10355
10356         (MethodSignature.ToString): implement.
10357
10358         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10359         to the case where we reduced into a LongConstant.
10360
10361         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10362         depend on whether the information is acurrate, because the
10363         Microsoft runtime will always claim that the array type is public,
10364         regardless of the real state.
10365
10366         If the type is a pointer, another problem happens: the type is
10367         reported as non-public in Microsoft.  
10368
10369         In both cases we have to call CheckAccessLevel recursively with
10370         the underlying type as the argument to be tested.
10371
10372 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10373
10374         * assign.cs (Assign.Emit): If we are dealing with a compound
10375         assignment expression, we should use the code path that stores the
10376         intermediate result in a temporary value.  This fixes #40903.
10377
10378         *expression.cs (Indirection.ToString): Provide ToString method for
10379         debugging. 
10380
10381 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10382
10383         * class.cs: Null out fields holding references to Block objects so
10384         they can be garbage collected.
10385
10386         * expression.cs (OverloadResolve): Remove unused local.
10387
10388 2003-04-07  Martin Baulig  <martin@ximian.com>
10389
10390         * codegen.cs (EmitContext.CurrentFile): New public field.
10391         (EmitContext.Mark): Use the CurrentFile to check whether the
10392         location is in the correct file.
10393         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10394
10395 2003-04-07  Martin Baulig  <martin@ximian.com>
10396
10397         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10398
10399         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10400         location.  [FIXME: The location argument which gets passed to this
10401         method is sometimes wrong!]
10402
10403 2003-04-07  Nick Drochak <ndrochak@gol.com>
10404
10405         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10406
10407 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10408
10409         * expression.cs (Indirection.EmitAssign): We were using the
10410         temporary, but returning immediately instead of continuing the
10411         EmitAssing flow.
10412
10413 2003-04-06  Martin Baulig  <martin@ximian.com>
10414
10415         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10416         if it's a nested child, but also deriving from the outer class.
10417         See test 190.cs.
10418
10419         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10420         nested child, but also deriving from the outer class.  See
10421         test-190.cs.
10422         (FilterWithClosure): We may access private members of the outer
10423         class if we're a nested child and deriving from the outer class.
10424         (RealMemberLookup): Only set `closure_private_ok' if the
10425         `original_bf' contained BindingFlags.NonPublic.
10426
10427 2003-04-05  Martin Baulig  <martin@ximian.com>
10428
10429         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10430
10431 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10432
10433         * class.cs (Event.Define): Do not allow abstract events to have
10434         initializers. 
10435
10436 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10437
10438         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10439         block in event declarations.
10440
10441         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10442         value type, get its address.
10443
10444         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10445         leaving a class on the stack instead of a boolean value (int
10446         0/1).  Change the code so we compare against null, and then the
10447         result against zero.
10448
10449         * class.cs (TypeContainer.GetClassBases): We were checking for the
10450         parent class being sealed too late.
10451
10452         * expression.cs (Binary.Emit): For <= and >= when dealing with
10453         floating point values, use cgt.un and clt.un instead of cgt and
10454         clt alone.
10455
10456 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10457
10458         * statement.cs: Apply the same optimization as MS: skip the 
10459         GetEnumerator returning an IEnumerator, and use the one returning a 
10460         CharEnumerator instead. This allows us to avoid the try-finally block 
10461         and the boxing.
10462
10463 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10464
10465         * cs-parser.jay: Attributes cannot be applied to
10466                          namespaces. Fixes #40473
10467
10468 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10469
10470         * class.cs:
10471         (Add*): check if the name is valid using the full name for constants,
10472         fields, properties and events.
10473
10474 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10477         char constants to be part of the enumeration.
10478
10479         * expression.cs (Conditional.DoResolve): Add support for operator
10480         true. Implements the missing functionality from 14.12
10481
10482         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10483         operator true/false as required by the spec.
10484
10485         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10486         implicit conversion to boolean.
10487
10488         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10489         also one where the type implements `operator true'. 
10490
10491         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10492         get an expression that will invoke operator true based on an
10493         expression.  
10494
10495         (GetConversionOperators): Removed the hack that called op_True
10496         here.  
10497
10498         (Expression.ResolveBoolean): Move this from Statement.
10499
10500 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10501
10502         * ecore.cs (FieldExpr): do not allow initialization of initonly
10503         fields on derived classes
10504
10505 2003-03-13  Martin Baulig  <martin@ximian.com>
10506
10507         * statement.cs (Block.Emit): Call ig.BeginScope() and
10508         ig.EndScope() when compiling with debugging info; call
10509         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10510
10511 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10512
10513         * expression.cs (Indexers): Do not construct immediately, allow
10514         for new members to be appended as we go.  Fixes 38143
10515
10516 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10517
10518         * expression.cs: save/restore context when resolving an unchecked
10519         expression.
10520
10521 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10522
10523         * cfold.cs: Catch division by zero in modulus operator during
10524         constant folding.
10525
10526 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10527
10528         * interface.cs (Interface.DefineMembers): Avoid defining members
10529         twice. 
10530
10531 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10532
10533         * driver.cs: handle the +/- options for -noconfig
10534
10535         * statement.cs (Unckeched.Resolve): Also track the state of
10536         unchecked in the Resolve phase.
10537
10538 2003-02-27  Martin Baulig  <martin@ximian.com>
10539
10540         * ecore.cs (Expression.MemberLookup): Don't create a
10541         MethodGroupExpr for something which is not a method.  Fixes #38291.
10542
10543 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10544
10545         * class.cs (MemberBase.CheckParameters): Also check that the type
10546         is unmanaged if it is a pointer.
10547
10548         * expression.cs (SizeOf.Resolve): Add location information.
10549
10550         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10551         a managed type is declared.
10552
10553         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10554         parameter modifiers as well.  Fixes bug 38606
10555
10556         * class.cs: Very sad.  Am backing out the speed up changes
10557         introduced by the ArrayList -> Array in the TypeContainer, as they
10558         were not actually that much faster, and introduced a bug (no error
10559         reports on duplicated methods).
10560
10561         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10562         source first, this will guarantee that we have a valid expression
10563         before calling in lower levels functions that will require a
10564         resolved object.  Then use this original_source in the
10565         target.ResolveLValue instead of the original source that was
10566         passed to us.
10567
10568         Another change.  Use target.Resolve instead of LValueResolve.
10569         Although we are resolving for LValues, we will let the Assign code
10570         take care of that (it will be called again from Resolve).  This
10571         basically allows code like this:
10572
10573         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10574         class Y { void A (X x) { x [0] += o; }
10575
10576         The problem was that the indexer was trying to resolve for
10577         set_Item (idx, object o) and never finding one.  The real set_Item
10578         was set_Item (idx, X).  By delaying the process we get the right
10579         semantics. 
10580
10581         Fixes bug 36505
10582
10583 2003-02-23  Martin Baulig  <martin@ximian.com>
10584
10585         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10586         while calling DoEmit ().
10587
10588         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10589         source files; if you use the #line directive inside a method, the
10590         compiler stops emitting line numbers for the debugger until it
10591         reaches the end of the method or another #line directive which
10592         restores the original file.
10593
10594 2003-02-23  Martin Baulig  <martin@ximian.com>
10595
10596         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10597
10598 2003-02-23  Martin Baulig  <martin@ximian.com>
10599
10600         * statement.cs (Block.AddChildVariableNames): We need to call this
10601         recursively, not just for our immediate children.
10602
10603 2003-02-23  Martin Baulig  <martin@ximian.com>
10604
10605         * class.cs (Event.Define): Always make the field private, like csc does.
10606
10607         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10608         actually work, fixes bug #37521.
10609
10610 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10611
10612         * delegate.cs: When creating the various temporary "Parameters"
10613         classes, make sure that we call the ComputeAndDefineParameterTypes
10614         on those new parameters (just like we do with the formal ones), to
10615         allow them to be resolved in the context of the DeclSpace.
10616
10617         This fixes the bug that Dick observed in Bugzilla #38530.
10618
10619 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10620
10621         * expression.cs (ResolveMemberAccess): When resolving a constant,
10622         do not attempt to pull a constant if the value was not able to
10623         generate a valid constant.
10624
10625         * const.cs (LookupConstantValue): Do not report more errors than required.
10626
10627 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10628
10629         * expression.cs: fixes bug #38328.
10630
10631 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10632
10633         * class.cs: Changed all the various members that can be part of a
10634         class from being an ArrayList to be an Array of the right type.
10635         During the DefineType type_list, interface_list, delegate_list and
10636         enum_list are turned into types, interfaces, delegates and enums
10637         arrays.  
10638
10639         And during the member population, indexer_list, event_list,
10640         constant_list, field_list, instance_constructor_list, method_list,
10641         operator_list and property_list are turned into their real arrays.
10642
10643         Although we could probably perform this operation earlier, for
10644         good error reporting we need to keep the lists and remove the
10645         lists for longer than required.
10646
10647         This optimization was triggered by Paolo profiling the compiler
10648         speed on the output of `gen-sample-program.pl' perl script. 
10649
10650         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10651         not crash in methods like MemberLookupFailed that use this field.  
10652
10653         This problem arises when the compiler fails to resolve a type
10654         during interface type definition for example.
10655
10656 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10657
10658         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10659         inherit from System.Object, so we have to stop at null, not only
10660         when reaching System.Object.
10661
10662 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10663
10664         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10665         DeclaredOnly because the parent indexer might have had a different
10666         name, but did not loop until the top of the hierarchy was reached.
10667
10668         The problem this one fixes is 35492: when a class implemented an
10669         indexer from an interface, we were getting the interface method
10670         (which was abstract) and we were flagging an error (can not invoke
10671         abstract method).
10672
10673         This also keeps bug 33089 functioning, and test-148 functioning.
10674
10675         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10676         out if a method is special is to see if it is declared in a
10677         property or event, or whether it is one of the predefined operator
10678         names.   This should fix correctly #36804.
10679
10680 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10681
10682         The goal here is to remove the dependency on EmptyCast.Peel ().
10683         Killing it completely.
10684
10685         The problem is that currently in a number of places where
10686         constants are expected, we have to "probe" for an EmptyCast, and
10687         Peel, which is not the correct thing to do, as this will be
10688         repetitive and will likely lead to errors. 
10689
10690         The idea is to remove any EmptyCasts that are used in casts that
10691         can be reduced to constants, so we only have to cope with
10692         constants. 
10693
10694         This bug hunt was triggered by Bug 37363 and the desire to remove
10695         the duplicate pattern where we were "peeling" emptycasts to check
10696         whether they were constants.  Now constants will always be
10697         constants.
10698
10699         * ecore.cs: Use an enumconstant here instead of wrapping with
10700         EmptyCast.  
10701
10702         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10703         throwing me off.  By handling this we can get rid of a few hacks.
10704
10705         * statement.cs (Switch): Removed Peel() code.
10706
10707 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10708
10709         * class.cs: Location information for error 508
10710
10711         * expression.cs (New.DoResolve): Add a guard against double
10712         resolution of an expression.  
10713
10714         The New DoResolve might be called twice when initializing field
10715         expressions (see EmitFieldInitializers, the call to
10716         GetInitializerExpression will perform a resolve on the expression,
10717         and later the assign will trigger another resolution
10718
10719         This leads to bugs (#37014)
10720
10721         * delegate.cs: The signature for EndInvoke should contain any ref
10722         or out parameters as well.  We were not doing this in the past. 
10723
10724         * class.cs (Field.Define): Do not overwrite the type definition
10725         inside the `volatile' group.  Turns out that volatile enumerations
10726         were changing the type here to perform a validity test, which
10727         broke conversions. 
10728
10729 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10730
10731         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10732         and structs, we do not want to load the instance variable
10733
10734         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10735         enum_type has to be handled like an object reference (implicit
10736         conversions exists from this to object), but the regular IsClass
10737         and IsValueType tests will never return true for this one.
10738
10739         Also we use TypeManager.IsValueType instead of type.IsValueType,
10740         just for consistency with the rest of the code (this is only
10741         needed if we ever use the construct exposed by test-180.cs inside
10742         corlib, which we dont today).
10743
10744 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10745
10746         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10747         just InternalCall.
10748
10749 2003-02-09  Martin Baulig  <martin@ximian.com>
10750
10751         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10752         (Namespace.DefineNamespaces): New static public method; this is
10753         called when we're compiling with debugging to add all namespaces
10754         to the symbol file.
10755
10756         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10757         pass it to the Namespace's .ctor.
10758
10759         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10760         and MethodBase arguments; pass the namespace ID to the symwriter;
10761         pass the MethodBase instead of the token to the symwriter.
10762         (SymbolWriter.DefineNamespace): New method to add a namespace to
10763         the symbol file.
10764
10765 2003-02-09  Martin Baulig  <martin@ximian.com>
10766
10767         * symbolwriter.cs: New file.  This is a wrapper around
10768         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10769         methods here in near future.
10770
10771 2003-02-09  Martin Baulig  <martin@ximian.com>
10772
10773         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10774         ILGenerator.MarkSequencePoint() which are actually used by the
10775         symbol writer.
10776
10777 2003-02-09  Martin Baulig  <martin@ximian.com>
10778
10779         * location.cs (SourceFile): New public sealed class.  This
10780         contains the name and an index which is used in the location's token.
10781         (Location): Reserve an appropriate number of bits in the token for
10782         the source file instead of walking over that list, this gives us a
10783         really huge performance improvement when compiling with debugging.
10784
10785         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
10786         `SourceFile' argument instead of a string.
10787         (Driver.ProcessFile): Add all the files via Location.AddFile(),
10788         but don't parse/tokenize here, we need to generate the list of all
10789         source files before we do that.
10790         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
10791         the files.
10792
10793         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
10794         instead of a string.
10795
10796         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
10797         of a string.
10798
10799 2003-02-09  Martin Baulig  <martin@ximian.com>
10800
10801         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
10802         filename on `#line default'.
10803
10804 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
10805
10806         * statement.cs: don't clear the pinned var when the fixed statement
10807         returns from the method (fixes bug#37752).
10808
10809 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
10810
10811         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
10812         to IsValueType.
10813
10814 2003-02-07  Martin Baulig  <martin@ximian.com>
10815
10816         * driver.cs: Removed the `--debug-args' command line argument.
10817
10818         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
10819         automatically by the AsssemblyBuilder.
10820         (CodeGen.InitializeSymbolWriter): We don't need to call any
10821         initialization function on the symbol writer anymore.  This method
10822         doesn't take any arguments.
10823
10824 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
10825
10826         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
10827         from referenced assemblies as well.
10828
10829 2003-02-02  Martin Baulig  <martin@ximian.com>
10830
10831         * class.cs (MethodData.Emit): Generate debugging info for external methods.
10832
10833 2003-02-02  Martin Baulig  <martin@ximian.com>
10834
10835         * class.cs (Constructor.Emit): Open the symbol writer before
10836         emitting the constructor initializer.
10837         (ConstructorInitializer.Emit): Call ec.Mark() to allow
10838         single-stepping through constructor initializers.
10839
10840 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
10841
10842         * class.cs: Handle error 549: do not allow virtual methods in
10843         sealed classes. 
10844
10845 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
10846
10847         * decl.cs: Check access levels when resolving types
10848
10849 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
10850
10851         * statement.cs: Add parameters and locals set in catch blocks that might 
10852         return to set vector
10853
10854 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
10855
10856         * class.cs (Operator): Set the SpecialName flags for operators.
10857
10858         * expression.cs (Invocation.DoResolve): Only block calls to
10859         accessors and operators on SpecialName methods.
10860
10861         (Cast.TryReduce): Handle conversions from char constants.
10862
10863
10864 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
10865
10866         * statement.cs: small memory and time optimization in FlowBranching.
10867
10868 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
10869
10870         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
10871         problem that the last fix but in the other sid (Set).
10872
10873         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
10874         access when there is no indexer in the hierarchy.
10875
10876 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
10877
10878         * class.cs: Combine some if statements.
10879
10880 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10881
10882         * driver.cs: fixed bug #37187.
10883
10884 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
10885
10886         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
10887         any indexer, it's needed to build a list with all the indexers in the
10888         hierarchy (AllGetters), else we have problems. Fixes #35653.
10889
10890 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * class.cs (MethodData.Define): It is wrong for an interface
10893         implementation to be static in both cases: explicit and implicit.
10894         We were only handling this in one case.
10895
10896         Improve the if situation there to not have negations.
10897
10898         * class.cs (Field.Define): Turns out that we do not need to check
10899         the unsafe bit on field definition, only on usage.  Remove the test.
10900
10901 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10902
10903         * driver.cs: use assembly.Location instead of Codebase (the latest
10904         patch made mcs fail when using MS assemblies).
10905
10906 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10907
10908         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10909         get the path to *corlib.dll.
10910
10911 2003-01-21  Nick Drochak <ndrochak@gol.com>
10912
10913         * cs-tokenizer.cs:
10914         * pending.cs:
10915         * typemanager.cs: Remove compiler warnings
10916
10917 2003-01-20  Duncan Mak  <duncan@ximian.com>
10918
10919         * AssemblyInfo.cs: Bump the version number to 0.19.
10920
10921 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10922
10923         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10924
10925 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10926
10927         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10928
10929 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10930
10931         * cs-parser.jay: Small fix: we were not comparing the constructor
10932         name correctly.   Thanks to Zoltan for the initial pointer.
10933
10934 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10935
10936         * cs-tokenizer.cs: Set file name when specified with #line
10937
10938 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10939
10940         * cs-parser.jay: Only perform the constructor checks here if we
10941         are named like the class;  This will help provider a better
10942         error.  The constructor path is taken when a type definition is
10943         not found, but most likely the user forgot to add the type, so
10944         report that rather than the constructor error.
10945
10946 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10947
10948         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10949         allocations.
10950
10951 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10952
10953         * cs-parser.jay: Add cleanup call.
10954
10955 2003-01-13  Duncan Mak  <duncan@ximian.com>
10956
10957         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10958         consistent with other methods.
10959
10960 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10961
10962         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10963
10964 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10965
10966         * attribute.cs: only set GuidAttr to true when we have a
10967         GuidAttribute.
10968
10969 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10970
10971         * ecore.cs:
10972         * expression.cs:
10973         * typemanager.cs: fixes to allow mcs compile corlib with the new
10974         Type.IsSubclassOf fix.
10975
10976 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10977
10978         * expression.cs (LocalVariableReference.DoResolve): Classify a
10979         constant as a value, not as a variable.   Also, set the type for
10980         the variable.
10981
10982         * cs-parser.jay (fixed_statement): take a type instead of a
10983         pointer_type, so we can produce a better error message later.
10984
10985         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10986         as an error.  
10987
10988         (For.DoEmit): Make inifinite loops have a
10989         non-conditional branch back.
10990
10991         (Fixed.DoEmit): First populate the pinned variables, then emit the
10992         statement, then clear the variables.  Before I was emitting the
10993         code once for each fixed piece.
10994
10995
10996 2003-01-08  Martin Baulig  <martin@ximian.com>
10997
10998         * statement.cs (FlowBranching.MergeChild): A break in a
10999         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11000
11001 2003-01-08  Martin Baulig  <martin@ximian.com>
11002
11003         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11004         lives in the same number space than `param_map'.  Fixes #36154.
11005
11006 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11007
11008         * cs-parser.jay (constructor_declaration): Set the
11009         Constructor.ModFlags before probing for it.  This makes the
11010         compiler report 514, 515 and 132 (the code was there, but got
11011         broken). 
11012
11013         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11014         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11015         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11016
11017 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11018
11019         * enum.cs: create the enum static fields using the enum type.
11020
11021 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11022
11023         * class.cs: don't try to create the ParamBuilder for the return
11024         type if it's not needed (and handle it breaking for the ms runtime
11025         anyway).
11026
11027 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11028
11029         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11030
11031 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11032
11033         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11034         the command.   This showed up while compiling the JANET source
11035         code, which used \r as its only newline separator.
11036
11037 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11038
11039         * class.cs (Method.Define): If we are an operator (because it
11040         reuses our code), then set the SpecialName and HideBySig.  #36128
11041
11042 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11045         exception, report error 120 `object reference required'.
11046
11047         * driver.cs: Add --pause option, used during to measure the size
11048         of the process as it goes with --timestamp.
11049
11050         * expression.cs (Invocation.DoResolve): Do not allow methods with
11051         SpecialName to be invoked.
11052
11053 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11054
11055         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11056         number before adding it.
11057
11058 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11059
11060         * ecore.cs (StandardImplicitConversion): When in an unsafe
11061         context, we allow conversion between void * to any other pointer
11062         type. This fixes bug #35973.
11063
11064 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11065
11066         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11067         is not thrown when extensionless outputs are used 
11068
11069 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11070
11071         * rootcontext.cs: fixed compilation of corlib.
11072
11073 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11074
11075         * attribute.cs (Attributes.Contains): Add new method.
11076
11077         * class.cs (MethodCore.LabelParameters): if the parameter is an
11078         `out' parameter, check that no attribute `[In]' has been passed.
11079
11080         * enum.cs: Handle the `value__' name in an enumeration.
11081
11082 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11083
11084         * decl.cs: Added special case to allow overrides on "protected
11085         internal" methods
11086
11087 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11088
11089         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11090         since it makes much more sense.
11091
11092         (Attributes.ctor): Don't require a Location parameter.
11093
11094         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11095
11096         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11097         since we already have that information per attribute.
11098
11099         * everywhere : make appropriate changes.
11100
11101         * class.cs (LabelParameters): Write the code which actually
11102         applies attributes to the return type. We can't do this on the MS
11103         .NET runtime so we flag a warning in the case an exception is
11104         thrown.
11105
11106 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11107
11108         * const.cs: Handle implicit null conversions here too.
11109
11110 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11111
11112         * class.cs (MethodCore.LabelParameters): Remove the extra
11113         Type [] parameter since it is completely unnecessary. Instead
11114         pass in the method's attributes so that we can extract
11115         the "return" attribute.
11116
11117 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11118
11119         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11120         of ignoring it and letting the compile continue.
11121
11122         * typemanager.cs (ChangeType): use an extra argument to return an
11123         error condition instead of throwing an exception.
11124
11125 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11126
11127         * expression.cs (Unary.TryReduce): mimic the code for the regular
11128         code path.  Perform an implicit cast in the cases where we can
11129         implicitly convert to one of the integral types, and then reduce
11130         based on that constant.   This fixes bug #35483.
11131
11132 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11133
11134         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11135
11136 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11137
11138         * namespace.cs: fixed bug #35489.
11139
11140 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11141
11142         * class.cs: Remove some dead code.
11143
11144         * cs-parser.jay: Estimate the number of methods needed
11145         (RootContext.MethodCount);
11146
11147         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11148         numbers instead of StringBuilders.
11149
11150         * support.cs (PtrHashtable): Add constructor with initial size;
11151         We can now reduce reallocations of the method table.
11152
11153 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11154
11155         * attribute.cs (ApplyAttributes): Keep track of the emitted
11156         attributes on a per-target basis. This fixes bug #35413.
11157
11158 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11159
11160         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11161         default to the Windows 1252 encoding.
11162
11163         (UnixParseOption): Support version, thanks to Alp for the missing
11164         pointer. 
11165
11166         * AssemblyInfo.cs: Add nice assembly information.
11167
11168         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11169         (bug 35169).
11170
11171         * cs-parser.jay: Allow a trailing comma before the close bracked
11172         in the attribute_section production.
11173
11174         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11175         address of the instance was being taken, I will take this out,
11176         because we take the address of the object immediately here.
11177
11178 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11179
11180         * typemanager.cs (AreMultipleAllowed): Take care of the most
11181         obvious case where attribute type is not in the current assembly -
11182         stupid me ;-)
11183
11184 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11185
11186         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11187         definitions, instead of doing that afterwards.  
11188
11189         Also we use a nice little hack, depending on the constructor, we
11190         know if we are a "composed" name or a simple name.  Hence, we
11191         avoid the IndexOf test, and we avoid 
11192
11193         * codegen.cs: Add code to assist in a bug reporter to track down
11194         the source of a compiler crash. 
11195
11196 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11197
11198         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11199         types have been emitted for a given element and flag an error
11200         if something which does not have AllowMultiple set is used more
11201         than once.
11202
11203         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11204         attribute types and their corresponding AllowMultiple properties
11205
11206         (AreMultipleAllowed): Check the property for a given type.
11207
11208         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11209         property in the case we have a TypeContainer.
11210
11211         (Attributes.AddAttribute): Detect duplicates and just skip on
11212         adding them. This trivial fix catches a pretty gross error in our
11213         attribute emission - global attributes were being emitted twice!
11214
11215         Bugzilla bug #33187 is now fixed.
11216
11217 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11218
11219         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11220         instead of pp_and).
11221
11222         * expression.cs (Binary.ResolveOperator): I can only use the
11223         Concat (string, string, string) and Concat (string, string,
11224         string, string) if the child is actually a concatenation of
11225         strings. 
11226
11227 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11228
11229         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11230         context where we need a 2-character lookahead.
11231
11232         * pending.cs (PendingImplementation): Rework so we can keep track
11233         of interface types all the time, and flag those which were
11234         implemented by parents as optional.
11235
11236 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11237
11238         * expression.cs (Binary.ResolveOperator): Use
11239         String.Concat(string,string,string) or
11240         String.Concat(string,string,string,string) when possible. 
11241
11242         * typemanager: More helper methods.
11243
11244
11245 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11246
11247         * pending.cs: remove the bogus return from GetMissingInterfaces()
11248         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11249
11250 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11251
11252         * namespace.cs: avoid duplicated 'using xxx' being added to
11253         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11254         when we get more than one 'using' statement for the same namespace.
11255         Report a CS0105 warning for it.
11256
11257 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11258
11259         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11260         of calling getChar/putback, uses internal knowledge of it.    
11261
11262         (xtoken): Reorder tokenizer so most common patterns are checked
11263         first.  This reduces the compilation time in another 5% (from 8.11s
11264         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11265
11266         The parsing time is 22% of the compilation in mcs, and from that
11267         64% is spent on the tokenization process.  
11268
11269         I tried using a binary search for keywords, but this is slower
11270         than the hashtable.  Another option would be to do a couple of
11271         things:
11272
11273                 * Not use a StringBuilder, instead use an array of chars,
11274                   with a set value.  Notice that this way we could catch
11275                   the 645 error without having to do it *afterwards*.
11276
11277                 * We could write a hand-parser to avoid the hashtable
11278                   compares altogether.
11279
11280         The identifier consumption process takes 37% of the tokenization
11281         time.  Another 15% is spent on is_number.  56% of the time spent
11282         on is_number is spent on Int64.Parse:
11283
11284                 * We could probably choose based on the string length to
11285                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11286                   computations. 
11287
11288         Another 3% is spend on wrapping `xtoken' in the `token' function.
11289
11290         Handle 0xa0 as whitespace (#34752)
11291
11292 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11293
11294         * typemanager.cs (IsCLRType): New routine to tell whether a type
11295         is one of the builtin types.  
11296
11297         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11298         typecode in more places instead of doing pointer comparissions.
11299         We could leverage some knowledge about the way the typecodes are
11300         laid out.
11301
11302         New code to cache namespaces in assemblies, it is currently not
11303         invoked, to be used soon.
11304
11305         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11306
11307         * expression.cs (Binary.ResolveOperator): specially handle
11308         strings, and do not perform user-defined operator overloading for
11309         built-in types.
11310
11311 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11312
11313         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11314         internalcall as it is a pretty simple operation;  Avoid whenever
11315         possible to call Char.IsLetter.
11316
11317         (consume_identifier): Cut by half the number of
11318         hashtable calls by merging the is_keyword and GetKeyword behavior.
11319
11320         Do not short-circuit, because if we do, we
11321         report errors (ie, #if false && true would produce an invalid
11322         directive error);
11323
11324
11325 2002-11-24  Martin Baulig  <martin@ximian.com>
11326
11327         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11328         check constant ranges and report a CS0221.  Fixes #33186.
11329
11330 2002-11-24  Martin Baulig  <martin@ximian.com>
11331
11332         * cs-parser.jay: Make this work for uninitialized variable
11333         declarations in the `for' initializer.  Fixes #32416.
11334
11335 2002-11-24  Martin Baulig  <martin@ximian.com>
11336
11337         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11338         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11339
11340 2002-11-24  Martin Baulig  <martin@ximian.com>
11341
11342         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11343         argument; if true, we also check for user-defined conversions.
11344         This is only needed if both arguments are of a user-defined type.
11345         Fixes #30443, added test-175.cs.
11346         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11347
11348         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11349
11350 2002-11-24  Martin Baulig  <martin@ximian.com>
11351
11352         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11353         function to get the store opcode.
11354         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11355         only emit the Ldelema if the store opcode is Stobj.  You must run
11356         both test-34 and test-167 to test this.  Fixes #34529.
11357
11358 2002-11-23  Martin Baulig  <martin@ximian.com>
11359
11360         * ecore.cs (Expression.MemberLookup): Added additional
11361         `qualifier_type' argument which is used when we're being called
11362         from MemberAccess.DoResolve() and null if we're called from a
11363         SimpleName lookup.
11364         (Expression.MemberLookupFailed): New method to report errors; this
11365         does the CS1540 check and reports the correct error message.
11366
11367         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11368         argument for the CS1540 check and redone the way how we're dealing
11369         with private members.  See the comment in the source code for details.
11370         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11371         `closure_start_type' to `closure_qualifier_type' and check whether
11372         it's not null.  It was not this filter being broken, it was just
11373         being called with the wrong arguments.
11374
11375         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11376         and pass it the correct `qualifier_type'; this also does the error
11377         handling for us.
11378
11379 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11380
11381         * expression.cs (Invocation.EmitParams): If the we are dealing
11382         with a non-built-in value type, load its address as well.
11383
11384         (ArrayCreation): Use a a pretty constant instead
11385         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11386         static initializers.  
11387
11388         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11389         because they are not really value types, just glorified integers. 
11390
11391         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11392
11393         * ecore.cs: Remove redundant code for enumerations, make them use
11394         the same code path as everything else, fixes the casting issue
11395         with enumerations in Windows.Forms.
11396
11397         * attribute.cs: Do only cast to string if it is a string, the
11398         validation happens later.
11399
11400         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11401         people upgrade their corlibs.
11402
11403         * ecore.cs: Oops, enumerations were not following the entire code path
11404
11405 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11406
11407         * typemanager.cs (FilterWithClosure): Commented out the test for
11408         1540 in typemanager.cs, as it has problems when accessing
11409         protected methods from a parent class (see test-174.cs). 
11410
11411         * attribute.cs (Attribute.ValidateGuid): new method.
11412         (Attribute.Resolve): Use above.
11413
11414 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11415
11416         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11417
11418         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11419         handling for enumerations, as we only needed the TypeContainer
11420         functionality to begin with (this is required for the fix below to
11421         work for enums that reference constants in a container class for
11422         example). 
11423
11424         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11425
11426         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11427         a valid TypeBuilder to perform lookups on.o
11428
11429         * class.cs (InheritableMemberSignatureCompare): Use true in the
11430         call to GetGetMethod and GetSetMethod, because we are comparing
11431         the signature, and we need to get the methods *even* if they are
11432         private. 
11433
11434         (PropertyBase.CheckBase): ditto.
11435
11436         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11437         GotoCase.Resolve): Use Peel on EmpytCasts.
11438
11439         * ecore.cs (EmptyCast): drop child, add Peel method.
11440
11441 2002-11-17  Martin Baulig  <martin@ximian.com>
11442
11443         * ecore.cs (EmptyCast.Child): New public property.
11444
11445         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11446         label resolved to an EmptyCast.  Fixes #34162.
11447         (GotoCase.Resolve): Likewise.
11448         (Block.EmitMeta): Likewise.
11449
11450 2002-11-17  Martin Baulig  <martin@ximian.com>
11451
11452         * expression.cs (Invocation.BetterConversion): Prefer int over
11453         uint; short over ushort; long over ulong for integer literals.
11454         Use ImplicitConversionExists instead of StandardConversionExists
11455         since we also need to check for user-defined implicit conversions.
11456         Fixes #34165.  Added test-173.cs.
11457
11458 2002-11-16  Martin Baulig  <martin@ximian.com>
11459
11460         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11461         with the `true' and `false' literals.  Fixes #33151.
11462
11463 2002-11-16  Martin Baulig  <martin@ximian.com>
11464
11465         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11466         October 22nd; don't do the cs1540 check for static members.
11467
11468         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11469         now using our own filter here and doing the cs1540 check again.
11470
11471 2002-11-16  Martin Baulig  <martin@ximian.com>
11472
11473         * support.cs (InternalParameters): Don't crash if we don't have
11474         any fixed parameters.  Fixes #33532.
11475
11476 2002-11-16  Martin Baulig  <martin@ximian.com>
11477
11478         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11479         when looking up static methods to make this work on Windows.
11480         Fixes #33773.
11481
11482 2002-11-16  Martin Baulig  <martin@ximian.com>
11483
11484         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11485         a setter rather than using PropertyInfo.CanWrite.
11486
11487 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11488
11489         * class.cs: Allow acces to block member by subclasses. Fixes build
11490         breaker.
11491
11492 2002-11-14  Martin Baulig  <martin@ximian.com>
11493
11494         * class.cs (Constructor.Emit): Added the extern/block check.
11495         Fixes bug #33678.
11496
11497 2002-11-14  Martin Baulig  <martin@ximian.com>
11498
11499         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11500         iteration while looking for indexers, this is needed because the
11501         indexer may have a different name in our base classes.  Fixed the
11502         error reporting (no indexers at all, not get accessor, no
11503         overloaded match).  Fixes bug #33089.
11504         (IndexerAccess.DoResolveLValue): Likewise.
11505
11506 2002-11-14  Martin Baulig  <martin@ximian.com>
11507
11508         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11509         indexers.  Fixes the first part of bug #33089.
11510         (MethodSignature.InheritableMemberSignatureCompare): Added support
11511         for properties.
11512
11513 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11514
11515         * attribute.cs (Attribute.Resolve): Catch the
11516         NullReferenceException and report it since it isn't supposed to
11517         happen. 
11518
11519 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11520
11521         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11522         LogicalOr and LogicalAnd that can benefit from recursively
11523         handling EmitBranchable.  The code now should be nice for Paolo.
11524
11525 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11526
11527         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11528         the Type lookups, as we perform quite a number of lookups on
11529         non-Types.  This can be removed once we can deterministically tell
11530         whether we have a type or a namespace in advance.
11531
11532         But this might require special hacks from our corlib.
11533
11534         * TODO: updated.
11535
11536         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11537         and double which avoids a conversion from an integer to a double.
11538
11539         * expression.cs: tiny optimization, avoid calling IsConstant,
11540         because it effectively performs the lookup twice.
11541
11542 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11543
11544         But a bogus return here to keep the semantics of the old code
11545         until the Mono runtime is fixed.
11546
11547         * pending.cs (GetMissingInterfaces): New method used to remove all
11548         the interfaces that are already implemented by our parent
11549         classes from the list of pending methods. 
11550
11551         * interface.cs: Add checks for calls after ResolveTypeExpr.
11552
11553 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * class.cs (Class.Emit): Report warning 67: event not used if the
11556         warning level is beyond 3.
11557
11558         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11559         being a NullLiteral.
11560
11561         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11562         specifiers. 
11563
11564         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11565         path that might fail if a type can not be resolved.
11566
11567         * expression.cs (Binary.Emit): Emit unsigned versions of the
11568         operators. 
11569
11570         * driver.cs: use error 5.
11571
11572 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11573
11574         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11575
11576 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11577
11578         * cs-parser.jay (switch_section): A beautiful patch from Martin
11579         Baulig that fixed 33094.
11580
11581 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11582
11583         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11584         Check whether the base is abstract and report an error if so.
11585
11586         * expression.cs (IndexerAccess.DoResolveLValue,
11587         IndexerAccess.DoResolve): ditto. 
11588
11589         (Invocation.DoResolve): ditto.
11590
11591         (Invocation.FullMethodDesc): Improve the report string.
11592
11593         * statement.cs (Block): Eliminate IsVariableDefined as it is
11594         basically just a wrapper for GetVariableInfo.
11595
11596         * ecore.cs (SimpleName): Use new 
11597
11598         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11599         type, as we return the actual parameter ref/unref state on a
11600         different call.
11601
11602 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11603
11604         * support.cs: Return proper flags REF/OUT fixing the previous
11605         commit.  
11606
11607         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11608         not used to mean `ref' but `ref or out' in ParameterReference
11609
11610         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11611         full type signature instead of calling TypeManger.CSharpName
11612         ourselves. 
11613
11614         * support.cs (InternalParameters.ParameterDesc): Do not compare
11615         directly to the modflags, because REF/OUT will actually be bitsets
11616         if set. 
11617
11618         * delegate.cs (VerifyMethod): Check also the modifiers.
11619
11620         * cs-tokenizer.cs: Fix bug where floating point values with an
11621         exponent where a sign was missing was ignored.
11622
11623         * driver.cs: Allow multiple assemblies to be specified in a single
11624         /r: argument
11625
11626 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11627
11628         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11629         because identifiers after a parenthesis would end up in this kind
11630         of production, and we needed to desamiguate it for having casts
11631         like:
11632
11633                 (UserDefinedType *) xxx
11634
11635 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11636
11637         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11638         we should set on the Bindingflags.NonPublic, but not turn on
11639         private_ok.  private_ok controls whether a Private member is
11640         returned (this is chekced on the filter routine), while the
11641         BindingFlags.NonPublic just controls whether private/protected
11642         will be allowed.   This fixes the problem part of the problem of
11643         private properties being allowed to be used in derived classes.
11644
11645         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11646         so we can call the children DoResolveLValue method (this will
11647         properly signal errors on lvalue assignments to base properties)
11648
11649         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11650         getter are null, and we have a property info, we know that this
11651         happened because the lookup failed, so we report an error 122 for
11652         protection level violation.
11653
11654         We also silently return if setter and getter are null in the
11655         resolve functions, this condition only happens if we have flagged
11656         the error before.  This is the other half of the problem. 
11657
11658         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11659         not have accessibility information, that is why we were returning
11660         true in the filter function in typemanager.cs.
11661
11662         To properly report 122 (property is inaccessible because of its
11663         protection level) correctly, we report this error in ResolveAccess
11664         by failing if both the setter and the getter are lacking (ie, the
11665         lookup failed). 
11666
11667         DoResolve and DoLResolve have been modified to check for both
11668         setter/getter being null and returning silently, the reason being
11669         that I did not want to put the knowledge about this error in upper
11670         layers, like:
11671
11672         int old = Report.Errors;
11673         x = new PropertyExpr (...);
11674         if (old != Report.Errors)
11675                 return null;
11676         else
11677                 return x;
11678
11679         So the property expr is returned, but it is invalid, so the error
11680         will be flagged during the resolve process. 
11681
11682         * class.cs: Remove InheritablePropertySignatureCompare from the
11683         class, as we no longer depend on the property signature to compute
11684         whether it is possible to implement a method or not.
11685
11686         The reason is that calling PropertyInfo.GetGetMethod will return
11687         null (in .NET, in Mono it works, and we should change this), in
11688         cases where the Get Method does not exist in that particular
11689         class.
11690
11691         So this code:
11692
11693         class X { public virtual int A { get { return 1; } } }
11694         class Y : X { }
11695         class Z : Y { public override int A { get { return 2; } } }
11696
11697         Would fail in Z because the parent (Y) would not have the property
11698         defined.  So we avoid this completely now (because the alternative
11699         fix was ugly and slow), and we now depend exclusively on the
11700         method names.
11701
11702         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11703         reference method, instead of using the property.
11704
11705         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11706         routines are gone now.
11707
11708         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11709         names, they were incorrectly named.
11710
11711         * cs-tokenizer.cs: Return are more gentle token on failure. 
11712
11713         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11714         had an out-of-sync index variable, which caused it to remove from
11715         the list of pending methods the wrong method sometimes.
11716
11717 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11718
11719         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11720         CanWrite, because those refer to this particular instance of the
11721         property, and do not take into account the fact that we can
11722         override single members of a property.
11723
11724         Constructor requires an EmitContext.  The resolution process does
11725         not happen here, but we need to compute the accessors before,
11726         because the resolution does not always happen for properties.
11727
11728         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11729         subclass, before we did not update this flag, but we did update
11730         bindingflags. 
11731
11732         (GetAccessors): Drop this routine, as it did not work in the
11733         presence of partially overwritten set/get methods. 
11734
11735         Notice that this broke the cs1540 detection, but that will require
11736         more thinking. 
11737
11738 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11739
11740         * class.cs:
11741         * codegen.cs:
11742         * driver.cs: issue a warning instead of an error if we don't support
11743         debugging for the platform. Also ignore a couple of errors that may
11744         arise when trying to write the symbols. Undo my previous patch.
11745
11746 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11747
11748         * driver.cs: ignore /debug switch except for Unix platforms.
11749
11750 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11751
11752         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11753
11754 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11755
11756         * driver.cs: Do not make mcs-debug conditional, so we do not break
11757         builds that use it.
11758
11759         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11760         review this patch.  But basically after all the children variables
11761         have been merged, the value of "Breaks" was not being set to
11762         new_breaks for Switch blocks.  I think that it should be set after
11763         it has executed.  Currently I set this to the value of new_breaks,
11764         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11765         conservative, but I do not understand this code very well.
11766
11767         I did not break anything in the build, so that is good ;-)
11768
11769         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11770
11771 2002-10-20  Mark Crichton  <crichton@gimp.org>
11772
11773         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11774
11775 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11776
11777         * cfold.cs: Fixed compile blocker.
11778
11779 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11780
11781         * driver.cs: I was chekcing the key, not the file.
11782
11783 2002-10-19  Ravi Pratap  <ravi@ximian.com>
11784
11785         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
11786         message that we were generating - we just need to silently return
11787         a null.
11788
11789 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
11790
11791         * class.cs (Event.Define): Change my previous commit, as this
11792         breaks the debugger.  This is a temporary hack, as it seems like
11793         the compiler is generating events incorrectly to begin with.
11794
11795         * expression.cs (Binary.ResolveOperator): Added support for 
11796         "U operator - (E x, E y)"
11797
11798         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
11799         y)".
11800
11801         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
11802         init-only variables, but this path did not take into account that
11803         there might be also instance readonly variables.  Correct this
11804         problem. 
11805
11806         This fixes bug 32253
11807
11808         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
11809         delegates as well.
11810
11811         * driver.cs: Change the extension for modules to `netmodule'
11812
11813         * cs-parser.jay: Improved slightly the location tracking for
11814         the debugger symbols.
11815
11816         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
11817         modifiers that were specified instead of the hardcoded value
11818         (FamAndAssem).  This was basically ignoring the static modifier,
11819         and others.  Fixes 32429.
11820
11821         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
11822         fixed a bug in the process (32476)
11823
11824         * expression.cs (ArrayAccess.EmitAssign): Patch from
11825         hwang_rob@yahoo.ca that fixes bug 31834.3
11826
11827 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
11828
11829         * driver.cs: Make the module extension .netmodule.
11830
11831 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
11832
11833         * driver.cs: Report an error if the resource file is not found
11834         instead of crashing.
11835
11836         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
11837         false, like Emit does.
11838
11839 2002-10-16  Nick Drochak  <ndrochak@gol.com>
11840
11841         * typemanager.cs: Remove unused private member.  Also reported mcs
11842         bug to report this as a warning like csc.
11843
11844 2002-10-15  Martin Baulig  <martin@gnome.org>
11845
11846         * statement.cs (Statement.Emit): Made this a virtual method; emits
11847         the line number info and calls DoEmit().
11848         (Statement.DoEmit): New protected abstract method, formerly knows
11849         as Statement.Emit().
11850
11851         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
11852
11853 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
11854
11855         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
11856         have fixed a remaining problem: not every AddXXXX was adding a
11857         fully qualified name.  
11858
11859         Now everyone registers a fully qualified name in the DeclSpace as
11860         being defined instead of the partial name.  
11861
11862         Downsides: we are slower than we need to be due to the excess
11863         copies and the names being registered this way.  
11864
11865         The reason for this is that we currently depend (on the corlib
11866         bootstrap for instance) that types are fully qualified, because
11867         we dump all the types in the namespace, and we should really have
11868         types inserted into the proper namespace, so we can only store the
11869         basenames in the defined_names array.
11870
11871 2002-10-10  Martin Baulig  <martin@gnome.org>
11872
11873         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
11874         from bug #31834, see the bug report for a testcase which is
11875         miscompiled.
11876
11877 2002-10-10  Martin Baulig  <martin@gnome.org>
11878
11879         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
11880         flow analysis code for this.
11881
11882         * statement.cs (Do, While, For): Tell the flow analysis code about
11883         infinite loops.
11884         (FlowBranching.UsageVector): Added support for infinite loops.
11885         (Block.Resolve): Moved the dead code elimination here and use flow
11886         analysis to do it.
11887
11888 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
11889
11890         * class.cs (Field.Define): Catch cycles on struct type
11891         definitions. 
11892
11893         * typemanager.cs (IsUnmanagedtype): Do not recursively check
11894         fields if the fields are static.  We only need to check instance
11895         fields. 
11896
11897         * expression.cs (As.DoResolve): Test for reference type.
11898
11899         * statement.cs (Using.ResolveExpression): Use
11900         ConvertImplicitRequired, not ConvertImplicit which reports an
11901         error on failture
11902         (Using.ResolveLocalVariableDecls): ditto.
11903
11904         * expression.cs (Binary.ResolveOperator): Report errors in a few
11905         places where we had to.
11906
11907         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11908
11909 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11910
11911         * expression.cs: Use StoreFromPtr instead of extracting the type
11912         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11913
11914         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11915         an enumeration value to a System.Enum, but System.Enum is not a
11916         value type, but an class type, so we need to box.
11917
11918         (Expression.ConvertExplicit): One codepath could return
11919         errors but not flag them.  Fix this.  Fixes #31853
11920
11921         * parameter.cs (Resolve): Do not allow void as a parameter type.
11922
11923 2002-10-06  Martin Baulig  <martin@gnome.org>
11924
11925         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11926         if it's a class type and not a struct.  Fixes #31815.
11927
11928 2002-10-06  Martin Baulig  <martin@gnome.org>
11929
11930         * statement.cs: Reworked the flow analysis code a bit to make it
11931         usable for dead code elimination.
11932
11933 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11934
11935         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11936
11937 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11938
11939         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11940         to fix the test 165, will investigate deeper.
11941
11942 2002-10-04  Martin Baulig  <martin@gnome.org>
11943
11944         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11945         finally blocks actually work.
11946         (Try.Resolve): We don't need to create a sibling for `finally' if
11947         there is no finally block.
11948
11949 2002-10-04  Martin Baulig  <martin@gnome.org>
11950
11951         * class.cs (Constructor.Define): The default accessibility for a
11952         non-default constructor is private, not public.
11953
11954 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11955
11956         * class.cs (Constructor): Make AllowedModifiers public, add
11957         EXTERN.
11958
11959         * cs-parser.jay: Perform the modifiers test here, as the
11960         constructor for the Constructor class usually receives a zero
11961         because of the way we create it (first we create, later we
11962         customize, and we were never checking the modifiers).
11963
11964         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11965         is a version of LookupTypeReflection that includes the type-name
11966         cache.  This can be used as a fast path for functions that know
11967         the fully qualified name and are only calling into *.GetType() to
11968         obtain a composed type.
11969
11970         This is also used by TypeManager.LookupType during its type
11971         composition.
11972
11973         (LookupType): We now also track the real type name, as sometimes
11974         we can get a quey for the real type name from things like
11975         ComposedCast.  This fixes bug 31422.
11976
11977         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11978         complete type fullname, it does not have to go through the type
11979         resolution system to obtain the composed version of the type (for
11980         obtaining arrays or pointers).
11981
11982         (Conditional.Emit): Use the EmitBoolExpression to
11983         generate nicer code, as requested by Paolo.
11984
11985         (ArrayCreation.CheckIndices): Use the patch from
11986         hwang_rob@yahoo.ca to validate the array initializers. 
11987
11988 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11989
11990         * class.cs (ConstructorInitializer.Emit): simplify code by using
11991         Invocation.EmitCall, and at the same time, fix the bugs in calling
11992         parent constructors that took variable arguments. 
11993
11994         * ecore.cs (Expression.ConvertNumericExplicit,
11995         Expression.ImplicitNumericConversion): Remove the code that
11996         manually wrapped decimal (InternalTypeConstructor call is now gone
11997         as well).
11998
11999         * expression.cs (Cast.TryReduce): Also handle decimal types when
12000         trying to perform a constant fold on the type.
12001
12002         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12003
12004         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12005         that only turned off an error report, and did nothing else. 
12006
12007 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12008
12009         * driver.cs: Handle and ignore /fullpaths
12010
12011 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12012
12013         * expression.cs (Binary.ResolveOperator): Catch the case where
12014         DoNumericPromotions returns true, 
12015
12016         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12017
12018 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12019
12020         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12021         report error 70.
12022
12023 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12024
12025         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12026         conversion exists, but it is also required that the conversion be
12027         performed.  This manifested in "(Type64Enum) 2".  
12028
12029         * class.cs (TypeManager.AddMethod): The fix is not to change
12030         AddEnum, because that one was using a fully qualified name (every
12031         DeclSpace derivative does), but to change the AddMethod routine
12032         that was using an un-namespaced name.  This now correctly reports
12033         the duplicated name.
12034
12035         Revert patch until I can properly fix it.  The issue
12036         is that we have a shared Type space across all namespaces
12037         currently, which is wrong.
12038
12039         Options include making the Namespace a DeclSpace, and merge
12040         current_namespace/current_container in the parser.
12041
12042 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12043
12044         * cs-parser.jay: Improve error reporting when we get a different
12045         kind of expression in local_variable_type and
12046         local_variable_pointer_type. 
12047
12048         Propagate this to avoid missleading errors being reported.
12049
12050         * ecore.cs (ImplicitReferenceConversion): treat
12051         TypeManager.value_type as a target just like object_type.   As
12052         code like this:
12053
12054         ValueType v = 1;
12055
12056         Is valid, and needs to result in the int 1 being boxed before it
12057         is assigned to the value type v.
12058
12059         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12060         to validate the enumeration name.
12061
12062         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12063         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12064         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12065
12066         * ecore.cs (TryImplicitIntConversion): When doing an
12067         implicit-enumeration-conversion, check if the type is 64-bits and
12068         perform a conversion before passing to EnumConstant.
12069
12070 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12071
12072         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12073         report ambiguous type references.  Unlike the MS version, we
12074         report what the ambiguity is.   Innovation at work ;-)
12075
12076         (DeclSpace.FindType): Require a location argument to
12077         display when we display an ambiguous error.
12078
12079         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12080
12081         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12082
12083         * expression.cs (EmitDynamicInitializers): Apply patch from
12084         hwang_rob@yahoo.ca that fixes the order in which we emit our
12085         initializers. 
12086
12087 2002-09-21  Martin Baulig  <martin@gnome.org>
12088
12089         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12090         delegate takes no arguments.
12091
12092 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12093
12094         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12095         from integers.
12096
12097         * expression.cs: Extract the underlying type.
12098
12099         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12100
12101         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12102
12103 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12104
12105         * class.cs (TypeContainer.DefineType): We can not use the nice
12106         PackingSize with the size set to 1 DefineType method, because it
12107         will not allow us to define the interfaces that the struct
12108         implements.
12109
12110         This completes the fixing of bug 27287
12111
12112         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12113         means also structs.  This fixes part of the problem. 
12114         (Expresion.ImplicitReferenceConversionExists): ditto.
12115
12116         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12117         error if there were no errors reported during the type lookup
12118         process, to avoid duplicates or redundant errors.  Without this
12119         you would get an ambiguous errors plus a type not found.  We have
12120         beaten the user enough with the first error.  
12121
12122         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12123         reference. 
12124
12125         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12126         during the resolution process, stop the lookup, this avoids
12127         repeated error reports (same error twice).
12128
12129         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12130
12131         * typemanager.cs (LookupType): Redo the type lookup code to match
12132         the needs of System.Reflection.  
12133
12134         The issue is that System.Reflection requires references to nested
12135         types to begin with a "+" sign instead of a dot.  So toplevel
12136         types look like: "NameSpace.TopLevelClass", and nested ones look
12137         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12138         levels. 
12139
12140 2002-09-19  Martin Baulig  <martin@gnome.org>
12141
12142         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12143         says that a method always returns or always throws an exception,
12144         don't report the CS0161.
12145
12146         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12147         set `Returns = new_returns'.
12148
12149 2002-09-19  Martin Baulig  <martin@gnome.org>
12150
12151         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12152         to an enum constant, check for a CS0176.
12153
12154 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12155
12156         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12157         for operators that must be in pairs and report errors.
12158
12159         * ecore.cs (SimpleName.DoResolveType): During the initial type
12160         resolution process, when we define types recursively, we must
12161         check first for types in our current scope before we perform
12162         lookups in the enclosing scopes.
12163
12164         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12165
12166         (Invocation.VerifyArgumentsCompat): Call
12167         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12168         I thought we were supposed to always call this, but there are a
12169         few places in the code where we dont do it.
12170
12171 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12172
12173         * driver.cs: Add support in -linkres and -resource to specify the
12174         name of the identifier.
12175
12176 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12177
12178         * ecore.cs (StandardConversionExists): Sync with the conversion
12179         code: allow anything-* to void* conversions.
12180
12181         (FindMostSpecificSource): Use an Expression argument
12182         instead of a Type, because we might be handed over a Literal which
12183         gets a few more implicit conversions that plain types do not.  So
12184         this information was being lost.
12185
12186         Also, we drop the temporary type-holder expression when not
12187         required.
12188
12189 2002-09-17  Martin Baulig  <martin@gnome.org>
12190
12191         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12192         this is an explicit interface implementation.
12193
12194 2002-09-17  Martin Baulig  <martin@gnome.org>
12195
12196         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12197         different `IndexerName' attributes.
12198
12199         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12200         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12201         virtual CommonResolve().
12202
12203 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12206         and convert that to the UnderlyingType.
12207
12208         * statement.cs (Foreach.Resolve): Indexers are just like variables
12209         or PropertyAccesses.
12210
12211         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12212         inside quoted strings, we were not doing this before.
12213
12214 2002-09-16  Martin Baulig  <martin@gnome.org>
12215
12216         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12217         resolve it.  This is needed for the definite assignment check of the
12218         instance expression, fixes bug #29846.
12219         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12220
12221 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12222
12223         * parameter.cs: Fix compile error.  Cannot reference static member
12224         from an instance object.  Is this an mcs bug?
12225
12226 2002-09-14  Martin Baulig  <martin@gnome.org>
12227
12228         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12229         multiple times.  Fixes bug #30295, added test-166.cs.
12230
12231 2002-09-14  Martin Baulig  <martin@gnome.org>
12232
12233         * statement.cs (Block.Emit): Don't emit unreachable code.
12234         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12235         `break' statements.
12236         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12237
12238 2002-09-14  Martin Baulig  <martin@gnome.org>
12239
12240         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12241         is set.
12242
12243 2002-09-14  Martin Baulig  <martin@gnome.org>
12244
12245         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12246         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12247         be false on the ms runtime.
12248
12249 2002-09-13  Martin Baulig  <martin@gnome.org>
12250
12251         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12252         the CS0038 error message.
12253
12254 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12255
12256         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12257         constant inside, return it.
12258
12259 2002-09-12  Martin Baulig  <martin@gnome.org>
12260
12261         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12262         implicit conversion can be done between enum types.
12263
12264         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12265         check whether an implicit conversion to the current enum's UnderlyingType
12266         exists and report an error if not.
12267
12268         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12269         without debugging support.
12270
12271         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12272         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12273
12274 2002-09-12  Martin Baulig  <martin@gnome.org>
12275
12276         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12277
12278         * ecore.cs (IMemberExpr.DeclaringType): New property.
12279         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12280         nonstatic member of an outer type (CS0038).
12281
12282 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12283
12284         * driver.cs: Activate the using-error detector at warning level
12285         4 (at least for MS-compatible APIs).
12286
12287         * namespace.cs (VerifyUsing): Small buglett fix.
12288
12289         * pending.cs (PendingImplementation): pass the container pointer. 
12290
12291         * interface.cs (GetMethods): Allow for recursive definition.  Long
12292         term, I would like to move every type to support recursive
12293         definitions, not the current ordering mechanism that we have right
12294         now.
12295
12296         The situation is this: Attributes are handled before interfaces,
12297         so we can apply attributes to interfaces.  But some attributes
12298         implement interfaces, we will now handle the simple cases
12299         (recursive definitions will just get an error).  
12300
12301         * parameter.cs: Only invalidate types at the end if we fail to
12302         lookup all types.  
12303
12304 2002-09-09  Martin Baulig  <martin@gnome.org>
12305
12306         * ecore.cs (PropertyExpr.Emit): Also check for
12307         TypeManager.system_int_array_get_length so this'll also work when
12308         compiling corlib.  Fixes #30003.
12309
12310 2002-09-09  Martin Baulig  <martin@gnome.org>
12311
12312         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12313         and throw an exception if we can't get the type's size.  Fixed #30040,
12314         added test-165.cs.
12315
12316 2002-09-09  Martin Baulig  <martin@gnome.org>
12317
12318         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12319
12320         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12321         context.  Fixes bug #30027.
12322
12323         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12324         virtual functions.  Fixes bug #30043, added test-164.cs.
12325
12326 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12327
12328         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12329
12330 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12331
12332         * driver.cs: Use an object to get the windows codepage since it's not a
12333         static property.
12334
12335 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12336
12337         * statement.cs (For.Emit): for infinite loops (test == null)
12338         return whether there is a break inside, not always "true".
12339
12340         * namespace.cs (UsingEntry): New struct to hold the name of the
12341         using definition, the location where it is defined, and whether it
12342         has been used in a successful type lookup.
12343
12344         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12345         strings.
12346
12347         * decl.cs: ditto.
12348
12349 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12350
12351         * attribute.cs : Fix incorrect code which relied on catching
12352         a NullReferenceException to detect a null being passed in
12353         where an object was expected.
12354
12355 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12356
12357         * statement.cs (Try): flag the catch variable as assigned
12358
12359         * expression.cs (Cast): Simplified by using ResolveType instead of
12360         manually resolving.
12361
12362         * statement.cs (Catch): Fix bug by using ResolveType.
12363
12364 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12365
12366         * expression.cs (BetterConversion): Special case for when we have
12367         a NullLiteral as the argument and we have to choose between string
12368         and object types - we choose string the way csc does.
12369
12370         * attribute.cs (Attribute.Resolve): Catch the
12371         NullReferenceException and report error #182 since the Mono
12372         runtime no more has the bug and having this exception raised means
12373         we tried to select a constructor which takes an object and is
12374         passed a null.
12375
12376 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12377
12378         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12379         message (1502, 1503) when we can't locate a method after overload
12380         resolution. This is much more informative and closes the bug
12381         Miguel reported.
12382
12383         * interface.cs (PopulateMethod): Return if there are no argument
12384         types. Fixes a NullReferenceException bug.
12385
12386         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12387         expressions too. Previously we were checking only in one place for
12388         positional arguments leaving out named arguments.
12389
12390         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12391         type to the enum type is not allowed. Remove code corresponding to
12392         that.
12393
12394         (ConvertNumericExplicit): Allow explicit conversions from
12395         the underlying type to enum type. This precisely follows the spec
12396         and closes a bug filed by Gonzalo.
12397
12398 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12399
12400         * compiler.csproj:
12401         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12402
12403 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12406         it was important that we stored the right value after the
12407         reduction in `converted'.
12408
12409 2002-09-04  Martin Baulig  <martin@gnome.org>
12410
12411         * location.cs (Location.SymbolDocument): Use full pathnames for the
12412         source files.
12413
12414 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12415
12416         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12417         of the expression resolve mechanism, because that will catch the
12418         SimpleName error failures.
12419
12420         (Conditional): If we can not resolve the
12421         expression, return, do not crash.
12422
12423 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12424
12425         * cs-tokenizer.cs:
12426         (location): display token name instead of its number.
12427
12428 2002-08-28  Martin Baulig  <martin@gnome.org>
12429
12430         * expression.cs (Binary.ResolveOperator): Don't silently return
12431         but return an error if an operator cannot be applied between two
12432         enum types.
12433
12434 2002-08-28  Martin Baulig  <martin@gnome.org>
12435
12436         * class.cs (Constructor.Define): Set the permission attributes
12437         correctly instead of making all constructors public.
12438
12439 2002-08-28  Martin Baulig  <martin@gnome.org>
12440
12441         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12442         for private members before reporting a CS0103; if we find anything,
12443         it's a CS0122.
12444
12445 2002-08-28  Martin Baulig  <martin@gnome.org>
12446
12447         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12448         to check whether `closure_start_type == closure_invocation_type',
12449         we also need to check whether `m.DeclaringType == closure_invocation_type'
12450         before bypassing the permission checks.  We might be accessing
12451         protected/private members from the base class.
12452         (TypeManager.RealMemberLookup): Only set private_ok if private
12453         members were requested via BindingFlags.NonPublic.
12454
12455         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12456
12457         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12458         MethodGroupExpr.IsExplicitImpl if appropriate.
12459         (Invocation.DoResolve): Don't report the CS0120 for explicit
12460         interface implementations.
12461
12462 2002-08-27  Martin Baulig  <martin@gnome.org>
12463
12464         * expression.cs (Invocation.DoResolve): If this is a static
12465         method and we don't have an InstanceExpression, we must report
12466         a CS0120.
12467
12468 2002-08-25  Martin Baulig  <martin@gnome.org>
12469
12470         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12471         `==' between a valuetype and an object.
12472
12473 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * ecore.cs (TypeExpr): Provide a ToString method.
12476
12477 2002-08-24  Martin Baulig  <martin@gnome.org>
12478
12479         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12480         now called proggie.dbg and it's a binary file.
12481
12482 2002-08-23  Martin Baulig  <martin@gnome.org>
12483
12484         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12485
12486 2002-08-23  Martin Baulig  <martin@gnome.org>
12487
12488         * struct.cs (MyStructInfo.ctor): Make this work with empty
12489         structs; it's not allowed to use foreach() on null.
12490
12491 2002-08-23  Martin Baulig  <martin@gnome.org>
12492
12493         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12494         writer the full pathname of the generated assembly.
12495
12496 2002-08-23  Martin Baulig  <martin@gnome.org>
12497
12498         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12499         A `finally' block never returns or breaks; improved handling of
12500         unreachable code.
12501
12502 2002-08-23  Martin Baulig  <martin@gnome.org>
12503
12504         * statement.cs (Throw.Resolve): Allow `throw null'.
12505
12506 2002-08-23  Martin Baulig  <martin@gnome.org>
12507
12508         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12509         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12510         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12511         MemberLookup would return a wrong event if this is an explicit
12512         interface implementation and the class has an event with the same
12513         name.
12514
12515 2002-08-23  Martin Baulig  <martin@gnome.org>
12516
12517         * statement.cs (Block.AddChildVariableNames): New public method.
12518         (Block.AddChildVariableName): Likewise.
12519         (Block.IsVariableNameUsedInChildBlock): Likewise.
12520         (Block.AddVariable): Check whether a variable name has already
12521         been used in a child block.
12522
12523         * cs-parser.jay (declare_local_variables): Mark all variable names
12524         from the current block as being used in a child block in the
12525         implicit block.
12526
12527 2002-08-23  Martin Baulig  <martin@gnome.org>
12528
12529         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12530         find the symbol writer.
12531
12532         * driver.cs: csc also allows the arguments to /define being
12533         separated by commas, not only by semicolons.
12534
12535 2002-08-23  Martin Baulig  <martin@gnome.org>
12536
12537         * interface.cs (Interface.GetMembers): Added static check for events.
12538
12539 2002-08-15  Martin Baulig  <martin@gnome.org>
12540
12541         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12542         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12543
12544         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12545         why the MethodData.EmitDestructor() change was necessary.
12546
12547 2002-08-20  Martin Baulig  <martin@gnome.org>
12548
12549         * class.cs (TypeContainer.FindMembers): Added static check for events.
12550
12551         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12552
12553         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12554         use Type.GetEvents(), not Type.FindMembers().
12555
12556 2002-08-20  Martin Baulig  <martin@gnome.org>
12557
12558         * decl.cs (MemberCache): Added a special method cache which will
12559         be used for method-only searched.  This ensures that a method
12560         search will return a MethodInfo with the correct ReflectedType for
12561         inherited methods.      
12562
12563 2002-08-20  Martin Baulig  <martin@gnome.org>
12564
12565         * decl.cs (DeclSpace.FindMembers): Made this public.
12566
12567 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12568
12569         * delegate.cs: fixed build on windows.
12570         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12571
12572 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12573
12574         * ecore.cs (StandardConversionExists): Return a false
12575         if we are trying to convert the void type to anything else
12576         since that is not allowed.
12577
12578         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12579         we flag error 70 in the event an event is trying to be accessed
12580         directly from outside the declaring type.
12581
12582 2002-08-20  Martin Baulig  <martin@gnome.org>
12583
12584         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12585         MemberCache from typemanager.cs to decl.cs.
12586
12587 2002-08-19  Martin Baulig  <martin@gnome.org>
12588
12589         * class.cs (TypeContainer): Implement IMemberContainer.
12590         (TypeContainer.DefineMembers): Create the MemberCache.
12591         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12592         return public members if BindingFlags.Public was given, check
12593         whether members are static.
12594
12595 2002-08-16  Martin Baulig  <martin@gnome.org>
12596
12597         * decl.cs (DeclSpace.Define): Splitted this in Define and
12598         DefineMembers.  DefineMembers is called first and initializes the
12599         MemberCache.
12600
12601         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12602         DefineMembers() on all our DeclSpaces.
12603
12604         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12605         but call DefineMembers() on all nested interfaces.  We call their
12606         Define() in our new Define() function.
12607
12608         * interface.cs (Interface): Implement IMemberContainer.
12609         (Interface.Define): Moved all code except the attribute stuf to
12610         DefineMembers().
12611         (Interface.DefineMembers): Initialize the member cache.
12612
12613         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12614         need this anymore since we can use MemberCache.FindMembers directly.
12615
12616 2002-08-19  Martin Baulig  <martin@gnome.org>
12617
12618         * typemanager.cs (MemberCache): When creating the cache for an
12619         interface type, add all inherited members.
12620         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12621         to `out bool used_cache' and documented it.
12622         (TypeManager.MemberLookup): If we already used the cache in the first
12623         iteration, we don't need to do the interfaces check.
12624
12625 2002-08-19  Martin Baulig  <martin@gnome.org>
12626
12627         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12628         here from IMemberFinder and don't implement this interface anymore.
12629         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12630
12631         * typemanager.cs (IMemberFinder): This interface is now only used by
12632         classes which actually support the member cache.
12633         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12634         since we only put DeclSpaces into this Hashtable.
12635         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12636         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12637
12638 2002-08-16  Martin Baulig  <martin@gnome.org>
12639
12640         * typemanager.cs (ICachingMemberFinder): Removed.
12641         (IMemberFinder.MemberCache): New property.
12642         (TypeManager.FindMembers): Merged this with RealFindMembers().
12643         This function will never be called from TypeManager.MemberLookup()
12644         so we can't use the cache here, just the IMemberFinder.
12645         (TypeManager.MemberLookup_FindMembers): Check whether the
12646         IMemberFinder has a MemberCache and call the cache's FindMembers
12647         function.
12648         (MemberCache): Rewrote larger parts of this yet another time and
12649         cleaned it up a bit.
12650
12651 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12652
12653         * driver.cs (LoadArgs): Support quoting.
12654
12655         (Usage): Show the CSC-like command line arguments.
12656
12657         Improved a few error messages.
12658
12659 2002-08-15  Martin Baulig  <martin@gnome.org>
12660
12661         * typemanager.cs (IMemberContainer.Type): New property.
12662         (IMemberContainer.IsInterface): New property.
12663
12664         The following changes are conditional to BROKEN_RUNTIME, which is
12665         defined at the top of the file.
12666
12667         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12668         class'es members, but add all members from TypeHandle.ObjectType
12669         if we're an interface.
12670         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12671         is the current type.
12672         (MemberCache.CacheEntry.Container): Removed this field.
12673         (TypeHandle.GetMembers): Include inherited members.
12674
12675 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12676
12677         * typemanager.cs: fixed compilation and added a comment on a field that
12678         is never used.
12679
12680 2002-08-15  Martin Baulig  <martin@gnome.org>
12681
12682         * class.cs (ConstructorInitializer.Resolve): In the
12683         Expression.MemberLookup call, use the queried_type as
12684         invocation_type.
12685
12686         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12687         declared' attribute, it's always true.
12688         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12689         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12690         temporary wrapper for FindMembers which tells MemberLookup whether
12691         members from the base classes are included in the return value.
12692         This will go away soon.
12693         (TypeManager.MemberLookup): Use this temporary hack here; once the
12694         new MemberCache is completed, we don't need to do the DeclaredOnly
12695         looping here anymore since the MemberCache will take care of this.
12696         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12697         (MemberCache): When creating the MemberCache for a class, get
12698         members from the current class and all its base classes.
12699         (MemberCache.CacheEntry.Container): New field.  This is a
12700         temporary hack until the Mono runtime is fixed to distinguish
12701         between ReflectedType and DeclaringType.  It allows us to use MCS
12702         with both the MS runtime and the unfixed Mono runtime without
12703         problems and without accecting performance.
12704         (MemberCache.SearchMembers): The DeclaredOnly looping from
12705         TypeManager.MemberLookup is now done here.      
12706
12707 2002-08-14  Martin Baulig  <martin@gnome.org>
12708
12709         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12710         Type.GetFields on dynamic types but get the fields from the
12711         corresponding TypeContainer.
12712         (MyStructInfo.GetStructInfo): Added check for enum types.
12713
12714         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12715         (MemberList.SyncRoot): Implemented.
12716         (TypeManager.FilterWithClosure): No need to check permissions if
12717         closure_start_type == closure_invocation_type, don't crash if
12718         closure_invocation_type is null.
12719
12720 2002-08-13  Martin Baulig  <martin@gnome.org>
12721
12722         Rewrote TypeContainer.FindMembers to use a member cache.  This
12723         gives us a speed increase of about 35% for the self-hosting MCS
12724         build and of about 15-20% for the class libs (both on GNU/Linux).
12725
12726         * report.cs (Timer): New class to get enhanced profiling.  This
12727         whole class is "TIMER" conditional since it remarkably slows down
12728         compilation speed.
12729
12730         * class.cs (MemberList): New class.  This is an IList wrapper
12731         which we're now using instead of passing MemberInfo[]'s around to
12732         avoid copying this array unnecessarily.
12733         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12734         (ICachingMemberFinder, IMemberContainer): New interface.
12735         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12736         has already been checked, otherwise use it for the name comparision.
12737         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12738         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12739         if possible.  Returns a MemberList, not a MemberInfo [].
12740         (TypeHandle): New class, implements IMemberContainer.  We create
12741         one instance of this class per type, it contains a MemberCache
12742         which is used to do the member lookups.
12743         (MemberCache): New class.  Each instance of this class contains
12744         all members of a type and a name-based hash table.
12745         (MemberCache.FindMembers): This is our new member lookup
12746         function.  First, it looks up all members of the requested name in
12747         the hash table.  Then, it walks this list and sorts out all
12748         applicable members and returns them.
12749
12750 2002-08-13  Martin Baulig  <martin@gnome.org>
12751
12752         In addition to a nice code cleanup, this gives us a performance
12753         increase of about 1.4% on GNU/Linux - not much, but it's already
12754         half a second for the self-hosting MCS compilation.
12755
12756         * typemanager.cs (IMemberFinder): New interface.  It is used by
12757         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12758         Enum, Delegate or Interface.
12759         (TypeManager.finder_to_member_finder): New PtrHashtable.
12760         (TypeManager.finder_to_container): Removed.
12761         (TypeManager.finder_to_delegate): Removed.
12762         (TypeManager.finder_to_interface): Removed.
12763         (TypeManager.finder_to_enum): Removed.
12764
12765         * interface.cs (Interface): Implement IMemberFinder.
12766
12767         * delegate.cs (Delegate): Implement IMemberFinder.
12768
12769         * enum.cs (Enum): Implement IMemberFinder.
12770
12771         * class.cs (TypeContainer): Implement IMemberFinder.
12772
12773 2002-08-12  Martin Baulig  <martin@gnome.org>
12774
12775         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12776
12777 2002-08-12  Martin Baulig  <martin@gnome.org>
12778
12779         * ecore.cs (ITypeExpression): New interface for expressions which
12780         resolve to a type.
12781         (TypeExpression): Renamed to TypeLookupExpression.
12782         (Expression.DoResolve): If we're doing a types-only lookup, the
12783         expression must implement the ITypeExpression interface and we
12784         call DoResolveType() on it.
12785         (SimpleName): Implement the new ITypeExpression interface.
12786         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
12787         hack, the situation that we're only looking up types can't happen
12788         anymore when this method is called.  Moved the type lookup code to
12789         DoResolveType() and call it.
12790         (SimpleName.DoResolveType): This ITypeExpression interface method
12791         is now doing the types-only lookup.
12792         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
12793         (ResolveFlags): Added MaskExprClass.
12794
12795         * expression.cs (MemberAccess): Implement the ITypeExpression
12796         interface.
12797         (MemberAccess.DoResolve): Added support for a types-only lookup
12798         when we're called via ITypeExpression.DoResolveType().
12799         (ComposedCast): Implement the ITypeExpression interface.
12800
12801         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
12802         Expression.Resolve() with ResolveFlags.Type instead.
12803
12804 2002-08-12  Martin Baulig  <martin@gnome.org>
12805
12806         * interface.cs (Interface.Define): Apply attributes.
12807
12808         * attribute.cs (Attribute.ApplyAttributes): Added support for
12809         interface attributes.
12810
12811 2002-08-11  Martin Baulig  <martin@gnome.org>
12812
12813         * statement.cs (Block.Emit): Only check the "this" variable if we
12814         do not always throw an exception.
12815
12816         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
12817         whether the property has a set accessor.
12818
12819 2002-08-11  Martin Baulig  <martin@gnome.org>
12820
12821         Added control flow analysis support for structs.
12822
12823         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
12824         with control flow analysis turned off.
12825         (IVariable): New interface.
12826         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
12827         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
12828         (FieldExpr.DoResolve): Resolve the instance expression with flow
12829         analysis turned off and do the definite assignment check after the
12830         resolving when we know what the expression will resolve to.
12831
12832         * expression.cs (LocalVariableReference, ParameterReference):
12833         Implement the new IVariable interface, only call the flow analysis
12834         code if ec.DoFlowAnalysis is true.
12835         (This): Added constructor which takes a Block argument.  Implement
12836         the new IVariable interface.
12837         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
12838         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
12839         This does the definite assignment checks for struct members.
12840
12841         * class.cs (Constructor.Emit): If this is a non-static `struct'
12842         constructor which doesn't have any initializer, call
12843         Block.AddThisVariable() to tell the flow analysis code that all
12844         struct elements must be initialized before control returns from
12845         the constructor.
12846
12847         * statement.cs (MyStructInfo): New public class.
12848         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
12849         argument to this indexer.  If non-zero, check an individual struct
12850         member, not the whole struct.
12851         (FlowBranching.CheckOutParameters): Check struct members.
12852         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
12853         overloaded versions of these methods which take an additional
12854         `int field_idx' argument to check struct members.
12855         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
12856         overloaded versions of these methods which take an additional
12857         `string field_name' argument to check struct member.s
12858         (VariableInfo): Implement the IVariable interface.
12859         (VariableInfo.StructInfo): New public property.  Returns the
12860         MyStructInfo instance of the variable if it's a struct or null.
12861         (Block.AddThisVariable): New public method.  This is called from
12862         Constructor.Emit() for non-static `struct' constructor which do
12863         not have any initializer.  It creates a special variable for the
12864         "this" instance variable which will be checked by the flow
12865         analysis code to ensure that all of the struct's fields are
12866         initialized before control returns from the constructor.
12867         (UsageVector): Added support for struct members.  If a
12868         variable/parameter is a struct with N members, we reserve a slot
12869         in the usage vector for each member.  A struct is considered fully
12870         initialized if either the struct itself (slot 0) or all its
12871         members are initialized.
12872
12873 2002-08-08  Martin Baulig  <martin@gnome.org>
12874
12875         * driver.cs (Driver.MainDriver): Only report an error CS5001
12876         if there were no compilation errors.
12877
12878         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
12879         `UnsafeContext' property to determine whether the parent is in
12880         unsafe context rather than checking the parent's ModFlags:
12881         classes nested in an unsafe class are unsafe as well.
12882
12883 2002-08-08  Martin Baulig  <martin@gnome.org>
12884
12885         * statement.cs (UsageVector.MergeChildren): Distinguish between
12886         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
12887         we return.  Added test17() and test18() to test-154.cs.
12888
12889 2002-08-08  Martin Baulig  <martin@gnome.org>
12890
12891         * typemanager.cs (TypeManager.FilterWithClosure): If we have
12892         Family access, make sure the invoking type isn't a subclass of the
12893         queried type (that'd be a CS1540).
12894
12895         * ecore.cs (Expression.MemberLookup): Added overloaded version of
12896         this method which takes an additional `Type invocation_type'.
12897
12898         * expression.cs (BaseAccess.DoResolve): Use the base type as
12899         invocation and query type.
12900         (MemberAccess.DoResolve): If the lookup failed and we're about to
12901         report a CS0122, try a lookup with the ec.ContainerType - if this
12902         succeeds, we must report a CS1540.
12903
12904 2002-08-08  Martin Baulig  <martin@gnome.org>
12905
12906         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12907         (MethodGroupExpr): Implement the IMemberExpr interface.
12908
12909         * expression (MemberAccess.ResolveMemberAccess): No need to have
12910         any special code for MethodGroupExprs anymore, they're now
12911         IMemberExprs.   
12912
12913 2002-08-08  Martin Baulig  <martin@gnome.org>
12914
12915         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12916         Family, FamANDAssem and FamORAssem permissions.
12917         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12918
12919 2002-08-08  Martin Baulig  <martin@gnome.org>
12920
12921         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12922         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12923         or loop block.
12924
12925 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12926
12927         * driver.cs: implemented /resource option to embed managed resources.
12928
12929 2002-08-07  Martin Baulig  <martin@gnome.org>
12930
12931         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12932         (FieldBase.HasFieldInitializer): New public property.
12933         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12934         returns the field initializer and makes sure it is only resolved once.
12935         (TypeContainer.EmitFieldInitializers): Call
12936         FieldBase.GetInitializerExpression to get the initializer, this ensures
12937         that it isn't resolved multiple times.
12938
12939         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12940         the resolving process (SimpleName/MemberLookup) that we're currently
12941         emitting a field initializer (which must not access any instance members,
12942         this is an error CS0236).
12943
12944         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12945         argument, if the `IsFieldInitializer' flag is set, we must report and
12946         error CS0236 and not an error CS0120.   
12947
12948 2002-08-07  Martin Baulig  <martin@gnome.org>
12949
12950         * ecore.cs (IMemberExpr): New public interface.
12951         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12952         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12953         if the expression is an IMemberExpr.
12954
12955         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12956         to be null, implicitly default to `this' if we're non-static in
12957         this case.  Simplified the code a lot by using the new IMemberExpr
12958         interface.  Also fixed bug #28176 here.
12959
12960 2002-08-06  Martin Baulig  <martin@gnome.org>
12961
12962         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12963         ParameterReferences during semantic analysis so that we can do a
12964         type-only search when resolving Cast, TypeOf and SizeOf.
12965         (block): Pass the `current_local_parameters' to the Block's
12966         constructor.
12967
12968         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12969         argument to the constructor.
12970         (ConstructorInitializer.Resolve): Create a temporary implicit
12971         block with the parameters.
12972
12973         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12974         references here if we aren't doing a type-only search.
12975
12976         * statement.cs (Block): Added constructor which takes a
12977         `Parameters parameters' argument.
12978         (Block.Parameters): New public property.
12979
12980         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12981         to `Parameters' and made it public readonly.
12982
12983 2002-08-06  Martin Baulig  <martin@gnome.org>
12984
12985         * ecore.cs (Expression.Warning): Made this public as well.
12986
12987         * report.cs (Report.Debug): Print the contents of collections.
12988
12989 2002-08-06  Martin Baulig  <martin@gnome.org>
12990
12991         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12992         used to tell Resolve() which kinds of expressions it may return.
12993         (Expression.Resolve): Added overloaded version of this method which
12994         takes a `ResolveFlags flags' argument.  This can be used to tell
12995         Resolve() which kinds of expressions it may return.  Reports a
12996         CS0118 on error.
12997         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12998         ResolveFlags.SimpleName.
12999         (Expression.Error118): Added overloaded version of this method which
13000         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13001         which kinds of expressions are allowed.
13002
13003         * expression.cs (Argument.ResolveMethodGroup): New public method.
13004         Resolves an argument, but allows a MethodGroup to be returned.
13005         This is used when invoking a delegate.
13006
13007         * TODO: Updated a bit.
13008
13009 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13010
13011         Fixed compilation with csc.
13012
13013         * ecore.cs: Expression.Error made public. Is this correct? Should
13014         Warning be made public too?
13015
13016         * expression.cs: use ea.Location instead of ea.loc.
13017         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13018
13019 2002-08-06  Martin Baulig  <martin@gnome.org>
13020
13021         * ecore.cs (Expression.loc): Moved the location here instead of
13022         duplicating it in all derived classes.
13023         (Expression.Location): New public property.
13024         (Expression.Error, Expression.Warning): Made them non-static and
13025         removed the location argument.
13026         (Expression.Warning): Added overloaded version which takes an
13027         `int level' argument.
13028         (Expression.Error118): Make this non-static and removed the
13029         expression and location arguments.
13030         (TypeExpr): Added location argument to the constructor.
13031
13032         * expression.cs (StaticCallExpr): Added location argument to
13033         the constructor.
13034         (Indirection, PointerArithmetic): Likewise.
13035         (CheckedExpr, UnCheckedExpr): Likewise.
13036         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13037         (StringPtr): Likewise.
13038
13039
13040 2002-08-05  Martin Baulig  <martin@gnome.org>
13041
13042         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13043
13044         * assign.cs (Assign.DoResolve): Check whether the source
13045         expression is a value or variable.
13046
13047         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13048         while resolving the corresponding blocks.
13049
13050         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13051         an error, don't silently return null.
13052
13053         * statement.cs (Block.AddVariable): Do the error reporting here
13054         and distinguish between CS0128 and CS0136.
13055         (Block.DoResolve): Report all unused labels (warning CS0164).
13056         (LabeledStatement): Pass the location to the constructor.
13057         (LabeledStatement.HasBeenReferenced): New property.
13058         (LabeledStatement.Resolve): Set it to true here.
13059
13060         * statement.cs (Return.Emit): Return success even after reporting
13061         a type mismatch error (CS0126 or CS0127), this is what csc does and
13062         it avoids confusing the users with any consecutive errors.
13063
13064 2002-08-05  Martin Baulig  <martin@gnome.org>
13065
13066         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13067
13068         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13069
13070         * expression.cs (MemberAccess.DoResolve): Silently return if an
13071         error has already been reported.
13072
13073         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13074         error has already been reported.
13075
13076 2002-08-05  Martin Baulig  <martin@gnome.org>
13077
13078         * statement.cs (UsageVector): Only initialize the `parameters'
13079         vector if we actually have any "out" parameters.
13080
13081 2002-08-05  Martin Baulig  <martin@gnome.org>
13082
13083         * expression.cs (Binary.ResolveOperator): When combining delegates,
13084         they must have the same type.
13085
13086 2002-08-05  Martin Baulig  <martin@gnome.org>
13087
13088         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13089         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13090         work with the ms runtime and we also don't need it: if we're a
13091         PropertyBuilder and not in the `indexer_arguments' hash, then we
13092         are a property and not an indexer.
13093
13094         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13095         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13096         since the latter one doesn't work with the ms runtime.
13097
13098 2002-08-03  Martin Baulig  <martin@gnome.org>
13099
13100         Fixed bugs #27998 and #22735.
13101
13102         * class.cs (Method.IsOperator): New public field.
13103         (Method.CheckBase): Report CS0111 if there's already a method
13104         with the same parameters in the current class.  Report CS0508 when
13105         attempting to change the return type of an inherited method.
13106         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13107         and it's not marked abstract or extern.
13108         (PropertyBase): New abstract base class for Property and Indexer.
13109         (PropertyBase.CheckBase): Moved here from Property and made it work
13110         for indexers.
13111         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13112         the same so we can reuse it there.
13113         (Property, Indexer): Derive from PropertyBase.
13114         (MethodSignature.inheritable_property_signature_filter): New delegate
13115         to find properties and indexers.
13116
13117         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13118         argument and improved error reporting.
13119
13120         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13121         EmptyReadOnlyParameters and made it a property.
13122
13123         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13124         version of this method which takes a `PropertyInfo indexer'.
13125         (TypeManager.RegisterIndexer): New method.
13126
13127         * class.cs: Added myself as author of this file :-)
13128
13129 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13130
13131         * class.cs: fixed compilation on windoze.
13132
13133 2002-08-03  Martin Baulig  <martin@gnome.org>
13134
13135         * interface.cs (Interface.GetInterfaceBases): Check whether all
13136         base interfaces are at least as accessible than the current one.
13137
13138         * class.cs (TypeContainer.GetClassBases): Check whether base types
13139         are at least as accessible than the current type.
13140         (TypeContainer.AsAccessible): Implemented and made non-static.
13141         (MemberBase.CheckParameters): Report errors if the accessibility
13142         checks fail.
13143
13144         * delegate.cs (Delegate.Delegate): The default visibility is
13145         internal for top-level types and private for nested types.
13146         (Delegate.Define): Report errors if the accessibility checks fail.
13147
13148         * enum.cs (Enum.Enum): The default visibility is internal for
13149         top-level types and private for nested types.
13150         (Enum.DefineType): Compute the correct visibility.
13151
13152         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13153         function which takes a `bool is_toplevel' instead of a TypeContainer.
13154
13155         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13156         builtin type.
13157
13158 2002-08-02  Martin Baulig  <martin@gnome.org>
13159
13160         * expression.cs (LocalVariableReferenc): Added constructor which
13161         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13162         (LocalVariableReference.IsReadOnly): New property.
13163         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13164         variable is readonly, use our own readonly flag to do this; you can
13165         use the new constructor to get a writable reference to a read-only
13166         variable.
13167
13168         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13169         reference to the local variable.
13170
13171 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13172
13173         * rootcontext.cs (ResolveCore): Also include System.Exception
13174
13175         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13176         we reach an EmptyStatement.
13177
13178         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13179         is also fine.
13180
13181         * expression.cs (Binary.ResolveOperator): Check error result in
13182         two places.
13183
13184         use brtrue/brfalse directly and avoid compares to null.
13185
13186 2002-08-02  Martin Baulig  <martin@gnome.org>
13187
13188         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13189         Fixes bug #28407, added test-155.cs.
13190
13191 2002-08-01  Martin Baulig  <martin@gnome.org>
13192
13193         * class.cs (Event.EmitDefaultMethod): Make this work with static
13194         events.  Fixes #28311, added verify-3.cs.
13195
13196 2002-08-01  Martin Baulig  <martin@gnome.org>
13197
13198         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13199         `is_disposable' fields.
13200         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13201         `hm.is_disposable' if we're using the collection pattern.
13202         (Foreach.EmitCollectionForeach): Use the correct type for the
13203         enumerator's local variable, only emit the try/finally block if
13204         necessary (fixes #27713).
13205
13206 2002-08-01  Martin Baulig  <martin@gnome.org>
13207
13208         * ecore.cs (Expression.report118): Renamed to Error118 and made
13209         it public static.
13210
13211         * statement.cs (Throw.Resolve): Check whether the expression is of
13212         the correct type (CS0118) and whether the type derives from
13213         System.Exception (CS0155).
13214         (Catch.Resolve): New method.  Do the type lookup here and check
13215         whether it derives from System.Exception (CS0155).
13216         (Catch.CatchType, Catch.IsGeneral): New public properties.
13217
13218         * typemanager.cs (TypeManager.exception_type): Added.
13219
13220 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13221
13222         * driver.cs: Updated About function.
13223
13224 2002-07-31  Martin Baulig  <martin@gnome.org>
13225
13226         Implemented Control Flow Analysis.
13227
13228         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13229         (EmitContext.CurrentBranching): Added.
13230         (EmitContext.StartFlowBranching): Added.
13231         (EmitContext.EndFlowBranching): Added.
13232         (EmitContext.KillFlowBranching): Added.
13233         (EmitContext.IsVariableAssigned): Added.
13234         (EmitContext.SetVariableAssigned): Added.
13235         (EmitContext.IsParameterAssigned): Added.
13236         (EmitContext.SetParameterAssigned): Added.
13237         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13238         Added control flow analysis stuff here.
13239
13240         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13241         resolve the expression as lvalue.
13242         (LocalVariableReference.DoResolve): Check whether the variable has
13243         already been assigned.
13244         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13245         the parameter as assigned here.
13246         (ParameterReference.DoResolve): Check whether the parameter has already
13247         been assigned.
13248         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13249         expression as lvalue.
13250
13251         * statement.cs (FlowBranching): New class for the flow analysis code.
13252         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13253         (LabeledStatement.IsDefined): New public property.
13254         (LabeledStatement.AddUsageVector): New public method to tell flow
13255         analyis that the label may be reached via a forward jump.
13256         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13257         flow analysis.
13258         (VariableInfo.Number): New public field.  This is used by flow analysis
13259         to number all locals of a block.
13260         (Block.CountVariables): New public property.  This is the number of
13261         local variables in this block (including the locals from all parent
13262         blocks).
13263         (Block.EmitMeta): Number all the variables.
13264
13265         * statement.cs: Added flow analysis support to all classes.
13266
13267 2002-07-31  Martin Baulig  <martin@gnome.org>
13268
13269         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13270         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13271         then use this argument.
13272
13273         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13274
13275         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13276         use this to specify /define options.
13277
13278 2002-07-29  Martin Baulig  <martin@gnome.org>
13279
13280         * statement.cs (Fixed): Moved all code that does variable lookups
13281         and resolvings from Emit to Resolve.
13282
13283         * statement.cs (For): Moved all code that does variable lookups
13284         and resolvings from Emit to Resolve.
13285
13286         * statement.cs (Using): Moved all code that does variable lookups
13287         and resolvings from Emit to Resolve.
13288
13289 2002-07-29  Martin Baulig  <martin@gnome.org>
13290
13291         * attribute.cs (Attribute.Resolve): Explicitly catch a
13292         System.NullReferenceException when creating the
13293         CustromAttributeBuilder and report a different warning message.
13294
13295 2002-07-29  Martin Baulig  <martin@gnome.org>
13296
13297         * support.cs (ParameterData.ParameterName): Added method to
13298         get the name of a parameter.
13299
13300         * typemanager.cs (TypeManager.IsValueType): New public method.
13301
13302 2002-07-29  Martin Baulig  <martin@gnome.org>
13303
13304         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13305         is a flag which specifies that it's either ref or out.
13306         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13307         the out parameter to `out Parameter.Modifier mod', also set the
13308         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13309
13310         * support.cs (InternalParameters.ParameterModifier): Distinguish
13311         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13312         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13313
13314         * expression.cs (Argument.GetParameterModifier): Distinguish
13315         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13316         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13317
13318 2002-07-29  Martin Baulig  <martin@gnome.org>
13319
13320         * expression.cs (ParameterReference.ParameterReference): Added
13321         `Location loc' argument to the constructor.
13322
13323         * cs-parser.jay: Pass location to ParameterReference.
13324
13325 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13326
13327         * statement.cs (Try): Initialize the location.
13328
13329         * cs-parser.jay: pass location to Try.
13330
13331         * expression.cs (Unary.Reduce): Change the prototype to return
13332         whether a constant fold could be performed or not.  The result is
13333         returned in an out parameters.  In the case of Indirection and
13334         AddressOf, we want to perform the full tests.
13335
13336 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * statement.cs (Statement.Emit): Flag dead code.
13339
13340 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13341
13342         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13343
13344 2002-07-27  Martin Baulig  <martin@gnome.org>
13345
13346         * class.cs (MethodData.Define): Put back call to
13347         TypeManager.AddMethod(), accidentally commented this out.
13348
13349         * report.cs (Debug): New public method to print debugging information,
13350         this is `[Conditional ("DEBUG")]'.
13351
13352 2002-07-26  Martin Baulig  <martin@gnome.org>
13353
13354         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13355         (switch_statement): Push the current_block to the switch_stack and
13356         pop it again when we're done with the switch.
13357         (switch_section): The new block is a child of the current_block.
13358         Fixes bug #24007, added test-152.cs.
13359
13360 2002-07-27  Martin Baulig  <martin@gnome.org>
13361
13362         * expression.cs (Invocation.EmitArguments): When calling a varargs
13363         function with only its fixed arguments, we need to pass an empty
13364         array.
13365
13366 2002-07-27  Martin Baulig  <martin@gnome.org>
13367
13368         Mono 0.13 has been released.
13369
13370 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13371
13372         * driver.cs: Rename --resource to --linkres, because that is what
13373         we do currently, we dont support --resource yet.
13374
13375         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13376
13377 2002-07-25  Martin Baulig  <martin@gnome.org>
13378
13379         * class.cs (MethodData): New public class.  This is a `method builder'
13380         class for a method or one accessor of a Property/Indexer/Event.
13381         (MethodData.GetMethodFlags): Moved here from MemberBase.
13382         (MethodData.ApplyAttributes): Likewise.
13383         (MethodData.ApplyObsoleteAttribute): Likewise.
13384         (MethodData.ApplyConditionalAttribute): Likewise.
13385         (MethodData.ApplyDllImportAttribute): Likewise.
13386         (MethodData.CheckAbstractAndExternal): Likewise.
13387         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13388         (MethodData.Emit): Formerly known as Method.Emit().
13389         (MemberBase): Moved everything which was specific to a single
13390         accessor/method to MethodData.
13391         (Method): Create a new MethodData and call Define() and Emit() on it.
13392         (Property, Indexer, Event): Create a new MethodData objects for each
13393         accessor and call Define() and Emit() on them.
13394
13395 2002-07-25  Martin Baulig  <martin@gnome.org>
13396
13397         Made MethodCore derive from MemberBase to reuse the code from there.
13398         MemberBase now also checks for attributes.
13399
13400         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13401         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13402         as virtual.
13403         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13404         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13405         (MemberBase.ApplyAttributes): New virtual method; applies the
13406         attributes to a method or accessor.
13407         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13408         (MemberBase.ApplyConditionalAttribute): Likewise.
13409         (MemberBase.ApplyDllImportAttribute): Likewise.
13410         (MemberBase.CheckAbstractAndExternal): Likewise.
13411         (MethodCore.ParameterTypes): This is now a property instead of a
13412         method, it's initialized from DoDefineParameters().
13413         (MethodCore.ParameterInfo): Removed the set accessor.
13414         (MethodCore.DoDefineParameters): New protected virtual method to
13415         initialize ParameterTypes and ParameterInfo.
13416         (Method.GetReturnType): We can now simply return the MemberType.
13417         (Method.GetMethodFlags): Override the MemberBase version and add
13418         the conditional flags.
13419         (Method.CheckBase): Moved some code from Define() here, call
13420         DoDefineParameters() here.
13421         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13422         here to avoid some larger code duplication.
13423         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13424         ensure that abstract and external accessors don't declare a body.
13425
13426         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13427         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13428         lookup in the attribute's parent classes, so we need to abort as soon
13429         as we found the first match.
13430         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13431         the attribute has no arguments.
13432
13433         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13434         of a Method.
13435
13436 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13437
13438         * cs-parser.jay: reverted previous patch.
13439
13440 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13441
13442         * cs-parser.jay: fixed bug #22119.
13443
13444 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13445
13446         * attribute.cs: fixed compilation. The error was:
13447         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13448         be assigned to before control leaves the current method."
13449         [FIXME:  Filed as bug #28186: MCS must report this error.]
13450
13451 2002-07-25  Martin Baulig  <martin@gnome.org>
13452
13453         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13454         method to pull the condition name ouf of a Conditional attribute.
13455         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13456         the obsolete message and error flag out of an Obsolete attribute.
13457
13458         * class.cs (Method.GetMethodFlags): New public method to get the
13459         TypeManager.MethodFlags for this method.
13460         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13461         private methods.
13462         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13463         if we're overriding a virtual function, set the new private variable
13464         `parent_method'; call the new TypeManager.AddMethod().
13465
13466         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13467         the MethodBuilder and the Method in a PtrHashtable.
13468         (TypeManager.builder_to_method): Added for this purpose.
13469         (TypeManager.MethodFlags): Added IsObsoleteError.
13470         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13471         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13472         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13473         the message from the attribute.
13474
13475 2002-07-24  Martin Baulig  <martin@gnome.org>
13476
13477         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13478         preprocessor directives, ensure that the argument to #define/#undef is
13479         exactly one identifier and that it's actually an identifier.
13480
13481         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13482         did not work ....
13483
13484 2002-07-24  Martin Baulig  <martin@gnome.org>
13485
13486         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13487         initialize it to TypeManager.object_type in the constructor.
13488         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13489         of the `hm.get_current' method if we're using the collection pattern.
13490         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13491         for the explicit conversion to make it work when we're using the collection
13492         pattern and the `Current' property has a different return type than `object'.
13493         Fixes #27713.
13494
13495 2002-07-24  Martin Baulig  <martin@gnome.org>
13496
13497         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13498         does not match, but don't report any errors.  This method is called in
13499         order for all methods in a MethodGroupExpr until a matching method is
13500         found, so we don't want to bail out if the first method doesn't match.
13501         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13502         matches, report the 123.  Fixes #28070.
13503
13504 2002-07-24  Martin Baulig  <martin@gnome.org>
13505
13506         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13507         TypeManager.TypeToCoreType() to the top of the method so the
13508         following equality checks will work.  Fixes #28107.
13509
13510 2002-07-24  Martin Baulig  <martin@gnome.org>
13511
13512         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13513         operand is of type uint, and the other operand is of type sbyte,
13514         short or int, the operands are converted to type long." -
13515         Actually do what this comment already told us.  Fixes bug #28106,
13516         added test-150.cs.
13517
13518 2002-07-24  Martin Baulig  <martin@gnome.org>
13519
13520         * class.cs (MethodBase): New abstract class.  This is now a base
13521         class for Property, Indexer and Event to avoid some code duplication
13522         in their Define() and DefineMethods() methods.
13523         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13524         generic methods for Define() and DefineMethods().
13525         (FieldBase): Derive from MemberBase, not MemberCore.
13526         (Property): Derive from MemberBase, not MemberCore.
13527         (Property.DefineMethod): Moved all the code from this method to the
13528         new MethodBase.DefineAccessor(), just call it with appropriate
13529         argumetnts.
13530         (Property.Define): Call the new Property.DoDefine(), this does some
13531         sanity checks and we don't need to duplicate the code everywhere.
13532         (Event): Derive from MemberBase, not MemberCore.
13533         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13534         accessors, this will also make them work with interface events.
13535         (Indexer): Derive from MemberBase, not MemberCore.
13536         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13537         (Indexer.Define): Use the new MethodBase functions.
13538
13539         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13540         argument to the constructor.
13541         (Interface.FindMembers): Added support for interface events.
13542         (Interface.PopluateEvent): Implemented.
13543
13544         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13545
13546 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13547
13548         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13549         but this is required to check for a method name being the same as
13550         the containing class.  
13551
13552         Handle this now.
13553
13554 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13555
13556         * interface.cs: initialize variable.
13557
13558 2002-07-23  Martin Baulig  <martin@gnome.org>
13559
13560         Implemented the IndexerName attribute in interfaces.
13561
13562         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13563         name if this is an explicit interface implementation.
13564         (Indexer.InterfaceIndexerName): New public variable.  If we're
13565         implementing an interface indexer, this is the IndexerName in that
13566         interface.  Otherwise, it's the IndexerName.
13567         (Indexer.DefineMethod): If we're implementing interface indexer,
13568         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13569         and Pending.ImplementIndexer methods.
13570         (Indexer.Define): Also define the PropertyBuilder if we're
13571         implementing an interface indexer and this is neither an explicit
13572         interface implementation nor do the IndexerName match the one in
13573         the interface.
13574
13575         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13576         If a method is defined here, then we always need to create a proxy
13577         for it.  This is used when implementing interface indexers.
13578         (Pending.IsInterfaceIndexer): New public method.
13579         (Pending.ImplementIndexer): New public method.
13580         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13581         This is used when implementing interface indexers to define a proxy
13582         if necessary.
13583         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13584         define a proxy if necessary.
13585
13586         * interface.cs (Interface.IndexerName): New public variable.
13587         (Interface.PopulateIndexer): Set the IndexerName.
13588         (Interface.DefineIndexers): New private method.  Populate all the
13589         indexers and make sure their IndexerNames match.
13590
13591         * typemanager.cs (IndexerPropertyName): Added support for interface
13592         indexers.
13593
13594 2002-07-22  Martin Baulig  <martin@gnome.org>
13595
13596         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13597         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13598         ret if HasReturnLabel.
13599         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13600         variables.
13601
13602         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13603         and set the ec.LoopBeginTryCatchLevel.
13604         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13605         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13606         the current ec.TryCatchLevel, the branch goes out of an exception
13607         block.  In this case, we need to use Leave and not Br.
13608
13609 2002-07-22  Martin Baulig  <martin@gnome.org>
13610
13611         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13612         block unless the block does not always return or it is contained in
13613         another try { ... } catch { ... } block.  Fixes bug #26506.
13614         Added verify-1.cs to the test suite.
13615
13616 2002-07-22  Martin Baulig  <martin@gnome.org>
13617
13618         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13619         then we do not always return.  Fixes bug #24985.
13620
13621 2002-07-22  Martin Baulig  <martin@gnome.org>
13622
13623         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13624         lookup on a per-class level; ie. walk up the class hierarchy until we
13625         found at least one applicable method, then choose the best among them.
13626         Fixes bug #24463 and test-29.cs.
13627
13628 2002-07-22  Martin Baulig  <martin@gnome.org>
13629
13630         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13631         return types of the methods.  The return type is not part of the
13632         signature and we must not check it to make the `new' modifier work.
13633         Fixes bug #27999, also added test-147.cs.
13634         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13635
13636         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13637         on the method's return type.
13638
13639 2002-07-21  Martin Baulig  <martin@gnome.org>
13640
13641         * assign.cs: Make this work if the rightmost source is a constant and
13642         we need to do an implicit type conversion.  Also adding a few more tests
13643         to test-38.cs which should have caught this.
13644
13645         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13646         target in the makefile for this.  The makefile.gnu is primarily intended
13647         for end-users who don't want to debug the compiler.
13648
13649 2002-07-21  Martin Baulig  <martin@gnome.org>
13650
13651         * assign.cs: Improved the Assign class so it can now handle embedded
13652         assignments (X = Y = Z = something).  As a side-effect this'll now also
13653         consume less local variables.  test-38.cs now passes with MCS, added
13654         a few new test cases to that test.
13655
13656 2002-07-20  Martin Baulig  <martin@gnome.org>
13657
13658         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13659         instructions.  Fixes bug #27977, also added test-146.cs.
13660
13661 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13662
13663         * cs-tokenizer.cs: fixed getHex ().
13664
13665 2002-07-19  Martin Baulig  <martin@gnome.org>
13666
13667         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13668         not Type.GetType() to lookup the array type.  This is needed when
13669         we're constructing an array of a user-defined type.
13670         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13671         single-dimensional arrays, but also for single-dimensial arrays of
13672         type decimal.
13673
13674 2002-07-19  Martin Baulig  <martin@gnome.org>
13675
13676         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13677         this function is called, it's not allowed to share LocalBuilders
13678         among ILGenerators.
13679
13680 2002-07-19  Martin Baulig  <martin@gnome.org>
13681
13682         * expression.cs (Argument.Resolve): Report an error 118 when trying
13683         to pass a type as argument.
13684
13685 2002-07-18  Martin Baulig  <martin@gnome.org>
13686
13687         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13688         Conv_R_Un for the signed `long' type.
13689
13690 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13691
13692         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13693         `expr' for the temporary result, as that will fail if we do
13694         multiple resolves on the same expression.
13695
13696 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13697
13698         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13699         ec.TypeContainer for looking up aliases. 
13700
13701         * class.cs (TypeContainer): Remove LookupAlias from here.
13702
13703         * decl.cs (DeclSpace); Move here.
13704
13705 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13706
13707         * class.cs (FindMembers): Only call filter if the constructor
13708         bulider is not null.
13709
13710         Also handle delegates in `NestedTypes' now.  Now we will perform
13711         type lookups using the standard resolution process.  This also
13712         fixes a bug.
13713
13714         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13715         This uses Expressions (the limited kind that can be parsed by the
13716         tree) instead of strings.
13717
13718         * expression.cs (ComposedCast.ToString): Implement, used to flag
13719         errors since now we have to render expressions.
13720
13721         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13722         FormArrayType. 
13723
13724         * ecore.cs (SimpleName.ToString): ditto.
13725
13726         * cs-parser.jay: Instead of using strings to assemble types, use
13727         Expressions to assemble the type (using SimpleName, ComposedCast,
13728         MemberAccess).  This should fix the type lookups in declarations,
13729         because we were using a different code path for this.
13730
13731         * statement.cs (Block.Resolve): Continue processing statements
13732         even when there is an error.
13733
13734 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13735
13736         * class.cs (Event.Define): Also remove the `remove' method from
13737         the list of pending items.
13738
13739         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13740         generate more compact code. 
13741
13742 2002-07-17  Martin Baulig  <martin@gnome.org>
13743
13744         * const.cs (Const.LookupConstantValue): Add support for constant
13745         `unchecked' and `checked' expressions.
13746         Also adding test case test-140.cs for this.
13747
13748 2002-07-17  Martin Baulig  <martin@gnome.org>
13749
13750         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13751         check whether mi.ReturnType implements the IEnumerator interface; the
13752         `==' and the IsAssignableFrom() will fail in this situation.
13753
13754 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13755
13756         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13757         here too.
13758
13759 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13760
13761         * expression.cs: fixed bug #27811.
13762
13763 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13764
13765         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13766         Molaro: when we are a ref, the value already contains a pointer
13767         value, do not take the address of it.
13768
13769 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13770         * removed mb-parser.jay and mb-tokenizer.cs
13771
13772 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13773
13774         * expression.cs: check against the building corlib void type.
13775
13776 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13777
13778         * ecore.cs: fix for valuetype static readonly fields: when 
13779         initializing them, we need their address, not the address of a copy.
13780
13781 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13782
13783         * typemanager.cs: register also enum_type in corlib.
13784
13785 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13786
13787         * class.cs: allow calling this (but not base) initializers in structs.
13788
13789 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
13790
13791         * ecore.cs: make sure we compare against the building base types
13792         in GetTypeSize ().
13793
13794 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
13795
13796         * typemanager.cs: fix TypeToCoreType() to handle void and object
13797         (corlib gets no more typerefs after this change).
13798
13799 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
13800
13801         * expression.cs (ArrayCreation.EmitArrayArguments): use
13802         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
13803
13804         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
13805         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
13806         array indexes, the runtime actually forbids them.
13807
13808         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
13809         for array arguments here.
13810
13811         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
13812         instead of the default for ValueTypes.
13813
13814         (New.DoEmit): Use IsValueType instead of
13815         IsSubclassOf (value_type)
13816         (New.DoResolve): ditto.
13817         (Invocation.EmitCall): ditto.
13818
13819         * assign.cs (Assign): ditto.
13820
13821         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
13822         Statements *are* currently doing part of their resolution during
13823         Emit.  
13824
13825         Expressions do always resolve during resolve, but statements are
13826         only required to propagate resolution to their children.
13827
13828 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
13829
13830         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
13831
13832         (LoadAssembly): Do not add the dll if it is already specified
13833
13834         (MainDriver): Add the System directory to the link path at the end,
13835         after all the other -L arguments. 
13836
13837         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
13838         wrong opcode for loading bytes and bools (ldelem.i1 instead of
13839         ldelem.u1) and using the opposite for sbytes.
13840
13841         This fixes Digger, and we can finally run it.
13842
13843         * driver.cs (UnixParseOption): Move the option parsing here.  
13844         (CSCParseOption): Implement CSC-like parsing of options.
13845
13846         We now support both modes of operation, the old Unix way, and the
13847         new CSC-like way.  This should help those who wanted to make cross
13848         platform makefiles.
13849
13850         The only thing broken is that /r:, /reference: and /lib: are not
13851         implemented, because I want to make those have the same semantics
13852         as the CSC compiler has, and kill once and for all the confussion
13853         around this.   Will be doing this tomorrow.
13854
13855         * statement.cs (Unsafe.Resolve): The state is checked during
13856         resolve, not emit, so we have to set the flags for IsUnsfe here.
13857
13858 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13859
13860         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
13861         not catch the Error_ObjectRefRequired in SimpleName (as it is
13862         possible to have a class/instance variable name that later gets
13863         deambiguated), we have to check this here.      
13864
13865 2002-07-10  Ravi Pratap  <ravi@ximian.com>
13866
13867         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
13868         make static and put into Expression.
13869
13870         (Event.Define): Register the private field of the event with the 
13871         TypeManager so that GetFieldFromEvent can get at it.
13872
13873         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
13874         keep track of the private field associated with an event which
13875         has no accessors.
13876
13877         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
13878         private field.
13879
13880         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
13881
13882 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
13883
13884         * expression.cs (Binary.EmitBranchable): this routine emits the
13885         Binary expression in a branchable context.  This basically means:
13886         we need to branch somewhere, not just get the value on the stack.
13887
13888         This works together with Statement.EmitBoolExpression.
13889
13890         * statement.cs (Statement.EmitBoolExpression): Use
13891         EmitBranchable. 
13892
13893 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
13894
13895         * statement.cs (For): Reduce the number of jumps in loops.
13896
13897         (For): Implement loop inversion for the For statement.
13898
13899         (Break): We can be breaking out of a Try/Catch controlled section
13900         (foreach might have an implicit try/catch clause), so we need to
13901         use Leave instead of Br.
13902
13903         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13904         now).  If the instace expression supports IMemoryLocation, we use
13905         the AddressOf method from the IMemoryLocation to extract the
13906         address instead of emitting the instance.
13907
13908         This showed up with `This', as we were emitting the instance
13909         always (Emit) instead of the Address of This.  Particularly
13910         interesting when This is a value type, as we dont want the Emit
13911         effect (which was to load the object).
13912
13913 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13914
13915         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13916
13917         * statement.cs (Checked): Set the CheckedState during the resolve
13918         process too, as the ConvCast operations track the checked state on
13919         the resolve process, and not emit.
13920
13921         * cs-parser.jay (namespace_member_declaration): Flag that we have
13922         found a declaration when we do.  This is used to flag error 1529
13923
13924         * driver.cs: Report ok when we display the help only.
13925
13926 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13927
13928         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13929
13930 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13931
13932         * cs-tokenizer.cs (define): We also have to track locally the
13933         defines.  AllDefines is just used for the Conditional Attribute,
13934         but we also need the local defines for the current source code. 
13935
13936 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13937
13938         * statement.cs (While, For, Do): These loops can exit through a
13939         Break statement, use this information to tell whether the
13940         statement is the last piece of code.
13941
13942         (Break): Flag that we break.
13943
13944         * codegen.cs (EmitContexts): New `Breaks' state variable.
13945
13946 2002-07-03  Martin Baulig  <martin@gnome.org>
13947
13948         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13949         modifiers in method declarations in structs.  Otherwise, you won't
13950         be able to override things like Object.Equals().
13951
13952 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13953
13954         * class.cs (Method, Property, Indexer): Do not allow the public
13955         modifier to be used in explicit interface implementations.
13956
13957         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13958         override modifiers in method declarations in structs
13959
13960 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13961
13962         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13963         integer or real overflow, report an error
13964
13965 2002-07-02  Martin Baulig  <martin@gnome.org>
13966
13967         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13968         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13969         to tell the runtime about our newly created System.Object and
13970         System.ValueType types.
13971
13972 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13973
13974         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13975         struct instead of Ldarg/Starg.
13976
13977 2002-07-02  Martin Baulig  <martin@gnome.org>
13978
13979         * expression.cs (Indirection.Indirection): Call
13980         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13981
13982 2002-07-02  Martin Baulig  <martin@gnome.org>
13983
13984         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13985         ValueType, call TypeManager.TypeToCoreType() on it.
13986         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13987         the OpCodes.Newarr argument.
13988
13989 2002-07-02  Martin Baulig  <martin@gnome.org>
13990
13991         * expression.cs (Invocation.EmitCall): When compiling corlib,
13992         replace all calls to the system's System.Array type to calls to
13993         the newly created one.
13994
13995         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13996         System.Array methods.
13997         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13998         from the system's System.Array type which must be replaced.
13999
14000 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14001
14002         * typemanager.cs: load unverifiable_code_ctor so we can build
14003         corlib using the correct type. Avoid using GetTypeCode() with
14004         TypeBuilders.
14005         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14006         TypeManager.object_type to allow building corlib.
14007
14008 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14009
14010         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14011
14012 2002-07-01  Martin Baulig  <martin@gnome.org>
14013
14014         * class.cs: Make the last change actually work, we need to check
14015         whether `ifaces != null' to avoid a crash.
14016
14017 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14018
14019         * class.cs: when we build structs without fields that implement
14020         interfaces, we need to add the interfaces separately, since there is
14021         no API to both set the size and add the interfaces at type creation
14022         time.
14023
14024 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14025
14026         * expression.cs: the dimension arguments to the array constructors
14027         need to be converted if they are a long.
14028
14029 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14030
14031         * class.cs: don't emit ldarg.0 if there is no parent constructor
14032         (fixes showstopper for corlib).
14033
14034 2002-06-29  Martin Baulig  <martin@gnome.org>
14035
14036         MCS now compiles corlib on GNU/Linux :-)
14037
14038         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14039         ie. check for MethodImplOptions.InternalCall.
14040
14041         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14042         and TypeManager.attribute_type are null, so we must explicitly check
14043         whether parent is not null to find out whether it's an attribute type.
14044         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14045         and SetBuilder, not only if the property is neither abstract nor external.
14046         This is necessary to set the MethodImplOptions on the accessor methods.
14047         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14048         SetBuilder, see Property.Emit().
14049
14050         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14051         populate "System.Object", "System.ValueType" and "System.Attribute" since
14052         they've already been populated from BootCorlib_PopulateCoreTypes().
14053
14054 2002-06-29  Martin Baulig  <martin@gnome.org>
14055
14056         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14057         is the NullLiteral, we also need to make sure that target_type is not
14058         an enum type.   
14059
14060 2002-06-29  Martin Baulig  <martin@gnome.org>
14061
14062         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14063         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14064         before calling BootstrapCorlib_ResolveDelegate ().
14065
14066 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14067
14068         * statement.cs: fixed build-breaker. All tests passed ok.
14069
14070 2002-06-27  Martin Baulig  <martin@gnome.org>
14071
14072         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14073         for System.Decimal when compiling corlib.
14074
14075 2002-06-27  Martin Baulig  <martin@gnome.org>
14076
14077         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14078         switch blocks which contain nothing but a default clause.
14079
14080 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14081
14082        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14083
14084 2002-06-27  Martin Baulig  <martin@gnome.org>
14085
14086         * ecore.cs (PropertyExpr.PropertyExpr): Call
14087         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14088
14089         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14090         is already a TypeBuilder.
14091
14092 2002-06-27  Martin Baulig  <martin@gnome.org>
14093
14094         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14095         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14096         the "from an array-type to System.Array" case.  This makes it work
14097         when compiling corlib.
14098
14099 2002-06-27  Martin Baulig  <martin@gnome.org>
14100
14101         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14102         non-static PropertyExpr, set its InstanceExpression.  This makes
14103         the `ICollection.Count' property work in System/Array.cs.
14104
14105 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14106
14107         * driver.cs: Made error handling more consistent.  Errors now
14108         tracked by Report class, so many methods which used to return int
14109         now return void.  Main() now prints success/failure and 
14110         errors/warnings message.
14111
14112         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14113         the magic number return values (123 and 124).  Now, if the
14114         expected error occurs, the compiler exits with success (exit value
14115         0).  If the compilation completes without seeing that particular
14116         error, the compiler exits with failure (exit value 1).  The
14117         makefile in mcs/errors has been changed to handle the new behaviour.
14118
14119         * report.cs: Made 'expected error' number a property and renamed
14120         it from 'Probe' to 'ExpectedError'.
14121
14122         * genericparser.cs: Removed error handling support, since it is
14123         now all done by Report class.
14124
14125         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14126         class, so parse() no longer returns an int.
14127
14128         * namespace.cs: Use Report.Error instead of GenericParser.error
14129
14130 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14131
14132         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14133         TypeContainer.AddOperator): At the front of the list put the
14134         explicit implementations, so they get resolved/defined first. 
14135
14136 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14137
14138         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14139         interface type is implemented by this TypeContainer.  Used during
14140         explicit interface implementation.
14141
14142         (Property.Define, Indexer.Define, Method.Define): Validate that
14143         the given interface in the explicit implementation is one of the
14144         base classes for the containing type.
14145
14146         Also if we are explicitly implementing an interface, but there is
14147         no match in the pending implementation table, report an error.
14148
14149         (Property.Define): Only define the property if we are
14150         not explicitly implementing a property from an interface.  Use the
14151         correct name also for those properties (the same CSC uses,
14152         although that is really not needed).
14153
14154         (Property.Emit): Do not emit attributes for explicitly implemented
14155         properties, as there is no TypeBuilder.
14156
14157         (Indexer.Emit): ditto.
14158
14159         Hiding then means that we do not really *implement* a pending
14160         implementation, which makes code fail.
14161
14162 2002-06-22  Martin Baulig  <martin@gnome.org>
14163
14164         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14165         the return value of Object.GetType().  [FIXME: we need to do this whenever
14166         we get a type back from the reflection library].
14167
14168 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14169
14170         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14171
14172 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14173
14174         * attribute.cs: Return null if we can not look up the type.
14175
14176         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14177         the interface types found.
14178
14179         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14180         interface types found.
14181
14182         * typemanager.cs (GetInterfaces): Make this routine returns alll
14183         the interfaces and work around the lame differences between
14184         System.Type and System.Reflection.Emit.TypeBuilder in the results
14185         result for GetInterfaces.
14186
14187         (ExpandInterfaces): Given an array of interface types, expand and
14188         eliminate repeated ocurrences of an interface.  This expands in
14189         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14190         be IA, IB, IC.
14191
14192 2002-06-21  Martin Baulig  <martin@gnome.org>
14193
14194         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14195         on System.Enum.
14196
14197 2002-06-21  Martin Baulig  <martin@gnome.org>
14198
14199         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14200         and called with one of the core types, return the corresponding typebuilder for
14201         that type.
14202
14203         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14204         element type.
14205
14206 2002-06-21  Martin Baulig  <martin@gnome.org>
14207
14208         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14209         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14210         (Expression.ConvertReferenceExplicit): Likewise.
14211
14212         * expression.cs (ElementAccess.DoResolve): Likewise.
14213         (ElementAccess.DoResolveLValue): Likewise.
14214
14215 2002-06-10  Martin Baulig  <martin@gnome.org>
14216
14217         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14218         add the "value" parameter to the parameter list.
14219
14220         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14221         to our caller.
14222
14223 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14224
14225         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14226         the argument to an int, uint, long or ulong, per the spec.  Also
14227         catch negative constants in array creation.
14228
14229 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14230
14231         * class.cs: do not allow the same interface to appear twice in
14232         the definition list.
14233
14234 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14235
14236         * ecore.cs: don't use ldlen with System.Array.
14237
14238 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14239
14240         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14241
14242 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14243
14244         * modifiers.cs: produce correct field attributes for protected
14245         internal. Easy fix so miguel can work on ther harder stuff:-)
14246
14247 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14248
14249         * pending.cs: New file.  Move the code from class.cs here.
14250         Support clearning the pending flag for all methods (when not doing
14251         explicit interface implementation).
14252
14253 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14254
14255         * rootcontext.cs: added a couple more types needed to bootstrap.
14256
14257 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14260         constructor in the type, instead of any constructor in the type
14261         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14262         a bug in the Mono runtime when applying the params attribute). 
14263
14264 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14265         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14266
14267 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14268
14269         * expression.cs (Unary.ResolveOperator): Use TypeManager
14270         to resolve the type.
14271
14272 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14273
14274         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14275         attached.
14276
14277         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14278         with each member too.
14279
14280         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14281         field builders too - this takes care of the enum member case.
14282
14283 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14284
14285         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14286         address-of operator on both value types and pointers.
14287
14288 2002-06-10  Martin Baulig  <martin@gnome.org>
14289
14290         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14291         PropertyBuilder to the `property_builders' list.
14292
14293         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14294         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14295         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14296         find any indexers which are inherited from an interface.
14297
14298 2002-06-09  Martin Baulig  <martin@gnome.org>
14299
14300         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14301         the same type as the constant if necessary.  There's also a test-130.cs
14302         for this.
14303
14304         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14305
14306         * typemanager.cs (TypeManager.ChangeType): Previously known as
14307         Enum.ChangeEnumType().
14308
14309 2002-06-09  Martin Baulig  <martin@gnome.org>
14310
14311         * expression.cs (Cast.TryReduce): Added support for consts.
14312
14313 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14314
14315         * class.cs (Accessor): Hold attributes information so we can pass
14316         it along.
14317
14318         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14319         Modify to pass in attributes attached to the methods.
14320
14321         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14322
14323         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14324         to handle the Accessor kind :-)
14325
14326         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14327
14328 2002-06-08  Martin Baulig  <martin@gnome.org>
14329
14330         * expression.cs (Unary.TryReduceNegative): Added support for
14331         ULongConstants.
14332
14333 2002-06-08  Martin Baulig  <martin@gnome.org>
14334
14335         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14336         name can't be found in the `defined_names' - the caller will do a
14337         MemberLookup in this case and thus find methods in System.Enum
14338         such as Enum.IsDefined().
14339
14340 2002-06-08  Martin Baulig  <martin@gnome.org>
14341
14342         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14343         Convert.ChangeType() which works with TypeBuilder created types.
14344         (Enum.LookupEnumValue, Enum.Define): Use it here.
14345
14346         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14347         `TypeBuilder.BaseType != null' check.
14348         (TypeContainer.FindMembers): Only lookup parent members if we
14349         actually have a parent.
14350         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14351         (ConstructorInitializer.Resolve): Likewise.
14352
14353         * interface.cs (Interface.FindMembers): Added
14354         `TypeBuilder.BaseType != null' check.
14355
14356         * rootcontext.cs (RootContext.ResolveCore): Added
14357         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14358         classes_second_stage.
14359
14360         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14361         debug_type and trace_type when compiling with --nostdlib.       
14362
14363 2002-06-07  Martin Baulig  <martin@gnome.org>
14364
14365         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14366         (AddField): Set it to true when adding a non-static field.
14367         (DefineType): Use `have_nonstatic_fields' to find out whether we
14368         have non-static fields, not `Fields != null'.
14369
14370 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14371
14372         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14373         dereferencing a null on the static-field code path)
14374
14375 2002-05-30  Martin Baulig  <martin@gnome.org>
14376
14377         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14378         to take command line arguments.  Use reflection to call the new
14379         custom `Initialize' function on the symbol writer and pass it the
14380         command line arguments.
14381
14382         * driver.cs (--debug-args): New command line argument to pass command
14383         line arguments to the symbol writer.
14384
14385 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14388         the target type for indexers and properties.  Thanks to Joe for
14389         catching this.
14390
14391 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * typemanager.cs (MethodFlags): returns the method flags
14394         (Obsolete/ShouldIgnore) that control warning emission and whether
14395         the invocation should be made, or ignored. 
14396
14397         * expression.cs (Invocation.Emit): Remove previous hack, we should
14398         not do this on matching a base type, we should do this based on an attribute
14399
14400         Only emit calls to System.Diagnostics.Debug and
14401         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14402         on the command line.
14403
14404         * rootcontext.cs: Global settings for tracing and debugging.
14405
14406         * cs-tokenizer.cs (define): New utility function to track
14407         defines.   Set the global settings for TRACE and DEBUG if found.
14408
14409 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14410
14411         * interface.cs (Populate*): Pass in the TypeContainer as well as
14412         the DeclSpace as parameters so that we can create EmitContexts and
14413         then use that to apply attributes etc.
14414
14415         (PopulateMethod, PopulateEvent, PopulateProperty)
14416         (PopulateIndexer): Apply attributes everywhere.
14417
14418         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14419         etc.
14420
14421         (ApplyAttributes): Update accordingly.
14422
14423         We now apply interface attributes for all members too.
14424
14425 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14426
14427         * class.cs (Indexer.Define); Correctly check if we are explicit
14428         implementation (instead of checking the Name for a ".", we
14429         directly look up if the InterfaceType was specified).
14430
14431         Delay the creation of the PropertyBuilder.
14432
14433         Only create the PropertyBuilder if we are not an explicit
14434         interface implementation.   This means that explicit interface
14435         implementation members do not participate in regular function
14436         lookups, and hence fixes another major ambiguity problem in
14437         overload resolution (that was the visible effect).
14438
14439         (DefineMethod): Return whether we are doing an interface
14440         implementation. 
14441
14442         * typemanager.cs: Temporary hack until we get attributes in
14443         interfaces (Ravi is working on that) and we get IndexerName
14444         support in interfaces.
14445
14446         * interface.cs: Register the indexers as properties.
14447
14448         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14449         warning, I have verified that this is a bug in the .NET runtime
14450         (JavaScript suffers of the same problem).
14451
14452         * typemanager.cs (MemberLookup): When looking up members for
14453         interfaces, the parent of an interface is the implicit
14454         System.Object (so we succeed in searches of Object methods in an
14455         interface method invocation.  Example:  IEnumerable x;  x.ToString
14456         ()) 
14457
14458 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14459
14460         * class.cs (Event): Events should also register if they do
14461         implement the methods that an interface requires.
14462
14463         * typemanager.cs (MemberLookup); use the new GetInterfaces
14464         method. 
14465
14466         (GetInterfaces): The code used to lookup interfaces for a type is
14467         used in more than one place, factor it here. 
14468
14469         * driver.cs: Track the errors at the bottom of the file, we kept
14470         on going.
14471
14472         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14473         instance if the method we are calling is static!
14474
14475 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14476
14477         * attribute.cs (ApplyAttributes): Make this function filter out
14478         the IndexerName attribute (as that attribute in reality is never
14479         applied) and return the string constant for the IndexerName
14480         attribute. 
14481
14482         * class.cs (TypeContainer.Emit): Validate that all the indexers
14483         have the same IndexerName attribute, and if so, set the
14484         DefaultName attribute on the class. 
14485
14486         * typemanager.cs: The return value might contain other stuff (not
14487         only methods).  For instance, consider a method with an "Item"
14488         property and an Item method.
14489
14490         * class.cs: If there is a problem with the parameter types,
14491         return. 
14492
14493 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14494
14495         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14496         looks at user defined conversion after making a call to 
14497         StandardConversionExists - we need this for overload resolution.
14498
14499         * expression.cs : Update accordingly the various method calls.
14500
14501         This fixes 2 bugs filed against implicit user defined conversions 
14502
14503 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14504
14505         * statement.cs: Track the result of the assignment.
14506
14507 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * expression.cs (MemberAccess): Improved error reporting for
14510         inaccessible members.
14511
14512 2002-05-22  Martin Baulig  <martin@gnome.org>
14513
14514         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14515         itself with debugging support.
14516
14517 2002-05-22  Martin Baulig  <martin@gnome.org>
14518
14519         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14520         Removed, this isn't needed anymore.
14521
14522 2002-05-20  Martin Baulig  <martin@gnome.org>
14523
14524         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14525         be underlying type for an enum.
14526
14527 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14528
14529         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14530         that splits out the loading of just the core types.
14531
14532         * rootcontext.cs (ResolveCore): Split the struct resolution in
14533         two, so we can load the enumeration underlying types before any
14534         enums are used.
14535
14536         * expression.cs (Is): Bandaid until we fix properly Switch (see
14537         bug #24985 for details).
14538
14539         * typemanager.cs (ImplementsInterface): The hashtable will contain
14540         a null if there are no interfaces implemented.
14541
14542 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14543
14544         * cs-parser.jay (indexer_declarator): It is fine to have array
14545         parameters
14546
14547 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14548
14549         * typemanager.cs: (RegisterBuilder): New function used to register
14550         TypeBuilders that implement interfaces.  Since
14551         TypeBuilder.GetInterfaces (as usual) does not work with lame
14552         Reflection.Emit. 
14553         (AddUserType): register interfaces.
14554
14555         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14556         dealing with TypeBuilder.  Also, arrays are showing up as
14557         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14558         methods can not be invoked on them!
14559
14560         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14561         (ImplicitReferenceConversionExists): Split out from
14562         StandardConversionExists. 
14563
14564         * expression.cs (As): We were only implementing one of the three
14565         cases for the as operator.  We now implement them all.
14566         (Is): Implement the various other cases for Is as well.
14567
14568         * typemanager.cs (CACHE): New define used to control if we want or
14569         not the FindMembers cache.  Seems to have a negative impact on
14570         performance currently
14571
14572         (MemberLookup): Nested types have full acess to
14573         enclosing type members
14574
14575         Remove code that coped with instance/static returns for events, we
14576         now catch this in RealFindMembers.
14577
14578         (RealFindMembers): only perform static lookup if the instance
14579         lookup did not return a type or an event.  
14580
14581 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14582
14583         * assign.cs (CompoundAssign): We pass more semantic information
14584         now to Compound Assignments than we did before: now we have all
14585         the information at hand, and now we resolve the target *before* we
14586         do the expression expansion, which allows the "CacheValue" method
14587         to have the effect we intended (before, a [x] += 1 would generate
14588         two differen ArrayAccess expressions from the ElementAccess,
14589         during the resolution process).
14590
14591         (CompoundAssign.DoResolve): Resolve target and original_source here.
14592
14593 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14594
14595         * expression.cs (ArrayAccess): dropped debugging information. 
14596
14597         * typemanager.cs: Small bug fix: I was always returning i_members,
14598         instead of one of i_members or s_members (depending on which had
14599         the content).
14600
14601         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14602         method is invoked before any code generation takes place, and it
14603         is a mechanism to inform that the expression will be invoked more
14604         than once, and that the method should use temporary values to
14605         avoid having side effects
14606
14607         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14608
14609         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14610         implementation.
14611
14612         * expression.cs (Indirection, ArrayAccess): Add support for
14613         CacheTemporaries in these two bad boys. 
14614
14615         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14616         ldobj or ldind_ref.  
14617         (StoreFromPtr): Handle stobj as well.
14618
14619         * expression.cs (UnaryMutator): Share more code.
14620
14621         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14622         down: I was not tracking the Filter function as well, which
14623         was affecting the results of the cache.
14624
14625 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14626
14627         * attribute.cs: Remove the hack to handle the CharSet property on
14628         StructLayouts. 
14629
14630 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14631
14632         * attribute.cs (DoResolve): More uglyness, we now only try to
14633         resolve the attribute partially, to extract the CharSet
14634         information (only if we are a StructLayout attribute).  Otherwise 
14635
14636         (GetExtraTypeInfo): Add some code to conditionally kill in the
14637         future this.   I am more and more convinced that the .NET
14638         framework has special code to handle the attribute setting on
14639         certain elements.
14640
14641         * expression.cs (IsParamsMethodApplicable): Revert my previous
14642         foreach change here, it was wrong.
14643
14644 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14645
14646         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14647         (pp_expr): do not abort on unknown input, just return.
14648         (eval): abort if there are pending chars.
14649
14650         * attribute.cs (Attribute.Resolve): Positional parameters are
14651         optional.  Deal with that case.
14652
14653         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14654         the Ansi/Unicode/Auto information for the type.
14655
14656         (TypeContainer.DefineType): instantiate the EmitContext here, as
14657         we will be using it during the type definition (to resolve
14658         attributes) and during the emit phase.
14659
14660         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14661         to pull type information out of the attributes
14662
14663         (Attribute.Resolve): track the constructor builder, and allow for
14664         multiple invocations (structs and classes will use this).
14665
14666         * ecore.cs (MemberLookupFinal): new version with all the
14667         parameters customizable.
14668
14669         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14670         constructors.  Return if the result value is null (as the error
14671         would have been flagged already by MemberLookupFinal)
14672
14673         Do not allow instances of abstract classes or interfaces to be
14674         created.
14675
14676         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14677         We have to compare the assembly property here when dealing with
14678         FamANDAssem and Assembly access modifiers, because we might be
14679         creating an assembly from *modules* (that means that we are not
14680         getting TypeBuilders for types defined in other modules that are
14681         part of this assembly).
14682
14683         (Method.Emit): If the method is marked abstract and has a body,
14684         emit an error. 
14685
14686         (TypeContainer.DefineMembers): If both the defined member and the
14687         parent name match are methods, then do not emit any warnings: let
14688         the Method.Define routine take care of flagging warnings.  But if
14689         there is a mismatch (method overrides something else, or method is
14690         overriwritten by something, then emit warning).
14691
14692         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14693         set to null, this means `do not check for the return type on the
14694         signature'. 
14695
14696         (Method.Define): set the return type for the method signature to
14697         null, so that we get methods with the same name and parameters and
14698         different return types.  This is used to flag warning 114 (you are
14699         hiding a method, and you probably want to use the new/override
14700         keywords instead).
14701
14702         * typemanager.cs (MemberLookup): Implemented proper access
14703         control, closing a long standing set of bug reports.  The problem
14704         was that the Framework only has two bits: Public and NonPublic,
14705         and NonPublic includes private and protected methods, but we need
14706         to enforce the FamANDAssem, FamOrAssem and Family. 
14707
14708 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14709
14710         * statement.cs (GotoCase): Return true: Ammounts to giving up
14711         knowledge on whether we return or not, and letting the other case
14712         be responsible for it.
14713
14714 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * driver.cs: Do not load directories for each file processed, only
14717         do it if there is a pattern.
14718
14719         * ecore.cs: Report readonly assigns here as well, as we might have
14720         been resolved only by MemberAccess.
14721
14722         (SimpleName.SimpleNameResolve): Also be useful for LValue
14723         resolution.   We need this to propagate assign to local readonly variables
14724
14725         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14726         do not want to reuse potential criteria memory.
14727
14728         * class.cs (MyEventBuilder): Set reflected_type;
14729
14730         * ecore.cs (Constantify): Added support for constifying bools.
14731
14732         (RootContext.LookupType): Added a cache for values looked up in
14733         the declaration space.
14734
14735         * typemanager.cs (FindMembers): Now is a front-end to
14736         RealFindMembers, and provides a two-level hashtable-based cache to
14737         the request.  
14738
14739         15% performance improvement: from 22.5 to 19.2 seconds.
14740
14741         * expression.cs (IsParamsMethodApplicable): use foreach.
14742         (Invocation.DoResolve): ditto.
14743         (New.DoResolve): ditto.
14744         (ArrayCreation.DoResolve): ditto.
14745
14746         * ecore.cs (FindMostEncompassingType): use foreach.
14747
14748         * delegate.cs (NewDelegate.DoResolve): Use foreach
14749
14750         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14751         (RemoveMethods): use foreach.
14752
14753         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14754         nested foreach statements instead of for, and also break out of
14755         the inner loop once a match is found.
14756
14757         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14758
14759 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14760
14761         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14762         we actually unwrap the expression to allow for extra information
14763         to be extracted. 
14764
14765         * expression.cs: Use Shr_Un on unsigned operations. 
14766
14767 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14768
14769         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14770         applicable operators was not being considered correctly. This closes
14771         the bug Miguel reported.
14772
14773 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14774
14775         * attribute.cs: check that the type derives from System.Attribute
14776         and report the correct error in that case (moved the duplicate code to
14777         its own method, too).
14778
14779 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14780
14781         * attribute.cs: lookup attribute type name as the spec says: first the
14782         bare attribute name and then name + "Attribute" (nant compiles with
14783         mcs after this fix).
14784
14785 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
14786
14787         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
14788         Because of the way we parse things, we should try to see if a
14789         UIntConstant can fit in an integer.
14790
14791 2002-05-07  Ravi Pratap  <ravi@ximian.com>
14792
14793         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
14794         when we are in an explicit context.
14795
14796         (ConvertReferenceExplicit): When converting from Iface type S to Class
14797         T make sure the rules are implemented as an OR.
14798
14799         * parameter.cs (ParameterType): Make it a property for now although the
14800         purpose really isn't anything immediate.
14801
14802         * expression.cs (Is*Applicable): Do better checking on the parameter type
14803         of a ref/out parameter. The ones from the system assemblies are already 
14804         marked with the correct type so we don't need to do any correction.
14805
14806         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
14807         the object type is standard too so include that.
14808
14809 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14810
14811         * ecore.cs (StandardConversionExists): Augment with missing code:
14812         deal with IntConstant, LongConstants and Enumerations.
14813
14814         * assign.cs: Report the error, instead of failing silently
14815
14816         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
14817         typecontainer that they are declared, because the
14818         typecontainer/namespace will have the list of using clauses that
14819         need to be applied.
14820
14821         Assembly Attributes were escaping the normal registration
14822         mechanism. 
14823
14824         (EmitCode): Apply attributes within an EmitContext that represents
14825         the container they were declared on.
14826
14827         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
14828
14829 2002-05-06  Ravi Pratap  <ravi@ximian.com>
14830
14831         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
14832         Revamp completely - make much cleaner as we now operate only
14833         on a set of Types.
14834
14835         (FindMostSpecificSource, FindMostSpecificTarget): New methods
14836         to implement the logic detailed in the spec more correctly.
14837
14838         (UserDefinedConversion): Update accordingly.
14839
14840 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14841
14842         * statement.cs: Return flow analysis information up.
14843
14844         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
14845         and the default.
14846
14847         (token): Do not consume an extra character before calling
14848         decimal_digits.
14849
14850 2002-05-06  Piers Haken <piersh@friskit.com>
14851
14852         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
14853
14854 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
14855
14856         * class.cs (Constructor.Emit): Set the IsStatic flag in the
14857         EmitContext during the instance constructor initializer
14858         resolution, to stop access to instance variables.
14859
14860         This is mandated by the spec, last paragraph of the `constructor
14861         initializers' section. 
14862
14863 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
14864
14865         * cs-parser.jay, class.cs (Accessor): new class used to represent
14866         an accessor (get or set).  In the past we used `null' to represent
14867         a missing accessor.  But this is ambiguous because there was no
14868         way to tell in abstract indexers/properties if one of them was
14869         specified.
14870
14871         Now there is a way of addressing that.
14872
14873         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
14874         instead of FindMembers.
14875
14876         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
14877         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
14878
14879         * attribute.cs: Treat indexers and properties as the same in terms
14880         of applying attributes
14881
14882         * ecore.cs (FindMostEncompassedType): Use statically initialized
14883         EmptyExpressions()s like we do elsewhere to avoid creating useless
14884         objects (and we take this out of the tight loop).
14885
14886         (GetConversionOperators): Move the code to extract the actual
14887         operators to a separate routine to clean things up.
14888
14889 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
14890
14891         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
14892         events are always registered FieldBuilders.
14893
14894         * class.cs (FieldBase): New class shared by Fields 
14895
14896         * delegate.cs: If we are a toplevel delegate, use our full name.
14897         If we are a nested delegate, then only use our tail name.
14898
14899 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14900
14901         * expression.cs (IsApplicable): Ensure that we add the "&" to
14902         ref/out types before comparing it with the type of the argument.
14903
14904         (IsParamsMethodApplicable): Ditto.
14905
14906         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14907         silly me ;-)
14908
14909         * delegate.cs : Handle the case when we have more than one applicable
14910         method. Flag an error only when we finish checking all.
14911
14912 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14913
14914         * expression.cs: Add support for boolean static initializers.
14915
14916 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14917
14918         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14919
14920         * parameter.cs (ComputeParameterTypes,
14921         ComputeAndDefineParameterTypes): Better error handling: now we
14922         clear the `types' cache if we fail during any of the type lookups.
14923         We also return the status code correctly to our caller
14924
14925         * delegate.cs: If we fail to define a delegate, abort the extra
14926         steps. 
14927
14928         * expression.cs (Binary.ResolveOperator): for
14929         operator==(object,object) and operator !=(object, object) we also
14930         have to verify that there is an implicit conversion from one to
14931         the other.
14932
14933         (ArrayAccess.DoResolve): Array Access can operate on
14934         non-variables. 
14935
14936 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14937
14938         * assign.cs (CompoundAssign): A new class used as a "flag" that
14939         the assignment actually is happening as part of a compound
14940         assignment operator.
14941
14942         During compound assignment, a few new rules exist to enable things
14943         like:
14944
14945         byte b |= 1 + 2
14946
14947         From the spec:
14948
14949         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14950         to the type of x) if y is implicitly convertible to the type of x,
14951         and the operator is a builtin operator and the return type of the
14952         operator is explicitly convertible to the type of x. 
14953
14954         * rootcontext.cs: Reset warning level to 2.  4 catches various
14955         "interesting" features in mcs, we must clean this up at some
14956         point, but currently am trying to kill other bugs ;-)
14957
14958         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14959         in container classes as well.  
14960
14961         * expression.cs (Binary.ResolveOperator): Handle string case
14962         before anything else (as operator overloading does emit an error
14963         before doing anything else).
14964
14965         This code could go away when we move to a table driven model, but
14966         i could not come up with a good plan last night.
14967
14968 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14969
14970         * typemanager.cs (CSharpName): reimplementation using regex.
14971         * class.cs: added null check for fields in Emit
14972         * rootcontext.cs: set warninglevel to 4
14973
14974 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14975
14976         * typemanager.cs (CSharpName): reimplemented with Lupus
14977         suggestion.
14978
14979 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14980
14981         * statement.cs (If): correclty implement Resolve, because we were
14982         not catching sem errors in there.  The same process is needed
14983         everywhere else. 
14984         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14985
14986
14987         (Statement.Warning_DeadCodeFound): Factorize code.
14988         (While): Report dead code here too.
14989
14990         (Statement): Added Resolve virtual method to allow
14991         for resolution split from the emit code.
14992
14993 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * statement.cs (EmitBoolExpression): No longer try to resolve the
14996         expression here.    
14997         (MakeBoolean): New utility function that resolve, implicitly
14998         converts to boolean and tags the expression. 
14999
15000
15001         (If, Do): Implement dead code elimination.
15002         (While): Implement loop inversion
15003
15004         (Do, While, For, If): Resolve the expression prior to calling our
15005         code generation.
15006
15007 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15008
15009         * class.cs:
15010           - added method Report28 (warning: program has more than one entry point)
15011           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15012           - modified method Method.Define, the part at the end of the method
15013
15014         * rootcontext.cs: added static public Location EntryPointLocation;
15015           
15016         * ../errors/cs0028.cs : Add test case for the above warning.              
15017
15018         * typemanager.cs:
15019           - modified method CSharpName to allow arrays of primitive type to
15020             be printed nicely (e.g. instead of System.Int32[][] it now prints
15021             int[][])
15022           - added method CSharpSignature: returns the signature of a method
15023             in string format to be used in reporting errors, warnings, etc.
15024
15025         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15026         with String.Empty.
15027
15028 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15029
15030         * delegate.cs (Define): Fix extremely silly bug where I was
15031         setting the type of the 'object' parameter of the BeginInvoke
15032         method to System.IAsyncResult instead of System.Object ;-)
15033
15034 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15035
15036         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15037         here. 
15038
15039         (Constructor.Emit): return if we fail to initialize the
15040         constructor.  Another door closed!  
15041
15042         * expression.cs (New.DoResolve): Improve error message (from -6 to
15043         1501).  Use DeclaredOnly lookup to find the exact constructor.
15044
15045         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15046         loop.  This is useful.
15047
15048         * cs-parser.jay: Adjust the default parameters so that destructors
15049         have the proper signature.
15050
15051 2002-04-26  Martin Baulig  <martin@gnome.org>
15052
15053         * driver.cs (LoadAssembly): If `assembly' contains any characters
15054         which are only valid in path names and not in assembly names
15055         (currently slash, backslash and point), use Assembly.LoadFrom ()
15056         instead of Assembly.Load () on the `assembly' (before iteration
15057         over the link_paths).
15058
15059 2002-04-26  Martin Baulig  <martin@gnome.org>
15060
15061         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15062
15063 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * class.cs (Property): use the new typemanager.MemberLookup
15066
15067         (TypeContainer.MemberLookup): Implement using the
15068         TypeManager.MemberLookup now. 
15069
15070         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15071         and return MemberInfos, so that these can be used without an
15072         EmitContext (what we had before).
15073
15074 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * expression.cs: Fix the case where the argument to params if the
15077         type of the params.  I omitted handling this before.   Fixed
15078
15079 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * driver.cs: Call BootCorlib_PopulateCoreType
15082
15083         * class.cs (Property.CheckBase): Check for properties only, not
15084         for all members. 
15085
15086         * interface.cs: Temporary hack: try/catch around the
15087         CustomAttributeBuilder, because I am getting an exception that I
15088         do not understand.
15089
15090         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15091         types whose definitions are required to be there (attributes are
15092         defined before standard types).
15093
15094         Compute definitions as we boot the various types, as they are used
15095         immediately (value_type class will need object_type, but if we do
15096         not initialize object_type, we will pass a null, which will let
15097         the runtime pick the System.Object from the existing corlib, which
15098         is not what we want).
15099
15100 2002-04-22  Patrik Torstensson <totte@labs2.com>
15101
15102         * cs-tokenizer.cs: fixed a number of trim() issues.
15103
15104 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15105
15106         * expression.cs (Argument.Type): Ensure that we return the correct
15107         type when we have out or ref parameters [in which case we 
15108         append a "&"].
15109
15110 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15111
15112         * class.cs (Property, Indexer): Allow extern modifier in there. 
15113
15114         * typemanager.cs (InitBaseTypes): Initializes object_type and
15115         value_type, since those will be used early on during the bootstrap
15116         process to compile corlib.
15117
15118         (InitCoreTypes): Move code from here to InitBaseTypes.
15119
15120 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15121
15122         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15123         single-dimension arrays as using the ldlen opcode.  
15124
15125         Daniel Lewis discovered this optimization.  
15126
15127         * typemanager.cs: Add signature for System.Array::get_Length
15128
15129 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15130
15131         * statement.cs: report the error when the foreach does not apply to an
15132         array nor a collection.
15133
15134 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15135
15136         * expression.cs: Add implicit conversions to the operator ~.
15137
15138         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15139
15140         * typemanager.cs: Locate the decimal constructor.
15141
15142 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15143
15144         * attribute.cs: use the new property of TypeOf.
15145         * expression.cs: added 'get' property around typearg.
15146
15147         These changes fix a build breaker reported by NickD. Is this the
15148         correct way to fix?  If not, please, revert my changes and make it
15149         work :-).
15150
15151 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15152
15153         * attribute.cs: Add support for typeof in attribute invocations.
15154         I am not sure that this is right though.
15155
15156 2002-04-14  Duncan Mak  <duncan@ximian.com>
15157
15158         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15159         Binary.Operator.Division case.
15160
15161 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15162
15163         * class.cs (DefineType): Ensure that we do a proper check on
15164         attribute types and also register it with the TypeManager.
15165
15166         (TypeContainer.Targets): The default for attribute types is
15167         AttributeTargets.All.
15168
15169         * attribute.cs (ApplyAttributes): Registering the attribute type
15170         is done elsewhere, not when we discover we have a Usage attribute.
15171
15172 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15173
15174         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15175         and get rid of is_delegate parameter.
15176
15177         * everywhere : update.
15178
15179 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15180
15181         * cs-parser.jay (compilation_unit): Revamp completely to use
15182         some new ideas that I got from Rhys' grammar to solve the problems
15183         with assembly level attributes.
15184
15185         (outer_declaration): New grammar production.
15186
15187         (attribute_sections): Add.
15188
15189         (opt_attributes): Base on attribute_sections
15190
15191         (namespace_declaration): Allow opt_attributes to tackle the case
15192         when we have assembly level attributes - we are clever in this
15193         regard now ;-)
15194
15195         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15196         attributes in the non-global context.
15197
15198         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15199         instead of SetGlobalAttributes.
15200
15201         * class.cs, rootcontext.cs : Ensure we define and generate 
15202         attribute types before anything else.
15203
15204         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15205         and flag the new error -20 for the case when the attribute type
15206         does not have valid targets specified. csc does not catch this.
15207
15208         * ../errors/errors.txt : update for error # -20
15209
15210 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15211
15212         * support.cs (InternalParameters.ParameterModifier): Do some null
15213         checking and return sane values.
15214
15215         * class.cs (Method.Define): If we are a PInvoke method, ensure
15216         that we are static and extern. Report error # 601
15217
15218         * ../errors/cs0601.cs : Add test case for the above error.
15219
15220 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15221
15222         * rootcontext.cs (attribute_types): We need to keep type of
15223         all attribute types separately and emit code for them first.
15224
15225         (RegisterAttribute) : Implement.
15226
15227         * class.cs (DefineType): Check if the current Type is a custom
15228         attribute type and register it accordingly.
15229
15230         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15231         adding the first attribute twice and rename to
15232
15233         (SetGlobalAttributes): this.
15234
15235         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15236         lookups.
15237
15238         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15239         if we are processing global arguments. Hmm, I am unsure of this.
15240
15241 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15242
15243         * expression.cs: added static array of strings to avoid calling
15244         Enum.ToString () for Operator in Binary. Significant recover of
15245         performance.
15246
15247 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15248
15249         * class.cs (FindMembers): Allow the Builders of the various
15250         members to be null.  If they are skip them.  This only happens
15251         during the PInvoke declaration.
15252
15253 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15254
15255         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15256         failure, so we do not keep going afterwards.
15257
15258         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15259         wanted to pass `false' as the `is_delegate' argument.  If this is
15260         the case, why not use delegate_type == null to mean `is_delegate =
15261         false' and anything else as is_delegate = true.
15262
15263 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15264
15265         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15266         code for the section, not the beginning of the tests.
15267
15268 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15271
15272         * expression.cs (Binary): same.  Warn about errors where we have
15273         Enum/Enum in operator + as well.
15274
15275 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15276
15277         * statement.cs:
15278                 - added support for switch(bool)
15279                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15280                 - add TableSwitchEmit() to handle table-based switch statements
15281
15282 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15283
15284         * expression.cs (Invocation.OverloadResolve): Factor out code which
15285         does parameter compatibility checking with arguments so that we can 
15286         re-use the code even from Delegate.VerifyApplicability
15287
15288         (VerifyArgumentsCompat): Move above code here.
15289
15290         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15291         and instead make a call to the above method.
15292
15293 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15294
15295         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15296         We use it to keep track of classes which are attribute types.
15297
15298 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * delegate.cs (Delegate.Define): Correctly define the types in the
15301         presence of fixed and array parameters.
15302
15303         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15304         doing FindMembers.
15305
15306         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15307         include NonPublic after the first iteration.
15308
15309         * class.cs (Indexer.CheckBase): Only check if both parents are
15310         non-null. 
15311
15312         * cs-parser.jay (accessor_body): If empty, set to null.
15313
15314         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15315         same code path here to resolve constants names that we did have in
15316         MemberAccess.DoResolve.  There is too much code duplicated here.
15317
15318 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15319
15320         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15321
15322         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15323         to MakeUnionSet.
15324
15325         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15326         tokens, numbers and strings.
15327
15328         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15329         parenthesis.
15330
15331         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15332         asyncronous parameters and the regular parameters.  
15333
15334         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15335         specify the target directory.
15336
15337         * expression.cs: (This.DoResolve): Simplify
15338         (As.Emit): Optimize, do not generate IsInst if the expression is
15339         always of the given type.
15340
15341         (Is.DoResolve): Bug fix, we were reporting both always/never for
15342         the is expression.
15343
15344         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15345         creating too many unnecessary arrays.
15346
15347 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15348
15349         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15350         fields instead of rolling our own initializer.   Takes care of all
15351         implicit conversions, and drops unnecessary static checks/argument.
15352
15353 2002-03-31  Dick Porter  <dick@ximian.com>
15354
15355         * driver.cs: use the GetDirectories() return values properly, and
15356         use "/" as path separator.
15357
15358 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15359
15360         * expression.cs (Unary): Optimize - - expr into expr.
15361         (Binary): Optimize a + (-b) into a -b.
15362
15363         * codegen.cs (CodeGen): Made all methods static.
15364
15365 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15366
15367         * rootcontext.cs: 
15368
15369         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15370         TypeBuilder property.
15371
15372         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15373         instead. 
15374
15375         * tree.cs: Removed the various RecordXXXX, and replaced with a
15376         single RecordDecl.  Removed all the accessor methods, and just
15377         left a single access point Type 
15378
15379         * enum.cs: Rename DefineEnum to DefineType.
15380
15381         * decl.cs: New abstract method `DefineType' used to unify the
15382         Defines for Enumerations, Interfaces, TypeContainers and
15383         Delegates.
15384
15385         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15386         LookupBaseClasses method that used to live in class.cs and
15387         interface.cs here, and renamed to FindType.
15388
15389         * delegate.cs: Implement DefineType.  Take advantage of the
15390         refactored pattern for locating the parent builder without taking
15391         the parent_builder argument (which we know does not work if we are
15392         nested, and triggering a toplevel definition).
15393
15394 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15395
15396         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15397         accessibility of a member has changed during override and report
15398         an error if so.
15399
15400         * class.cs (Method.Define, Property.Define): Only complain on
15401         overrides if the method is private, any other accessibility is
15402         fine (and since we just checked the permission is the same, we are
15403         good to go).
15404
15405         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15406         and elif are processed always.  The other pre-processing
15407         directives are only processed if we are "taking" the path
15408
15409 2002-03-29  Martin Baulig  <martin@gnome.org>
15410
15411         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15412         current location is not Null.
15413
15414         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15415         a separate method so we can profile it.
15416
15417         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15418         `span.Seconds' are just seconds, but no minutes or hours.
15419         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15420
15421 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15422
15423         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15424         Remove the gratuitous set of Final:
15425
15426                                 // If an interface implementation, then we can set Final.
15427                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15428                                     implementing.DeclaringType.IsInterface)
15429                                         flags |= MethodAttributes.Final;
15430
15431         I do not know what I was smoking when I used that.
15432
15433
15434         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15435         step into fixing the name resolution issues for delegates and
15436         unifying the toplevel name resolution.
15437
15438 2002-03-28  Martin Baulig  <martin@gnome.org>
15439
15440         * class.cs (Method.Emit): If we have a symbol writer, call its
15441         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15442         tell it about the current method.
15443
15444         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15445         writer that we're going to emit the first byte of IL code for a new
15446         statement (a new source line).
15447         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15448         EmitContext.Mark() before emitting any code.
15449
15450         * location.cs (SymbolDocument): Return null when we're Null.
15451
15452         * statement.cs (Statement): Moved the `Location loc' variable here.
15453         (Statement.EmitBoolExpression): If we have a symbol writer, call
15454         ec.Mark() before emitting any code to tell it that we're at the
15455         beginning of a new statement.
15456         (StatementExpression): Added `Location' argument to the constructor.
15457         (Block): Added public readonly variable `StartLocation' and public
15458         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15459         (Block): Added constructor which takes a start and end location.
15460         (Block.SetEndLocation): New method. This sets the end location.
15461         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15462         local variables we create.
15463         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15464         each statement and do also mark the begin and end of the block.
15465
15466         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15467         tell it the current lexer.Location, use Location.Null for the end of the
15468         block.
15469         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15470         current block, set its end location using SetEndLocation().
15471         (statement_expression): StatementExpression constructor now takes the
15472         lexer.Location as additional argument.
15473         (for_statement, declare_local_variables): Likewise.
15474         (declare_local_variables): When creating a new implicit block, use the
15475         new Block constructor and pass it the lexer.Location.
15476
15477 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15478
15479         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15480         members also on the parent interfaces recursively.
15481
15482 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15483
15484         * report.cs: Use new formats, since Gonzalo finished the missing
15485         bits. 
15486
15487         * expression.cs (Binary.ResolveOperator): added missing operator|
15488         operator& and operator^ for bool/bool.
15489
15490         * cs-parser.jay: CheckDef now takes a Location argument that is
15491         used to report errors more precisly (instead of reporting the end
15492         of a definition, we try to track something which is a lot closer
15493         to the source of the problem).
15494
15495         * cs-tokenizer.cs: Track global token use, so we can properly flag
15496         the use of #define/#undef after the first token has been seen.
15497
15498         Also, rename the reportXXXX to Error_DescriptiveName
15499
15500         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15501         TypeContainer, so that Enum and Interface can use this too.
15502
15503         * class.cs (TypeContainer.LookupInterfaceOrClass,
15504         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15505         `builder' argument.  Typically this was used to pass the parent
15506         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15507         the definition).  
15508
15509         The problem is that a nested class could trigger the definition of
15510         a toplevel class, and the builder would be obviously wrong in that
15511         case. 
15512
15513         So we drop this argument, and we compute dynamically the
15514         TypeBuilder/ModuleBuilder (the correct information was available
15515         to us anyways from DeclSpace.Parent)
15516
15517         * interface.cs (Interface.DefineInterface): Drop builder
15518         parameter cleanup like class.cs
15519
15520         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15521         like class.cs
15522
15523         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15524         values. 
15525
15526         (Try.Emit): Propagate the returns value from the statement.
15527
15528         (Return.Emit): Even if we are leavning 
15529
15530         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15531
15532         * modifiers.cs: Fix the computation of MethodAttributes flags.
15533
15534 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15535
15536         * driver.cs: allow compilation of files that start with '/'.
15537         Add a default case when checking the argument of --target.
15538
15539 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * interface.cs: Implement the same search algorithm for types in
15542         the interface code.
15543
15544         * delegate.cs: Do not allow multiple definition.
15545
15546         * Recovered ChangeLog that got accidentally amputated
15547
15548         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15549
15550         * rootcontext.cs: Load manually enum to allow core classes to
15551         contain enumerations.
15552
15553         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15554         Update to new static methods in TypeManager.
15555
15556         * typemanager.cs (GetMethod, GetConstructor): Use our
15557         implementation of FindMembers to find the members, since during
15558         corlib compilation, the types are TypeBuilders and GetMethod and
15559         GetConstructor do not work.
15560
15561         Make all methods in TypeManager static.
15562
15563         (InitCodeHelpers): Split the functionality from
15564         the InitCodeTypes function.
15565
15566         * driver.cs: Call InitCodeHelpers after we have populated the
15567         types. 
15568
15569         * cs-parser.jay (delegate_declaration): we did not used to compute
15570         the delegate name correctly for void delegates.
15571
15572 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15573
15574         * rootcontext.cs (RootContext): Init the interface_resolve_order
15575         and type_container_resolve_order always.
15576
15577         (ResolveCore, BootstrapCorlib_ResolveClass,
15578         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15579         compiler when compiling with --nostdlib
15580
15581         * class.cs (TypeContainer.DefineType): Check that our parent is
15582         not null.  This test is most important when we are bootstraping
15583         the core types.
15584
15585         * codegen.cs: Split out the symbol writing code.
15586
15587 2002-03-25  Martin Baulig  <martin@gnome.org>
15588
15589         * driver.cs (-g): Made -g an alias for --debug.
15590
15591 2002-03-24  Martin Baulig  <martin@gnome.org>
15592
15593         * codegen.cs (SymbolWriter): New public variable. Returns the
15594         current symbol writer.
15595         (CodeGen): Added `bool want_debugging_support' argument to the
15596          constructor. If true, tell the ModuleBuild that we want debugging
15597         support and ask it for the ISymbolWriter.
15598         (Save): If we have a symbol writer, call it's Close() method after
15599         saving the assembly.
15600
15601         * driver.c (--debug): New command line argument to create a
15602         debugger information file.
15603
15604         * location.cs (SymbolDocument): New public property. Returns an
15605         ISymbolDocumentWriter object for the current source file or null
15606         if we don't have a symbol writer.
15607
15608 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15609
15610         * driver.cs (LoadAssembly): Correctly return when all the paths
15611         have been tried and not before.
15612
15613         * statement.cs (Switch.Emit): return the actual coverage for this
15614         statement (returns/not-returns)
15615
15616         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15617         switch of the statement if we are the last switch section.  That
15618         kills two problems: try/catch problems (we used to emit an empty
15619         nop at the end) and switch statements where all branches would
15620         return. 
15621
15622 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15623
15624         * driver.cs: Add default assemblies (the equivalent to the
15625         Microsoft CSC.RSP file)
15626
15627         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15628         also update tokens_seen and set it to false.
15629
15630         * driver.cs: Implement --recurse for Mike.
15631
15632         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15633         correctly splitting out the paths.
15634
15635 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * interface.cs (Interface.PopulateProperty): Instead of using
15638         `parent' as the declaration space for the set parameters, use
15639         `this' 
15640
15641         * support.cs (InternalParameters): InternalParameters constructor
15642         takes a DeclSpace instead of a TypeContainer.
15643
15644         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15645         types are being initialized, load the address of it before calling
15646         the function.  
15647
15648         (New): Provide a mechanism to disable the generation of local
15649         value type temporaries when the caller will be providing us with
15650         an address to store it.
15651
15652         (ArrayCreation.EmitDynamicInitializers): Use it.
15653
15654 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15655
15656         * expression.cs (Invocation.EmitArguments): Only probe for array
15657         property if there is more than one argument.  Sorry about that.
15658
15659         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15660         empty param arrays.
15661
15662         * class.cs (Method.LabelParameters): Fix incorrect code path that
15663         prevented the `ParamArrayAttribute' from being applied to the
15664         params attribute.
15665
15666 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15667
15668         * support.cs (ReflectionParameters): Correctly compute whether the
15669         last argument is a params array.  Fixes the problem with
15670         string.Split ('a')
15671
15672         * typemanager.cs: Make the assemblies array always be non-null
15673         (empty, but non-null)
15674
15675         * tree.cs (RecordDecl): New function that abstracts the recording
15676         of names.  This reports error 101, and provides a pointer to the
15677         previous declaration.  Fixes a crash in the compiler.
15678
15679         * cs-parser.jay (constructor_declaration): Update to new grammar,
15680         and provide a constructor_body that can be empty.
15681
15682 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15683
15684         * driver.cs: Add support for --resources.
15685
15686         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15687         Make all types for the various array helper methods be integer.
15688
15689         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15690         CheckState to ConvCast.
15691
15692         (ConvCast): Now it takes a `checked' state argument, to avoid
15693         depending on the emit context for the conversion, and just using
15694         the resolve time setting.
15695
15696         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15697         instead of Invocation.EmitArguments.  We do not emit the original
15698         arguments, instead we emit those which have been converted to
15699         unsigned int expressions.
15700
15701         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15702
15703         * codegen.cs: ditto.
15704
15705         * expression.cs (LocalVariableReference): Drop the use of the
15706         Store function that depended on the variable index.
15707
15708         * statement.cs (VariableInfo): Drop the `Idx' property from this
15709         class, as this is not taking into account the indexes for
15710         temporaries tat we generate during the execution, getting the
15711         indexes wrong.
15712
15713         * class.cs: First emit class initializers, then call the parent
15714         constructor. 
15715
15716         * expression.cs (Binary): Fix opcode emision.
15717         (UnaryMutator.EmitCode): Support checked code generation
15718
15719         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15720         matches for events for both the Static and Instance scans,
15721         pointing to the same element.   Fix that.
15722
15723 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15724
15725         * rootcontext.cs (ResolveTree): Always set the
15726         interface_resolve_order, because nested interfaces will be calling
15727         into us.
15728
15729         * class.cs (GetInterfaceOrClass): Track the same resolution
15730         process used by TypeManager.LookupType.  This fixes the nested
15731         type lookups in class declarations (separate path from
15732         LookupType). 
15733
15734         (TypeContainer.DefineType): Also define nested interfaces.
15735         (TypeContainer.RegisterOrder): New public function used to
15736         register the order in which child interfaces need to be closed.
15737
15738         Nested interfaces need to be closed after their parents have been
15739         created. 
15740
15741         * interface.cs (InterfaceAttr): Put all the logic for computing
15742         the interface attribute here. 
15743
15744         (DefineInterface): Register our interface order with the
15745         RootContext or with the TypeContainer depending on the case.
15746
15747 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15748
15749         * cs-parser.jay: rework foreach statement to work with the new
15750         changes to the policy on SimpleNames.
15751
15752         * report.cs: support Stacktrace on warnings as well.
15753
15754         * makefile: drop --unsafe and /unsafe from the compile.
15755
15756 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15757
15758         * ecore.cs (StandardConversionExists): Modify to take an Expression
15759         as the first parameter. Ensure we do null -> reference type conversion
15760         checking.
15761
15762         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15763         temporary Expression objects.
15764
15765 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15766
15767         * interface.cs: workaround bug in method overloading resolution
15768         (there is already a bugzilla bug for it).
15769
15770 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15771
15772         We could also solve this problem by having a separate path for
15773         performing type lookups, instead of DoResolve, we could have a
15774         ResolveType entry point, and only participating pieces of the
15775         production (simplename, deref, array) would implement this. 
15776
15777         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15778         signal SimpleName to only resolve type names and not attempt to
15779         resolve anything else.
15780
15781         * expression.cs (Cast): Set the flag.
15782
15783         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
15784
15785         * class.cs: Only report 108 if there is no `new' modifier.
15786
15787         * cs-parser.jay: rework foreach statement to work with the new
15788         changes to the policy on SimpleNames.
15789
15790         * report.cs: support Stacktrace on warnings as well.
15791
15792         * makefile: drop --unsafe and /unsafe from the compile.
15793
15794 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
15795
15796         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15797         lookups here, instead of doing that at parse time.  This means
15798         that our grammar will not introduce `LocalVariableReferences' as
15799         expressions at this point.  That solves the problem of code like
15800         this:
15801
15802         class X {
15803            static void Main ()
15804            { int X = 1;
15805             { X x = null }}}
15806
15807         This is only half the fix.  The full fix requires parameters to
15808         also be handled in this way.
15809
15810         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
15811         makes the use more obvious of the DeclSpace.  The
15812         ec.TypeContainer.TypeBuilder is now only used to pull the
15813         TypeBuilder for it.
15814
15815         My theory is that I can get rid of the TypeBuilder completely from
15816         the EmitContext, and have typecasts where it is used (from
15817         DeclSpace to where it matters).  
15818
15819         The only pending problem is that the code that implements Aliases
15820         is on TypeContainer, and probably should go in DeclSpace.
15821
15822         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
15823         lookups here, instead of doing that at parse time.  This means
15824         that our grammar will not introduce `LocalVariableReferences' as
15825         expressions at this point.  That solves the problem of code like
15826         this:
15827
15828         class X {
15829            static void Main ()
15830            { int X = 1;
15831             { X x = null }}}
15832
15833         This is only half the fix.  The full fix requires parameters to
15834         also be handled in this way.
15835
15836         * class.cs (Property.DefineMethod): When implementing an interface
15837         method, set newslot, when implementing an abstract method, do not
15838         set the flag (before we tried never setting it, or always setting
15839         it, which is the difference).
15840         (Indexer.DefineMethod): same.
15841         (Method.DefineMethod): same.
15842
15843         * ecore.cs: Only set the status used flag if we get back a Field.
15844
15845         * attribute.cs: Temporary hack, so Paolo can keep working.
15846
15847 2002-03-08  Ravi Pratap  <ravi@ximian.com>
15848
15849         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
15850         the unmanaged type in the case we have a MarshalAs attribute.
15851
15852         (Resolve): Handle the case when we are parsing the special MarshalAs
15853         attribute [we need to store the unmanaged type to use later]
15854
15855         * typemanager.cs (marshal_as_attr_type): Built in type for the 
15856         MarshalAs Attribute.
15857
15858         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
15859         on parameters and accordingly set the marshalling info.
15860
15861 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
15862
15863         * class.cs: Optimizing slightly by removing redundant code after
15864         we switched to the `NoTypes' return value.
15865         (Property.DefineMethod): use NoTypes here too.
15866
15867         This fixes the bug I introduced in my last batch of changes.
15868
15869 2002-03-05  Ravi Pratap  <ravi@ximian.com>
15870
15871         * tree.cs (RecordEnum): Add. We now keep track of enums too.
15872
15873         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
15874         Enums since those are types too. 
15875
15876         * cs-parser.jay (enum_declaration): Record enums as we parse them.
15877
15878         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
15879         thanks to a call during the lookup process.
15880
15881 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
15882
15883         * statement.cs (Foreach): Lots of work to accomodate a particular
15884         kind of foreach statement that I had not kept in mind.  It is
15885         possible to have foreachs on classes that provide a GetEnumerator
15886         method that return objects that implement the "pattern" for using
15887         a foreach, there is no need to support GetEnumerator
15888         specifically. 
15889
15890         This is needed to compile nant.
15891
15892         * decl.cs: Only report 114 if the member is not `Finalize' and if
15893         the warning level is at least 2.
15894
15895         * class.cs: Moved the compare function from Method to
15896         MethodSignature. 
15897
15898         (MethodSignature.InheritableMemberSignatureCompare): Add new
15899         filter function that is used to extract inheritable methods from a
15900         class. 
15901
15902         (Method.Define): Use the new `inheritable_method_signature_filter'
15903         delegate
15904
15905         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15906         command. 
15907
15908 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15909
15910         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15911
15912         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15913
15914         * expression.cs: Pass location information to
15915         ConvertImplicitStandard. 
15916
15917         * class.cs: Added debugging code to track return values from
15918         interfaces. 
15919
15920 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15921
15922         * expression.cs (Is.DoResolve): If either side of the `is' is an
15923         interface, do not flag the warning.
15924
15925         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15926         for interfaces
15927
15928         * report.cs: Allow for --fatal to be used with --probe.
15929
15930         * typemanager.cs (NoTypes): Move the definition for the empty Type
15931         array here. 
15932
15933         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15934         properties. 
15935         (TypeContainer.DefineProxy): New function used to proxy to parent
15936         implementations when implementing interfaces.
15937         (TypeContainer.ParentImplements): used to lookup if our parent
15938         implements a public function that is required by an interface.
15939         (TypeContainer.VerifyPendingMethods): Hook this up.
15940
15941         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15942         `modules' and `assemblies' arraylists into arrays.  We only grow
15943         these are the very early start up of the program, so this improves
15944         the speedof LookupType (nicely measured).
15945
15946         * expression.cs (MakeByteBlob): Replaced unsafe code with
15947         BitConverter, as suggested by Paolo.
15948
15949         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15950         folding of string concatenation, but if either side is a string,
15951         and the other is not, then return null, and let the runtime use
15952         the concatenation on the string plus the object (using
15953         `Object.ToString'). 
15954
15955 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15956
15957         Constant Folding has been implemented now.
15958
15959         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15960         the error instead on types that are not supported in one's
15961         complement. 
15962
15963         * constant.cs (Constant and all children): New set of functions to
15964         perform implict and explicit conversions.
15965
15966         * ecore.cs (EnumConstant): Implement the new functions to perform
15967         conversion by proxying to the child expression.
15968
15969         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15970         own separate setting that can not be turned off from the command
15971         line using --unchecked or --checked and is only controlled using
15972         the checked/unchecked statements and expressions.  This setting is
15973         used by the constant folder to flag errors.
15974
15975         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15976         ConstantCheckState as well.   
15977
15978         During Resolve, they also have to flag the state, because the
15979         constant folder runs completely in the Resolve phase.
15980
15981         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15982         well.
15983
15984 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15985
15986         * cfold.cs: New file, this file contains the constant folder.
15987
15988         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15989         argument to track whether we are using the resulting address to
15990         load or store a value and provide better error messages. 
15991
15992         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15993         new AddressOf arguments.
15994
15995         * statement.cs (Foreach.EmitCollectionForeach): Update
15996
15997         * expression.cs (Argument.Emit): Call AddressOf with proper
15998         arguments to track usage.
15999
16000         (New.DoEmit): Call AddressOf with new arguments.
16001
16002         (Unary.Emit): Adjust AddressOf call.
16003
16004 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16005
16006         * cs-parser.jay (member_access): Change the case for pre-defined types
16007         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16008         this suggestion.
16009
16010         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16011         a method body.
16012
16013         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16014         essentially like methods and apply attributes like MethodImplOptions to them too.
16015
16016         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16017         not being null.
16018
16019         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16020         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16021         is the DeclSpace.
16022
16023         * Update code everywhere accordingly.
16024
16025         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16026
16027         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16028
16029 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16030
16031         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16032         try performing lookups against those instead of jumping straight into using
16033         the 'using' clauses.
16034
16035         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16036
16037         (LookupType): Perform lookups in implicit parents too.
16038
16039         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16040         sequence as RootContext.LookupType. 
16041
16042         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16043         the various cases of namespace lookups into this method.
16044
16045 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16046
16047         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16048         in positional arguments)
16049
16050         * class.cs (Operator): Update the AllowedModifiers to contain
16051         extern. 
16052
16053         * cs-parser.jay: Update operator declaration to allow for the
16054         operator body to be empty.
16055
16056         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16057         values. 
16058
16059 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16060
16061         * class.cs (Method.Emit): Label parameters.
16062
16063         * driver.cs: Return 1 or 0 as the program exit code.
16064
16065 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * expression.cs: Special case the `null' object when trying to
16068         auto-compute the type, as anything can be explicitly converted to
16069         that. 
16070
16071         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16072         spotting this Paolo.
16073
16074         (Expression.ImplicitNumericConversion): Perform comparissions of
16075         the type using the underlying type in the case of an enumeration
16076         rather than using the enumeration type for the compare.
16077
16078         Cope with the underlying == type case, which is not possible to
16079         catch before. 
16080
16081         (Expression.ConvertNumericExplicit): Perform comparissions of
16082         the type using the underlying type in the case of an enumeration
16083         rather than using the enumeration type for the compare.
16084
16085         * driver.cs: If the user does not supply an extension, assume .exe
16086
16087         * cs-parser.jay (if_statement): Rewrote so that we can track the
16088         location for the if statement.
16089
16090         * expression.cs (Binary.ConstantFold): Only concat strings when
16091         the operation is "+", not everything ;-)
16092
16093         * statement.cs (Statement.EmitBoolExpression): Take a location
16094         argument. 
16095         (If, While, Do): Track location.
16096
16097         * expression.cs (Binary.ResolveOperator): In the object + string
16098         case, I was missing a call to ConvertImplicit
16099
16100 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16101
16102         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16103         Location arguments. Ensure we use RootContext.LookupType to do our work
16104         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16105
16106         * interface.cs (PopulateMethod): Handle the type of the parameter being
16107         null gracefully.
16108
16109         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16110         have a params method with no fixed arguments and a call is made with no
16111         arguments.
16112
16113 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16114
16115         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16116         the verbatim-string-literal
16117
16118         * support.cs (InternalParameters.ParameterModifier): handle null
16119         fixed parameters.
16120         (InternalParameters.ParameterType): ditto.
16121
16122         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16123         duplicating the name of the variable parameter.
16124         (GetParameterByName): Fix bug where we were not looking up array
16125         paramters if they were the only present (thanks Paolo!).
16126         (GetParameterInfo): We only have an empty set of types if both
16127         fixed and array are set to null.
16128         (GetParameterInfo-idx): Handle FixedParameter == null
16129
16130         * cs-parser.jay: Handle the case where there is no catch
16131         statements (missing null test).
16132
16133 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16134
16135         * driver.cs (MainDriver): Be conservative on our command line
16136         handling.
16137
16138         Catch DirectoryNotFoundException when calling GetFiles.
16139
16140         (SplitPathAndPattern): Used to split the input specification into
16141         a path and a pattern that we can feed to Directory.GetFiles.
16142
16143 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16144
16145         * statement.cs (Fixed): Implement the last case of the Fixed
16146         statement (string handling).
16147
16148         * expression.cs (StringPtr): New class used to return a char * to
16149         a string;  Used by the Fixed statement.
16150
16151         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16152
16153         * expression.cs (Binary.ResolveOperator): Remove redundant
16154         MemberLookup pn parent type.
16155         Optimize union call, we do not need a union if the types are the same.
16156         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16157         type.
16158
16159         Specialize the use of MemberLookup everywhere, instead of using
16160         the default settings. 
16161
16162         (StackAlloc): Implement stackalloc keyword.
16163
16164         * cs-parser.jay: Add rule to parse stackalloc.
16165
16166         * driver.cs: Handle /h, /help, /?
16167
16168         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16169         before we supported unsafe code.
16170
16171         * makefile: add --unsafe to the self compilation of mcs.
16172
16173 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16174
16175         * expression.cs (PointerArithmetic): New class that is used to
16176         perform pointer arithmetic.
16177         (Binary.Resolve): Handle pointer arithmetic
16178         Handle pointer comparission.
16179         (ArrayPtr): Utility expression class that is used to take the
16180         address of an array.
16181
16182         (ElementAccess): Implement array access for pointers
16183
16184         * statement.cs (Fixed): Implement fixed statement for arrays, we
16185         are missing one more case before we are done.
16186
16187         * expression.cs (Indirection): Implement EmitAssign and set the
16188         ExprClass to Variable.  This allows pointer dereferences to be
16189         treated as variables, and to have values assigned to them.
16190
16191         * ecore.cs (Expression.StoreFromPtr): New utility function to
16192         store values dereferencing.
16193
16194 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16195
16196         * expression.cs (Binary.ResolveOperator): Ensure that we are
16197         not trying to operate on a void type - this fixes the reported
16198         bug.
16199
16200         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16201         the parent implementation is sealed.
16202
16203         * ../errors/cs0239.cs : Add.
16204
16205         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16206
16207         * typemanager.cs (unverifiable_code_type): Corresponds to 
16208         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16209         which have unsafe code in them.
16210
16211         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16212         unsafe context.
16213
16214 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16215
16216         * cs-tokenizer.cs: Add support for @"litreal strings"
16217
16218         Make tokenizer accept pre-processor directives
16219         on any column (remove the old C-like limitation). 
16220
16221         * rootcontext.cs (EmitCode): Emit any global attributes.
16222         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16223
16224         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16225
16226         * cs-parser.jay: Add support for global attributes.  
16227
16228 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * expression.cs (Indirection): New helper class.  Unary will
16231         create Indirection classes to be able to implement the
16232         IMemoryLocation interface on it.
16233
16234 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16235
16236         * cs-parser.jay (fixed_statement): reference the right statement.
16237
16238         * statement.cs (Fixed.Emit): Finish implementing the fixed
16239         statement for the &x case.
16240
16241 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16242
16243         * class.cs (Property.Define, Method.Define): Remove newslot when
16244         `implementing'.  
16245
16246         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16247         wrong.  NewSlot should only be used if the `new' keyword is present.
16248
16249         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16250         locating our system dir.  Sorry about this.
16251
16252 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16253
16254         * driver.cs (GetSystemDir): Compute correctly the location of our
16255         system assemblies.  I was using the compiler directory instead of
16256         the library directory.
16257
16258 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16259
16260         * expression.cs (BetterFunction): Put back in what Miguel commented out
16261         since it is the correct fix. The problem is elsewhere ;-)
16262
16263         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16264         parameters of the parms method are themselves compatible or not !
16265
16266         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16267         to check that a class implements an interface before saying that an implicit
16268         conversion was allowed. Use ImplementsInterface to do the checking.
16269
16270 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16271
16272         * class.cs (Method.Define): Track whether we are an explicit
16273         implementation or not.  And only call DefineMethodOverride if we
16274         are an explicit implementation.
16275
16276         (Property.DefineMethod): Ditto.
16277
16278 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16279
16280         * expression.cs (BetterFunction): Catch hideous bug which was
16281          preventing us from detecting ambiguous calls due to implicit casts i.e
16282         cs0121.
16283
16284 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16285
16286         * support.cs (Pair): Remove un-needed method.  I figured why I was
16287         getting the error in cs-parser.jay, the variable in a foreach loop
16288         is readonly, and the compiler does not really treat this as a variable.
16289
16290         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16291         instead of EQUALS in grammar.  
16292
16293         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16294
16295         * expression.cs (Unary.DoResolve): Check whether the argument is
16296         managed or not.
16297
16298 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16299
16300         * support.cs: Api for Pair to set a value.  Despite the fact that
16301         the variables are public the MS C# compiler refuses to compile
16302         code that accesses the field if the variable is part of a foreach
16303         statement. 
16304
16305         * statement.cs (Fixed): Begin implementation of the fixed
16306         statement.
16307
16308         (Block.AddVariable): Return the VariableInfo on success and null
16309         on failure instead of true/false. 
16310
16311         * cs-parser.jay (foreach): Catch errors on variables already
16312         defined (we were ignoring this value before) and properly unwind
16313         the block hierarchy
16314
16315         (fixed_statement): grammar for the fixed statement.
16316
16317 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16318
16319         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16320         pointer types to be incretemented.
16321
16322         (SizeOf): Implement.
16323
16324         * cs-parser.jay (pointer_member_access): Implement
16325         expr->IDENTIFIER production.
16326
16327         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16328         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16329         on safe contexts.
16330
16331         (Unary): Implement indirection.
16332
16333         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16334         use in non-unsafe context).
16335
16336         (SimpleName.DoResolve): Check for pointers in field access on safe
16337         contexts. 
16338
16339         (Expression.LoadFromPtr): Factor the load-indirect code in this
16340         function.  This was duplicated in UnboxCast and ParameterReference
16341
16342 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16343
16344         * expression.cs (ComposedCast): report an error if a pointer cast
16345         is used in a safe region.
16346
16347         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16348         pointer type casts in unsafe context.
16349
16350         * codegen.cs (EmitContext): Set up IsUnsafe.
16351
16352         * cs-parser.jay (non_expression_type): Add productions for pointer
16353         casts. 
16354
16355         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16356         code.  We should not use force into static mode if the method is
16357         not virtual.  Fixes bug in MIS
16358
16359         * statement.cs (Do.Emit, While.Emit, For.Emit,
16360         Statement.EmitBoolExpression): Add support to Do and While to
16361         propagate infinite loop as `I do return' semantics.
16362
16363         Improve the For case to also test for boolean constants.
16364
16365         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16366         to the list of attributes we can add.
16367
16368         Remove `EmitContext' argument.
16369
16370         * class.cs (Method.Define): Apply parameter attributes.
16371         (Constructor.Define): Apply parameter attributes.
16372         (MethodCore.LabelParameters): Move here the core of labeling
16373         parameters. 
16374
16375         * support.cs (ReflectionParameters.ParameterModifier,
16376         InternalParameters.ParameterModifier): Use IsByRef on the type and
16377         only return the OUT bit for these parameters instead of in/out/ref
16378         flags.
16379
16380         This is because I miss-understood things.  The ParameterInfo.IsIn
16381         and IsOut represent whether the parameter has the [In] and [Out]
16382         attributes set.  
16383
16384 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16385
16386         * ecore.cs (FieldExpr.Emit): Release temporaries.
16387
16388         * assign.cs (LocalTemporary.Release): new function.
16389
16390         * codegen.cs (EmitContext.GetTemporaryStorage,
16391         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16392         temporary storage.  Now we can "put back" localbuilders when we
16393         are done with them
16394
16395 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16396
16397         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16398         need to make a copy of the variable to generate verifiable code.
16399
16400 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16401
16402         * driver.cs: Compute dynamically the system directory.
16403
16404         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16405         Slower, but more generally useful.  Used by the abstract
16406         registering implementation. 
16407
16408         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16409         the rules for the special rule on Type/instances.  First check if
16410         we have the same name, and if so, try that special static path
16411         rather than the instance path.
16412
16413 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16414
16415         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16416         for, while and if.
16417
16418         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16419         Enum, ValueType, Delegate or Array for non-corlib compiles.
16420
16421         * cs-tokenizer.cs: Catch long identifiers (645)
16422
16423         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16424         piece of code.
16425
16426         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16427         fix, we were returning too early, so we were not registering
16428         pending methods from abstract classes.
16429
16430         Do not register pending methods if the class is abstract.
16431
16432         * expression.cs (Conditional.DoResolve): Report circular implicit
16433         conversions when we neecd to compute it for conditional
16434         expressions. 
16435
16436         (Is.DoResolve): If the expression is always of the provided type,
16437         flag warning 183.  If the expression can not ever be of the
16438         provided type flag warning 184.
16439
16440         * class.cs: Catch 169 as well.
16441
16442         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16443         read. 
16444
16445 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16446
16447         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16448
16449 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16450
16451         * interface.cs: (PopulateMethod): Check for pointers being defined
16452         only if the unsafe context is active.
16453         (PopulateProperty): ditto.
16454         (PopulateIndexer): ditto.
16455
16456         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16457         specified.  If pointers are present, make sure that they are
16458         present in an unsafe context.
16459         (Constructor, Constructor.Define): ditto.
16460         (Field, Field.Define): ditto.
16461         (Property, Property.Define): ditto.
16462         (Event, Event.Define): ditto.
16463
16464         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16465         hashtable if there are classes or structs defined.
16466
16467         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16468         code, as the constant resolution moved.
16469
16470         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16471         the metadata, so we can flag error 133. 
16472
16473         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16474         pointer is being declared in an unsafe context.
16475
16476 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16477
16478         * modifiers.cs (Modifiers.Check): Require a Location argument.
16479         Report error 227 for Unsafe use.
16480
16481         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16482
16483         * statement.cs (For.Emit): If the test is null, then report that
16484         we do `return', as we wont reach anything afterwards.
16485
16486         (Switch.SwitchGoverningType): Track the expression that matched
16487         the conversion.
16488
16489         * driver.cs: Allow negative numbers as an error code to flag.
16490
16491         * cs-parser.jay: Handle 1551.
16492
16493         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16494
16495 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16496
16497         * cs-parser.jay: Report 1518 (type declaration can only contain
16498         class, struct, interface, enum or delegate)
16499
16500         (switch_label): Report 1523 (keywords `case' or `default' must
16501         preced code)
16502
16503         (opt_switch_sections): Report 1522 (empty switch)
16504
16505         * driver.cs: Report 1515 (response file specified multiple times)
16506         Report 1516 (Source file specified multiple times).
16507
16508         * expression.cs (Argument.Resolve): Signal 1510
16509
16510         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16511         access not allowed in static code)
16512
16513 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16514
16515         * typemanager.cs (IsPointerType): Utility method which we are going
16516         to need a lot.
16517
16518         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16519         the object type, so we take care of that.
16520
16521         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16522
16523         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16524         added to non-params parameters :-)
16525
16526         * typemanager.cs (CSharpName): Include 'void' type too. 
16527
16528         (void_ptr_type): Include in the set of core types.
16529
16530         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16531         duplicating code.
16532
16533         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16534         an unsafe context.
16535
16536         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16537         completely forgotten about it.
16538
16539 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16540
16541         * cs-parser.jay (pointer_type): Add. This begins our implementation
16542         of parsing rules for unsafe code.
16543
16544         (unsafe_statement): Implement.
16545
16546         (embedded_statement): Modify to include the above.
16547
16548         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16549
16550         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16551         if the current context is an unsafe one.
16552
16553         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16554         are handled differently, we need separate rules for them.
16555
16556         (local_variable_declaration): Update to use local_variable_pointer_type
16557         to allow variable declarations of unmanaged pointer types.
16558
16559         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16560         in unsafe contexts.
16561
16562         * ../errors/cs0214.cs : Add.
16563
16564 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16565
16566         * makefile: remove 'response' file when cleaning.
16567
16568 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16569
16570         * cs-parser.jay: Report 1524.
16571
16572 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16573
16574         * typemanager.cs (RegisterMethod): drop checking if we have
16575         registered this from here
16576
16577 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16578
16579         * class.cs (Method.EmitDestructor): Implement calling our base
16580         destructor. 
16581
16582         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16583         value of InFinally.
16584
16585         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16586         this routine and will wrap the call in a try/catch block.  Deal
16587         with the case.
16588
16589 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16590
16591         * ecore.cs (Expression.MemberLookup): instead of taking a
16592         parameter `same_type' that was used to tell whether we could
16593         access private members we compute our containing type from the
16594         EmitContext.
16595
16596         (FieldExpr): Added partial support for volatile fields.  This does
16597         not work for volatile fields exposed from assemblies, as I can not
16598         figure out how to extract the modreq from it.
16599
16600         Updated all the source files to use this.
16601
16602         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16603         because it is referenced by MemberLookup very often. 
16604
16605 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16606
16607         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16608         TypeBuilder.GetCustomAttributes to retrieve what we need.
16609
16610         Get rid of redundant default_member_attr_type as this is the same as
16611         default_member_type which already exists.
16612
16613         * interface.cs, attribute.cs : Update accordingly.
16614
16615 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16616
16617         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16618         work for TYpeBuilders though.  Ravi, can you please fix this?
16619
16620         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16621
16622         * expression.cs (Argument.Emit): Handle the case of ref objects
16623         being passed to ref functions;  
16624
16625         (ParameterReference.EmitLoad): Loads the content of the pointer
16626         without dereferencing.
16627
16628 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16629
16630         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16631
16632 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16633
16634         * class.cs (Indexer.DefineMethod): Incorporate the interface
16635         type in the name of the method if we are doing explicit interface
16636         implementation.
16637
16638         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16639
16640         (BetterConversion): Fix extremely trivial bug where we were referring to
16641         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16642         again !
16643
16644         * ../errors/bug16.cs : Add although we have fixed it.
16645
16646 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16647
16648         * expression.cs (BaseIndexer): Begin implementation.
16649
16650         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16651
16652         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16653         production directly to remove a shift/reduce, and implement
16654         explicit interface implementation.
16655
16656         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16657         after a floating point suffix.
16658
16659         * expression.cs (DoNumericPromotions): Improved the conversion for
16660         uint/uint.  If we have a constant, we avoid doing a typecast to a
16661         larger type.
16662
16663         * class.cs (Indexer): Implement explicit interface implementation
16664         for indexers.
16665
16666 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16667
16668         * class.cs: make the default instance constructor public and hidebysig.
16669
16670 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16671
16672         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16673         so we can call it from elsewhere.
16674
16675         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16676         we emit it internally if the class has a defined indexer; otherwise the user
16677         emits it by decorating the class definition with the DefaultMemberAttribute.
16678
16679         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16680         attribute is not used on a type which defines an indexer.
16681
16682         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16683         character when we skip whitespace.
16684
16685         * ../errors/cs0646.cs : Add.
16686
16687 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16688
16689         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16690         again. 
16691
16692         * makefile: Add practical target `mcs3.exe' which builds the third
16693         generation compiler. 
16694
16695         * expression.cs (New): Fix structures constructor calling.
16696
16697         * class.cs (Property, Method, Indexer): Emit Final flag on the
16698         method if we are an interface implementation and we are not
16699         abstract. 
16700
16701         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16702         whether this property is referencing a `base' method.
16703
16704         * expression.cs (Invocation.EmitCall): take an extra argument:
16705         is_base, this is used to determine whether the `call' or
16706         `callvirt' opcode should be used.
16707
16708
16709         * delegate.cs: update EmitCall.
16710
16711         * class.cs (Method.Define): Set NewSlot for the cases where we are
16712         not implementing an interface method.
16713
16714         (Property.Define): ditto.
16715
16716 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16717
16718         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16719         'r'.  Allows mcs to parse itself fully.
16720
16721 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16722
16723         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16724         of the number of initializers that require the InitializeArray method.
16725
16726         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16727         update the above field where necessary.
16728
16729         (MakeByteBlob): Update accordingly.
16730
16731         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16732         greater than 2.
16733
16734         (EmitDynamicInitializers): Update in accordance with the new optimization.
16735
16736         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16737         same OpCode applies.
16738
16739         * cs-parser.jay : Fix some glaring errors I introduced.
16740
16741 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16742
16743         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16744         so that we can check for name clashes there too.
16745
16746         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16747         for interface indexers.
16748
16749         * interfaces.cs (Define): Emit the default member attribute.
16750
16751         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16752         variable was being referred to while setting the value ;-)
16753
16754 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16755
16756         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16757         byte-by-byte information when we know the data is zero.
16758
16759         Make the block always a multiple of 4, because
16760         DefineInitializedData has a bug.
16761
16762         * assign.cs: Fix, we should assign from the temporary, not from
16763         the source. 
16764
16765         * expression.cs (MakeByteBlob): Fix my incorrect code.
16766
16767 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * typemanager.cs (EnumToUnderlying): This function is used to get
16770         the underlying type from an enumeration, because it does not
16771         always work. 
16772
16773         * constant.cs: Use the I4_S form for values between -128 and 127.
16774
16775         * statement.cs (Block.LookupLabel): Looks up a label.
16776         (Block): Drop support for labeled blocks.
16777
16778         (LabeledStatement): New kind of statement that represents a label
16779         only.
16780
16781         (Goto): Finally implement this bad boy.
16782
16783         * cs-parser.jay: Update to reflect new mechanism to implement
16784         labels.
16785
16786 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * codegen.cs (EmitContext.This): a codegen property that keeps the
16789         a single instance of this instead of creating many different this
16790         instances. 
16791
16792         * delegate.cs (Delegate.DoResolve): Update to use the property;
16793
16794         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
16795
16796         * expression.cs (BaseAccess.DoResolve): Ditto.
16797
16798 2001-12-29  Ravi Pratap  <ravi@ximian.com>
16799
16800         * typemanager.cs (methodimpl_attr_type): Add to hold the type
16801         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
16802
16803         (InitCoreTypes): Update accordingly.
16804
16805         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
16806         so we can quickly store the state.
16807
16808         (ApplyAttributes): Set the correct implementation flags
16809         for InternalCall methods.
16810
16811 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
16812
16813         * expression.cs (EmitCall): if a method is not virtual, then do
16814         not use callvirt on it.
16815
16816         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
16817         user defined stuff) requires the use of stobj, which takes an
16818         address on the stack instead of an array and an index.  So emit
16819         the Ldelema operation for it.
16820
16821         (EmitStoreOpcode): Use stobj for valuetypes.
16822
16823         (UnaryMutator.EmitCode): Use the right 1 value depending on
16824         whether we are dealing with int64/uint64, float or doubles.
16825
16826         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
16827         constructors that I implemented last night.
16828
16829         (Constructor.IsDefault): Fix to work properly for static
16830         constructors.
16831
16832         * cs-parser.jay (CheckDef): report method signature errors.
16833         Update error number 103 to be 132.
16834
16835         * decl.cs: New AdditionResult enumeration value: MethodExists.
16836         Although we do this check for methods later on in the semantic
16837         analysis, catching repeated default constructors is so easy that
16838         we catch these here. 
16839
16840         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
16841         promotions code.
16842
16843         (ParameterReference.EmitAssign, Emit): handle
16844         bools as bytes.
16845
16846         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
16847         (ArrayAccess.EmitStoreOpcode): ditto.
16848
16849         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
16850
16851         * expression.cs (MakeByteBlob): Complete all the missing types
16852         (uint, short, ushort, byte, sbyte)
16853
16854         * class.cs: Only init instance field initializers on instance
16855         constructors. 
16856
16857         Rename `constructors' to instance_constructors. 
16858
16859         (TypeContainer.AddConstructor): Only add constructors to the list
16860         if it is not static.
16861
16862         Make sure that we handle default_static_constructor independently
16863         everywhere where we handle instance_constructors
16864
16865 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
16866
16867         * class.cs: Do not lookup or create a base initializer for a
16868         static constructor.
16869
16870         (ConstructorInitializer.Resolve): use the proper type to lookup
16871         for constructors.
16872
16873         * cs-parser.jay: Report error 1585 (modifiers between type and name).
16874
16875         * enum.cs, interface.cs: Remove CloseType, this is taken care by
16876         in DeclSpace. 
16877
16878         * decl.cs: CloseType is now an virtual method, the default
16879         implementation just closes this type.
16880
16881 2001-12-28  Ravi Pratap  <ravi@ximian.com>
16882
16883         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
16884         to PreserveSig by default. Also emit HideBySig on such methods.
16885
16886         Basically, set the defaults to standard values.
16887
16888         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
16889         argument, if candidate is better, it can't be worse than the best !
16890
16891         (Invocation): Re-write bits to differentiate between methods being
16892         applicable in their expanded form and their normal form - for params
16893         methods of course.
16894
16895         Get rid of use_standard everywhere as only standard conversions are allowed
16896         in overload resolution. 
16897
16898         More spec conformance.
16899
16900 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * driver.cs: Add --timestamp, to see where the compiler spends
16903         most of its time.
16904
16905         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16906         `this' in static code.
16907
16908         (SimpleName.DoResolve): Implement in terms of a helper function
16909         that allows static-references to be passed upstream to
16910         MemberAccess.
16911
16912         (Expression.ResolveWithSimpleName): Resolve specially simple
16913         names when called by MemberAccess to implement the special
16914         semantics. 
16915
16916         (Expression.ImplicitReferenceConversion): Handle conversions from
16917         Null to reference types before others, as Null's type is
16918         System.Object. 
16919
16920         * expression.cs (Invocation.EmitCall): Handle the special case of
16921         calling methods declared on a reference type from a ValueType
16922         (Base classes System.Object and System.Enum)
16923
16924         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16925         the left hand side is a TypeExpr, not on every enumeration. 
16926
16927         (Binary.Resolve): If types are reference types, then do a cast to
16928         object on operators != and == of both arguments.
16929
16930         * typemanager.cs (FindMembers): Extract instance and static
16931         members if requested.
16932
16933         * interface.cs (PopulateProperty): Use void_type instead of null
16934         as the return type for the setter method.
16935
16936         (PopulateIndexer): ditto.
16937
16938 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16939
16940         * support.cs (ReflectionParameters): Fix minor bug where we
16941         were examining the wrong parameter for the ParamArray attribute.
16942
16943         Cope with requests for the type of the parameter at position
16944         greater than the params parameter's. We now return the element
16945         type of the params array as that makes more sense.
16946
16947         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16948         accordingly as we no longer have to extract the element type
16949         ourselves.
16950
16951         (Invocation.OverloadResolve): Update.
16952
16953 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16954
16955         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16956         against IEnumerator, test whether the return value is a descendant
16957         of the IEnumerator interface.
16958
16959         * class.cs (Indexer.Define): Use an auxiliary method to implement
16960         the other bits of the method definition.  Begin support for
16961         explicit interface implementation.
16962
16963         (Property.DefineMethod): Use TypeManager.void_type instead of null
16964         for an empty return value.
16965
16966 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16967
16968         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16969         dealing with a FieldExpr which is composed of a FieldBuilder, in
16970         the code path we did extract the constant, but we should have
16971         obtained the underlying value to be able to cast it (otherwise we
16972         end up in an infinite loop, this is what Ravi was running into).
16973
16974         (ArrayCreation.UpdateIndices): Arrays might be empty.
16975
16976         (MemberAccess.ResolveMemberAccess): Add support for section
16977         14.5.4.1 that deals with the special case of E.I when E is a type
16978         and something else, that I can be a reference to a static member.
16979
16980         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16981         handle a particular array type to create byte blobs, it is just
16982         something we dont generate byteblobs for.
16983
16984         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16985         arguments. 
16986
16987         * location.cs (Push): remove the key from the hashtable that we
16988         are about to add.   This happens for empty files.
16989
16990         * driver.cs: Dispose files after we have parsed them.
16991
16992         (tokenize): new function that only runs the tokenizer on its
16993         input, for speed testing.
16994
16995 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16996
16997         * class.cs (Event.Define): Define the private field only if there
16998         are no accessors defined.
16999
17000         * expression.cs (ResolveMemberAccess): If there is no associated
17001         field with the event, that means we have an event defined with its
17002         own accessors and we should flag error cs0070 since transforming
17003         ourselves into a field is not valid in that case.
17004
17005         * ecore.cs (SimpleName.DoResolve): Same as above.
17006
17007         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17008         and charset to sane values.
17009
17010 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17011
17012         * assign.cs (DoResolve): Perform check on events only if they 
17013         are being accessed outside the declaring type.
17014
17015         * cs-parser.jay (event_declarations): Update rules to correctly
17016         set the type of the implicit parameter etc.
17017
17018         (add_accessor, remove_accessor): Set current local parameters.
17019
17020         * expression.cs (Binary): For delegate addition and subtraction,
17021         cast the return value from the method into the appropriate delegate
17022         type.
17023
17024 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17025
17026         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17027         of these as the workaround is unnecessary.
17028
17029         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17030         delegate data - none of that is needed at all.
17031
17032         Re-write bits to extract the instance expression and the delegate method
17033         correctly.
17034
17035         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17036         on delegates too.
17037
17038         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17039         of attaching attributes instead of duplicating code everywhere.
17040
17041         * everywhere : Update code to do attribute emission using the above method.
17042
17043 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17044
17045         * expression.cs (IsParamsMethodApplicable): if there are not
17046         parameters, return immediately.
17047
17048         * ecore.cs: The 0 literal can be implicity converted to an enum
17049         type. 
17050
17051         (SimpleName.DoResolve): First lookup the type, then lookup the
17052         members. 
17053
17054         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17055         want to get its address.  If the InstanceExpression is not
17056         addressable, store the result in a temporary variable, then get
17057         the address of it.
17058
17059         * codegen.cs: Only display 219 errors on warning level or above. 
17060
17061         * expression.cs (ArrayAccess): Make it implement the
17062         IMemoryLocation interface.
17063
17064         (Binary.DoResolve): handle the operator == (object a, object b)
17065         and operator != (object a, object b) without incurring into a
17066         BoxedCast (because 5 != o should never be performed).
17067
17068         Handle binary enumerator operators.
17069
17070         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17071         value type, otherwise use Ldelem_ref.
17072
17073         Use precomputed names;
17074
17075         (AddressOf): Implement address of
17076
17077         * cs-parser.jay (labeled_statement): Fix recursive block
17078         addition by reworking the production.
17079
17080         * expression.cs (New.DoEmit): New has a special case:
17081                 
17082                  If we are dealing with a ValueType, we have a few
17083                  situations to deal with:
17084                 
17085                     * The target of New is a ValueType variable, that is
17086                       easy, we just pass this as the variable reference
17087                 
17088                     * The target of New is being passed as an argument,
17089                       to a boxing operation or a function that takes a
17090                       ValueType.
17091                 
17092                       In this case, we need to create a temporary variable
17093                       that is the argument of New.
17094
17095
17096 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17097
17098         * rootcontext.cs (LookupType): Check that current_type is not null before
17099         going about looking at nested types.
17100
17101         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17102         not implement the IAssignMethod interface any more.
17103
17104         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17105         where we tranform them into FieldExprs if they are being resolved from within
17106         the declaring type.
17107
17108         * ecore.cs (SimpleName.DoResolve): Do the same here.
17109
17110         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17111
17112         * ../errors/bug10.cs : Add.
17113
17114         * ../errors/cs0070.cs : Add.
17115
17116         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17117
17118         * assign.cs : Get rid of EventIsLocal everywhere.
17119
17120 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17121
17122         * ecore.cs (ConvertIntLiteral): finished the implementation.
17123
17124         * statement.cs (SwitchLabel): Convert the value we are using as a
17125         key before looking up the table.
17126
17127 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * codegen.cs (EmitTopBlock): Require a Location argument now.
17130
17131         * cs-parser.jay (constructor_declarator): We need to setup
17132         current_local_parameters before we parse the
17133         opt_constructor_initializer, to allow the variables to be bound
17134         to the constructor arguments.
17135
17136         * rootcontext.cs (LookupType): First lookup nested classes in our
17137         class and our parents before we go looking outside our class.
17138
17139         * expression.cs (ConstantFold): Extract/debox the values at the
17140         beginnning. 
17141
17142         * rootcontext.cs (EmitCode): Resolve the constants first before we
17143         resolve the types.  This is not really needed, but it helps debugging.
17144
17145         * statement.cs: report location.
17146
17147         * cs-parser.jay: pass location to throw statement.
17148
17149         * driver.cs: Small bug fix.
17150
17151         * report.cs: Updated format to be 4-zero filled digits.
17152
17153 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17154
17155         * expression.cs (CheckIndices): Fix minor bug where the wrong
17156         variable was being referred to ;-)
17157
17158         (DoEmit): Do not call EmitStaticInitializers when the 
17159         underlying type is System.Object.
17160
17161 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17162
17163         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17164         and do the usual workaround for SRE.
17165
17166         * class.cs (MyEventBuilder.EventType): New member to get at the type
17167         of the event, quickly.
17168
17169         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17170
17171         * assign.cs (Assign.DoResolve): Handle the case when the target
17172         is an EventExpr and perform the necessary checks.
17173
17174         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17175         interface.
17176
17177         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17178
17179         (EventExpr): Set the type in the constructor itself since we 
17180         are meant to be born fully resolved.
17181
17182         (EventExpr.Define): Revert code I wrote earlier.
17183                 
17184         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17185         instance expression is null. The instance expression is a This in that case
17186         or a null, depending on whether it is a static method or not.
17187
17188         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17189         refers to more than one method.
17190
17191         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17192         and accordingly flag errors.
17193
17194 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17195
17196         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17197
17198 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17199
17200         * location.cs (ToString): Provide useful rutine.
17201
17202 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17203
17204         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17205         objects, return the actual integral boxed.
17206
17207         * statement.cs (SwitchLabel): define an ILLabel for each
17208         SwitchLabel. 
17209
17210         (Switch.CheckSwitch): If the value is a Literal, extract
17211         the underlying literal.
17212
17213         Also in the unused hashtable we had, add the SwitchLabel so we can
17214         quickly look this value up.
17215
17216         * constant.cs: Implement a bunch of new constants.  Rewrite
17217         Literal based on this.  Made changes everywhere to adapt to this.
17218
17219         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17220         dereferencing array only once, and also copes with enumrations.
17221
17222         bytes are two bytes wide, not one.
17223
17224         (Cast): Perform constant conversions.
17225
17226         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17227         wrappers to the literals here.
17228
17229         * expression.cs (DoNumericPromotions): long literals can converted
17230         to ulong implicity (this is taken care of elsewhere, but I was
17231         missing this spot).
17232
17233         * ecore.cs (Expression.Literalize): Make the return type Literal,
17234         to improve type checking.
17235
17236         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17237
17238 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17239
17240         * literal.cs: Revert code from ravi that checked the bounds.  The
17241         bounds are sane by the definition of the type itself. 
17242
17243         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17244         need to actually look up in our parent hierarchy for interfaces
17245         implemented. 
17246
17247         * const.cs: Use the underlying type for enumerations
17248
17249         * delegate.cs: Compute the basename for the delegate creation,
17250         that should fix the delegate test case, and restore the correct
17251         Type Lookup semantics in rootcontext
17252
17253         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17254         referencing a nested type with the Reflection API is using the "+"
17255         sign. 
17256
17257         * cs-parser.jay: Do not require EOF token at the end.
17258
17259 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17260
17261         * rootcontext.cs (LookupType): Concatenate type names with
17262         a '.' instead of a '+' The test suite passes again.
17263
17264         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17265         field of the enumeration.
17266
17267         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17268         the case when the member is an EventExpr.
17269
17270         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17271         static has an associated instance expression.
17272
17273         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17274
17275         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17276
17277         * class.cs (Event.Define): Register event and perform appropriate checks
17278         for error #111.
17279
17280         We define the Add and Remove methods even if the use provides none because
17281         in that case, we provide default implementations ourselves.
17282
17283         Define a private field of the type of the event. This is done by the CSC compiler
17284         and we should be doing it too ;-)
17285
17286         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17287         More methods we use in code we generate.
17288
17289         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17290         is important.
17291
17292         (InitCoreTypes): Update accordingly for the above.
17293
17294         * class.cs (Event.Emit): Generate code for default accessors that we provide
17295
17296         (EmitDefaultMethod): Do the job in the above.
17297
17298         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17299         appropriate place.
17300
17301 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17302
17303         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17304         builders even if we were missing one.
17305
17306         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17307         pass the Basename as our class name instead of the Name.  The
17308         basename will be correctly composed for us.
17309
17310         * parameter.cs (Paramters): Now takes a Location argument.
17311
17312         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17313         make all the code call directly LookupType in RootContext and take
17314         this chance to pass the Location information everywhere.
17315
17316         * Everywhere: pass Location information.
17317
17318 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17319
17320         * class.cs (Constructor.Define): Updated way of detecting the
17321         length of the parameters.
17322
17323         (TypeContainer.DefineType): Use basename as the type name for
17324         nested types.
17325
17326         (TypeContainer.Define): Do not recursively define types here, as
17327         definition is taken care in order by the RootContext.
17328
17329         * tree.cs: Keep track of namespaces in a per-file basis.
17330
17331         * parameter.cs (Parameter.ComputeSignature): Update to use
17332         DeclSpace. 
17333
17334         (Parameters.GetSignature): ditto.
17335
17336         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17337         instead of a TypeContainer.
17338
17339         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17340         resolve names.  Because we need to be resolve in our context, not
17341         our parents.
17342
17343         * driver.cs: Implement response files.
17344
17345         * class.cs (TypeContainer.DefineType): If we are defined, do not
17346         redefine ourselves.
17347
17348         (Event.Emit): Emit the code for add/remove handlers.
17349         (Event.Define): Save the MethodBuilders for add/remove.
17350
17351         * typemanager.cs: Use pair here too.
17352
17353         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17354         DictionaryEntry requires the first argument to be non-null.  
17355
17356         (enum_declaration): Compute full name for registering the
17357         enumeration.
17358
17359         (delegate_declaration): Instead of using
17360         formal_parameter_list, use opt_formal_parameter_list as the list
17361         can be empty.
17362
17363         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17364         (EventParsing): New property that controls whether `add' and
17365         `remove' are returned as tokens or identifiers (for events);
17366
17367 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17368
17369         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17370         use MyEventBuilder only and let it wrap the real builder for us.
17371
17372         (MyEventBuilder): Revamp constructor etc.
17373
17374         Implement all operations that we perform on EventBuilder in precisely the same
17375         way here too.
17376
17377         (FindMembers): Update to use the EventBuilder member.
17378
17379         (Event.Emit): Update accordingly.
17380
17381 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17382
17383         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17384         by calling the appropriate methods.
17385
17386         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17387         useful.
17388
17389         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17390
17391 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17392
17393         * delegate.cs (Delegate.Populate): Check that the return type
17394         and various parameters types are indeed accessible.
17395
17396         * class.cs (Constructor.Define): Same here.
17397
17398         (Field.Define): Ditto.
17399
17400         (Event.Define): Ditto.
17401
17402         (Operator.Define): Check that the underlying Method defined itself
17403         correctly - so it's MethodBuilder should not be null.
17404
17405         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17406         expression happens to be null.
17407
17408         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17409         members but as of now we don't seem to be able to do anything really useful with it.
17410
17411         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17412         not the EventBuilder.
17413
17414 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17415
17416         * cs-tokenizer.cs: Add support for defines.
17417         Add support for #if, #elif, #else, #endif
17418
17419         (eval_var): evaluates a variable.
17420         (eval): stubbed for evaluating functions.
17421
17422         * cs-parser.jay: Pass the defines information
17423
17424         * driver.cs: Add --define command line option.
17425
17426         * decl.cs: Move MemberCore here.
17427
17428         Make it the base class for DeclSpace.  This allows us to catch and
17429         report 108 and 109 for everything now.
17430
17431         * class.cs (TypeContainer.Define): Extract all the members
17432         before populating and emit the warning 108 (new keyword required
17433         to override) instead of having each member implement this.
17434
17435         (MemberCore.Define): New abstract method, we will be using this in
17436         the warning reporting engine in Populate.
17437
17438         (Operator.Define): Adjust to new MemberCore protocol. 
17439
17440         * const.cs (Const): This does not derive from Expression, it is a
17441         temporary object we use to create fields, it is a MemberCore. 
17442
17443         * class.cs (Method.Define): Allow the entry point to be in a
17444         specific class.
17445
17446         * driver.cs: Rewrite the argument handler to clean it up a bit.
17447
17448         * rootcontext.cs: Made it just an auxiliary namespace feature by
17449         making everything static.
17450
17451         * driver.cs: Adapt code to use RootContext type name instead of
17452         instance variable.
17453
17454         * delegate.cs: Remove RootContext argument.
17455
17456         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17457         argument. 
17458
17459         * class.cs (Event.Define): The lookup can fail.
17460
17461         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17462
17463         * expression.cs: Resolve the this instance before invoking the code.
17464
17465 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17466
17467         * cs-parser.jay: Add a production in element_access that allows
17468         the thing to become a "type" reference.  This way we can parse
17469         things like "(string [])" as a type.
17470
17471         Note that this still does not handle the more complex rules of
17472         casts. 
17473
17474
17475         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17476
17477         * ecore.cs: (CopyNewMethods): new utility function used to
17478         assemble the list of methods from running FindMembers.
17479
17480         (MemberLookup): Rework FindMembers so that 
17481
17482 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17483
17484         * class.cs (TypeContainer): Remove Delegates who fail to be
17485         defined.
17486
17487         * delegate.cs (Populate): Verify that we dont get null return
17488         values.   TODO: Check for AsAccessible.
17489
17490         * cs-parser.jay: Use basename to emit error 574 (destructor should
17491         have the same name as container class), not the full name.
17492
17493         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17494         possible representation.  
17495
17496         Also implements integer type suffixes U and L.
17497
17498 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17499
17500         * expression.cs (ArrayCreation.DoResolve): We need to do the
17501         argument resolution *always*.
17502
17503         * decl.cs: Make this hold the namespace.  Hold the root context as
17504         well.
17505         (LookupType): Move here.
17506
17507         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17508
17509         * location.cs (Row, Name): Fixed the code, it was always returning
17510         references to the first file.
17511
17512         * interface.cs: Register properties defined through interfaces.
17513
17514         * driver.cs: Add support for globbing on the command line
17515
17516         * class.cs (Field): Make it derive from MemberCore as well.
17517         (Event): ditto.
17518
17519 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17520
17521         * class.cs (Event::Define): Check that the type of the event is a delegate
17522         type else flag error #66.
17523
17524         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17525         same.
17526
17527         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17528         values of EntryPoint, CharSet etc etc.
17529
17530         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17531
17532         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17533         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17534         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17535         which needs this to do its work.
17536
17537         * ../errors/cs0066.cs : Add.
17538
17539 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17540
17541         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17542         helper functions.
17543
17544         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17545         clears out the parameters field.
17546         (MemberSignatureCompare): Cleanup
17547
17548         (MemberCore): New base class used to share code between MethodCore
17549         and Property.
17550
17551         (RegisterRequiredImplementations) BindingFlags.Public requires
17552         either BindingFlags.Instace or Static.  Use instance here.
17553
17554         (Property): Refactored code to cope better with the full spec.
17555
17556         * parameter.cs (GetParameterInfo): Return an empty array instead
17557         of null on error.
17558
17559         * class.cs (Property): Abstract or extern properties have no bodies.
17560
17561         * parameter.cs (GetParameterInfo): return a zero-sized array.
17562
17563         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17564         method modifier validation to the typecontainer so we can reuse
17565         this on properties.
17566
17567         (MethodCore.ParameterTypes): return an empty sized array of types.
17568
17569         (Property.Define): Test property modifier validity.
17570
17571         Add tests for sealed/override too.
17572
17573         (Method.Emit): abstract or extern methods have no bodies.
17574
17575 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17576
17577         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17578         thing.
17579
17580         (Method::Define, ::Emit): Modify accordingly.
17581
17582         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17583
17584         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17585
17586         * makefile: Pass in /unsafe.
17587
17588 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17589
17590         * class.cs (MakeKey): Kill routine.
17591
17592         * class.cs (TypeContainer.Define): Correctly define explicit
17593         method implementations (they require the full interface name plus
17594         the method name).
17595
17596         * typemanager.cs: Deply the PtrHashtable here and stop using the
17597         lame keys.  Things work so much better.
17598
17599         This of course broke everyone who depended on `RegisterMethod' to
17600         do the `test for existance' test.  This has to be done elsewhere.
17601
17602         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17603         the object stupid Equals method (because, that like fails all over
17604         the place).  We still do not use it.
17605
17606         * class.cs (TypeContainer.SetRequiredInterface,
17607         TypeContainer.RequireMethods): Killed these two routines and moved
17608         all the functionality to RegisterRequiredImplementations.
17609
17610         (TypeContainer.RegisterRequiredImplementations): This routine now
17611         registers all the implementations required in an array for the
17612         interfaces and abstract methods.  We use an array of structures
17613         which can be computed ahead of time to reduce memory usage and we
17614         also assume that lookups are cheap as most classes will not
17615         implement too many interfaces.
17616
17617         We also avoid creating too many MethodSignatures.
17618
17619         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17620         clear the "pending" bit if we find that there are problems with
17621         the declaration.
17622
17623         (TypeContainer.VerifyPendingMethods): Update to report errors of
17624         methods that look like implementations but are not.
17625
17626         (TypeContainer.Define): Add support for explicit interface method
17627         implementation. 
17628
17629 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17630
17631         * typemanager.cs: Keep track of the parameters here instead of
17632         being a feature of the TypeContainer.
17633
17634         * class.cs: Drop the registration of parameters here, as
17635         InterfaceMethods are also interface declarations.
17636
17637         * delegate.cs: Register methods with the TypeManager not only with
17638         the TypeContainer.  This code was buggy.
17639
17640         * interface.cs: Full registation here.
17641
17642 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17643
17644         * expression.cs: Remove reducer for binary expressions, it can not
17645         be done this way.
17646
17647         * const.cs: Put here the code that used to go into constant.cs
17648
17649         * constant.cs: Put here the code for constants, this is a new base
17650         class for Literals.
17651
17652         * literal.cs: Make Literal derive from Constant.
17653
17654 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17655
17656         * statement.cs (Return.Emit): Report error 157 if the user
17657         attempts to return from a finally block.
17658
17659         (Return.Emit): Instead of emitting a return, jump to the end of
17660         the function.
17661
17662         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17663         LocalBuilder to store the result of the function.  ReturnLabel is
17664         the target where we jump.
17665
17666
17667 2001-12-09  Radek Doulik  <rodo@ximian.com>
17668
17669         * cs-parser.jay: remember alias in current namespace
17670
17671         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17672         namespaces
17673
17674         * class.cs (LookupAlias): lookup alias in my_namespace
17675
17676         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17677         aliases hashtable
17678         (LookupAlias): lookup alias in this and if needed in parent
17679         namespaces
17680
17681 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * support.cs: 
17684
17685         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17686         making things static.  I need this to avoid passing the
17687         TypeContainer when calling ParameterType.
17688
17689         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17690         that did string manipulation to compute the type and then call
17691         GetType.  Use Parameter.ParameterType instead.
17692
17693         * cs-tokenizer.cs: Consume the suffix for floating values.
17694
17695         * expression.cs (ParameterReference): figure out whether this is a
17696         reference parameter or not.  Kill an extra variable by computing
17697         the arg_idx during emission.
17698
17699         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17700         function that returns whether a parameter is an out/ref value or not.
17701
17702         (Parameter.ParameterType): The type of the parameter (base,
17703         without ref/out applied).
17704
17705         (Parameter.Resolve): Perform resolution here.
17706         (Parameter.ExternalType): The full type (with ref/out applied).
17707
17708         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17709         support for expressions on the using statement.
17710
17711 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17712
17713         * statement.cs (Using.EmitLocalVariableDecls): Split the
17714         localvariable handling of the using statement.
17715
17716         (Block.EmitMeta): Keep track of variable count across blocks.  We
17717         were reusing slots on separate branches of blocks.
17718
17719         (Try.Emit): Emit the general code block, we were not emitting it. 
17720
17721         Check the type of the declaration to be an IDisposable or
17722         something that can be implicity converted to it. 
17723
17724         Emit conversions if required.
17725
17726         * ecore.cs (EmptyExpression): New utility class.
17727         (Expression.ImplicitConversionExists): New utility function.
17728
17729 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17730
17731         * statement.cs (Using): Implement.
17732
17733         * expression.cs (LocalVariableReference): Support read only variables.
17734
17735         * statement.cs: Remove the explicit emit for the Leave opcode.
17736         (VariableInfo): Add a readonly field.
17737
17738 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17739
17740         * ecore.cs (ConvCast): new class used to encapsulate the various
17741         explicit integer conversions that works in both checked and
17742         unchecked contexts.
17743
17744         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17745         properly generate the overflow opcodes.
17746
17747 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17748
17749         * statement.cs: The correct type for the EmptyExpression is the
17750         element_type, not the variable type.  Ravi pointed this out.
17751
17752 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17753
17754         * class.cs (Method::Define): Handle PInvoke methods specially
17755         by using DefinePInvokeMethod instead of the usual one.
17756
17757         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17758         above to do the task of extracting information and defining the method.
17759
17760 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17761
17762         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17763         of the condition for string type.
17764
17765         (Emit): Move that here. 
17766
17767         (ArrayCreation::CheckIndices): Keep string literals in their expression
17768         form.
17769
17770         (EmitDynamicInitializers): Handle strings appropriately.
17771
17772 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17773
17774         * codegen.cs (EmitContext): Replace multiple variables with a
17775         single pointer to the current Switch statement.
17776
17777         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17778         EmitContext.
17779
17780 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17781
17782         * statement.cs 
17783
17784         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
17785         default'.
17786
17787         (Foreach.Emit): Foreach on arrays was not setting
17788         up the loop variables (for break/continue).
17789
17790         (GotoCase): Semi-implented.
17791
17792 2001-12-03  Ravi Pratap  <ravi@ximian.com>
17793
17794         * attribute.cs (CheckAttribute): Handle system attributes by using
17795         Attribute.GetAttributes to examine information we need.
17796
17797         (GetValidPlaces): Same here.
17798
17799         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
17800
17801         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
17802
17803         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
17804
17805         (Method::Define): Set appropriate flags if we have a DllImport attribute.
17806
17807         (Method::Emit): Handle the case when we are a PInvoke method.
17808
17809 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * expression.cs: Use ResolveWithSimpleName on compound names.
17812
17813 2001-12-02  Ravi Pratap  <ravi@ximian.com>
17814
17815         * constant.cs (EmitConstant): Make sure we resolve the associated expression
17816         before trying to reduce it.
17817
17818         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
17819
17820         * constant.cs (LookupConstantValue): Implement.
17821
17822         (EmitConstant): Use the above in emitting the constant.
17823
17824         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
17825         that are user-defined by doing a LookupConstantValue on them.
17826
17827         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
17828         too, like above.
17829
17830 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
17831
17832         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
17833
17834         (BaseAccess.DoResolve): Implement.
17835
17836         (MemberAccess.DoResolve): Split this routine into a
17837         ResolveMemberAccess routine that can be used independently
17838
17839 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
17840
17841         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
17842         As that share bits of the implementation.  Is returns a boolean,
17843         while As returns the Type that is being probed.
17844
17845 2001-12-01  Ravi Pratap  <ravi@ximian.com>
17846
17847         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
17848         instead of a Literal - much easier.
17849
17850         (EnumInTransit): Remove - utterly useless :-)
17851
17852         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
17853
17854         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
17855
17856         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
17857         chain when we have no associated expression.
17858
17859 2001-11-30  Ravi Pratap  <ravi@ximian.com>
17860
17861         * constant.cs (Define): Use Location while reporting the errror.
17862
17863         Also emit a warning when 'new' is used and there is no inherited
17864         member to hide.
17865
17866         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
17867         populated.
17868
17869         (LookupEnumValue): Implement to lookup an enum member's value and define it
17870         if necessary.
17871
17872         (Populate): Re-write accordingly to use the above routine.
17873
17874 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
17875
17876         * expression.cs (This): Fix prototype for DoResolveLValue to
17877         override the base class DoResolveLValue.
17878
17879         * cs-parser.cs: Report errors cs574 and cs575 (destructor
17880         declarations) 
17881
17882         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
17883         (we need to load the address of the field here).  This fixes
17884         test-22. 
17885
17886         (FieldExpr.DoResolveLValue): Call the DoResolve
17887         function to initialize the Instance expression.
17888
17889         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
17890         correctly the GetEnumerator operation on a value type.
17891
17892         * cs-parser.jay: Add more simple parsing error catches.
17893
17894         * statement.cs (Switch): Add support for string switches.
17895         Handle null specially.
17896
17897         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
17898
17899 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17900
17901         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17902
17903         (declare_local_constant): New helper function.
17904
17905         * statement.cs (AddConstant): Keep a separate record of constants
17906
17907         (IsConstant): Implement to determine if a variable is a constant.
17908
17909         (GetConstantExpression): Implement.
17910
17911         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17912
17913         * statement.cs (IsVariableDefined): Re-write.
17914
17915 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17916
17917         * class.cs (TypeContainer::FindMembers): Look for constants
17918         in the case when we are looking for MemberTypes.Field
17919
17920         * expression.cs (MemberAccess::DoResolve): Check that in the
17921         case we are a FieldExpr and a Literal, we are not being accessed
17922         by an instance reference.
17923
17924         * cs-parser.jay (local_constant_declaration): Implement.
17925
17926         (declaration_statement): Implement for constant declarations.
17927
17928 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17929
17930         * statement.cs (Switch): Catch double defaults.
17931
17932         (Switch): More work on the switch() statement
17933         implementation.  It works for integral values now, need to finish
17934         string support.
17935
17936
17937 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17938
17939         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17940         integer literals into other integer literals.  To be used by
17941         switch. 
17942
17943 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17944
17945         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17946         some memory.
17947
17948         (EmitDynamicInitializers): Cope with the above since we extract data
17949         directly from ArrayData now.
17950
17951         (ExpectInitializers): Keep track of whether initializers are mandatory
17952         or not.
17953
17954         (Bounds): Make it a hashtable to prevent the same dimension being 
17955         recorded for every element in that dimension.
17956
17957         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17958         from being found.
17959
17960         Also fix bug which was causing the indices to be emitted in the reverse
17961         order.
17962
17963 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17966         unfinished.  They do not work, because the underlying code is
17967         sloppy.
17968
17969 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * cs-parser.jay: Remove bogus fixme.
17972
17973         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17974         on Switch statement.
17975
17976 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17977
17978         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17979         the same. 
17980
17981         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17982         parameter. Apparently, any expression is allowed. 
17983
17984         (ValidateInitializers): Update accordingly.
17985
17986         (CheckIndices): Fix some tricky bugs thanks to recursion.
17987
17988         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17989         I was being completely brain-dead.
17990
17991         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17992         and re-write acordingly.
17993
17994         (DelegateInvocation): Re-write accordingly.
17995
17996         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17997
17998         (MakeByteBlob): Handle types more correctly.
17999
18000         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18001         initialization from expressions but it is incomplete because I am a complete
18002         Dodo :-|
18003
18004 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18005
18006         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18007         on If.  Basically, we have to return `true' (ie, we do return to
18008         our caller) only if both branches of the if return.
18009
18010         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18011         short-circuit operators, handle them as short circuit operators. 
18012
18013         (Cast.DoResolve): Resolve type.
18014         (Cast.Cast): Take an expression as the target type.
18015
18016         * cs-parser.jay (cast_expression): Remove old hack that only
18017         allowed a limited set of types to be handled.  Now we take a
18018         unary_expression and we resolve to a type during semantic
18019         analysis.
18020
18021         Use the grammar productions from Rhys to handle casts (this is
18022         not complete like Rhys syntax yet, we fail to handle that corner
18023         case that C# has regarding (-x), but we will get there.
18024
18025 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18026
18027         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18028         field which is an array type.
18029
18030         * cs-parser.jay (declare_local_variables): Support array initialization too.
18031
18032         * typemanager.cs (MakeKey): Implement.
18033
18034         (everywhere): Use the above appropriately.
18035
18036         * cs-parser.jay (for_statement): Update for array initialization while
18037         declaring variables.
18038
18039         * ecore.cs : The error message was correct, it's the variable's names that
18040         were misleading ;-) Make the code more readable.
18041
18042         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18043         the correct type etc.
18044
18045         (ConvertExplicit): Handle Enum types by examining the underlying type.
18046
18047 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18048
18049         * parameter.cs (GetCallingConvention): Always return
18050         CallingConventions.Standard for now.
18051
18052 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18053
18054         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18055         and `r' after calling DoNumericPromotions.
18056
18057         * ecore.cs: Fix error message (the types were in the wrong order).
18058
18059         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18060         BindingFlags.Instance as well 
18061
18062         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18063         implicit int literal conversion in an empty cast so that we
18064         propagate the right type upstream.
18065
18066         (UnboxCast): new class used to unbox value types.
18067         (Expression.ConvertExplicit): Add explicit type conversions done
18068         by unboxing.
18069
18070         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18071         the target type before applying the implicit LongLiterals to ULong
18072         literal cast.
18073
18074 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18075
18076         * cs-parser.jay (for_statement): Reworked the way For works: now
18077         we declare manually any variables that are introduced in
18078         for_initializer to solve the problem of having out-of-band code
18079         emition (that is what got for broken).
18080
18081         (declaration_statement): Perform the actual variable declaration
18082         that used to be done in local_variable_declaration here.
18083
18084         (local_variable_declaration): Do not declare anything, just pass
18085         the information on a DictionaryEntry
18086
18087 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18088
18089         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18090         re-write of the logic to now make it recursive.
18091
18092         (UpdateIndices): Re-write accordingly.
18093
18094         Store element data in a separate ArrayData list in the above methods.
18095
18096         (MakeByteBlob): Implement to dump the array data into a byte array.
18097
18098 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18099
18100         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18101         into CheckIndices.
18102
18103         * constant.cs (Define): Implement.
18104
18105         (EmitConstant): Re-write fully.
18106
18107         Pass in location info.
18108
18109         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18110         respectively.
18111
18112         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18113         DictionaryEntry since we need location info too.
18114
18115         (constant_declaration): Update accordingly.
18116
18117         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18118         code into another method : UpdateIndices.
18119
18120 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18121
18122         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18123         some type checking etc.
18124
18125 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18126
18127         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18128         bits to provide dimension info if the user skips doing that.
18129
18130         Update second constructor to store the rank correctly.
18131
18132 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18133
18134         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18135         and try to implement.
18136
18137         * ../errors/cs0150.cs : Add.
18138
18139         * ../errors/cs0178.cs : Add.
18140
18141 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18142
18143         * statement.cs: Implement foreach on multi-dimensional arrays. 
18144
18145         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18146         name of the params argument.
18147
18148         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18149         initializing the array.
18150
18151         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18152         we can use this elsewhere.
18153
18154         * statement.cs: Finish implementation of foreach for single
18155         dimension arrays.
18156
18157         * cs-parser.jay: Use an out-of-band stack to pass information
18158         around, I wonder why I need this.
18159
18160         foreach_block: Make the new foreach_block the current_block.
18161
18162         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18163         function used to return a static Parameters structure.  Used for
18164         empty parameters, as those are created very frequently.
18165
18166         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18167
18168 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18169
18170         * interface.cs : Default modifier is private, not public. The
18171         make verify test passes again.
18172
18173 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18174
18175         * support.cs (ReflectionParameters): Fix logic to determine
18176         whether the last parameter is a params one. Test 9 passes again.
18177
18178         * delegate.cs (Populate): Register the builders we define with
18179         RegisterParameterForBuilder. Test 19 passes again.
18180
18181         * cs-parser.jay (property_declaration): Reference $6 instead
18182         of $$ to get at the location.
18183
18184         (indexer_declaration): Similar stuff.
18185
18186         (attribute): Ditto.
18187
18188         * class.cs (Property): Register parameters for the Get and Set methods
18189         if they exist. Test 23 passes again.
18190
18191         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18192         call to EmitArguments as we are sure there aren't any params arguments. 
18193         Test 32 passes again.
18194
18195         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18196         IndexOutOfRangeException. 
18197
18198         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18199         Test 33 now passes again.
18200
18201 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18202
18203         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18204         broke a bunch of things.  Will have to come up with a better way
18205         of tracking locations.
18206
18207         * statement.cs: Implemented foreach for single dimension arrays.
18208
18209 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18210
18211         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18212         an error.  This removes the lookup from the critical path.
18213
18214         * cs-parser.jay: Removed use of temporary_loc, which is completely
18215         broken. 
18216
18217 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * support.cs (ReflectionParameters.ParameterModifier): Report
18220         whether the argument is a PARAMS argument or not.
18221
18222         * class.cs: Set the attribute `ParamArrayAttribute' on the
18223         parameter argument.
18224
18225         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18226         and cons_param_array_attribute (ConstructorInfo for
18227         ParamArrayAttribute)., 
18228
18229         * codegen.cs: Emit the return using the `Return' statement, that
18230         way we can report the error correctly for missing return values. 
18231
18232         * class.cs (Method.Emit): Clean up.
18233
18234         * expression.cs (Argument.Resolve): Take another argument: the
18235         location where this argument is used.  Notice that this is not
18236         part of the "Argument" class as to reduce the size of the
18237         structure (we know the approximate location anyways).
18238
18239         Test if the argument is a variable-reference, if not, then
18240         complain with a 206.
18241
18242         (Argument.Emit): Emit addresses of variables.
18243
18244         (Argument.FullDesc): Simplify.
18245
18246         (Invocation.DoResolve): Update for Argument.Resolve.
18247
18248         (ElementAccess.DoResolve): ditto.
18249
18250         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18251         method should be virtual, as this method is always virtual.
18252
18253         (NewDelegate.DoResolve): Update for Argument.Resolve.
18254
18255         * class.cs (ConstructorInitializer.DoResolve): ditto.
18256
18257         * attribute.cs (Attribute.Resolve): ditto.
18258
18259 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18260
18261         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18262
18263         * expression.cs (ParameterReference): Drop IStackStorage and implement
18264         IAssignMethod instead. 
18265
18266         (LocalVariableReference): ditto.
18267
18268         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18269         IAssignMethod instead. 
18270
18271 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18272
18273         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18274         enumerations that are used in heavily used structures derive from
18275         byte in a laughable and pathetic attempt to reduce memory usage.
18276         This is the kind of pre-optimzations that you should not do at
18277         home without adult supervision.
18278
18279         * expression.cs (UnaryMutator): New class, used to handle ++ and
18280         -- separatedly from the other unary operators.  Cleans up the
18281         code, and kills the ExpressionStatement dependency in Unary.
18282
18283         (Unary): Removed `method' and `Arguments' from this class, making
18284         it smaller, and moving it all to SimpleCall, so I can reuse this
18285         code in other locations and avoid creating a lot of transient data
18286         strucutres when not required.
18287
18288         * cs-parser.jay: Adjust for new changes.
18289
18290 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18291
18292         * enum.cs (Enum.Populate): If there is a failure during
18293         definition, return
18294
18295         * cs-parser.jay (opt_enum_base): we used to catch type errors
18296         here, but this is really incorrect.  The type error should be
18297         catched during semantic analysis.
18298
18299 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18300
18301         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18302         current_local_parameters as expected since I, in my stupidity, had forgotten
18303         to do this :-)
18304
18305         * attribute.cs (GetValidPlaces): Fix stupid bug.
18306
18307         * class.cs (Method::Emit): Perform check on applicability of attributes.
18308
18309         (Constructor::Emit): Ditto.
18310
18311         (Field::Emit): Ditto.
18312
18313         (Field.Location): Store location information.
18314
18315         (Property, Event, Indexer, Operator): Ditto.
18316
18317         * cs-parser.jay (field_declaration): Pass in location for each field.
18318
18319         * ../errors/cs0592.cs : Add.
18320
18321 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18322
18323         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18324
18325         (InitCoreTypes): Update accordingly.
18326
18327         (RegisterAttrType, LookupAttr): Implement.
18328
18329         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18330         info about the same.
18331
18332         (Resolve): Update to populate the above as necessary.
18333
18334         (Error592): Helper.
18335
18336         (GetValidPlaces): Helper to the above.
18337
18338         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18339
18340         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18341
18342 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18343
18344         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18345
18346         * ../errors/cs0617.cs : Add.
18347
18348 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18349
18350         * enum.cs (Emit): Rename to Populate to be more consistent with what
18351         we expect it to do and when exactly it is called.
18352
18353         * class.cs, rootcontext.cs : Update accordingly.
18354
18355         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18356         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18357
18358         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18359
18360         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18361         of a fieldinfo using the above, when dealing with a FieldBuilder.
18362
18363 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18364
18365         * ../errors/cs0031.cs : Add.
18366
18367         * ../errors/cs1008.cs : Add.
18368
18369         * ../errrors/cs0543.cs : Add.
18370
18371         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18372         enum type.
18373
18374         (FindMembers): Implement.
18375
18376         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18377         enums and delegates too.
18378
18379         (enum_types): Rename to builder_to_enum.
18380
18381         (delegate_types): Rename to builder_to_delegate.
18382
18383         * delegate.cs (FindMembers): Implement.
18384
18385 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18386
18387         * typemanager.cs (IsEnumType): Implement.
18388
18389         * enum.cs (Emit): Re-write parts to account for the underlying type
18390         better and perform checking etc.
18391
18392         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18393         of the underlying type.
18394
18395         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18396         value
18397
18398         * enum.cs (error31): Helper to report error #31.
18399
18400         * cs-parser.jay (enum_declaration): Store location of each member too.
18401
18402         * enum.cs (member_to_location): New hashtable. 
18403
18404         (AddEnumMember): Update location hashtable.
18405
18406         (Emit): Use the location of each member while reporting errors.
18407
18408 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18409
18410         * cs-parser.jay: A for_initializer if is a
18411         local_variable_declaration really ammount to have an implicit
18412         block with the variable declaration and no initializer for for.
18413
18414         * statement.cs (For.Emit): Cope with null initializers.
18415
18416         This fixes the infinite loop on for initializers.
18417
18418 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18419
18420         * enum.cs: More cleanup.
18421
18422         * ecore.cs: Remove dead code.
18423
18424         * class.cs (Property.Emit): More simplification.
18425         (Event.Emit): ditto.
18426
18427         Reworked to have less levels of indentation.
18428
18429 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18430
18431         * class.cs (Property): Emit attributes.
18432
18433         (Field): Ditto.
18434
18435         (Event): Ditto.
18436
18437         (Indexer): Ditto.
18438
18439         (Operator): Ditto.
18440
18441         * enum.cs (Emit): Ditto.
18442
18443         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18444         Enums too.
18445
18446         * class.cs (Field, Event, etc.): Move attribute generation into the
18447         Emit method everywhere.
18448
18449         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18450         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18451         as we had no way of defining nested enums !
18452
18453         * rootcontext.cs : Adjust code accordingly.
18454
18455         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18456
18457 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18458
18459         * expression.cs (EvalConstantExpression): Move into ecore.cs
18460
18461         * enum.cs (Enum): Rename some members and make them public and readonly
18462         according to our convention.
18463
18464         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18465         nothing else.
18466
18467         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18468
18469         (Enum::Emit): Write a simple version for now which doesn't try to compute
18470         expressions. I shall modify this to be more robust in just a while.
18471
18472         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18473
18474         (TypeContainer::CloseType): Create the Enum types too.
18475
18476         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18477
18478         * expression.cs (EvalConstantExpression): Get rid of completely.
18479
18480         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18481         user-defined values and other cases.
18482
18483         (IsValidEnumLiteral): Helper function.
18484
18485         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18486         out there in the case we had a literal FieldExpr.
18487
18488         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18489
18490         (Literalize): Revamp a bit to take two arguments.
18491
18492         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18493
18494 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18495
18496         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18497
18498         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18499
18500         (Resolve): Use the above to ensure we have proper initializers.
18501
18502 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18503
18504         * expression.cs (Expression::EvalConstantExpression): New method to 
18505         evaluate constant expressions.
18506
18507         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18508
18509 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18510
18511         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18512         in an array.
18513
18514         (Binary.ResolveOperator): Handle operator != (object a, object b)
18515         and operator == (object a, object b);
18516
18517         (Binary.DoNumericPromotions): Indicate whether the numeric
18518         promotion was possible.
18519
18520         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18521         Implement.  
18522
18523         Made the ArrayAccess implement interface IAssignMethod instead of
18524         IStackStore as the order in which arguments are passed reflects
18525         this.
18526
18527         * assign.cs: Instead of using expr.ExprClass to select the way of
18528         assinging, probe for the IStackStore/IAssignMethod interfaces.
18529
18530         * typemanager.cs: Load InitializeArray definition.
18531
18532         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18533         static data that can be used to initialize arrays. 
18534
18535 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18536
18537         * expression.cs: Handle operator== and operator!= for booleans.
18538
18539         (Conditioal.Reduce): Implement reducer for the ?: operator.
18540
18541         (Conditional.Resolve): Implement dead code elimination.
18542
18543         (Binary.Resolve): Catch string literals and return a new
18544         concatenated string.
18545
18546         (Unary.Reduce): Implement reduction of unary expressions.
18547
18548         * ecore.cs: Split out the expression core handling here.
18549
18550         (Expression.Reduce): New method used to perform constant folding
18551         and CSE.  This is needed to support constant-expressions. 
18552
18553         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18554         targets, and optimize for !x.
18555
18556 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18557
18558         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18559         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18560         set custom atttributes.
18561
18562         * literal.cs (Literal::GetValue): New abstract method to return the actual
18563         value of the literal, cast as an object.
18564
18565         (*Literal): Implement GetValue method.
18566
18567         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18568         expressions to the arraylist but objects of type Argument.
18569
18570         * class.cs (TypeContainer::Emit): Emit our attributes too.
18571
18572         (Method::Emit, Constructor::Emit): Ditto.
18573
18574         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18575         to be ignoring earlier.
18576
18577 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18578
18579         * attribute.cs (AttributeSection::Define): Implement to do the business
18580         of constructing a CustomAttributeBuilder.
18581
18582         (Attribute): New trivial class. Increases readability of code.  
18583
18584         * cs-parser.jay : Update accordingly.
18585
18586         (positional_argument_list, named_argument_list, named_argument): New rules
18587
18588         (attribute_arguments): Use the above so that we are more correct.
18589
18590 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18591
18592         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18593         to perform all checks for a method with a params parameter.
18594
18595         (Invocation::OverloadResolve): Update to use the above method and therefore
18596         cope correctly with params method invocations.
18597
18598         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18599         params too.
18600
18601         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18602         constructors in our parent too because we can't afford to miss out on 
18603         protected ones ;-)
18604
18605         * attribute.cs (AttributeSection): New name for the class Attribute
18606
18607         Other trivial changes to improve readability.
18608
18609         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18610         use the new class names.
18611
18612 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18613
18614         * class.cs (Method::Define): Complete definition for params types too
18615
18616         (Indexer::Define): Ditto.
18617
18618         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18619         Cope everywhere with a request for info about the array parameter.
18620
18621 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18622
18623         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18624
18625         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18626         local_variable_type to extract the string corresponding to the type.
18627
18628         (local_variable_type): Fixup the action to use the new helper method.
18629
18630         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18631         go.
18632
18633         * expression.cs : Clean out code which uses the above.
18634
18635 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18636
18637         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18638         and bale out if necessary by returning a false.
18639
18640         (RegisterProperty): Ditto.
18641
18642         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18643         and print out appropriate error messages.
18644
18645         * interface.cs (everywhere): Ditto.
18646
18647         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18648         location to constructor.
18649
18650         * class.cs (Property, Event, Indexer): Update accordingly.
18651
18652         * ../errors/cs111.cs : Added.
18653
18654         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18655         of a method, as laid down by the spec.
18656
18657         (Invocation::OverloadResolve): Use the above method.
18658
18659 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18660
18661         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18662         now take a TypeContainer and a Parameters object.
18663
18664         (ParameterData): Modify return type of ParameterModifier method to be 
18665         Parameter.Modifier and not a string.
18666
18667         (ReflectionParameters, InternalParameters): Update accordingly.
18668
18669         * expression.cs (Argument::GetParameterModifier): Same here.
18670
18671         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18672         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18673         symbol in it at all so maybe this is only for now.
18674
18675 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18676
18677         * support.cs (InternalParameters): Constructor now takes an extra argument 
18678         which is the actual Parameters class.
18679
18680         (ParameterDesc): Update to provide info on ref/out modifiers.
18681
18682         * class.cs (everywhere): Update call to InternalParameters to pass in
18683         the second argument too.
18684
18685         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18686         to return the modifier info [ref/out etc]
18687
18688         (InternalParameters, ReflectionParameters): Implement the above.
18689
18690         * expression.cs (Argument::ParameterModifier): Similar function to return
18691         info about the argument's modifiers.
18692
18693         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18694         too.
18695
18696         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18697         a new SetFormalParameters object which we pass to InternalParameters.
18698
18699 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18700
18701         * expression.cs (NewArray): Merge into the ArrayCreation class.
18702
18703 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18704
18705         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18706         NewUserdefinedArray into one as there wasn't much of a use in having
18707         two separate ones.
18708
18709         * expression.cs (Argument): Change field's name to ArgType from Type.
18710
18711         (Type): New readonly property which returns the proper type, taking into 
18712         account ref/out modifiers.
18713
18714         (everywhere): Adjust code accordingly for the above.
18715
18716         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18717         whether we are emitting for a ref or out parameter.
18718
18719         * expression.cs (Argument::Emit): Use the above field to set the state.
18720
18721         (LocalVariableReference::Emit): Update to honour the flag and emit the
18722         right stuff.
18723
18724         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18725
18726         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18727
18728         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18729
18730         (ReflectionParameters, InternalParameters): Implement the above method.
18731
18732         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18733         reporting errors.
18734
18735         (Invocation::FullMethodDesc): Ditto. 
18736
18737 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18738
18739         * cs-parser.jay: Add extra production for the second form of array
18740         creation. 
18741
18742         * expression.cs (ArrayCreation): Update to reflect the above
18743         change. 
18744
18745         * Small changes to prepare for Array initialization.
18746
18747 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18748
18749         * typemanager.cs (ImplementsInterface): interface might be null;
18750         Deal with this problem;
18751
18752         Also, we do store negative hits on the cache (null values), so use
18753         this instead of calling t.GetInterfaces on the type everytime.
18754
18755 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18756
18757         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18758
18759         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18760         split functionality out into different classes.
18761
18762         (New::FormArrayType): Move into NewBuiltinArray.
18763
18764         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18765         quite useless.
18766
18767         (NewBuiltinArray): New class to handle creation of built-in arrays.
18768
18769         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18770         account creation of one-dimensional arrays.
18771
18772         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18773
18774         (NewUserdefinedArray::DoResolve): Implement.
18775
18776         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18777
18778         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18779         we maintain inside the TypeManager. This is necessary to perform lookups on the
18780         module builder.
18781
18782         (LookupType): Update to perform GetType on the module builders too.     
18783
18784         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
18785
18786         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
18787
18788 2001-10-23  Ravi Pratap  <ravi@ximian.com>
18789
18790         * expression.cs (New::DoResolve): Implement guts of array creation.
18791
18792         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
18793
18794 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
18795
18796         * expression.cs: Fix bug I introduced lsat night that broke
18797         Delegates. 
18798
18799         (Expression.Resolve): Report a 246 error (can not resolve name)
18800         if we find a SimpleName in the stream.
18801
18802         (Expression.ResolveLValue): Ditto.
18803
18804         (Expression.ResolveWithSimpleName): This function is a variant of
18805         ResolveName, this one allows SimpleNames to be returned without a
18806         warning.  The only consumer of SimpleNames is MemberAccess
18807
18808 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
18809
18810         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
18811         might arrive here.  I have my doubts that this is correct.
18812
18813         * statement.cs (Lock): Implement lock statement.
18814
18815         * cs-parser.jay: Small fixes to support `lock' and `using'
18816
18817         * cs-tokenizer.cs: Remove extra space
18818
18819         * driver.cs: New flag --checked, allows to turn on integer math
18820         checking. 
18821
18822         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
18823         Threading.Monitor.Exit 
18824
18825 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
18826
18827         * expression.cs (IndexerAccess::DoResolveLValue): Set the
18828         Expression Class to be IndexerAccess.
18829
18830         Notice that Indexer::DoResolve sets the eclass to Value.
18831
18832 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
18833
18834         * class.cs (TypeContainer::Emit): Emit code for indexers.
18835
18836         * assign.cs (IAssignMethod): New interface implemented by Indexers
18837         and Properties for handling assignment.
18838
18839         (Assign::Emit): Simplify and reuse code. 
18840
18841         * expression.cs (IndexerAccess, PropertyExpr): Implement
18842         IAssignMethod, clean up old code. 
18843
18844 2001-10-22  Ravi Pratap  <ravi@ximian.com>
18845
18846         * typemanager.cs (ImplementsInterface): New method to determine if a type
18847         implements a given interface. Provides a nice cache too.
18848
18849         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
18850         method.
18851
18852         (ConvertReferenceExplicit): Ditto.
18853
18854         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
18855         various methods, with correct names etc.
18856
18857         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
18858         Operator.UnaryNegation.
18859
18860         * cs-parser.jay (operator_declarator): Be a little clever in the case where
18861         we have a unary plus or minus operator.
18862
18863         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
18864         UnaryMinus.
18865
18866         * everywhere : update accordingly.
18867
18868         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
18869         respectively.
18870
18871         * class.cs (Method::Define): For the case where we are implementing a method
18872         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
18873         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
18874
18875 2001-10-21  Ravi Pratap  <ravi@ximian.com>
18876
18877         * interface.cs (FindMembers): Implement to work around S.R.E
18878         lameness.
18879
18880         * typemanager.cs (IsInterfaceType): Implement.
18881
18882         (FindMembers): Update to handle interface types too.
18883
18884         * expression.cs (ImplicitReferenceConversion): Re-write bits which
18885         use IsAssignableFrom as that is not correct - it doesn't work.
18886
18887         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
18888         and accordingly override EmitStatement.
18889
18890         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
18891         using the correct logic :-)
18892
18893 2001-10-19  Ravi Pratap  <ravi@ximian.com>
18894
18895         * ../errors/cs-11.cs : Add to demonstrate error -11 
18896
18897 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
18898
18899         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18900         then pass this as a hint to ResolveLValue.
18901
18902         * expression.cs (FieldExpr): Add Location information
18903
18904         (FieldExpr::LValueResolve): Report assignment to readonly
18905         variable. 
18906
18907         (Expression::ExprClassFromMemberInfo): Pass location information.
18908
18909         (Expression::ResolveLValue): Add new method that resolves an
18910         LValue. 
18911
18912         (Expression::DoResolveLValue): Default invocation calls
18913         DoResolve. 
18914
18915         (Indexers): New class used to keep track of indexers in a given
18916         Type. 
18917
18918         (IStackStore): Renamed from LValue, as it did not really describe
18919         what this did.  Also ResolveLValue is gone from this interface and
18920         now is part of Expression.
18921
18922         (ElementAccess): Depending on the element access type
18923
18924         * typemanager.cs: Add `indexer_name_type' as a Core type
18925         (System.Runtime.CompilerServices.IndexerNameAttribute)
18926
18927         * statement.cs (Goto): Take a location.
18928
18929 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18930
18931         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18932         if two delegates are compatible.
18933
18934         (NewDelegate::DoResolve): Update to take care of the case when
18935         we instantiate a delegate from another delegate.
18936
18937         * typemanager.cs (FindMembers): Don't even try to look up members
18938         of Delegate types for now.
18939
18940 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18941
18942         * delegate.cs (NewDelegate): New class to take care of delegate
18943         instantiation.
18944
18945         * expression.cs (New): Split the delegate related code out into 
18946         the NewDelegate class.
18947
18948         * delegate.cs (DelegateInvocation): New class to handle delegate 
18949         invocation.
18950
18951         * expression.cs (Invocation): Split out delegate related code into
18952         the DelegateInvocation class.
18953
18954 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18955
18956         * expression.cs (New::DoResolve): Implement delegate creation fully
18957         and according to the spec.
18958
18959         (New::DoEmit): Update to handle delegates differently.
18960
18961         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18962         because of which we were printing out arguments in reverse order !
18963
18964         * delegate.cs (VerifyMethod): Implement to check if the given method
18965         matches the delegate.
18966
18967         (FullDelegateDesc): Implement.
18968
18969         (VerifyApplicability): Implement.
18970
18971         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18972         delegate invocations too.
18973
18974         (Invocation::Emit): Ditto.
18975
18976         * ../errors/cs1593.cs : Added.
18977
18978         * ../errors/cs1594.cs : Added.
18979
18980         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18981
18982 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18983
18984         * typemanager.cs (intptr_type): Core type for System.IntPtr
18985
18986         (InitCoreTypes): Update for the same.
18987
18988         (iasyncresult_type, asynccallback_type): Ditto.
18989
18990         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18991         correct.
18992
18993         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18994         too.
18995
18996         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18997         the builders for the 4 members of a delegate type :-)
18998
18999         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19000         type.
19001
19002         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19003
19004         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19005
19006 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19007
19008         * statement.cs (Break::Emit): Implement.   
19009         (Continue::Emit): Implement.
19010
19011         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19012         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19013         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19014         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19015         end loop
19016
19017         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19018         properties that track the label for the current loop (begin of the
19019         loop and end of the loop).
19020
19021 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19022
19023         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19024         use of emitting anything at all.
19025
19026         * class.cs, rootcontext.cs : Get rid of calls to the same.
19027
19028         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19029
19030         (Populate): Define the constructor correctly and set the implementation
19031         attributes.
19032
19033         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19034         have been defined.
19035
19036         (AddDelegateType): Implement.
19037
19038         (IsDelegateType): Implement helper method.
19039
19040         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19041
19042         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19043         and accordingly handle it.
19044
19045         * delegate.cs (Populate): Take TypeContainer argument.
19046         Implement bits to define the Invoke method. However, I still haven't figured out
19047         how to take care of the native int bit :-(
19048
19049         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19050         Qualify the name of the delegate, not its return type !
19051
19052         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19053         conversion.
19054
19055         (StandardConversionExists): Checking for array types turns out to be recursive.
19056
19057         (ConvertReferenceExplicit): Implement array conversion.
19058
19059         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19060
19061 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19062
19063         * cs-parser.jay (delegate_declaration): Store the fully qualified
19064         name as it is a type declaration.
19065
19066         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19067         readonly.
19068
19069         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19070         as TypeContainer::DefineType.
19071
19072         (Populate): Method in which all the definition of the various methods (Invoke)
19073         etc is done.
19074
19075         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19076         see.
19077
19078         (CloseDelegate): Finally creates the delegate.
19079
19080         * class.cs (TypeContainer::DefineType): Update to define delegates.
19081         (Populate, Emit and CloseType): Do the same thing here too.
19082
19083         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19084         delegates in all these operations.
19085
19086 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19087
19088         * expression.cs: LocalTemporary: a new expression used to
19089         reference a temporary that has been created.
19090
19091         * assign.cs: Handle PropertyAccess back here, so that we can
19092         provide the proper semantic access to properties.
19093
19094         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19095         a few more explicit conversions. 
19096
19097         * modifiers.cs: `NEW' modifier maps to HideBySig.
19098
19099         * expression.cs (PropertyExpr): Make this into an
19100         ExpressionStatement, and support the EmitStatement code path. 
19101
19102         Perform get/set error checking, clean up the interface.
19103
19104         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19105         them into toplevel access objects.
19106
19107 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19108
19109         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19110         SRE.
19111
19112         * typemanager.cs: Keep track here of our PropertyBuilders again to
19113         work around lameness in SRE.
19114
19115 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19116
19117         * expression.cs (LValue::LValueResolve): New method in the
19118         interface, used to perform a second resolution pass for LValues. 
19119
19120         (This::DoResolve): Catch the use of this in static methods.
19121
19122         (This::LValueResolve): Implement.
19123
19124         (This::Store): Remove warning, assigning to `this' in structures
19125         is 
19126
19127         (Invocation::Emit): Deal with invocation of
19128         methods on value types.  We need to pass the address to structure
19129         methods rather than the object itself.  (The equivalent code to
19130         emit "this" for structures leaves the entire structure on the
19131         stack instead of a pointer to it). 
19132
19133         (ParameterReference::DoResolve): Compute the real index for the
19134         argument based on whether the method takes or not a `this' pointer
19135         (ie, the method is static).
19136
19137         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19138         value types returned from functions when we need to invoke a
19139         method on the sturcture.
19140
19141
19142 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19143
19144         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19145         defining the type in the Modulebuilder or Typebuilder. This is to take
19146         care of nested types which need to be defined on the TypeBuilder using
19147         DefineNestedMethod.
19148
19149         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19150         methods in RootContext, only ported to be part of TypeContainer.
19151
19152         (TypeContainer::GetInterfaceOrClass): Ditto.
19153
19154         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19155
19156         * interface.cs (Interface::DefineInterface): New method. Does exactly
19157         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19158         too.
19159
19160         (Interface::GetInterfaces): Move from RootContext here and port.
19161
19162         (Interface::GetInterfaceByName): Same here.
19163
19164         * rootcontext.cs (ResolveTree): Re-write.
19165
19166         (PopulateTypes): Re-write.
19167
19168         * class.cs (TypeContainer::Populate): Populate nested types too.
19169         (TypeContainer::Emit): Emit nested members too.
19170
19171         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19172         instead just use the name argument passed in as it is already fully
19173         qualified.
19174
19175         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19176         to TypeContainer mapping to see if a type is user-defined.
19177
19178         * class.cs (TypeContainer::CloseType): Implement. 
19179
19180         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19181         the default constructor.
19182
19183         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19184         twice.
19185
19186         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19187
19188         * interface.cs (CloseType): Create the type here.
19189
19190         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19191         the hierarchy.
19192
19193         Remove all the methods which are now in TypeContainer.
19194
19195 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19196
19197         * delegate.cs (Define): Re-write bits to define the delegate
19198         correctly.
19199
19200 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19201
19202         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19203
19204         * expression.cs (ImplicitReferenceConversion): handle null as well
19205         as a source to convert to any reference type.
19206
19207         * statement.cs (Return): Perform any implicit conversions to
19208         expected return type.  
19209
19210         Validate use of return statement.  
19211
19212         * codegen.cs (EmitContext): Pass the expected return type here.
19213
19214         * class.cs (Method, Constructor, Property): Pass expected return
19215         type to EmitContext.
19216
19217 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19218
19219         * expression.cs: Make DoResolve take an EmitContext instead of a
19220         TypeContainer.
19221
19222         Replaced `l' and `location' for `loc', for consistency.
19223
19224         (Error, Warning): Remove unneeded Tc argument.
19225
19226         * assign.cs, literal.cs, constant.cs: Update to new calling
19227         convention. 
19228
19229         * codegen.cs: EmitContext now contains a flag indicating whether
19230         code is being generated in a static method or not.
19231
19232         * cs-parser.jay: DecomposeQI, new function that replaces the old
19233         QualifiedIdentifier.  Now we always decompose the assembled
19234         strings from qualified_identifier productions into a group of
19235         memberaccesses.
19236
19237 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19238
19239         * rootcontext.cs: Deal with field-less struct types correctly now
19240         by passing the size option to Define Type.
19241
19242         * class.cs: Removed hack that created one static field. 
19243
19244 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19245
19246         * statement.cs: Moved most of the code generation here. 
19247
19248 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19249
19250         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19251         seem very right.
19252
19253         (ElementAccess): Remove useless bits for now - keep checks as the spec
19254         says.
19255
19256 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19257
19258         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19259         and start performing checks according to the spec.
19260
19261 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19262
19263         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19264         rank_specifiers instead.
19265
19266         (rank_specifiers): Change the order in which the rank specifiers are stored
19267
19268         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19269
19270         * expression.cs (ElementAccess): Implement the LValue interface too.
19271
19272 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19273
19274         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19275         except that user defined conversions are not included.
19276
19277         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19278         perform the conversion of the return type, if necessary.
19279
19280         (New::DoResolve): Check whether we are creating an array or an object
19281         and accordingly do the needful.
19282
19283         (New::Emit): Same here.
19284
19285         (New::DoResolve): Implement guts of array creation.
19286
19287         (New::FormLookupType): Helper function.
19288
19289 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19290
19291         * codegen.cs: Removed most of the code generation here, and move the
19292         corresponding code generation bits to the statement classes. 
19293
19294         Added support for try/catch/finalize and throw.
19295
19296         * cs-parser.jay: Added support for try/catch/finalize.
19297
19298         * class.cs: Catch static methods having the flags override,
19299         virtual or abstract.
19300
19301         * expression.cs (UserCast): This user cast was not really doing
19302         what it was supposed to do.  Which is to be born in fully resolved
19303         state.  Parts of the resolution were being performed at Emit time! 
19304
19305         Fixed this code.
19306
19307 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19308
19309         * expression.cs: Implicity convert the result from UserCast.
19310
19311 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19312
19313         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19314         prevented it from working correctly. 
19315
19316         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19317         merely ConvertImplicit.
19318
19319 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19320
19321         * typemanager.cs: Make the LookupTypeContainer function static,
19322         and not per-instance.  
19323
19324         * class.cs: Make static FindMembers (the one that takes a Type
19325         argument). 
19326
19327         * codegen.cs: Add EmitForeach here.
19328
19329         * cs-parser.jay: Make foreach a toplevel object instead of the
19330         inline expansion, as we need to perform semantic analysis on it. 
19331
19332 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19333
19334         * expression.cs (Expression::ImplicitUserConversion): Rename to
19335         UserDefinedConversion.
19336
19337         (Expression::UserDefinedConversion): Take an extra argument specifying 
19338         whether we look for explicit user conversions too.
19339
19340         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19341
19342         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19343
19344         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19345         with the appropriate arguments.
19346
19347         * cs-parser.jay (cast_expression): Record location too.
19348
19349         * expression.cs (Cast): Record location info.
19350
19351         (Expression::ConvertExplicit): Take location argument.
19352
19353         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19354         to determine if we are doing explicit conversions.
19355
19356         (UserCast::Emit): Update accordingly.
19357
19358         (Expression::ConvertExplicit): Report an error if everything fails.
19359
19360         * ../errors/cs0030.cs : Add.
19361
19362 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19363
19364         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19365         virtual and newslot bits. 
19366
19367         * class.cs (TypeContainer::RegisterRequiredImplementations):
19368         Record methods we need.
19369
19370         (TypeContainer::MakeKey): Helper function to make keys for
19371         MethodBases, since the Methodbase key is useless.
19372
19373         (TypeContainer::Populate): Call RegisterRequiredImplementations
19374         before defining the methods.   
19375
19376         Create a mapping for method_builders_to_methods ahead of time
19377         instead of inside a tight loop.
19378
19379         (::RequireMethods):  Accept an object as the data to set into the
19380         hashtable so we can report interface vs abstract method mismatch.
19381
19382 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19383
19384         * report.cs: Make all of it static.
19385
19386         * rootcontext.cs: Drop object_type and value_type computations, as
19387         we have those in the TypeManager anyways.
19388
19389         Drop report instance variable too, now it is a global.
19390
19391         * driver.cs: Use try/catch on command line handling.
19392
19393         Add --probe option to debug the error reporting system with a test
19394         suite. 
19395
19396         * report.cs: Add support for exiting program when a probe
19397         condition is reached.
19398
19399 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19400
19401         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19402         we do a forcible conversion regardless of type, to check if 
19403         ForceConversion returns a null.
19404
19405         (Binary::error19): Use location to report error.
19406
19407         (Unary::error23): Use location here too.
19408
19409         * ../errors/cs0019.cs : Check in.
19410
19411         * ../errors/cs0023.cs : Check in.
19412
19413         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19414         case of a non-null MethodInfo object with a length of 0 !
19415
19416         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19417         an applicable member - according to the spec :-)
19418         Also fix logic to find members in base types.
19419
19420         (Unary::ResolveOperator): Same here.
19421
19422         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19423         as I was getting thoroughly confused between this and error19 :-)
19424
19425         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19426         (::FindMostEncompassedType): Implement.
19427         (::FindMostEncompassingType): Implement.
19428         (::StandardConversionExists): Implement.
19429
19430         (UserImplicitCast): Re-vamp. We now need info about most specific
19431         source and target types so that we can do the necessary conversions.
19432
19433         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19434         mathematical union with no duplicates.
19435
19436 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19437
19438         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19439         in order from base classes to child classes, so that we can in
19440         child classes look up in our parent for method names and
19441         attributes (required for handling abstract, virtual, new, override
19442         constructs: we need to instrospect our base class, and if we dont
19443         populate the classes in order, the introspection might be
19444         incorrect.  For example, a method could query its parent before
19445         the parent has any methods and would determine that the parent has
19446         no abstract methods (while it could have had them)).
19447
19448         (RootContext::CreateType): Record the order in which we define the
19449         classes.
19450
19451 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19452
19453         * class.cs (TypeContainer::Populate): Also method definitions can
19454         fail now, keep track of this.
19455
19456         (TypeContainer::FindMembers): Implement support for
19457         DeclaredOnly/noDeclaredOnly flag.
19458
19459         (Constructor::Emit) Return the ConstructorBuilder.
19460
19461         (Method::Emit) Return the MethodBuilder. 
19462         Check for abstract or virtual methods to be public.
19463
19464         * rootcontext.cs (RootContext::CreateType): Register all the
19465         abstract methods required for the class to be complete and the
19466         interface methods that must be implemented. 
19467
19468         * cs-parser.jay: Report error 501 (method requires body if it is
19469         not marked abstract or extern).
19470
19471         * expression.cs (TypeOf::Emit): Implement.
19472
19473         * typemanager.cs: runtime_handle_type, new global type.
19474
19475         * class.cs (Property::Emit): Generate code for properties.
19476
19477 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19478
19479         * expression.cs (Unary::ResolveOperator): Find operators on base type
19480         too - we now conform exactly to the spec.
19481
19482         (Binary::ResolveOperator): Same here.
19483
19484         * class.cs (Operator::Define): Fix minor quirk in the tests.
19485
19486         * ../errors/cs0215.cs : Added.
19487
19488         * ../errors/cs0556.cs : Added.
19489
19490         * ../errors/cs0555.cs : Added.
19491
19492 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19493
19494         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19495         single integer which is really efficient
19496
19497 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19498
19499         *  expression.cs (Expression::ImplicitUserConversion): Use location
19500         even in the case when we are examining True operators.
19501  
19502         * class.cs (Operator::Define): Perform extensive checks to conform
19503         with the rules for operator overloading in the spec.
19504
19505         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19506         some of the other conversions mentioned in the spec.
19507
19508         * typemanager.cs (array_type): New static member for the System.Array built-in
19509         type.
19510
19511         (cloneable_interface): For System.ICloneable interface.
19512
19513         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19514         we start resolving the tree and populating types.
19515
19516         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19517  
19518 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19519
19520         * expression.cs (Expression::ExprClassFromMemberInfo,
19521         Expression::Literalize): Create literal expressions from
19522         FieldInfos which are literals.
19523
19524         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19525         type casts, because they were wrong.  The test suite in tests
19526         caught these ones.
19527
19528         (ImplicitNumericConversion): ushort to ulong requires a widening
19529         cast. 
19530
19531         Int32 constant to long requires widening cast as well.
19532
19533         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19534         for integers because the type on the stack is not i4.
19535
19536 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19537
19538         * expression.cs (report118): require location argument. 
19539
19540         * parameter.cs: Do not dereference potential null value.
19541
19542         * class.cs: Catch methods that lack the `new' keyword when
19543         overriding a name.  Report warnings when `new' is used without
19544         anything being there to override.
19545
19546         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19547
19548         * class.cs: Only add constructor to hashtable if it is non-null
19549         (as now constructors can fail on define).
19550
19551         (TypeManager, Class, Struct): Take location arguments.
19552
19553         Catch field instance initialization in structs as errors.
19554
19555         accepting_filter: a new filter for FindMembers that is static so
19556         that we dont create an instance per invocation.
19557
19558         (Constructor::Define): Catch errors where a struct constructor is
19559         parameterless 
19560
19561         * cs-parser.jay: Pass location information for various new
19562         constructs. 
19563
19564         * delegate.cs (Delegate): take a location argument.
19565
19566         * driver.cs: Do not call EmitCode if there were problesm in the
19567         Definition of the types, as many Builders wont be there. 
19568
19569         * decl.cs (Decl::Decl): Require a location argument.
19570
19571         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19572         into integers, and find the most appropiate integer for it.
19573
19574         * literal.cs: Implement ULongLiteral.
19575
19576         * rootcontext.cs: Provide better information about the location of
19577         failure when CreateType fails.
19578
19579 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19580
19581         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19582         as well.
19583
19584         * expression.cs (Binary::CheckShiftArguments): Add missing type
19585         computation.
19586         (Binary::ResolveOperator): Add type to the logical and and logical
19587         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19588         before.
19589
19590         (Binary::DoNumericPromotions): In the case where either argument
19591         is ulong (and most signed types combined with ulong cause an
19592         error) perform implicit integer constant conversions as well.
19593
19594 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19595
19596         * expression.cs (UserImplicitCast): Method should always be
19597         non-null. 
19598         (Invocation::BetterConversion): Simplified test for IntLiteral.
19599
19600         (Expression::ImplicitNumericConversion): Split this routine out.
19601         Put the code that performs implicit constant integer conversions
19602         here. 
19603
19604         (Expression::Resolve): Become a wrapper around DoResolve so we can
19605         check eclass and type being set after resolve.
19606
19607         (Invocation::Badness): Remove this dead function
19608
19609         (Binary::ResolveOperator): Do not compute the expensive argumnets
19610         unless we have a union for it.
19611
19612         (Probe::Emit): Is needs to do an isinst and then
19613         compare against null.
19614
19615         (::CanConvert): Added Location argument.  If the Location argument
19616         is null (Location.Null), then we do not report errors.  This is
19617         used by the `probe' mechanism of the Explicit conversion.  We do
19618         not want to generate an error for something that the user
19619         explicitly requested to be casted.  But the pipeline for an
19620         explicit cast first tests for potential implicit casts.
19621
19622         So for now, if the Location is null, it means `Probe only' to
19623         avoid adding another argument.   Might have to revise this
19624         strategy later.
19625
19626         (ClassCast): New class used to type cast objects into arbitrary
19627         classes (used in Explicit Reference Conversions).
19628
19629         Implement `as' as well.
19630
19631         Reverted all the patches from Ravi below: they were broken:
19632
19633                 * The use of `level' as a mechanism to stop recursive
19634                   invocations is wrong.  That was there just to catch the
19635                   bug with a strack trace but not as a way of addressing
19636                   the problem.
19637
19638                   To fix the problem we have to *understand* what is going
19639                   on and the interactions and come up with a plan, not
19640                   just get things going.
19641
19642                 * The use of the type conversion cache that I proposed
19643                   last night had an open topic: How does this work across
19644                   protection domains.  A user defined conversion might not
19645                   be public in the location where we are applying the
19646                   conversion, a different conversion might be selected
19647                   (ie, private A->B (better) but public B->A (worse),
19648                   inside A, A->B applies, but outside it, B->A will
19649                   apply).
19650
19651                 * On top of that (ie, even if the above is solved),
19652                   conversions in a cache need to be abstract.  Ie, `To
19653                   convert from an Int to a Short use an OpcodeCast', not
19654                   `To convert from an Int to a Short use the OpcodeCast on
19655                   the variable 5' (which is what this patch was doing).
19656
19657 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19658
19659         * expression.cs (Invocation::ConversionExists): Re-write to use
19660         the conversion cache
19661
19662         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19663         cache all conversions done, not just user-defined ones.
19664
19665         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19666         to determine if a conversion exists instead of acutually trying to 
19667         perform the conversion. It's faster too.
19668
19669         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19670         and only then attempt the implicit conversion.
19671
19672 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19673
19674         * expression.cs (ConvertImplicit): Use a cache for conversions
19675         already found. Check level of recursion and bail out if necessary.
19676
19677 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19680         Export standard methods that we expect for string operations.
19681
19682         * statement.cs (Block::UsageWarning): Track usage of variables and
19683         report the errors for not used variables.
19684
19685         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19686         operator. 
19687
19688 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19689
19690         * codegen.cs: remove unnneded code 
19691
19692         * expression.cs: Removed BuiltinTypeAccess class
19693
19694         Fix the order in which implicit conversions are
19695         done.  
19696
19697         The previous fixed dropped support for boxed conversions (adding a
19698         test to the test suite now)
19699
19700         (UserImplicitCast::CanConvert): Remove test for source being null,
19701         that code is broken.  We should not feed a null to begin with, if
19702         we do, then we should track the bug where the problem originates
19703         and not try to cover it up here.
19704
19705         Return a resolved expression of type UserImplicitCast on success
19706         rather than true/false.  Ravi: this is what I was talking about,
19707         the pattern is to use a static method as a "constructor" for
19708         objects. 
19709
19710         Also, do not create arguments until the very last minute,
19711         otherwise we always create the arguments even for lookups that
19712         will never be performed. 
19713
19714         (UserImplicitCast::Resolve): Eliminate, objects of type
19715         UserImplicitCast are born in a fully resolved state. 
19716
19717         * typemanager.cs (InitCoreTypes): Init also value_type
19718         (System.ValueType). 
19719
19720         * expression.cs (Cast::Resolve): First resolve the child expression.
19721
19722         (LValue): Add new method AddressOf to be used by
19723         the `&' operator.  
19724
19725         Change the argument of Store to take an EmitContext instead of an
19726         ILGenerator, because things like FieldExpr need to be able to call
19727         their children expression to generate the instance code. 
19728
19729         (Expression::Error, Expression::Warning): Sugar functions for
19730         reporting errors.
19731
19732         (Expression::MemberLookup): Accept a TypeContainer instead of a
19733         Report as the first argument.
19734
19735         (Expression::ResolvePrimary): Killed.  I still want to improve
19736         this as currently the code is just not right.
19737
19738         (Expression::ResolveMemberAccess): Simplify, but it is still
19739         wrong. 
19740
19741         (Unary::Resolve): Catch errors in AddressOf operators.
19742
19743         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19744         index to a byte for the short-version, or the compiler will choose
19745         the wrong Emit call, which generates the wrong data.
19746
19747         (ParameterReference::Emit, ::Store): same.
19748
19749         (FieldExpr::AddressOf): Implement.
19750
19751         * typemanager.cs: TypeManager: made public variable instead of
19752         property.
19753
19754         * driver.cs: document --fatal.
19755
19756         * report.cs (ErrorMessage, WarningMessage): new names for the old
19757         Error and Warning classes.
19758
19759         * cs-parser.jay (member_access): Turn built-in access to types
19760         into a normal simplename
19761
19762 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19763
19764         * expression.cs (Invocation::BetterConversion): Fix to cope
19765         with q being null, since this was introducing a bug.
19766
19767         * expression.cs (ConvertImplicit): Do built-in conversions first.
19768
19769 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19770
19771         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19772
19773 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19774
19775         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19776         I had introduced long ago (what's new ?).
19777
19778         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19779         the work of all the checking. 
19780         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19781         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19782
19783         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
19784         that is the right way. 
19785
19786         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
19787         overloading resolution. Use everywhere instead of cutting and pasting code.
19788
19789         (Binary::ResolveOperator): Use MakeUnionSet.
19790
19791         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
19792         we have to convert to bool types. Not complete yet.
19793
19794 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19795
19796         * typemanager.cs (TypeManager::CSharpName): support ushort.
19797
19798         * expression.cs (Expression::TryImplicitIntConversion): Attempts
19799         to provide an expression that performsn an implicit constant int
19800         conversion (section 6.1.6).
19801         (Expression::ConvertImplicitRequired): Reworked to include
19802         implicit constant expression conversions.
19803
19804         (Expression::ConvertNumericExplicit): Finished.
19805
19806         (Invocation::Emit): If InstanceExpression is null, then it means
19807         that we perform a call on this.
19808
19809 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19810
19811         * expression.cs (Unary::Emit): Remove some dead code.
19812         (Probe): Implement Resolve and Emit for `is'.
19813         (Expression::ConvertImplicitRequired): Attempt to do constant
19814         expression conversions here.  Maybe should be moved to
19815         ConvertImplicit, but I am not sure.
19816         (Expression::ImplicitLongConstantConversionPossible,
19817         Expression::ImplicitIntConstantConversionPossible): New functions
19818         that tell whether is it possible to apply an implicit constant
19819         expression conversion.
19820
19821         (ConvertNumericExplicit): Started work on explicit numeric
19822         conversions.
19823
19824         * cs-parser.jay: Update operator constants.
19825
19826         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
19827         (Parameters::GetSignature): Hook up VerifyArgs here.
19828         (Parameters::VerifyArgs): Verifies that no two arguments have the
19829         same name. 
19830
19831         * class.cs (Operator): Update the operator names to reflect the
19832         ones that the spec expects (as we are just stringizing the
19833         operator names).
19834
19835         * expression.cs (Unary::ResolveOperator): Fix bug: Use
19836         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
19837         previous usage did only work for our methods.
19838         (Expression::ConvertImplicit): Handle decimal implicit numeric
19839         conversions as well.
19840         (Expression::InternalTypeConstructor): Used to invoke constructors
19841         on internal types for default promotions.
19842
19843         (Unary::Emit): Implement special handling for the pre/post
19844         increment/decrement for overloaded operators, as they need to have
19845         the same semantics as the other operators.
19846
19847         (Binary::ResolveOperator): ditto.
19848         (Invocation::ConversionExists): ditto.
19849         (UserImplicitCast::Resolve): ditto.
19850
19851 2001-09-26  Ravi Pratap  <ravi@ximian.com>
19852
19853         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
19854         operator, return after emitting body. Regression tests pass again !
19855
19856         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
19857         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
19858         (Invocation::OverloadResolve): Ditto.
19859         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
19860
19861         * everywhere : update calls to the above methods accordingly.
19862
19863 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
19864
19865         * assign.cs (Assign): Make it inherit from ExpressionStatement.
19866
19867         * expression.cs (ExpressionStatement): New base class used for
19868         expressions that can appear in statements, so that we can provide
19869         an alternate path to generate expression that do not leave a value
19870         on the stack.
19871
19872         (Expression::Emit, and all the derivatives): We no longer return
19873         whether a value is left on the stack or not.  Every expression
19874         after being emitted leaves a single value on the stack.
19875
19876         * codegen.cs (EmitContext::EmitStatementExpression): Use the
19877         facilties of ExpressionStatement if possible.
19878
19879         * cs-parser.jay: Update statement_expression.
19880
19881 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * driver.cs: Change the wording of message
19884
19885 2001-09-25  Ravi Pratap  <ravi@ximian.com>
19886
19887         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
19888         the type of the expression to the return type of the method if
19889         we have an overloaded operator match ! The regression tests pass again !
19890         (Unary::ResolveOperator): Ditto.
19891
19892         * expression.cs (Invocation::ConversionExists): Correct the member lookup
19893         to find "op_Implicit", not "implicit" ;-)
19894         (UserImplicitCast): New class to take care of user-defined implicit conversions.
19895         (ConvertImplicit, ForceConversion): Take TypeContainer argument
19896
19897         * everywhere : Correct calls to the above accordingly.
19898
19899         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19900         (ConvertImplicit): Do user-defined conversion if it exists.
19901
19902 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * assign.cs: track location.
19905         (Resolve): Use implicit conversions on assignment.
19906
19907         * literal.cs: Oops.  Not good, Emit of short access values should
19908         pass (Bytes) or the wrong argument will be selected.
19909
19910         * expression.cs (Unary::Emit): Emit code for -expr.
19911
19912         (Unary::ResolveOperator): Handle `Substract' for non-constants
19913         (substract from zero from the non-constants).
19914         Deal with Doubles as well. 
19915
19916         (Expression::ConvertImplicitRequired): New routine that reports an
19917         error if no implicit conversion exists. 
19918
19919         (Invocation::OverloadResolve): Store the converted implicit
19920         expressions if we make them
19921
19922 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19923
19924         * class.cs (ConstructorInitializer): Take a Location argument.
19925         (ConstructorBaseInitializer): Same here.
19926         (ConstructorThisInitializer): Same here.
19927
19928         * cs-parser.jay : Update all calls accordingly.
19929
19930         * expression.cs (Unary, Binary, New): Take location argument.
19931         Update accordingly everywhere.
19932
19933         * cs-parser.jay : Update all calls to the above to take a location
19934         argument.
19935
19936         * class.cs : Ditto.
19937
19938 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19939
19940         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19941         (Invocation::BetterConversion): Same here
19942         (Invocation::ConversionExists): Ditto.
19943
19944         (Invocation::ConversionExists): Implement.
19945
19946 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19947
19948         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19949         Also take an additional TypeContainer argument.
19950
19951         * All over : Pass in TypeContainer as argument to OverloadResolve.
19952
19953         * typemanager.cs (CSharpName): Update to check for the string type and return
19954         that too.
19955
19956         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19957         a given method.
19958
19959 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19960
19961         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19962         (Invocation::BetterFunction): Implement.
19963         (Invocation::BetterConversion): Implement.
19964         (Invocation::ConversionExists): Skeleton, no implementation yet.
19965
19966         Okay, things work fine !
19967
19968 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19969
19970         * typemanager.cs: declare and load enum_type, delegate_type and
19971         void_type. 
19972
19973         * expression.cs (Expression::Emit): Now emit returns a value that
19974         tells whether a value is left on the stack or not.  This strategy
19975         might be reveted tomorrow with a mechanism that would address
19976         multiple assignments.
19977         (Expression::report118): Utility routine to report mismatches on
19978         the ExprClass.
19979
19980         (Unary::Report23): Report impossible type/operator combination
19981         utility function.
19982
19983         (Unary::IsIncrementableNumber): Whether the type can be
19984         incremented or decremented with add.
19985         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19986         complemented. 
19987         (Unary::ResolveOperator): Implement ++, !, ~,
19988
19989         (Invocation::Emit): Deal with new Emit convetion.
19990
19991         * All Expression derivatives: Updated their Emit method to return
19992         whether they leave values on the stack or not.
19993
19994         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19995         stack for expressions that are statements. 
19996
19997 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19998
19999         * expression.cs (LValue): New interface.  Must be implemented by
20000         LValue objects.
20001         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20002         LValue interface.
20003
20004         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20005         interface for generating code, simplifies the code.
20006
20007 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20008
20009         * expression.cs (everywhere): Comment out return statements in ::Resolve
20010         methods to avoid the warnings.
20011
20012 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20013
20014         * driver.cs (parse): Report error 2001 if we can not open the
20015         source file.
20016
20017         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20018         not resolve it.
20019
20020         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20021         object. 
20022
20023         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20024         otherwise nested blocks end up with the same index.
20025
20026         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20027
20028         * expression.cs:  Instead of having FIXMEs in the Resolve
20029         functions, throw exceptions so it is obvious that we are facing a
20030         bug. 
20031
20032         * cs-parser.jay (invocation_expression): Pass Location information.
20033
20034         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20035         Use a basename for those routines because .NET does not like paths
20036         on them. 
20037
20038         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20039         already defined.
20040
20041 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20042
20043         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20044         are loading the correct data types (throws an exception if not).
20045         (TypeManager::InitCoreTypes): Use CoreLookupType
20046
20047         * expression.cs (Unary::ResolveOperator): return the child
20048         expression for expressions which are just +expr.
20049         (Unary::ResolveOperator): Return negative literals for -LITERAL
20050         expressions (otherwise they are Unary {Literal}).
20051         (Invocation::Badness): Take into account `Implicit constant
20052         expression conversions'.
20053
20054         * literal.cs (LongLiteral): Implement long literal class.
20055         (IntLiteral): export the `Value' of the intliteral. 
20056
20057 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20058
20059         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20060
20061         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20062         instead of 'Operator'
20063
20064         * expression.cs (Binary::ResolveOperator): Update accordingly.
20065         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20066         and 'Minus'
20067
20068         * cs-parser.jay (unary_expression): Update to use the new names.
20069
20070         * gen-treedump.cs (GetUnary): Same here.
20071
20072         * expression.cs (Unary::Resolve): Implement.
20073         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20074         operators are found instead of making noise ;-)
20075         (Unary::ResolveOperator): New method to do precisely the same thing which
20076         Binary::ResolveOperator does for Binary expressions.
20077         (Unary.method, .Arguments): Add.
20078         (Unary::OperName): Implement.   
20079         (Unary::ForceConversion): Copy and Paste !
20080
20081         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20082         a unary operator.
20083
20084         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20085         for the inbuilt operators. Only overloading works for now ;-)
20086
20087 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20090         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20091
20092         * expression.cs (This::Emit): Implement. 
20093         (This::Resolve): Implement.
20094         (TypeOf:Resolve): Implement.
20095         (Expression::ResolveSimpleName): Add an implicit this to instance
20096         field references. 
20097         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20098         Bind instance variable to Field expressions.
20099         (FieldExpr::Instance): New field used to track the expression that
20100         represents the object instance.
20101         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20102         binding 
20103         (FieldExpr::Emit): Implement.
20104
20105         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20106         the last instruction contains a return opcode to avoid generating
20107         the last `ret' instruction (this generates correct code, and it is
20108         nice to pass the peverify output).
20109
20110         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20111         initializer for static and instance variables.
20112         (Constructor::Emit): Allow initializer to be null in the case of
20113         static constructors.  Only emit initializer for instance
20114         constructors. 
20115
20116         (TypeContainer::FindMembers): Return a null array if there are no
20117         matches.
20118
20119         Also fix the code for the MemberTypes.Method branch, as it was not
20120         scanning that for operators (or tried to access null variables before).
20121
20122         * assign.cs (Assign::Emit): Handle instance and static fields. 
20123
20124         * TODO: Updated.
20125
20126         * driver.cs: Stop compilation if there are parse errors.
20127
20128         * cs-parser.jay (constructor_declaration): Provide default base
20129         initializer for non-static constructors.
20130         (constructor_declarator): Do not provide a default base
20131         initializers if none was specified.
20132         Catch the fact that constructors should not have parameters.
20133
20134         * class.cs: Do not emit parent class initializers for static
20135         constructors, that should be flagged as an error.
20136
20137 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20138
20139         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20140         Move back code into TypeContainer::Populate.
20141
20142 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20143
20144         * class.cs (TypeContainer::AddConstructor): Fix the check to
20145         compare against Name, not Basename. 
20146         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20147
20148         * cs-parser.jay : Update accordingly.
20149
20150         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20151         for methods, don't forget to look into the operators too.
20152         (RegisterMethodBuilder): Helper method to take care of this for
20153         methods, constructors and operators.
20154         (Operator::Define): Completely revamp.
20155         (Operator.OperatorMethod, MethodName): New fields.
20156         (TypeContainer::Populate): Move the registering of builders into
20157         RegisterMethodBuilder.
20158         (Operator::Emit): Re-write.
20159
20160         * expression.cs (Binary::Emit): Comment out code path to emit method
20161         invocation stuff for the case when we have a user defined operator. I am
20162         just not able to get it right !
20163
20164 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20165
20166         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20167         argument. 
20168
20169         (Expression::MemberLookup): Provide a version that allows to
20170         specify the MemberTypes and BindingFlags. 
20171
20172         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20173         so it was not fetching variable information from outer blocks.
20174
20175         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20176         Beforefieldinit as it was buggy.
20177
20178         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20179         that Ravi put here.  
20180
20181         * class.cs (Constructor::Emit): Only emit if block is not null.
20182         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20183         deal with this by semantically definining it as if the user had
20184         done it.
20185
20186         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20187         constructors as we now "emit" them at a higher level.
20188
20189         (TypeContainer::DefineDefaultConstructor): Used to define the
20190         default constructors if none was provided.
20191
20192         (ConstructorInitializer): Add methods Resolve and Emit. 
20193
20194         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20195
20196 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20197
20198         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20199         the default constructor builder with our hashtable for methodbuilders
20200         to methodcores.
20201
20202         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20203         and argument_count is 0 in which case we have a match.
20204         (Binary::ResolveOperator): More null checking and miscellaneous coding
20205         style cleanup.
20206
20207 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20208
20209         * rootcontext.cs (IsNameSpace): Compare against null.
20210
20211         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20212
20213         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20214         and Unary::Operator.
20215
20216         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20217         accordingly.
20218
20219         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20220         we have overloaded operators.
20221         (Binary::ResolveOperator): Implement the part which does the operator overload
20222         resolution.
20223
20224         * class.cs (Operator::Emit): Implement.
20225         (TypeContainer::Emit): Emit the operators we have too.
20226
20227         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20228         the case when we have a user-defined operator.
20229
20230 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20231
20232         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20233
20234 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20235
20236         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20237         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20238         (Constructor::Emit): Implement.
20239         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20240         if we have no work to do. 
20241         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20242         Emit method.
20243
20244         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20245         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20246
20247         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20248         of parent.parent.
20249
20250 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20251
20252         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20253         in the source.
20254         (Tree::RecordNamespace): Method to do what the name says ;-)
20255         (Tree::Namespaces): Property to get at the namespaces hashtable.
20256
20257         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20258         keep track.
20259
20260         * rootcontext.cs (IsNamespace): Fixed it :-)
20261
20262 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20263
20264         * class.cs (TypeContainer::FindMembers): Add support for
20265         constructors. 
20266         (MethodCore): New class that encapsulates both the shared aspects
20267         of a Constructor and a Method.  
20268         (Method, Constructor): Factored pieces into MethodCore.
20269
20270         * driver.cs: Added --fatal which makes errors throw exceptions.
20271         Load System assembly as well as part of the standard library.
20272
20273         * report.cs: Allow throwing exceptions on errors for debugging.
20274
20275         * modifiers.cs: Do not use `parent', instead use the real type
20276         container to evaluate permission settings.
20277
20278         * class.cs: Put Ravi's patch back in.  He is right, and we will
20279         have to cope with the
20280
20281 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20282
20283         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20284         FamORAssem, not FamANDAssem.
20285
20286 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20287
20288         * driver.cs: Added --parse option that only parses its input files
20289         and terminates.
20290
20291         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20292         incorrect.  IsTopLevel is not used to tell whether an object is
20293         root_types or not (that can be achieved by testing this ==
20294         root_types).  But to see if this is a top-level *class* (not
20295         necessarly our "toplevel" container). 
20296
20297 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20298
20299         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20300         parent instead of a direct call to GetType.
20301
20302 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20303
20304         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20305         Modifiers.TypeAttr. This should just be a call to that method.
20306
20307         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20308         object so that we can determine if we are top-level or not.
20309
20310         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20311         TypeContainer too.
20312
20313         * enum.cs (Enum::Define): Ditto.
20314
20315         * modifiers.cs (FieldAttr): Re-write.
20316
20317         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20318         (TypeContainer::HaveStaticConstructor): New property to provide access
20319         to precisely that info.
20320
20321         * modifiers.cs (MethodAttr): Re-write.
20322         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20323
20324         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20325         of top-level types as claimed.
20326
20327 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20328
20329         * expression.cs (MemberLookup): Fruitless attempt to lookup
20330         constructors.  Maybe I need to emit default constructors?  That
20331         might be it (currently .NET emits this for me automatically).
20332         (Invocation::OverloadResolve): Cope with Arguments == null.
20333         (Invocation::EmitArguments): new function, shared by the new
20334         constructor and us.
20335         (Invocation::Emit): Handle static and instance methods.  Emit
20336         proper call instruction for virtual or non-virtual invocations.
20337         (New::Emit): Implement.
20338         (New::Resolve): Implement.
20339         (MemberAccess:Resolve): Implement.
20340         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20341         to track instances.
20342         (FieldExpr::Resolve): Set type.
20343
20344         * support.cs: Handle empty arguments.
20345                 
20346         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20347         SimpleLookup): Auxiliary routines to help parse a qualifier
20348         identifier.  
20349
20350         Update qualifier_identifier rule.
20351
20352         * codegen.cs: Removed debugging messages.
20353
20354         * class.cs: Make this a global thing, this acts just as a "key" to
20355         objects that we might have around.
20356
20357         (Populate): Only initialize method_builders_to_methods once.
20358
20359         * expression.cs (PropertyExpr): Initialize type from the
20360         PropertyType. 
20361
20362         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20363         Resolve pattern.  Attempt to implicitly convert value to boolean.
20364         Emit code.
20365
20366         * expression.cs: Set the type for the int32/int32 argument case.
20367         (Binary::ResolveOperator): Set the return type to boolean for
20368         comparission operators
20369
20370         * typemanager.cs: Remove debugging print code.
20371
20372         (Invocation::Resolve): resolve type.
20373
20374         * class.cs: Allocate a MemberInfo of the correct size, as the code
20375         elsewhere depends on the test to reflect the correct contents.
20376
20377         (Method::) Keep track of parameters, due to System.Reflection holes
20378
20379         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20380         mapping here.
20381
20382         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20383         of the exact size and return that.
20384
20385         (Class::LookupMethodByBuilder): New function that maps
20386         MethodBuilders to its methods.  Required to locate the information
20387         on methods because System.Reflection bit us again.
20388
20389         * support.cs: New file, contains an interface ParameterData and
20390         two implementations: ReflectionParameters and InternalParameters
20391         used to access Parameter information.  We will need to grow this
20392         as required.
20393
20394         * expression.cs (Invocation::GetParameterData): implement a cache
20395         and a wrapper around the ParameterData creation for methods. 
20396         (Invocation::OverloadResolve): Use new code.
20397
20398 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20399
20400         * class.cs (TypeContainer::EmitField): Remove and move into 
20401         (Field::Define): here and modify accordingly.
20402         (Field.FieldBuilder): New member.
20403         (TypeContainer::Populate): Update accordingly.
20404         (TypeContainer::FindMembers): Implement.
20405
20406 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20407
20408         * statement.cs: (VariableInfo::VariableType): New field to be
20409         initialized with the full type once it is resolved. 
20410
20411 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20412
20413         * parameter.cs (GetParameterInfo): Use a type cache to compute
20414         things only once, and to reuse this information
20415
20416         * expression.cs (LocalVariableReference::Emit): Implement.
20417         (OpcodeCast::Emit): fix.
20418
20419         (ParameterReference::Resolve): Implement.
20420         (ParameterReference::Emit): Implement.
20421
20422         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20423         that are expressions need to stay as Expressions.
20424
20425         * typemanager.cs (CSharpName): Returns the C# name of a type if
20426         possible. 
20427
20428         * expression.cs (Expression::ConvertImplicit): New function that
20429         implements implicit type conversions.
20430
20431         (Expression::ImplicitReferenceConversion): Implements implicit
20432         reference conversions.
20433
20434         (EmptyCast): New type for transparent casts.
20435
20436         (OpcodeCast): New type for casts of types that are performed with
20437         a sequence of bytecodes.
20438
20439         (BoxedCast): New type used for casting value types into reference
20440         types.  Emits a box opcode.
20441
20442         (Binary::DoNumericPromotions): Implements numeric promotions of
20443         and computation of the Binary::Type.
20444
20445         (Binary::EmitBranchable): Optimization.
20446
20447         (Binary::Emit): Implement code emission for expressions.
20448
20449         * typemanager.cs (TypeManager): Added two new core types: sbyte
20450         and byte.
20451
20452 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20453
20454         * class.cs (TypeContainer::FindMembers): Method which does exactly
20455         what Type.FindMembers does, only we don't have to use reflection. No
20456         implementation yet.
20457
20458         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20459         typecontainer objects as we need to get at them.
20460         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20461
20462         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20463         typecontainer object.
20464
20465         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20466         of just a Report object.
20467
20468 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20469
20470         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20471         "remove_"
20472         (TypeContainer::Populate): Now define the delegates of the type too.
20473         (TypeContainer.Delegates): Property to access the list of delegates defined
20474         in the type.
20475
20476         * delegates.cs (Delegate::Define): Implement partially.
20477
20478         * modifiers.cs (TypeAttr): Handle more flags.
20479
20480 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20481
20482         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20483         and not <=
20484         (Operator::Define): Re-write logic to get types by using the LookupType method
20485         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20486         (Indexer::Define): Ditto.
20487         (Event::Define): Ditto.
20488         (Property::Define): Ditto.
20489
20490 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20491
20492         * class.cs (TypeContainer::Populate): Now define operators too. 
20493         (TypeContainer.Operators): New property to access the list of operators
20494         in a type.
20495         (Operator.OperatorMethodBuilder): New member to hold the method builder
20496         for the operator we are defining.
20497         (Operator::Define): Implement.
20498
20499 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20500
20501         * class.cs (Event::Define): Make the prefixes of the accessor methods
20502         addOn_ and removeOn_ 
20503
20504         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20505         of the location being passed in too. Ideally, this should go later since all
20506         error reporting should be done through the Report object.
20507
20508         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20509         (Populate): Iterate thru the indexers we have and define them too.
20510         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20511         for the get and set accessors.
20512         (Indexer::Define): Implement.
20513
20514 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20515
20516         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20517         my previous implementation, did not work.
20518
20519         * typemanager.cs: Add a couple of missing types (the longs).
20520
20521         * literal.cs: Use TypeManager.bool_type instead of getting it.
20522
20523         * expression.cs (EventExpr): New kind of expressions.
20524         (Expressio::ExprClassFromMemberInfo): finish
20525
20526 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20527
20528         * assign.cs: Emit stores to static fields differently.
20529
20530 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20531
20532         * Merge in changes and adjust code to tackle conflicts. Backed out my
20533         code in Assign::Resolve ;-) 
20534
20535 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20536
20537         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20538         instead Report.Error and also pass in the location.
20539         (CSharpParser::Lexer): New readonly property to return the reference
20540         to the Tokenizer object.
20541         (declare_local_variables): Use Report.Error with location instead of plain 
20542         old error.
20543         (CheckDef): Ditto.
20544
20545         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20546         (Operator.CheckBinaryOperator): Ditto.
20547
20548         * cs-parser.jay (operator_declarator): Update accordingly.
20549
20550         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20551         (CheckBinaryOperator): Same here.
20552
20553         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20554         on the name without any prefixes of namespace names etc. This is because we
20555         already might have something already fully qualified like 
20556         'System.Console.WriteLine'
20557
20558         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20559
20560 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20561
20562         * cs-tokenizer.cs (location): Return a string which also contains
20563         the file name.
20564
20565         * expression.cs (ElementAccess): New class for expressions of the
20566         type 'element access.'
20567         (BaseAccess): New class for expressions of the type 'base access.'
20568         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20569         respectively.
20570
20571         * cs-parser.jay (element_access): Implement action.
20572         (base_access): Implement actions.
20573         (checked_expression, unchecked_expression): Implement.
20574
20575         * cs-parser.jay (local_variable_type): Correct and implement.
20576         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20577
20578         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20579
20580         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20581         name and the specifiers.
20582
20583         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20584
20585         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20586         making them all public ;-)
20587
20588         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20589         class anyways.
20590
20591 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20592
20593         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20594         PropertyExprs.
20595         (FieldExpr, PropertyExprs): New resolved expressions.
20596         (SimpleName::MemberStaticCheck): Perform static checks for access
20597         to non-static fields on static methods. Maybe this should be
20598         generalized for MemberAccesses. 
20599         (SimpleName::ResolveSimpleName): More work on simple name
20600         resolution. 
20601
20602         * cs-parser.jay (primary_expression/qualified_identifier): track
20603         the parameter index.
20604
20605         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20606         (EmitContext::EmitBoolExpression): Chain to expression generation
20607         instead of temporary hack.
20608         (::EmitStatementExpression): Put generic expression code generation.
20609
20610         * assign.cs (Assign::Emit): Implement variable assignments to
20611         local variables, parameters and fields.
20612
20613 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20614
20615         * statement.cs (Block::GetVariableInfo): New method, returns the
20616         VariableInfo for a variable name in a block.
20617         (Block::GetVariableType): Implement in terms of GetVariableInfo
20618
20619         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20620         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20621
20622 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20623
20624         * cs-parser.jay (operator_declaration): Continue on my quest : update
20625         to take attributes argument.
20626         (event_declaration): Ditto.
20627         (enum_declaration): Ditto.
20628         (indexer_declaration): Ditto.
20629
20630         * class.cs (Operator::Operator): Update constructor accordingly.
20631         (Event::Event): Ditto.
20632
20633         * delegate.cs (Delegate::Delegate): Same here.
20634
20635         * enum.cs (Enum::Enum): Same here.
20636
20637 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20638
20639         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20640
20641         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20642
20643         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20644         being passed around as an arraylist.
20645         (Attributes::AddAttribute): Method to add attribute sections.
20646
20647         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20648         (struct_declaration): Update accordingly.
20649         (constant_declaration): Update.
20650         (field_declaration): Update.
20651         (method_header): Update.
20652         (fixed_parameter): Update.
20653         (parameter_array): Ditto.
20654         (property_declaration): Ditto.
20655         (destructor_declaration): Ditto.
20656
20657         * class.cs (Struct::Struct): Update constructors accordingly.
20658         (Class::Class): Ditto.
20659         (Field::Field): Ditto.
20660         (Method::Method): Ditto.
20661         (Property::Property): Ditto.
20662         (TypeContainer::OptAttribute): update property's return type.
20663
20664         * interface.cs (Interface.opt_attributes): New member.
20665         (Interface::Interface): Update to take the extra Attributes argument.
20666
20667         * parameter.cs (Parameter::Parameter): Ditto.
20668
20669         * constant.cs (Constant::Constant): Ditto.
20670
20671         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20672         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20673         the attributes as a parameter.
20674         (InterfaceProperty): Update constructor call.
20675         (InterfaceEvent): Ditto.
20676         (InterfaceMethod): Ditto.
20677         (InterfaceIndexer): Ditto.
20678
20679         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20680         pass the attributes too.
20681         (interface_event_declaration): Ditto.
20682         (interface_property_declaration): Ditto.
20683         (interface_method_declaration): Ditto.
20684         (interface_declaration): Ditto.
20685
20686 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20687
20688         * class.cs (Method::Define): Track the "static Main" definition to
20689         create an entry point. 
20690
20691         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20692         EntryPoint if we find it. 
20693
20694         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20695         (EmitContext::ig): Make this variable public.
20696
20697         * driver.cs: Make the default output file be the first file name
20698         with the .exe extension.  
20699
20700         Detect empty compilations
20701
20702         Handle various kinds of output targets.  Handle --target and
20703         rename -t to --dumper.
20704
20705         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20706         methods inherited from Expression return now an Expression.  This
20707         will is used during the tree rewriting as we resolve them during
20708         semantic analysis.
20709
20710         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20711         the spec.  Missing entirely is the information about
20712         accessability of elements of it.
20713
20714         (Expression::ExprClassFromMemberInfo): New constructor for
20715         Expressions that creates a fully initialized Expression based on
20716         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20717         a Type.
20718
20719         (Invocation::Resolve): Begin implementing resolution of invocations.
20720
20721         * literal.cs (StringLiteral):  Implement Emit.
20722
20723 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20724
20725         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20726         member.
20727
20728 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20729
20730         * cs-parser.jay (attribute_arguments): Implement actions.
20731         (attribute): Fix bug in production. Implement action.
20732         (attribute_list): Implement.
20733         (attribute_target): Implement.
20734         (attribute_target_specifier, opt_target_specifier): Implement
20735         (CheckAttributeTarget): New method to check if the attribute target
20736         is valid.
20737         (attribute_section): Implement.
20738         (opt_attributes): Implement.
20739
20740         * attribute.cs : New file to handle attributes.
20741         (Attribute): Class to hold attribute info.
20742
20743         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20744         (attribute_section): Modify production to use 2 different rules to 
20745         achieve the same thing. 1 s/r conflict down !
20746         Clean out commented, useless, non-reducing dimension_separator rules.
20747
20748         * class.cs (TypeContainer.attributes): New member to hold list
20749         of attributes for a type.
20750         (Struct::Struct): Modify to take one more argument, the attribute list.
20751         (Class::Class): Ditto.
20752         (Field::Field): Ditto.
20753         (Method::Method): Ditto.
20754         (Property::Property): Ditto.
20755
20756         * cs-parser.jay (struct_declaration): Update constructor call to
20757         pass in the attributes too.
20758         (class_declaration): Ditto.
20759         (constant_declaration): Ditto.
20760         (field_declaration): Ditto.
20761         (method_header): Ditto.
20762         (fixed_parameter): Ditto.
20763         (parameter_array): Ditto.
20764         (property_declaration): Ditto.
20765
20766         * constant.cs (Constant::Constant): Update constructor similarly.
20767         Use System.Collections.
20768
20769         * parameter.cs (Parameter::Parameter): Update as above.
20770
20771 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20772
20773         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20774         (TypeContainer.delegates): New member to hold list of delegates.
20775
20776         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20777         this time as I seem to be on crack ;-)
20778
20779 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20780
20781         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20782         tell whether an identifier represents a namespace.
20783
20784         * expression.cs (NamespaceExpr): A namespace expression, used only
20785         temporarly during expression resolution.
20786         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
20787         utility functions to resolve names on expressions.
20788
20789 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
20790
20791         * codegen.cs: Add hook for StatementExpressions. 
20792
20793         * class.cs: Fix inverted test for static flag in methods.
20794
20795 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20796
20797         * class.cs (Operator::CheckUnaryOperator): Correct error number used
20798         to make it coincide with MS' number.
20799         (Operator::CheckBinaryOperator): Ditto.
20800
20801         * ../errors/errors.txt : Remove error numbers added earlier.
20802
20803         * ../errors/cs1019.cs : Test case for error # 1019
20804
20805         * ../errros/cs1020.cs : Test case for error # 1020
20806
20807         * cs-parser.jay : Clean out commented cruft.
20808         (dimension_separators, dimension_separator): Comment out. Ostensibly not
20809         used anywhere - non-reducing rule.
20810         (namespace_declarations): Non-reducing rule - comment out.
20811
20812         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
20813         with TypeContainer::AddEnum.
20814
20815         * delegate.cs : New file for delegate handling classes.
20816         (Delegate): Class for declaring delegates.
20817
20818         * makefile : Update.
20819
20820         * cs-parser.jay (delegate_declaration): Implement.
20821
20822 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
20823
20824         * class.cs (Event::Define): Implement.
20825         (Event.EventBuilder): New member.
20826
20827         * class.cs (TypeContainer::Populate): Update to define all enums and events
20828         we have.
20829         (Events): New property for the events arraylist we hold. Shouldn't we move to using
20830         readonly fields for all these cases ?
20831
20832 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20833
20834         * class.cs (Property): Revamp to use the convention of making fields readonly.
20835         Accordingly modify code elsewhere.
20836
20837         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
20838         the Define method of the Property class.
20839
20840         * class.cs : Clean up applied patch and update references to variables etc. Fix 
20841         trivial bug.
20842         (TypeContainer::Populate): Update to define all the properties we have. Also
20843         define all enumerations.
20844
20845         * enum.cs (Define): Implement.
20846
20847 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
20848
20849         * cs-parser.jay (overloadable_operator): The semantic value is an
20850         enum of the Operator class.
20851         (operator_declarator): Implement actions.
20852         (operator_declaration): Implement.
20853
20854         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
20855         validity of definitions.
20856         (Operator::CheckBinaryOperator): Static method to check for binary operators
20857         (TypeContainer::AddOperator): New method to add an operator to a type.
20858
20859         * cs-parser.jay (indexer_declaration): Added line to actually call the
20860         AddIndexer method so it gets added ;-)
20861
20862         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
20863         already taken care of by the MS compiler ?  
20864
20865 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20866
20867         * class.cs (Operator): New class for operator declarations.
20868         (Operator::OpType): Enum for the various operators.
20869
20870 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
20871
20872         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
20873         ostensibly handle this in semantic analysis.
20874
20875         * cs-parser.jay (general_catch_clause): Comment out
20876         (specific_catch_clauses, specific_catch_clause): Ditto.
20877         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
20878         (catch_args, opt_catch_args): New productions.
20879         (catch_clause): Rewrite to use the new productions above
20880         (catch_clauses): Modify accordingly.
20881         (opt_catch_clauses): New production to use in try_statement
20882         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
20883         and re-write the code in the actions to extract the specific and
20884         general catch clauses by being a little smart ;-)
20885
20886         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
20887         Hooray, try and catch statements parse fine !
20888
20889 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20890
20891         * statement.cs (Block::GetVariableType): Fix logic to extract the type
20892         string from the hashtable of variables.
20893
20894         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
20895         I end up making that mistake ;-)
20896         (catch_clauses): Fixed gross error which made Key and Value of the 
20897         DictionaryEntry the same : $1 !!
20898
20899 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20900
20901         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20902
20903         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20904         when the add and remove accessors are specified. 
20905
20906 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20907
20908         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20909         information about indexer_declarator.
20910         (indexer_declarator): Implement actions.
20911         (parsing_indexer): New local boolean used to keep track of whether
20912         we are parsing indexers or properties. This is necessary because 
20913         implicit_parameters come into picture even for the get accessor in the 
20914         case of an indexer.
20915         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20916
20917         * class.cs (Indexer): New class for indexer declarations.
20918         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20919         (TypeContainer::indexers): New member to hold list of indexers for the
20920         type.
20921
20922 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20923
20924         * cs-parser.jay (add_accessor_declaration): Implement action.
20925         (remove_accessor_declaration): Implement action.
20926         (event_accessors_declaration): Implement
20927         (variable_declarators): swap statements for first rule - trivial.
20928
20929         * class.cs (Event): New class to hold information about event
20930         declarations.
20931         (TypeContainer::AddEvent): New method to add an event to a type
20932         (TypeContainer::events): New member to hold list of events.
20933
20934         * cs-parser.jay (event_declaration): Implement actions.
20935
20936 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20937
20938         * cs-parser.jay (dim_separators): Implement. Make it a string
20939         concatenating all the commas together, just as they appear.
20940         (opt_dim_separators): Modify accordingly
20941         (rank_specifiers): Update accordingly. Basically do the same
20942         thing - instead, collect the brackets here.
20943         (opt_rank_sepcifiers): Modify accordingly.
20944         (array_type): Modify to actually return the complete type string
20945         instead of ignoring the rank_specifiers.
20946         (expression_list): Implement to collect the expressions
20947         (variable_initializer): Implement. We make it a list of expressions
20948         essentially so that we can handle the array_initializer case neatly too.
20949         (variable_initializer_list): Implement.
20950         (array_initializer): Make it a list of variable_initializers
20951         (opt_array_initializer): Modify accordingly.
20952
20953         * expression.cs (New::NType): Add enumeration to help us
20954         keep track of whether we have an object/delegate creation
20955         or an array creation.
20956         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20957         members to hold data about array creation.
20958         (New:New): Modify to update NewType
20959         (New:New): New Overloaded contructor for the array creation
20960         case.
20961
20962         * cs-parser.jay (array_creation_expression): Implement to call
20963         the overloaded New constructor.
20964
20965 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20966
20967         * class.cs (TypeContainer::Constructors): Return member
20968         constructors instead of returning null.
20969
20970 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20971
20972         * typemanager.cs (InitCoreTypes): Initialize the various core
20973         types after we have populated the type manager with the user
20974         defined types (this distinction will be important later while
20975         compiling corlib.dll)
20976
20977         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20978         on Expression Classification.  Now all expressions have a method
20979         `Resolve' and a method `Emit'.
20980
20981         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20982         generation from working.     Also add some temporary debugging
20983         code. 
20984
20985 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20986
20987         * codegen.cs: Lots of code generation pieces.  This is only the
20988         beginning, will continue tomorrow with more touches of polish.  We
20989         handle the fundamentals of if, while, do, for, return.  Others are
20990         trickier and I need to start working on invocations soon.
20991
20992         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20993         s.InitStatement. 
20994
20995         * codegen.cs (EmitContext): New struct, used during code
20996         emission to keep a context.   Most of the code generation will be
20997         here. 
20998
20999         * cs-parser.jay: Add embedded blocks to the list of statements of
21000         this block.  So code generation proceeds in a top down fashion.
21001
21002 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21003
21004         * statement.cs: Add support for multiple child blocks.
21005
21006 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21007
21008         * codegen.cs (EmitCode): New function, will emit the code for a
21009         Block of code given a TypeContainer and its ILGenerator. 
21010
21011         * statement.cs (Block): Standard public readonly optimization.
21012         (Block::Block constructors): Link children. 
21013         (Block::Child): Child Linker.
21014         (Block::EmitVariables): Emits IL variable declarations.
21015
21016         * class.cs: Drop support for MethodGroups here, delay until
21017         Semantic Analysis.
21018         (Method::): Applied the same simplification that I did before, and
21019         move from Properties to public readonly fields.
21020         (Method::ParameterTypes): Returns the parameter types for the
21021         function, and implements a cache that will be useful later when I
21022         do error checking and the semantic analysis on the methods is
21023         performed.
21024         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21025         and made a method, optional argument tells whether this is a class
21026         or a structure to apply the `has-this' bit.
21027         (Method::GetCallingConvention): Implement, returns the calling
21028         convention. 
21029         (Method::Define): Defines the type, a second pass is performed
21030         later to populate the methods.
21031
21032         (Constructor::ParameterTypes): implement a cache similar to the
21033         one on Method::ParameterTypes, useful later when we do semantic
21034         analysis. 
21035
21036         (TypeContainer::EmitMethod):  New method.  Emits methods.
21037
21038         * expression.cs: Removed MethodGroup class from here.
21039
21040         * parameter.cs (Parameters::GetCallingConvention): new method.
21041
21042 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * class.cs (TypeContainer::Populate): Drop RootContext from the
21045         argument. 
21046
21047         (Constructor::CallingConvention): Returns the calling convention.
21048         (Constructor::ParameterTypes): Returns the constructor parameter
21049         types. 
21050
21051         (TypeContainer::AddConstructor): Keep track of default constructor
21052         and the default static constructor.
21053
21054         (Constructor::) Another class that starts using `public readonly'
21055         instead of properties. 
21056
21057         (Constructor::IsDefault): Whether this is a default constructor. 
21058
21059         (Field::) use readonly public fields instead of properties also.
21060
21061         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21062         track of static constructors;  If none is used, turn on
21063         BeforeFieldInit in the TypeAttributes. 
21064
21065         * cs-parser.jay (opt_argument_list): now the return can be null
21066         for the cases where there are no arguments. 
21067
21068         (constructor_declarator): If there is no implicit `base' or
21069         `this', then invoke the default parent constructor. 
21070
21071         * modifiers.cs (MethodAttr): New static function maps a set of
21072         modifiers flags into a MethodAttributes enum
21073         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21074         MethodAttr, TypeAttr to represent the various mappings where the
21075         modifiers are used.
21076         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21077
21078 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21079
21080         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21081         method arguments.
21082
21083         * interface.cs (PopulateIndexer): Implemented the code generator
21084         for interface indexers.
21085
21086 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21087
21088         * interface.cs (InterfaceMemberBase): Now we track the new status
21089         here.  
21090
21091         (PopulateProperty): Implement property population.  Woohoo!  Got
21092         Methods and Properties going today. 
21093
21094         Removed all the properties for interfaces, and replaced them with
21095         `public readonly' fields. 
21096
21097 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21098
21099         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21100         initialize their hashtables/arraylists only when they are needed
21101         instead of doing this always.
21102
21103         * parameter.cs: Handle refs and out parameters.
21104
21105         * cs-parser.jay: Use an ArrayList to construct the arguments
21106         instead of the ParameterCollection, and then cast that to a
21107         Parameter[] array.
21108
21109         * parameter.cs: Drop the use of ParameterCollection and use
21110         instead arrays of Parameters.
21111
21112         (GetParameterInfo): Use the Type, not the Name when resolving
21113         types. 
21114
21115 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21116
21117         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21118         and instead use public readonly fields.
21119
21120         * class.cs: Put back walking code for type containers.
21121
21122 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21123
21124         * class.cs (MakeConstant): Code to define constants.
21125
21126         * rootcontext.cs (LookupType): New function.  Used to locate types 
21127
21128
21129 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21130
21131         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21132         this System.Reflection code is.  Kudos to Microsoft
21133
21134         * typemanager.cs: Implement a type cache and avoid loading all
21135         types at boot time.  Wrap in LookupType the internals.  This made
21136         the compiler so much faster.  Wow.  I rule!
21137
21138         * driver.cs: Make sure we always load mscorlib first (for
21139         debugging purposes, nothing really important).
21140
21141         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21142         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21143
21144         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21145         on namespaces that have been imported using the `using' keyword.
21146
21147         * class.cs (TypeContainer::TypeAttr): Virtualize.
21148         (Class::TypeAttr): Return attributes suitable for this bad boy.
21149         (Struct::TypeAttr): ditto.
21150         Handle nested classes.
21151         (TypeContainer::) Remove all the type visiting code, it is now
21152         replaced with the rootcontext.cs code
21153
21154         * rootcontext.cs (GetClassBases): Added support for structs. 
21155
21156 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21157
21158         * interface.cs, statement.cs, class.cs, parameter.cs,
21159         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21160         Drop use of TypeRefs, and use strings instead.
21161
21162 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21163
21164         * rootcontext.cs: 
21165
21166         * class.cs (Struct::Struct): set the SEALED flags after
21167         checking the modifiers.
21168         (TypeContainer::TypeAttr): new property, returns the
21169         TypeAttributes for a class.  
21170
21171         * cs-parser.jay (type_list): Oops, list production was creating a
21172         new list of base types.
21173
21174         * rootcontext.cs (StdLib): New property.
21175         (GetInterfaceTypeByName): returns an interface by type name, and
21176         encapsulates error handling here.
21177         (GetInterfaces): simplified.
21178         (ResolveTree): Encapsulated all the tree resolution here.
21179         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21180         types. 
21181
21182         * driver.cs: Add support for --nostdlib, to avoid loading the
21183         default assemblies.
21184         (Main): Do not put tree resolution here. 
21185
21186         * rootcontext.cs: Beginning of the class resolution.
21187
21188 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21189
21190         * rootcontext.cs: Provide better error reporting. 
21191
21192         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21193
21194         * rootcontext.cs (CreateInterface): Handle the case where there
21195         are no parent interfaces.
21196
21197         (CloseTypes): Routine to flush types at the end.
21198         (CreateInterface): Track types.
21199         (GetInterfaces): Returns an array of Types from the list of
21200         defined interfaces.
21201
21202         * typemanager.c (AddUserType): Mechanism to track user types (puts
21203         the type on the global type hash, and allows us to close it at the
21204         end). 
21205
21206 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21207
21208         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21209         RecordInterface instead.
21210
21211         * cs-parser.jay: Updated to reflect changes above.
21212
21213         * decl.cs (Definition): Keep track of the TypeBuilder type that
21214         represents this type here.  Not sure we will use it in the long
21215         run, but wont hurt for now.
21216
21217         * driver.cs: Smaller changes to accomodate the new code.
21218
21219         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21220         when done. 
21221
21222         * rootcontext.cs (CreateInterface):  New method, used to create
21223         the System.TypeBuilder type for interfaces.
21224         (ResolveInterfaces): new entry point to resolve the interface
21225         hierarchy. 
21226         (CodeGen): Property, used to keep track of the code generator.
21227
21228 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21229
21230         * cs-parser.jay: Add a second production for delegate_declaration
21231         with `VOID'.
21232
21233         (enum_body): Put an opt_comma here instead of putting it on
21234         enum_body or enum_member_declarations so we can handle trailing
21235         commas on enumeration members.  Gets rid of a shift/reduce.
21236
21237         (type_list): Need a COMMA in the middle.
21238
21239         (indexer_declaration): Tell tokenizer to recognize get/set
21240
21241         * Remove old targets.
21242
21243         * Re-add the parser target.
21244
21245 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21246
21247         * cs-parser.jay: Add precendence rules for a number of operators
21248         ot reduce the number of shift/reduce conflicts in the grammar.
21249
21250 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21251
21252         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21253         and put it here.
21254
21255         Get rid of old crufty code.
21256
21257         * rootcontext.cs: Use this to keep track of the parsed
21258         representation and the defined types available to the program. 
21259
21260         * gen-treedump.cs: adjust for new convention.
21261
21262         * type.cs: Split out the type manager, and the assembly builder
21263         from here. 
21264
21265         * typemanager.cs: the type manager will live here now.
21266
21267         * cil-codegen.cs: And the code generator here. 
21268
21269 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21270
21271         * makefile: Fixed up for easy making.
21272
21273 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21274
21275         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21276         the 
21277
21278         (unary_expression): Expand pre_increment_expression and
21279         post_decrement_expression to reduce a shift/reduce.
21280
21281 2001-07-11  Simon Cozens
21282
21283         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21284
21285         Improve allow_keyword_as_indent name.
21286
21287 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21288
21289         * Adjustments for Beta2. 
21290
21291 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21292
21293         * decl.cs: Added `Define' abstract method.
21294         (InTransit): new property, used to catch recursive definitions. 
21295
21296         * interface.cs: Implement `Define'. 
21297
21298         * modifiers.cs: Map Modifiers.constants to
21299         System.Reflection.TypeAttribute flags.
21300
21301         * class.cs: Keep track of types and user-defined types.
21302         (BuilderInit): New method for creating an assembly
21303         (ResolveType): New function to launch the resolution process, only
21304         used by interfaces for now.
21305
21306         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21307         that are inserted into the name space. 
21308
21309 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21310
21311         * ARGH.  I have screwed up my tree so many times due to the use of
21312         rsync rather than using CVS.  Going to fix this at once. 
21313
21314         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21315         load types.
21316
21317 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21318
21319         * Experiment successful: Use System.Type rather that our own
21320         version of Type.  
21321
21322 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21323
21324         * cs-parser.jay: Removed nsAliases from here.
21325
21326         Use new namespaces, handle `using XXX;' 
21327
21328         * namespace.cs: Reimplemented namespace handling, use a recursive
21329         definition of the class.  Now we can keep track of using clauses
21330         and catch invalid using clauses.
21331
21332 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * gen-treedump.cs: Adapted for all the renaming.
21335
21336         * expression.cs (Expression): this class now has a Type property
21337         which returns an expression Type.
21338
21339         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21340         `Type', as this has a different meaning now in the base
21341
21342 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21343
21344         * interface.cs, class.cs: Removed from all the sources the
21345         references to signature computation, as we can not do method
21346         signature computation during the parsing time, as we are not
21347         trying to solve at that point distinguishing:
21348
21349         class X {
21350                 void a (Blah x) {}
21351                 void a (NS.Blah x) {}
21352         }
21353
21354         Which depending on the context might be valid or not, as we do not
21355         know if Blah is the same thing as NS.Blah at that point.
21356
21357         * Redid everything so the code uses TypeRefs now instead of
21358         Types.  TypeRefs are just temporary type placeholders, that need
21359         to be resolved.  They initially have a pointer to a string and the
21360         current scope in which they are used.  This is used later by the
21361         compiler to resolve the reference to an actual Type. 
21362
21363         * DeclSpace is no longer a CIR.Type, and neither are
21364         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21365         are all DeclSpaces, but no Types. 
21366
21367         * type.cs (TypeRefManager): This implements the TypeRef manager,
21368         which keeps track of all the types that need to be resolved after
21369         the parsing has finished. 
21370
21371 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * ARGH.  We are going to have to store `foreach' as a class rather
21374         than resolving it, as we need to verify error 1579 after name
21375         resolution.   *OR* we could keep a flag that says `This request to
21376         IEnumerator comes from a foreach statement' which we can then use
21377         to generate the error.
21378
21379 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21380
21381         * class.cs (TypeContainer.AddMethod): we now add methods to the
21382         MethodGroup instead of the method hashtable.  
21383
21384         * expression.cs: Add MethodGroup abstraction, which gets us one
21385         step closer to the specification in the way we handle method
21386         declarations.  
21387
21388         * cs-parser.jay (primary_expression): qualified_identifier now
21389         tried to match up an identifier to a local variable reference or
21390         to a parameter reference.
21391
21392         current_local_parameters is now a parser global variable that
21393         points to the current parameters for the block, used during name
21394         lookup.
21395
21396         (property_declaration): Now creates an implicit `value' argument to
21397         the set accessor.
21398
21399 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21400
21401         * parameter.cs: Do not use `param' arguments as part of the
21402         signature, per the spec.
21403
21404 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21405
21406         * decl.cs: Base class for classes, structs and interfaces.  This
21407         is the "Declaration Space" 
21408
21409         * cs-parser.jay: Use CheckDef for checking declaration errors
21410         instead of having one on each function.
21411
21412         * class.cs: Factor out some code for handling error handling in
21413         accordance to the "Declarations" section in the "Basic Concepts"
21414         chapter in the ECMA C# spec.
21415
21416         * interface.cs: Make all interface member classes derive from
21417         InterfaceMemberBase.
21418
21419 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21420
21421         * Many things: all interfaces are parsed and generated in
21422         gen-treedump.  Support for member variables, constructors,
21423         destructors, properties, constants is there.
21424
21425         Beginning of the IL backend, but very little done, just there for
21426         testing purposes. 
21427
21428 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21429
21430         * cs-parser.jay: Fix labeled statement.
21431
21432         * cs-tokenizer.cs (escape): Escape " and ' always.
21433         ref_line, ref_name: keep track of the line/filename as instructed
21434         by #line by the compiler.
21435         Parse #line.
21436
21437 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21438
21439         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21440         to match the values in System.CodeDOM.
21441
21442         Divid renamed to Divide.
21443
21444         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21445         statements. 
21446         (Statements.set): remove.
21447
21448         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21449         statements. 
21450
21451         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21452         falseStatements always have valid values. 
21453
21454         * cs-parser.jay: Use System.CodeDOM now.
21455