2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * doc.cs : use TypeManager.FindMembers() instead of (possible)
4           TypeBuilder.FindMembers() and filter overriden base members out.
5           Fixed bug #76990.
6
7 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8
9         * doc.cs : ref/out parameters are represented as '@' (instead of
10           '&' in type FullName). Fixed bug #76630 (additionally crefs).
11
12 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
13
14         * doc.cs : when there was no '.' in cref to methods in doc comment,
15           then parameters were missing in the output. Fixed bug #76691.
16
17 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
18
19         * driver.cs : don't output docs when there is an error.
20           Fixed bug #76693.
21
22 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
23
24         * doc.cs :
25           Now it should detect indexers. Fixed primary concern in bug #76685.
26           Fixed CS0419 message to not show the identical member signature in
27           the message.
28
29 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
30
31         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
32           instead of Type.FindMembers() since it does not handle events.
33           Fixed bug #71604.
34
35 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
36
37         * codegen.cs: Fixed typo (speficied -> specified).
38
39 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
40
41         Fix #76369.
42         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
43
44 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
45
46         * attribute.cs: Changed error message.
47
48         * cs-tokenizer.cs: One more check.
49
50 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
51
52         * statement.cs (Block.Resolve): Ignore empty statement.
53
54 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
55
56         * report.cs: Made error/warning methods more strict to avoid
57         their misuse.
58
59         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
60         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
61         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
62         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
63
64 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
65
66         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
67         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
68
69         * class.cs (TypeContainer.IsComImport): New property.
70         (Constructor.Define): Create proper ctor for ComImport types.
71
72         * expression.cs (New.CheckComImport): Fixed.
73
74 2005-11-07  Miguel de Icaza  <miguel@novell.com>
75
76         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
77         that a parameter has been captured does not mean that we do not
78         have to do the rest of the processing.  This fixes the second part
79         of #76592.  If there was another anonymous method capturing
80         values in the past, the Scope would never be set for the second
81         method that captured the same parameter.
82
83         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
84         properly manipulate the stack.   Second part of fix for #76592.
85
86         * expression.cs (New): Add support for invoking "new" on
87         interfaces that have been flagged with the ComImport attribute and
88         the CoClass.  Fixes #76637 
89
90         * statement.cs (Try.DoEmit): When a variable is captured, do not
91         try to emit the vi.LocalBuilder variable as it has been captured.
92         Create a temporary variable and store the results on the
93         FieldBuilder.  Fixes #76642
94
95 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
96
97         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
98
99         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
100
101         * expression.cs (Binary.DoResolve): Added && optimalization.
102     
103         * typemanager.cs (AddUserType): Removed useless argument.
104
105 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
106
107         * statement.cs (Block.variables): Uses ListDictionary.
108
109 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
110
111         Fix #75969.
112         * class.cs (PartialContainer.EmitType): Customized to emit
113         security attributes.
114         (ClassPart.ApplyAttributeBuilder): Transform security attribute
115         for partial classes.
116
117 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
118
119         Fix #76599.
120         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
121         access has to be fixed.
122         
123         * typemanager.cs (IsUnmanagedType): Wrong common field type.
124
125 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
126
127         Fix #76590.
128         * ecore.cs (NullCast.Reduce): Implemented.
129
130         * expression.cs (ArrayCreation.CheckIndices): Correcly check
131         constant type.
132         
133         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
134         properly.
135         (Foreach.Resolve): Catch null properly.
136
137 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
138  
139         * cs-tokenizer.cs: Warning text fix.
140
141         * driver.cs: AllWarningNumbers exposed on public interface.
142
143         * report.cs (): Reviewed warning numbers.
144         (IsValidWarning): Use binary search.
145
146 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
147  
148         * driver.cs: Implemeted resource visibility.
149         (Resources): New class for code sharing between /res: and
150         /linkres:
151  
152 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
153
154         Fix #76568.
155         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
156         folding.
157         
158         * convert (Convert.ImplicitReferenceConversion): NullCast holds
159         contants only.
160         
161         * ecore.cs (NullCast): Child is contant only.
162         
163         * literal.cs (NullLiteral.Reduce): null can be converted to any
164         reference type.
165
166 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
167
168         * driver.cs: Use Encoding.Default as default code page instead
169           of ISO-28591.
170
171 2005-10-27  Raja R Harinath  <rharinath@novell.com>
172
173         Fix #76085.
174         * expression.cs (Invocation.Error_InvalidArguments): Handle
175         __arglist parameters.
176         (Invocation.VerifyArgumentsCompat): Likewise.
177         * support.cs (ReflectionParameters.GetSignatureForError): Print
178         __arglist parameters.
179         (InternalParamters.GetSignatureForError): Likewise.
180         * parameter.cs (Parameters.GetSignatureForError): Likewise.
181
182 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
183
184         * attribute.cs (GetPropertyValue): Made public.
185
186         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
187         Resolve.
188         Add new property WrapNonExceptionThrows to handle 2.0 assembly
189         attribute.
190         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
191         is not defined.
192         
193         * driver.cs: Reflect method name change.
194         
195         * statement.cs (Try.Resolve): Warn when try has both general
196         exception handlers.
197         
198         * typemanager.cs: runtime_compatibility_attr_type new predefined
199         type.
200
201 2005-10-26  Raja R Harinath  <harinath@gmail.com>
202
203         Fix #76419.
204         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
205         treat it as an empty parameter list.
206
207 2005-10-26  Raja R Harinath  <rharinath@novell.com>
208
209         Fix #76271.     
210         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
211         ResolveAsTypeStep silent.
212         * statement.cs (Block.AddConstant): Mark block as used.
213         (Block.ResolveMeta): Avoid piling on error messages
214         if a constant initializer resolution fails.
215
216 2005-10-25  Raja R Harinath  <rharinath@novell.com>
217
218         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
219         Remove.
220         (NamespaceEntry.VerifyAllUsing): New.
221         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
222         behaviour.  Delegates actual resolution of alias to ...
223         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
224         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
225         Update.
226         * driver.cs (Driver.MainDriver): Update.
227         
228         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
229         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
230         property.
231         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
232         Remove.
233         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
234         RootNamespace.DefineNamespacesForAll.
235
236 2005-10-24  Raja R Harinath  <harinath@gmail.com>
237
238         * typemanager.cs (assemblies, external_aliases, modules)
239         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
240         (ComputeNamespaces, GetRootNamespace): Remove extra staging
241         overhead.  Move resposibility ...
242         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
243         * driver.cs, attribute.cs, codegen.cs: Update to changes.
244
245 2005-10-23  Raja R Harinath  <harinath@gmail.com>
246
247         * namespace.cs (RootNamespace.all_namespaces): Renamed from
248         cached_namespaces.  Improve usage.
249         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
250         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
251         Move from GlobalRootNamespace and simplify.
252         (RootNamespace.Global): Make instance variable.
253         (RootNamespace.RootNamespace): Add "alias name" parameter.
254         (GlobalRootNamespace): Simplify drastically.
255         (Namespace.Lookup): Don't use GetNamespace.
256         * typemanager.cs (GetRootNamespace): Rename from
257         ComputeNamespaceForAlias.
258         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
259
260 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
261
262         * anonymous.cs (AnonymousContainer): Don't crash when container
263         doesn't exist.
264
265 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
266
267         * expression.cs (Binary.DoResolve): Warn when comparing same
268         values.
269
270 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
271
272         Fix #76486.
273         * expression.cs (Binary.DoResolve): It looks like there are no
274         convetsion rules in enum context.
275
276 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
277
278         Add support for extern alias qualifiers.
279         * typemanager.cs: Move some LookupTypeReflection code
280         to namespace.cs, to have cleaner code. Added some methods
281         to help us keep track of the extern aliased references.
282         * driver.cs: Add suport for extern alias assemblies on command
283         line and check for their warnings/errors. Also keep track of the
284         extern aliased assemblies.
285         * namespace.cs: Move the global functionality of Namespace
286         to GlobalRootNamespace/RootNamespace. Now the global namespace
287         is GlobalRootNamespace.Globa. Also the code moved from 
288         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
289         Finally added LocalAliasEntry (AliasEntry before) and
290         ExternAliasEntry, to handle alias statements.
291         * cs-parser.jay: Add support in the grammar for extern alias
292         statement.
293         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
294         Update callings to Namespace (now in GlobalRootNamespace).
295
296 2005-10-18  Raja R Harinath  <rharinath@novell.com>
297
298         Fix #76371.
299         * class.cs (TypeContainer.DefineType): Move updating of
300         topological sort earlier in the code.
301         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
302
303 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
304
305         Fix #76273.
306         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
307         
308         * constant.cs (Constant.TryReduce): Moved from Cast class.
309         (Reduce): Made little bit more OO and fixed missing conversions.
310         
311         * ecore.cs (Reduce): Implemented.
312         (Binary.EnumLiftUp): New method to upgrade values to enum values.
313         
314         * literal.cs (Reduce): Implemented.
315         
316         * class.cs: Reverted Miguel's wrong commit.
317
318 2005-10-14  Miguel de Icaza  <miguel@novell.com>
319
320         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
321
322 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
323
324         * cs-parser.jay, expression.cs : CS0214 was missing error location
325           for constants. Fixed bug #76404.
326
327 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
328
329         Fix #76370.
330         * convert.cs (ExplicitConversionCore): Fixed object->enum
331         conversion.
332
333 2005-10-10  Raja R Harinath  <rharinath@novell.com>
334
335         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
336         InstanceExpression.
337         (PropertyExpr.EmitCall): Likewise.
338         * expression.cs (Invocation.EmitArguments): Handle case where
339         arguments == null.
340         (Invocation.EmitCall): Avoid allocating temporary variable if
341         there are no arguments.
342
343 2005-10-07  Raja R Harinath  <rharinath@novell.com>
344
345         Fix #76323.
346         * convert.cs (ImplicitConversionStandard): Move conversion of
347         void* to arbitrary pointer types ...
348         (ExplicitConversionStandard): .. here.
349         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
350         error to always print typenames.
351
352 2005-10-07  Raja R Harinath  <rharinath@novell.com>
353
354         * convert.cs (GetConversionOperator): Rename from
355         GetConversionOperators.  Move operator selection code from ...
356         (UserDefinedConversion): ... here.
357
358 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
359
360         * convert.cs (ExplicitConversionCore): Removed duplicate enum
361         conversion.
362
363 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
364
365         * assign.cs (Assign.DoResolve): Error method changed.
366
367         * cfold.cs (DoConstantNumericPromotions): Error method changed.
368         
369         * const.cs (ResolveValue): Reset in_transit immediately.
370         
371         * constant.cs: Error method changed.
372         
373         * convert.cs: Removed useless location parameter.
374         (ExplicitNumericConversion): Don't do double enum check.
375         (ExplicitConversionCore): Renamed from ExplicitConversion.
376         (ExplicitUnsafe): Extracted from ExplicitConversion.
377         (ExplicitConversion): Uses for error reporting.
378         
379         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
380         error messages.
381         (ResolveBoolean): Uses common error method.
382         (CastToDecimal): Get rid of ec.
383         (CastFromDecimal): Optimized.
384         (ConvCast): Get rid of ec.
385         
386         * enum.cs (ResolveValue): Reset in_transit immediately.
387         (Emit): Return after first error.
388         
389         * expression.cs: Convert changes.
390         
391         * literal.cs: Error method changed.
392         
393         * statement.cs: Error method changed.
394
395 2005-10-03  Raja R Harinath  <rharinath@novell.com>
396
397         * support.cs (SeekableStreamReader.Position): Don't error out when
398         the requested position is just beyond the end of the current
399         buffered data.
400
401 2005-09-28  Raja R Harinath  <rharinath@novell.com>
402
403         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
404         try to keep in sync with the byte count of the underlying Stream.
405         However, this limits us to a window size of 2048 characters: i.e.,
406         the maximum lookahead of our lexer/parser can be 2048 characters.
407
408 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
409
410         Fix #76255.
411         * driver.cs: Fix compilation files with full root path.
412
413 2005-09-25  Miguel de Icaza  <miguel@novell.com>
414
415         * report.cs (SymbolRelatedToPreviousError): Format the output so
416         it does not use an open parenthesis that is never closed. 
417
418         * driver.cs: Follow coding guidelines
419
420 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
421
422         Fix #72930.
423         * const.cs (Const.ResolveValue): Check for assigning non-null
424         value to reference type.
425
426 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
427
428         * anonymous.cs: Implemented ExprClassName.
429         
430         * assign.cs (Assign.DoResolve): Don't chrash when type is not
431         delegate.
432         
433         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
434         check.
435         
436         * class.cs (StaticClass.DefineContainerMembers): Report protected
437         members as error.
438         
439         * codegen.cs: if(ed) PRODUCTION.
440         
441         * convert.cs (Error_CannotImplicitConversion): Better error
442         distinction.
443         
444         * cs-parser.jay: More error checks.
445         
446         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
447         
448         * driver.cs (CSCParseOption): Enabled wrong option check.
449         
450         * ecore.cs (Expression.ExprClassName): Turned to property.
451         (MemberExpr.CheckIntermediateModification): For checking boxed
452         value types     modification.
453         
454         * statement.cs (Fixed.Resolve): Expression type must be
455         convertible to fixed type.
456         (CollectionForeach.GetEnumeratorFilter,TryType):
457         Small refactoring for easier error checking.
458
459 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
460
461         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
462         attributes.
463         
464         * class.cs (GeneratedBaseInitializer): New class for customization
465         compiler generated initializers.
466         (MemberBase.DoDefine): Check Obsolete attribute here.
467         (FieldMember.DoDefine): Ditto.
468         
469         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
470         constants.
471         
472         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
473         (MemberCore.GetObsoleteAttribute): Removed argument.
474         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
475         (MemberCore.CheckObsoleteType): New helper.
476         
477         * delegate.cs,
478         * enum.cs,
479         * statement.cs: Updates after MemberCore changes.
480         
481         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
482         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
483         
484         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
485         obsolete attribute for compiler construct.
486         (As.DoResolve): Cache result.
487         
488         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
489
490 2005-09-26  Raja R Harinath  <rharinath@novell.com>
491
492         Fix #76133.
493         * expression.cs (This.VerifyFixed): In a value type T, the type of
494         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
495         value type R, 'this' is treated as a value parameter.
496
497 2005-09-22  Miguel de Icaza  <miguel@novell.com>
498
499         * statement.cs (Lock): Use the TemporaryVariable class instead of
500         manually using local variables as those do not work when variables
501         are captured.
502
503         * ecore.cs: Moved the TemporaryVariable class from being a nested
504         class inside Foreach to be a public class that can be employed in
505         other places. 
506
507 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
508
509         * cs-parser.jay: interface_accessors replaced by
510         accessor_declarations.
511
512         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
513         location.
514         
515         * statement.cs (GotoCase.Resolve): Convert null constant to
516         null case.
517         (SwitchLabel.ResolveAndReduce): Ditto.
518         (SwitchLabel.NullStringCase): Custom null stamp.
519         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
520         
521         typemanager.cs (CSharpSignature): Don't skip first argument
522         for full names.
523
524 2005-09-18  Miguel de Icaza  <miguel@novell.com>
525
526         * driver.cs: Set InEmacs based on the environment variable EMACS. 
527
528         * location.cs (InEmacs): in this mode, do not report column
529         location as it confuses Emacs.
530
531 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
532
533         * cfold.cs, constant.cs, convert.cs, ecore.cs,
534         expression.cs, iterators.cs, literal.cs: Store constants and
535         literals location.
536         
537         * class.cs (MemberBase.ShortName): Pass location.
538         
539         * cs-parser.jay: Some location fixes.
540         
541         * ecore.cs (Expression.Location): Made virtual.
542
543 2005-09-05  Miguel de Icaza  <miguel@novell.com>
544
545         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
546         if the underlying types are the same, otherwise we need to produce
547         code that will do the proper cast.
548
549         This was exposed by Marek's constant rewrite which produced
550         invalid code for the call site:
551
552         enum X : long { a }
553         void Method (X v) {}
554
555         Method ((X) 5)
556
557         This fixes test-49.cs
558
559 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
560
561         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
562           Type/Object should be allowed as well. Fixed bug #75968.
563
564 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
565
566         * expression.cs : (Binary.DoResolve): when one is enum constant and
567           another is constant 0, then return enum one *as enum type*.
568           Fixed bug 74846.
569
570 2005-09-02  Raja R Harinath  <rharinath@novell.com>
571
572         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
573         internal.
574
575         Fix #75941.
576         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
577         flow-branching for LocalVariableReferences in case we were invoked
578         from a MemberAccess.
579         * expression.cs (LocalVariableReference.VerifyAssigned): New.
580         Carved out of ...
581         (LocalVariableReference.DoResolveBase): ... this.
582         (MemberAccess.Resolve): Do the check that was disabled during
583         SimpleNameResolve.
584
585 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
586
587         * class.cs :
588           (PartialContainer.Create): check abstract/sealed/static strictly
589           but abstract/sealed can exist only at one side. Fixed bug #75883.
590
591 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
592
593         Fix #75945.
594         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
595         specified, don't default to UnmanagedType.I4.
596
597 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
598
599         * expression.cs : conditional operator should check possibly
600           incorrect assign expression. Fixed bug #75946.
601
602 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
603
604         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
605           Reverting the change. gmcs is much complex than mcs on this matter.
606
607 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
608
609         * cs-tokenizer.cs : To read another token ahead of the actual 
610           consumption, use new SavedToken and cache token instead of moving
611           back the stream with SeekableStreamReader (it seemed problematic).
612         * cs-parser.jay,
613           driver.cs : Thus use StreamReader directly.
614         * support.cs : Thus removed SeekableStreamReader.
615
616 2005-08-30  Raja R Harinath  <rharinath@novell.com>
617
618         Fix #75934.
619         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
620         (ScopeInfo.EmitScopeType): Use it to construct field names from
621         names of captured locals.
622
623         Fix #75929.
624         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
625         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
626         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
627         (ExplicitConversion): Remove enum cases already handled by
628         implicit conversion.  Move implicit conversion check to the beginning.
629         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
630         * expression.cs (ArrayCreation.EmitDynamicInitializers):
631         Don't treat System.Enum as a struct.
632
633 2005-08-30  Jb Evain  <jbevain@gmail.com>
634
635         * attribute.cs: handles as expression in parameters.
636
637 2005-08-30  Raja R Harinath  <rharinath@novell.com>
638
639         Fix #75802.
640         * class.cs (TypeContainer.VerifyClsName): Don't use a
641         PartialContainer when verifying CLS compliance.
642         (AbstractPropertyEventMethod): Set Parent here, ...
643         (PropertyMethod): ... not here.
644
645 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
646
647         * attribute.cs : escaped attribute name should not be allowed to be
648           resolved (e.g. @class as classAttribute). Fixed bug #75930.
649
650 2005-08-29  Raja R Harinath  <rharinath@novell.com>
651
652         Fix #75927.
653         * convert.cs (ImplicitStandardConversionExists): Allow zero also
654         when converting a long constant to unsigned long.
655         * expression.cs (Invocation.OverloadResolve): Add sanity check to
656         detect where IsApplicable and VerifyArgumentsCompat disagree.
657
658 2005-08-29  Raja R Harinath  <rharinath@novell.com>
659         and Carlos Alberto Cortez  <carlos@unixmexico.org>
660
661         Fix #75848.
662         * class.cs (TypeContainer.CanElideInitializer): New helper.
663         (TypeContainer.EmitFieldInitializers): Use it to determine if we
664         can safely emitting the initializer of a field.
665
666 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
667
668         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
669           allowed inside a switch (without loop). Fixed bug #75433.
670
671 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
672
673         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
674         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
675
676 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
677
678         * driver.cs : kinda reverting the default encoding changes (not exact 
679           revert since I noticed that "codepage:reset" might not work fine).
680
681 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
682
683         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
684           Location. Now getter and setter store location correctly.
685           (errors/cs0111-12.cs now reports the expected location.)
686
687 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
688
689         * driver.cs : Use default encoding on the environment.
690           Removed (now that) extra parameter for SeekableStreamReader.
691         * support.cs : (SeekableStreamReader) third .ctor() argument for
692           StreamReader is not required (always true). preamble size could
693           be acquired in simpler and safe way.
694
695 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
696
697         * cs-parser.jay: report CS0642 at warning level 3
698           and report CS0642 for an if else statement also
699           fixes bug #74745. Patch by John Luke (and a bit
700           modified by me).
701           Removed extra CS0642 warning check for "while",
702           "for" and "fixed".
703         * statement.cs: In Block.Resolve(), CS0642 check
704           is reimplemented to check a sequence of an empty
705           statement and a block.
706
707           Both fix bug #66777.
708
709 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
710
711         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
712         detection until I fix it.
713         
714         * cs-tokenizer.cs: Changed error message.
715         
716         * cs-parser.jay: Fixed 2 error locations.
717         
718         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
719         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
720         properties.
721         
722         * enum.cs (GetSignatureForError): Fixed.
723         
724         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
725         method detection.
726         
727         * class.cs,
728         * typemanager.cs (RegisterProperty): Removed.
729         
730         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
731
732 2005-08-24  Raja R Harinath  <rharinath@novell.com>
733
734         Fix #75874.
735         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
736         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
737
738 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
739
740         * expression.cs : tiny fix is required for not warning positive ulong.
741           See test-441.cs.
742
743 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
744
745         * expression.cs : add CS0652 check for constant and integral
746           expression. Fixed bug #53974.
747
748 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
749
750         * expression.cs : in DoNumericPromotions(), check if there is implicit
751           conversion overload for string (to check CS0034). Fixed bug #52492.
752
753 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
754
755         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
756
757 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
758
759         * ecore.cs : report location when it is *not* Null.
760
761 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
762
763         * codegen.cs,
764           ecore.cs,
765           flowanalysis.cs,
766           expression.cs:
767           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
768           correctly. Fixed bug #75721.
769
770 2005-08-23  Raja R Harinath  <rharinath@novell.com>
771
772         * support.cs (SeekableStreamReader.Position): Avoid an expensive
773         loop that performs 'min (pos, char_count)'.
774
775         Fix #75862.
776         * expression.cs (Unary.ResolveOperator): Don't discard implicit
777         converted value in Operator.OnesComplement.
778
779 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
780
781         * anonymous.cs: If the anon method is pulled into a helper class,
782         it needs to be `internal' not `private'. Fixes runtime behavior on
783         msft. bug #75704
784
785 2005-08-20  Martin Baulig  <martin@ximian.com>
786
787         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
788         scope if we don't already have it.
789
790         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
791         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
792         fixes #75867.
793
794 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
795
796         Fix #75803
797         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
798         is a partial class.
799
800 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
801
802         The big constants rewrite
803         Fix #75746, #75685 and more
804         As a side effect saved 1MB for MWF ;-)
805         
806         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
807         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
808         enum based for corlib compilation.
809         
810         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
811         subtractions.
812         
813         * class.cs (FixedField.Define): Use ResolveAsConstant.
814         
815         * const.cs (IConstant): Interface constants and enums.
816         (Const.ResolveValue): New method for constant resolvning.
817         (ExternalConstant): Constants from imported assemblies.
818         
819         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
820         conversion; like enums.
821         (Constant.ToType): Converts this constant to different type.
822         (Constant.Increment): Adds 1.
823         
824         * convert.cs (ImplicitConversionRequired): Simplified.
825         
826         * cs-parser.jay: Create EnumMember directly.
827         
828         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
829         
830         * doc.cs (GenerateEnumDocComment): Removed.
831         
832         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
833         (ConvertIntLiteral): Removed.
834         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
835         
836         * enum.cs (EnumMember): Implement IConstant.
837         (Enum.IsValidEnumConstant): Removed.
838         (Enum.GetNextDefaultValue): Removed.
839         (Enum.FindMembers): Updated.
840         (Enum.GenerateDocComment): Iterate enum members.
841         
842         * expression.cs (Cast.TryReduce): Handle enums correctly.
843         (New.Constantify): Made public.
844         (MemberAccess.DoResolve): Removed contant specific if(s).
845         
846         * literal.cs (NullLiteral): Implement new abstract methods.
847         
848         * statement.cs (GotoCase.Resolve): Use new constant methods.
849         (SwitchLabel.ResolveAndReduce): Use new constant methods.
850         
851         * typemanager.cs (LookupEnum): Removed.
852         (IsEnumType): Fixed to work with corlib.
853         (RegisterConstant): Removed.
854         (LookupConstant): Removed.
855         (GetConstant): Changed to work with IConstant.
856
857 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
858
859         * location.cs : Fixed overflown (>255) column number.
860
861 2005-08-03  Raja R Harinath  <rharinath@novell.com>
862
863         First cut of the qualified-alias-member feature.
864         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
865         token.
866         * cs-parser.jay (DOUBLE_COLON): New token.
867         (namespace_or_type_name): Add rule for recognizing
868         qualified-alias-members.
869         (primary_expression): Likewise.
870         (element_access): Allow QualifiedAliasMember as a possible
871         type-bearing expression.
872         (local_variable_type, local_variable_pointer_type): Likewise.
873         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
874         aliases in the current and enclosing namespace declarations.
875         (NamespaceEntry.UsingAlias): Add CS0440 warning.
876         * decl.cs (MemberName.is_double_colon): New.
877         (MemberName.MemberName): Add new constructor for alias-member.
878         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
879         * expression.cs (QualifiedAliasMember): New expression type.
880
881 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
882
883         * location.cs : it borked when no argument was specified.
884
885 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
886
887         * location.cs : tiny ToString() format fix.
888
889 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
890
891         * statement.cs : oops, it was missing.
892
893 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
894
895         A set of fixes for precise line/column location.
896
897         * location.cs :
898           "token" field now holds a file/line "delta", a line number offset 
899           from the segment, and a column number. See also:
900           http://lists.ximian.com/pipermail/mono-devel-list/2004-
901           December/009508.html
902           Removed static IsNull. Use instance IsNull property instead.
903         * cs-tokenizer.cs :
904           For some tokens it stores Location. For Identifier it stores
905           LocatedToken which is a pair of string name and location.
906           Column numbers are adjusted only at getChar().
907         * report.cs :
908           Use Location.ToString() for reporting (it now contains column).
909         * cs-parser.jay :
910           Largely modified to use LocatedToken instead of
911           string (IDENTIFIER), and to acquire Location from some tokens.
912         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
913           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
914           codegen.cs :
915           Now MemberName holds Location. DeclSpace.ctor() receives Location
916           as a parameter. Removed extra parameters to all derived classes.
917           Replaced Location.IsNull() with instance property.
918         * assign.cs, expression.cs :
919           Added .ctor() overload that omits Location.
920         * attribute.cs :
921           Added "nameEscaped" flag that indicates the identifier was escaped
922           in the source file. This fixes bug #57047.
923
924 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
925
926         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
927         New method, looking for lo-case imported cls type.
928
929         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
930         here.
931
932         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
933
934         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
935
936         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
937         all_imported_types.
938         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
939
940         Optimized to save 3.5 MB for SWF compilation.
941
942 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
943
944         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
945         (PartialContainer.Create): Moved logic AddToContainer.
946         (PartialContainer.MarkForDuplicationCheck): Shares name.
947         
948         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
949         place.
950         
951         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
952         initialization.
953         (Namespace.GetSignatureForError): New method.
954         
955         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
956         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
957
958 2005-08-01  Raja R Harinath  <rharinath@novell.com>
959
960         Fix #75669.
961         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
962         member lookup rather than qualifier_type, since qualifier_type can
963         be null.
964
965 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
966
967         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
968         enum member.
969
970 2005-07-31  Miguel de Icaza  <miguel@novell.com>
971
972         * statement.cs: Copy the local exception into the exception
973         captured local.  Fixes 75674
974
975 2005-07-31  Raja R Harinath  <harinath@gmail.com>
976
977         Fix #75658.
978         * expression.cs (Invocation.OverloadResolve): Don't report error
979         CS1501 if error CS1502 has been reported.
980         (New.DoResolve): Delegate CS1501 reporting to
981         Invocation.OverloadResolve.
982
983         Fix #75656.
984         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
985         invariant-meaning-in-block property in an enclosing block if
986         necessary.
987
988 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
989
990         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
991         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
992         (Switch.CheckSwitch): Just save 50kb for SWF.
993
994 2005-07-27  Martin Baulig  <martin@ximian.com>
995
996         * anonymous.cs (CaptureContext.AddField): Added
997         `AnonymousContainer am' argument; compute its toplevel scope if
998         it's not already computed.  Fixes #75649.
999
1000 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1001
1002         Fix #75628.
1003         * class.cs (Constructor.Emit): Reset block to null if the block
1004         resolve fails.
1005
1006 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1007
1008         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1009
1010 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1011
1012         * class.cs (MethodData.Define): Check whether accessor implementing
1013         interface is public.
1014
1015         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1016
1017 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1018
1019         Fix #57245
1020         * namespace.cs (LookupType): Moved same type check to...
1021         
1022         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1023         with the same name.
1024
1025 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1026
1027         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1028         already found a typebuilder.
1029         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1030         MemberNames, not strings.
1031
1032         * const.cs (Error_ExpressionMustBeConst): 
1033         Rename from Error_EpressionMustBeConst.
1034         * const.cs, class.cs, statement.cd: Update.
1035
1036 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1037
1038         Fix #65573
1039
1040         * const.cs (Const.LookupConstantValue): Report missing contant expression
1041         everytime.
1042         (Error_EpressionMustBeConstant): Only one error method.
1043
1044         * class.cs, statement.c: Updated.
1045
1046 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1047
1048         * statement.cs (Block.Flags): Add back HasVarargs.
1049         (Block.flags): Make protected.
1050         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1051
1052         * typemanager.cs (types, typecontainers, user_types): Remove.
1053         (UserTypes, TypeContainers): Likewise.
1054         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1055         (CleanUp, Reset): Update.
1056         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1057         (GetNestedType): Use Type.GetNestedType.
1058         (CoreLookupType): Take two arguments, the namespace and the
1059         basename of the type.  Update to use the Namespace.Lookup
1060         mechanism.
1061         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1062         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1063         string concatenation and substring matches.
1064         * class.cs, enum.cs, delegate.cs: Update to changes.
1065
1066 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1067
1068         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1069         Expression and made virtual.
1070
1071         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1072         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1073
1074         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1075
1076         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1077         error message.
1078
1079         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1080         change.
1081
1082 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1083
1084         Fix #57707
1085         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1086         AssemblyCultureAttribute is not used on executable.
1087
1088         * rootcontext.cs,
1089         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1090
1091 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1092
1093         Fix #60638.
1094         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1095         New.  Reports CS0252/CS0253.
1096         Mostly taken from preliminary patch by Duncak Mak.
1097         (Binary.DoResolveOperator): Store results of operator lookup.
1098         Use them to detect if we need to warn about unintended reference
1099         comparisons.
1100
1101 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1102
1103         Fix #72969.
1104         * namespace.cs (Namespace.Lookup): Add back location parameter.
1105         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1106         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1107
1108         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1109         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1110         (Namespace.LookupType): ... this.
1111         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1112         of namespaces.
1113         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1114         purported to handle pointers.
1115         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1116         CoreLookupType.
1117
1118 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1119
1120         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1121         type as namespace.
1122
1123 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1124
1125         * namespace.cs (Namespace.Lookup): Drop location parameter.
1126         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1127         (NamespaceEntry.Lookup): ... this.
1128         (NamespaceEntry.Error_AmbiguousTypeReference):
1129         Move here from DeclSpace.
1130         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1131         names ...
1132         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1133         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1134         Move to NamespaceEntry.
1135         * delegate.cs, expression.cs: Update to changes.
1136
1137 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1138
1139         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1140         CheckAttributeType and refactored.
1141         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1142         ResolveAsTypeTerminal error handling.
1143         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1144         handling.
1145         (GetSignatureForError): Print errors in same way.
1146
1147         * class.cs,
1148         * codegen.cs: Reflect attribute GetSignatureForError change.
1149
1150         * ecore.cs,
1151         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1152
1153         * namespace.cs (UsingEntry): Refactored to make fields private.
1154
1155         * assign.cs,
1156         statement.cs: Error_UnexpectedKind has extra parameter.
1157
1158 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1159
1160         * ecore.cs (IAlias): Remove.
1161         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1162         that implement the interface.
1163         * namespace.cs (Namespace): Likewise.
1164         (Namespace.declspaces): Renamed from 'defined_names'.
1165         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1166         DeclSpace instead of an IAlias.
1167         * tree.cs (Tree.AddDecl): Update.
1168
1169 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1170
1171         * statement.cs (Block.Flags); Remove HasVarargs.
1172         (Block.HasVarargs): Move to ToplevelBlock.
1173         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1174         (Block.Variables): Make protected.  Initialize variable hashtable
1175         if necessary.
1176         (Block.AddVariable): Update.
1177         (Block.Resolve): Update to changes.
1178         (ToplevelBlock.HasVarargs): New boolean.
1179         (ToplevelBlock.ThisVariable): Move here from Block.
1180         (ToplevelBlock.AddThisVariable): Likewise.
1181         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1182         * expression.cs (This.ResolveBase): Update to changes.
1183         (ArglistAccess.DoResolve): Likewise.
1184
1185 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1186
1187         Fix #75321
1188         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1189
1190         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1191         not used and not used & assigned.
1192         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1193
1194 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1195
1196         Fix #75053
1197         * expression.cs (Is.DoResolve): null is never provided type.
1198
1199 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1200
1201         Fix #52496
1202         * cs-parser.jay: Less strict event error rule to catch more errors.
1203
1204 2005-07-08  Martin Baulig  <martin@ximian.com>
1205
1206         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1207         gettter (allowed) or setter (not allowed).
1208
1209         * class.cs (Accessor): Implement IIteratorContainer.
1210         (Accessor.Yields): New public field.
1211         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1212         per-accessor basis.
1213
1214         * cs-parser.jay
1215         (get_accessor_declaration, set_accessor_declaration): Set the
1216         `yields' flag on the accessor, not the property.
1217         (property_declaration): Do the iterators check on a per-accessor
1218         basis and not for the whole property.
1219
1220 2005-07-08  Martin Baulig  <martin@ximian.com>
1221
1222         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1223         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1224
1225 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1226
1227         Fix #74975
1228         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1229         (ExtractSecurityPermissionSet): Cope with self referencing security
1230         attributes properly.
1231
1232         * driver.cs (SetOutputFile): Made public property OutputFile.
1233
1234 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1235
1236         Fix #75486.
1237         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1238         has_nonstatic_fields.  Make into a FieldBase pointer.
1239         (TypeContainer.AddField): Add CS0282 check.
1240         (TypeContainer.EmitType): Update.
1241
1242 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1243
1244         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1245         compare if they start with __.
1246
1247 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1248
1249         * statement.cs (Switch.SwitchGoverningType): Only look at
1250         UserCasts that don't need implicit standard conversions to one of
1251         the allowed switch types (Fixes test-322.cs).
1252         (LocalInfo.Resolve): Re-enable sanity-test.
1253
1254 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1255
1256         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1257         
1258         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1259         
1260         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1261
1262 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1263
1264         Fix #75472.
1265         * ecore.cs (SimpleName.GetSignatureForError): Add.
1266         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1267         (MemberAccess.GetSignatureForError): Add.
1268
1269 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1270  
1271         The big error and warning messages review.
1272         
1273         * anonymous.cs,
1274         * assign.cs,
1275         * attribute.cs,
1276         * class.cs,
1277         * codegen.cs,
1278         * convert.cs,
1279         * cs-parser.jay,
1280         * cs-tokenizer.cs,
1281         * decl.cs,
1282         * delegate.cs,
1283         * doc.cs,
1284         * driver.cs,
1285         * ecore.cs,
1286         * enum.cs,
1287         * expression.cs,
1288         * flowanalysis.cs,
1289         * iterators.cs,
1290         * literal.cs,
1291         * location.cs,
1292         * modifiers.cs,
1293         * namespace.cs,
1294         * parameter.cs,
1295         * pending.cs,
1296         * report.cs,
1297         * rootcontext.cs,
1298         * statement.cs,
1299         * support.cs,
1300         * tree.cs,
1301         * typemanager.cs: Updated.
1302         
1303         * class.cs: (MethodCore.SetYields): Moved here to share.
1304         (PropertyMethod.Define): Moved iterator setup here.
1305         
1306         * iterators.cs: Add orig_method to have full access to parent
1307         container.
1308
1309 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1310
1311         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1312         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1313         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1314         variable of struct type.
1315         * expression.cs (Unary.ResolveOperator): Update to change.
1316         (Indirection.VerifyFixed): Likewise.
1317         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1318         (ParameterReference.VerifyFixed): Value parameters are fixed.
1319         (This.VerifyFixed): Treat 'this' as a value parameter.
1320         * statement.cs (LocalInfo.IsFixed): Remove.
1321
1322 2005-07-01  Martin Baulig  <martin@ximian.com>
1323
1324         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1325         `ec.EmitThis ()' to get the correct scope.
1326
1327 2005-07-01  Martin Baulig  <martin@ximian.com>
1328
1329         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1330         instance is a ParameterReference; fixes #75299.
1331
1332 2005-07-01  Martin Baulig  <martin@ximian.com>
1333
1334         Reverted Marek's latest patch (r46725):
1335         - it contains structural changes which are neither mentioned in
1336           the ChangeLog nor explained anywhere; for example the additional
1337           argument of EmitContext's and Iterator's .ctor's and the
1338           TypeContainer.DefineMembers() change.
1339         - structural changes like this should go in in seperate patches
1340           and not be hidden in a huge patch which just seems to affect
1341           warnings and errors.
1342           a big and hard to understand patch.
1343         - it breaks iterators and causes regressions, for instance in
1344           test-iter-03.cs.      
1345
1346 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1347
1348         Fix #75412.
1349         * expression.cs (Indexers.map): Remove.
1350         (Indexers.Append): Filter out inaccessible setters and getters.
1351         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1352
1353         Fix #75283.
1354         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1355         Refactored from ...
1356         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1357         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1358         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1359         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1360
1361 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1362
1363         Fix #75322
1364         * class.cs (FieldBase.GetInitializerExpression): One more field
1365         for backup.
1366
1367 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1368
1369         * pending.cs: Do not define a proxy if the base method is virtual,
1370         it will be picked up by the runtime (bug 75270).
1371
1372 2005-06-08  Martin Baulig  <martin@ximian.com>
1373
1374         The big Iterators rewrite :-)
1375
1376         * iterators.cs: Rewrite this to use the anonymous methods framework.
1377
1378         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1379         before the TypeContainers; see 2test-21.cs.
1380
1381         * class.cs
1382         (TypeContainer.DefineType): Don't create a new EmitContext if we
1383         already have one (this only happens if we're an Iterator).
1384         (TypeContainer.Define): Also call Define() on all our iterators.
1385         (Method.CreateEmitContext): Added support for iterators.
1386
1387         * anonymous.cs
1388         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1389         (AnonymousContainer.CreateMethodHost): Moved here from
1390         AnonymousMethod and made abstract.
1391         (AnonymousContainer.CreateScopeType): New abstract method.
1392         (AnonymousContainer.IsIterator): New public property.
1393         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1394         get the ScopeTypeBuilder rather than manually defining it here. 
1395         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1396         iterators here.
1397
1398         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1399         before RootContext.DefineTypes().
1400
1401         * codegen.cs (EmitContext.RemapToProxy): Removed.
1402         (EmitContext.CurrentAnonymousMethod): Changed type from
1403         AnonymousMethod -> AnonymousContainer.
1404         (EmitContext.ResolveTopBlock): Protect from being called twice.
1405         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1406         (EmitContext.EmitThis): Removed the iterators hacks; use the
1407         anonymous methods framework for that.
1408
1409         * statement.cs
1410         (ToplevelBlock.Container): Make this a property, not a field.
1411         (ToplevelBlock.ReParent): New public method; move the
1412         ToplevelBlock into a new container.
1413         (Foreach.TemporaryVariable): Simplify.
1414
1415 2005-06-05  Martin Baulig  <martin@ximian.com>
1416
1417         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1418         (Block.AddTemporaryVariable): New public method; creates a new
1419         `LocalInfo' for a temporary variable.
1420         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1421         variables here.
1422         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1423         non-iterator variables.
1424
1425 2005-06-05  Martin Baulig  <martin@ximian.com>
1426
1427         * statement.cs (Foreach.TemporaryVariable): Create the
1428         LocalBuilder in the Emit phase and not in Resolve since in some
1429         situations, we don't have an ILGenerator during Resolve; see
1430         2test-19.cs for an example.
1431
1432 2005-06-04  Martin Baulig  <martin@ximian.com>
1433
1434         **** Merged r45395 from GCS ****
1435
1436         The big Foreach rewrite - Part II.
1437
1438         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1439         with `PropertyInfo ienumerator_getcurrent'.
1440
1441         * codegen.cs (VariableStorage): Removed.
1442
1443         * statement.cs
1444         (Foreach): Derive from Statement, not ExceptionStatement.
1445         (Foreach.CollectionForeach): New nested class.  Moved all the code
1446         dealing with collection foreach here.
1447         (Foreach.ForeachHelperMethods): Removed.
1448         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1449
1450 2005-05-23  Martin Baulig  <martin@ximian.com>
1451
1452         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1453         don't need to.  Fix #75014.
1454
1455 2005-05-20  Martin Baulig  <martin@ximian.com>
1456
1457         Merged r44808 from GMCS.
1458
1459         * class.cs (TypeContainer.CircularDepException): Removed.
1460         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1461         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1462         (CS0146) and interface (CS0529) dependencies here.
1463
1464 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1465
1466         * expression.cs (Invocation.EmitCall): Fix initialization
1467         'this_call' to reflect current behaviour.  Fix indentation.
1468
1469         * convert.cs (FindMostEncompassedType): Add two trivial special
1470         cases (number_of_types == 0 || number_of_types == 1).
1471         (FindMostEncompasingType): Likewise.
1472
1473 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1474
1475         Some cleanups preparing for the fix of #75283.
1476         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1477         error testing.
1478         (EventExpr.InstanceResolve): Likewise.
1479         (EventExpr.DoResolve): Remove redundant checks.
1480
1481 2005-06-10  Duncan Mak  <duncan@novell.com>
1482
1483         * cs-tokenizer.cs (process_directives): New flag for controlling
1484         the processing of preprocessor directives.
1485         (x_token): After seeing a '#', return Token.NONE instead of going
1486         to handle_preprocessing_directive() when not processing
1487         directives. This avoids unnecessary processing during the token peek in
1488         is_punct().
1489
1490         This fixes #74939.
1491
1492         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1493         the existing error reporting methods instead of Report.Error.
1494
1495         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1496         after Raja's rewrite.
1497
1498 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1499
1500         * class.cs: Small fix.
1501
1502 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1503
1504         Fix #75160.
1505         * class.cs (GetPartialBases): Fix return value check of
1506         part.GetClassBases.
1507
1508 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1509
1510         Ensure that partial classes are registered in their enclosing
1511         namespace.  Initial part of fix of #75160.
1512         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1513         Register declspace with namespace here, not in
1514         DeclSpace.RecordDecl.
1515         * cs-parser.jay: Pass namespace to RecordDecl.
1516         * class.cs (PartialContainer.Create): Likewise.
1517         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1518         called.
1519         * decl.cs (Declspace.RecordDecl): Remove.
1520         * namespace.cs (NamespaceEntry.DefineName): Remove.
1521
1522 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1523
1524         * rootcontext.cs: Reset TargetExt as well.
1525
1526 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1527
1528         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1529         -langversion:ISO-1.
1530
1531 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1532
1533         Fix #75080, cs0119.cs.
1534         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1535         of ...
1536         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1537         allowing ExprClass.Type and ExprClass.Namespace for
1538         ResolveFlags.VariableOrValue.
1539         (Expression.Resolve) [1-argument variant]: Change default resolve
1540         flags based on language version.
1541         (Expression.Error_UnexpectedKind): Use a simple string array
1542         rather than an ArrayList.
1543         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1544         not ExprClass.Type.
1545         (TypeOfVoid.DoResolve): Likewise.
1546         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1547         flags argument -- it always has the same value.
1548
1549 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1550
1551         Fix #75081.
1552         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1553         Use it in the error message.
1554         * assign.cs, expression.cs, statement.cs: Update.
1555
1556 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1557
1558         Fix #75088.
1559         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1560         the "almostMatchedMember" case too.
1561         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1562         that failed the accessibility checks to 'almost_match'.
1563
1564 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1565
1566         * attribute.cs: Use internal MethodBuilder methods to set
1567         ExactSpelling and SetLastError on PInvoke methods, instead
1568         of passing them via charset.  Fixes #75060.
1569
1570 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1571
1572         * parameter.cs (Parameter): Remove TODO comment.
1573         (Parameter.DefineParameter): Remove Location parameter.
1574         (Parameters.LabelParameters): Likewise.
1575         * class.cs (Constructor.Emit): Update to change.
1576         (MethodData.Emit): Likewise.
1577         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1578         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1579
1580 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1581
1582         * parameter.cs,
1583           Removed Parameters.Location and added Parameter.Location instead.
1584           Removed Location parameter from Emit() and GetSignature().
1585         * anonymous.cs,
1586           class.cs,
1587           cs-parser.jay,
1588           delegate.cs,
1589           iterators.cs,
1590           statement.cs :
1591           Modified all related calls.
1592
1593 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1594
1595         Improve user-defined conversion handling.
1596         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1597         applicable operators.
1598         (AddConversionOperators): New.  Helper for GetConversionOperators.
1599         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1600         there is only one most encompassed/encompassing type.
1601         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1602         "applicable operator" handling.
1603         (UserConversion): Move cache here from GetConversionOperators.
1604         Directly cache the chosen operator, rather than the whole
1605         MethodGroup.
1606         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1607         case.  Allow conversion of decimal to sbyte and byte too.
1608         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1609         New static methods.  Used to avoid allocating EmptyExpressions in
1610         convert.cs.
1611
1612 2005-05-24  Duncan Mak  <duncan@novell.com>
1613
1614         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1615         another class, used in Convert.ExplicitNumericConversion.
1616         (CastToDecimal): New class, similar to above, but casts to
1617         System.Decimal, used in Convert.ImplicitNumericConversion and also
1618         in explicit convesion from double/float to decimal.
1619
1620         * convert.cs (ImplicitNumericConversion): Handle implicit
1621         conversions to System.Decimal.
1622         (ExplicitNumericConversion): handle explicit conversions to
1623         System.Decimal.
1624
1625         This fixes #68711.
1626         
1627 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1628
1629         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1630         know the type at this stage, just break through.   Fixes #75008 
1631
1632 2005-05-19  Martin Baulig  <martin@ximian.com>
1633
1634         * delegate.cs
1635         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1636         to disable error reporting.
1637
1638         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1639         here since we don't want to report an error; see the new test-336.cs.
1640
1641 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1642
1643         * statement.cs (ToplevelBlock.GetParameterReference)
1644         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1645         Move here from class Block.
1646         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1647         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1648
1649 2005-05-18  Martin Baulig  <martin@ximian.com>
1650
1651         Fix #74978.
1652
1653         * flowanalysis.cs
1654         (FlowBranching.Reachability): Add non-static public And() and Or()
1655         methods.
1656         (FlowBranchingSwitch): New class; do the `break_origins' thing
1657         like in FlowBranchingLoop.
1658         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1659         reachability, not just locals and parameters.
1660         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1661         switch; MergeBreakOrigins() now takes care of that.
1662
1663 2005-05-18  Martin Baulig  <martin@ximian.com>
1664
1665         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1666         a loop and may leave it, reset the barrier; fixes #74974.
1667
1668 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1669         
1670         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1671         is back.
1672         
1673         * cs-parser.jay: Catch more lexical errors.
1674         
1675         * report.cs: Add one more Error method.
1676         
1677         * rootcontext.cs,
1678         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1679
1680 2005-05-17  Martin Baulig  <martin@ximian.com>
1681
1682         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1683         #70970. 
1684
1685 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1686
1687         Fix test-382.cs.  Emit values of decimal constants.
1688         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1689         Carved out of ...
1690         (TypeContainer.AddField): ... this.
1691         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1692         with initializers to include 'Const's.
1693         (ClassPart.RegisterFieldForInitialization): Forward to
1694         PartialContainer.
1695         * const.cs (Const.Const): Pass initializer to base class.
1696         (Const.Define): In case of decimal constants, register them for
1697         initialization in a static constructor.
1698
1699 2005-05-14  Martin Baulig  <martin@ximian.com>
1700
1701         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1702         do not call ResolveUnreachable() on unreachable statements in
1703         here, see the comment in the source code.
1704
1705 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1706
1707         Fix #74934.
1708         * expression.cs (BinaryResolveOperator): If one of the operands of
1709         an equality comparison is 'null' and the other is a pointer type,
1710         convert the null to a NullPointer.
1711         * convert.cs (ImplicitReferenceConversion): If the expression is a
1712         NullLiteral and the target type is a pointer type, return a
1713         NullPointer instead.
1714         (ImplicitConversionStandard): Likewise.
1715
1716 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1717         
1718         * cs-parser.jay: Set readonly context based on special constructs.
1719         
1720         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1721         readonly variable error handling.
1722         
1723         * rootcontext.cs (EmitCode): Don't verify members when error
1724         occurred.
1725         
1726         * statement.cs (LocalInfo): Add reaodnly context information.
1727         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1728
1729 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1730
1731         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1732         for #74041 to initialize 'resolved' to false only for explicit
1733         blocks.  Fixes #74873.
1734
1735 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1736
1737         Fix #74920.
1738         * typemanager.cs (unmanaged_enclosing_types): New.
1739         (IsUnmanagedType): Avoid infloops by using
1740         'unmanaged_enclosing_types' to talk with recursive invocations.
1741
1742 2005-05-13  Martin Baulig  <martin@ximian.com>
1743
1744         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1745         instance variable, not a local.  Fix #74873.
1746         (Block.ResolveUnreachable): Set it to true here.
1747
1748 2005-05-11  Duncan Mak  <duncan@novell.com>
1749
1750         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1751         continuing to process for 'arg'.
1752         (handle_preprocessing_directive): Check the argument of the #endif
1753         directive and report error CS1025 if there are any trailing
1754         characters.
1755
1756         According to the C# spec, having even whitespace after the #endif
1757         directive is illegal; however, because we call arg.TrimEnd ()
1758         beforehand, we have the same behavior as csc, allowing whitespace
1759         after the directive.
1760
1761         Fixes #74892.
1762
1763 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1764
1765         Fix #74863.
1766         
1767         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1768         (Constructor.GetObsoleteAttribute): Implemented correctly.
1769
1770 2005-05-10  Martin Baulig  <martin@ximian.com>
1771
1772         * support.cs (ReflectionParameters.ParameterModifier): Use
1773         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1774         and `ParameterAttributes.In'.  Fixes #74884.
1775
1776 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1777
1778         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1779         
1780         * expression.cs (Argument.GetParameterModifier): Turned to property.
1781         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1782         
1783         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1784         its C# equivalent.
1785         
1786 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1787
1788         Fix #74852.
1789         * decl.cs (MemberCache.AddMethods): Register override methods,
1790         rather than non-override methods.
1791         * typemanager.cs (RegisterOverride): New.
1792         (IsOverride): Update.
1793
1794 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1795
1796         Fix #73105.
1797         
1798         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1799         recursive declaration.
1800         
1801         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1802         
1803 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1804
1805         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1806         
1807         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1808
1809 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1810
1811         Fix #74797.
1812         * decl.cs (DeclSpace.FamilyAccessible): 
1813         Use TypeManager.IsNestedFamilyAccessible.
1814
1815         Fix reopened #64812.
1816         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1817         internal'.
1818
1819 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1820             Abin Thomas  <projectmonokochi@rediffmail.com>
1821             Anoob V E  <projectmonokochi@rediffmail.com>
1822             Harilal P R  <projectmonokochi@rediffmail.com>
1823
1824         Fix #64812.
1825         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1826         allow access to all static members.
1827
1828 2005-05-04  Martin Baulig  <martin@ximian.com>
1829
1830         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1831
1832 2005-05-04  Martin Baulig  <martin@ximian.com>
1833
1834         Fix #74655.
1835
1836         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1837         section at the end; make things work if `default' is not the last
1838         section.        
1839
1840 2005-05-04  Martin Baulig  <martin@ximian.com>
1841
1842         Fix #70400.
1843
1844         * statement.cs (Switch): Replaced the `got_default' field with a
1845         `default_section' one.
1846         (Switch.CheckSwitch): Set `default_section' here.
1847         (Switch.Resolve): If we're a constant switch and the constant is
1848         not found, use the default section.
1849
1850 2005-05-03  Martin Baulig  <martin@ximian.com>
1851
1852         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1853
1854         * statement.cs (Foreach.ArrayForeach): New nested class.
1855         (Foreach.TemporaryVariable): New nested class.
1856         (Foreach.EmitArrayForeach): Removed; this is now in the new
1857         ArrayForeach class.
1858
1859 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1860
1861         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1862         more conservative.
1863         (VerifyPendingMethods): Revert change below.
1864
1865         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1866         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1867         that used to trigger warning -28.  Remove warning -28.
1868         * expression.cs (Invocation.OverloadResolve): Use
1869         TypeManager.IsOverride to distinguish override methods.
1870
1871         Fix #74773.
1872         * pending.cs (VerifyPendingMethods): If a base type implements the
1873         requested interface, don't bother checking individual methods of
1874         the base type.  As a side-effect, this prevents the creation of
1875         unnecessary proxies.
1876
1877 2005-05-02  Martin Baulig  <martin@ximian.com>
1878
1879         Fix #70182.
1880
1881         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1882         Also `And' the locals if the old vector is null.
1883         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1884         null; in this case we basically reset all the variables.        
1885
1886 2005-05-02  Martin Baulig  <martin@ximian.com>
1887
1888         Fix #74529.
1889
1890         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1891         Added `FlowBranching branching' argument; always `and' the
1892         variables instead of `or'ing them unless we're an infinite loop.
1893
1894         * statement.cs (While.Resolve): Create a new sibling unless we're
1895         infinite.       
1896
1897 2005-05-02  Martin Baulig  <martin@ximian.com>
1898
1899         Fix #70140.
1900
1901         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1902         arguments; use it instead of creating a new TopLevelBlock.
1903         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1904         our ConstructorInitializer.
1905
1906         * statement.cs
1907         (TopLevelBlock.TopLevelBranching): New public property.
1908         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1909         and create our `TopLevelBranching'.
1910
1911         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1912         anonymous method host, use `block.TopLevelBranching' rather than
1913         creating a new branching.
1914
1915 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1916
1917         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1918         a ScopeInfo, if any of the current children is a child of the new
1919         entry, move those children there.
1920
1921 2005-04-30  Martin Baulig  <martin@ximian.com>
1922
1923         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1924         at the beginning of a SwitchSection.  Fix #73335.
1925
1926 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1927
1928         Fix #74378
1929         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1930         
1931         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1932         (FieldExpr.DoResolve): Obsolete members are ignored for field
1933         initializers.
1934         
1935 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1936
1937         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1938         of arrays detection.
1939
1940         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1941         verification.
1942         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1943
1944         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1945         arrays report.
1946
1947 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1948
1949         * cs-parser.jay: Use the prefered version of -unsafe in error
1950         message.
1951
1952 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1953
1954         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1955         circumstances.
1956
1957 2005-04-20  John Luke  <john.luke@gmail.com>
1958
1959         * driver.cs: fix typo in error message, --outout to --output
1960
1961 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1962
1963         * codegen.cs (InRefOutArgumentResolving): New field.
1964         
1965         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1966         fields outside contructor.
1967         
1968         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1969         
1970 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1971
1972         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1973         parameter code was not completed ever, so it was not as up-to-date
1974         as local variables.  Must finish it.
1975
1976         The bug fix was to compare the Toplevel of the block, not the
1977         current block.  Thanks for Ben for pointing this out. 
1978
1979 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1980
1981         * decl.cs (AddMethods): Use the declaring type of the problem
1982         method to determine if we want to squash a warning.
1983
1984 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1985
1986         * attribute.cs: Removed debug output.
1987
1988         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1989         
1990         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1991         Report.Stderr.
1992         
1993 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1994
1995         Fix #74481.
1996         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1997         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1998         all null comparisons against reference types.
1999
2000 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2001
2002         Fix# 74565
2003         * class.cs (TypeContainer.CircularDepException) New nested
2004         exception class.
2005         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2006         (TypeContainer.DefineType): Removed error, reset InTransit before
2007         exit.
2008         (Class.DefineType): Throw exception when is in Transit.
2009         Catch exception and report error.
2010         (Struct.DefineType): Throw exception when is in Transit.
2011         Catch exception and report error.
2012         (Interface.DefineType): Throw exception when is in Transit.
2013         Catch exception and report error.
2014
2015         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2016         handle nested exception handlers.
2017
2018         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2019         a catch.
2020
2021         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2022         InFinally and InCatch storage.
2023
2024         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2025         (Catch.Resolve): Set and Restore ec.InCatch.
2026         (Try.Resolve): Set and Restore ec.InFinally.
2027         (Try.HasCatch): True when try has catch.
2028
2029 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2030
2031         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2032           for the same event member, so exclude such cases from warning 419.
2033           Fixed bug #74633.
2034
2035 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2036
2037         * expression.cs (Binary.ResolveOperator): Apply patch from John
2038         Luke to fix bug 59864: operators &, | and ^ on enumerations
2039         require that the same enum type on both sides.
2040
2041         * driver.cs: Add warnings to old flag usage, this is to assist
2042         people who produce Makefiles and hope that the Makefiles will be
2043         used on Windows.
2044
2045         * class.cs (TypeContainer.EmitType): Moved the definition of the
2046         special $PRIVATE$ field from the resolve phase to the Emit phase.
2047         During resolve we do not know if we are a struct with
2048         HasExplicitLayout, we know this only after the attributes for the
2049         type are emitted.
2050
2051         Set the FieldOffset to zero on the dummy field that we create for
2052         the class.   Fixes 74590.
2053
2054 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2055
2056         Fix #73834.
2057         * ecore.cs (PropertyExpr.resolved): New.
2058         (DoResolve): Use it to handle a case of double resolution here.
2059         Handle a case of identical-name-and-type-name.
2060         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2061         resolution by storing the results of expression resolution back
2062         into the "probes" array.
2063
2064 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2065
2066         Fix cs0208-7.cs and cs0208-8.cs.
2067         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2068         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2069         error reporting to point out the reason a struct is not unmanaged.
2070
2071 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2072
2073         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2074           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2075
2076 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2077
2078         Fix #74528.
2079         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2080         IdenticalNameAndTypeName here.
2081         (EventExpr.InstanceResolve): Likewise.
2082
2083 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2084
2085         C# 2.0 DefaultCharSetAttribute implementation
2086         
2087         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2088         which allows us to set GlobalNamespace for every resolve.
2089         (Attribute.ResolveArguments): Cut from Resolve.
2090         (Attribute.GetCharSetValue): Returns CharSet named argument.
2091         (Attribute.DefinePInvokeMethod): Gets default charset from
2092         module settings.
2093         (GlobalAttribute.ResolveAsTypeStep): Override.
2094         (GlobalAttribute.ResolveArguments): Override.
2095         
2096         * class.cs (TypeAttr): Is protected.
2097         
2098         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2099         (ModuleClass.DefaultCharSetType): New memeber.
2100         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2101         
2102         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2103         charset from module.
2104         
2105         * delegate.cs (TypeAttr): Override.
2106         (Delegate.DefineType): Use this TypeAttr.
2107         
2108         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2109         at very early stage (before types are defined) to resolve model
2110         module attributes. It will probably not work with corlib but it
2111         should be ok.
2112         
2113         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2114         charset from module.
2115         
2116         * typemanager.cs (default_charset_type): New type.
2117
2118 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2119
2120         * decl.cs (MemberCache.AddMethods): Don't warn if
2121         System.Object.Finalize has buggy MethodAttributes.
2122
2123         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2124         removed below.
2125
2126 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2127
2128         * doc.cs : detect ambiguous reference to overloaded members.
2129           Fixed bug #71603. MS 1.1 csc does not detect it.
2130
2131 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2132
2133         * doc.cs : delegates must not be referenced with parameters.
2134           Fixed bug #71605.
2135
2136 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2137
2138         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2139
2140 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2141
2142         * driver.cs (MainDriver): Stop processing if the CLS stage found
2143         errors. 
2144
2145         (CompilerCallableEntryPoint.InvokeCompiler): Always
2146         reset after execution;   Take a TextWriter argument for the
2147         output.
2148
2149         * report.cs: Use the error stream instead of hardcoding stderr. 
2150
2151 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2152
2153         * class.cs: Reduce code paths to test, too small of an
2154         optimization to make it worth the extra testing.  Always perform
2155         it. 
2156
2157 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2158
2159         Fix #74510.
2160         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2161         operators that had errors reported on them.
2162
2163 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2164
2165         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2166         argument types.
2167         (Attribute.Resolve): Add named argument type checking.
2168         
2169         * class.cs (FixedField.Define): Use IsPrimitiveType
2170         
2171         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2172         
2173         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2174         unsafe parameter types.
2175         
2176         * statement.cs (Using.ResolveExpression): Add better error description.
2177         
2178         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2179         
2180 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2181
2182         Fix #74484.
2183         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2184         AttributeUsageAttribute in the emitcontext of the attribute class,
2185         not in the emitcontext of the attributable entity it was attached to.
2186         * cs-parser.jay: Use 'current_class', not 'current_container',
2187         when creating a GlobalAttribute.
2188
2189 2005-04-08  Alp Toker  <alp@atoker.com>
2190
2191         * pending.cs: The fix to #58413 failed to compile methods implementing
2192         interfaces with/without params modifiers and vice versa, even though
2193         params modifiers aren't part of the signature. Make the modifier check
2194         less strict as in csc.
2195
2196 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2197             Anoob V E  <projectmonokochi@rediffmail.com>
2198             Harilal P R  <projectmonokochi@rediffmail.com>
2199
2200         Fix #58413.
2201         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2202         modifiers of pending methods.
2203         (PendingImplementation.PendingImplementation): Initialize it.
2204         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2205         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2206         with ParameterData.  Add check for modifiers.
2207         * class.cs (MethodData.Define): Update to changes.
2208
2209 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2210
2211         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2212
2213 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2214
2215         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2216         property.
2217         
2218         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2219         
2220         * rootcontext.cs,
2221         * typemanager.cs: Registered RequiredAttributeAttribute.
2222         
2223 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2224
2225         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2226         Warning CS0169 is back at level 3.
2227         (IMethodData.SetMemberIsUsed): New method.
2228         
2229         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2230         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2231         
2232         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2233
2234         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2235         contants.
2236         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2237         is used.
2238         
2239         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2240         is used.
2241         
2242         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2243         to avoid the problems with nested types.
2244
2245 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2246             Anoob V.E  <projectmonokochi@rediffmail.com>
2247             Harilal P.R  <projectmonokochi@rediffmail.com>
2248             Raja R Harinath  <rharinath@novell.com>
2249
2250         Fix #73820.
2251         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2252         attribute.
2253         * typemanager (GetConstructor): Make public.
2254
2255 2005-04-05  John Luke  <john.luke@gmail.com>
2256             Raja R Harinath  <rharinath@novell.com>
2257
2258         Fix #62232.
2259         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2260         struct too.  Return false quicker in a few cases.
2261         (VerifyUnManaged): Use it.
2262
2263 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2264
2265         Fix #74041.
2266         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2267         not 'unreachable_seen'.
2268
2269 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2270
2271         * attribute.cs (Attribute.GetValue): Removed unused.
2272         
2273         * codegen.cs (CodeGen.TrimExt): Removed unused.
2274         
2275         * cs-parser.jay (output): Removed unused.
2276         
2277         * cs-tokenizer.cs (hex_digits): Removed unused.
2278         
2279         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2280         
2281         * expression.cs (Indirection.LoadExprValue): Removed unused.
2282         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2283         
2284         * iterators.cs (Iterator.param_types): Removed unused.
2285         
2286         * statement.cs (Goto.block): Removed unused.
2287         (ToplevelBlock.did): Removed unused.
2288         (Switch.ResolveConstantSwitch): Removed unused.
2289
2290 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2291
2292         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2293         resetting thingy.
2294
2295 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2296
2297         Fix #74232 and cs0208-3.cs.
2298         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2299         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2300         unmanaged type.  Don't use FieldBuilders when 't' is a
2301         TypeBuilder.  Use ModFlags and MemberType fields.
2302         * class.cs (MemberBase.member_type): Rename from MemberType.
2303         (MemberBase.MemberType): New property.  Determines member_type on
2304         demand.
2305         (MemberBase.DoDefine): Don't initialize MemberType here.
2306         (FieldMember.Define): Likewise.
2307
2308 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2309
2310         Fix #74241
2311         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2312         Attributes are emitted there.
2313         
2314 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2315
2316         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2317         keyword in 'partial enum' too.
2318         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2319         is not allowed).
2320         Report from Kamil Skalski <nazgul@omega.pl>.
2321
2322         Fix #74309.
2323         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2324         have partial containers too.
2325
2326         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2327         in block' checks to Block.CheckInvariantMeaningInBlock.
2328         * statement.cs (Block.GetKnownVariableInfo): Make private.
2329         (Block.IsVariableUsedInChildBlock): Remove.
2330         (Block.IsVariableUsedInBlock): Likewise.
2331         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2332         conflicting declaration.
2333         (Block.AddVariable): Make error messages less long-winded and more
2334         specific.  Show location of conflicting declaration.
2335         * parameter.cs (Parameters.Location): New readonly property.
2336
2337 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2338
2339         Clean up semantics of invoking ResolveMemberAccess.
2340         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2341         can have an instance, ensure that we pass in a non-TypeExpression
2342         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2343         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2344         argument.  Update to changes and simplify.
2345         (FieldExpr.Emitinstance): Remove CS0120 check.
2346         (PropertyExpr.EmitInstance): Likewise.
2347         * expression.cs (Argument.Resolve): Likewise.
2348         (Invocation.DoResolve): Update to changes in semantics of
2349         InstanceExpression.
2350
2351 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2352
2353         Fix #74241
2354         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2355         customization.
2356         
2357         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2358
2359 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2360
2361         Fix difference in behaviour with commandline invocation.
2362         * driver.cs (Driver.Reset): New.
2363         (CompilerCallableEntryPoint): Call it.
2364
2365         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2366         variable" warnings if the boolean expression failed to resolve.
2367
2368 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2369
2370         * attribute.cs: Fix the union of several permissions when some of them
2371         are unrestricted (so the result isn't an unrestricted permission set).
2372         Fix #74036.
2373
2374 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2375
2376         * ecore.cs (MemberExpr): New class.  Convert from interface
2377         IMemberExpr.
2378         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2379         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2380         error checks.
2381         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2382         (MethodGroupExpr.IsExplicitImpl): Remove.
2383         (Expression.GetFieldFromEvent): Remove.
2384         (SimpleName.MemberStaticCheck): Remove.
2385         (SimpleName.DoSimpleNameResolve): Update to changes.
2386         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2387         (MemberAccess.IdenticalNameAndTypeName): Remove.
2388         (MemberAccess.error176): Move to MemberExpr.
2389         (MemberAccess.DoResolve): Update to changes.
2390         (BaseAccess.DoResolve): Likewise.
2391
2392 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2393
2394         C# 2.0 Conditional attribute class implementation
2395         
2396         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2397         Analyzes class whether it has attribute which has ConditionalAttribute
2398         and its condition is not defined.
2399         
2400         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2401         (Class.IsExcluded): New method. Search for at least one defined
2402         condition in ConditionalAttribute of attribute class.
2403
2404 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2405
2406         * ecore.cs (PropertyExpr): Derive from Expression, not
2407         ExpressionStatement.
2408         (PropertyExpr.EmitStatement): Remove.
2409
2410 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2411
2412         Fix #74060.
2413         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2414         internal field "value__" of an enum be private.  The examples for
2415         "value__" that I found on MSDN all used FieldAttributes.Private.
2416
2417         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2418         Don't mention IL method attribute names.
2419
2420         Fix #47991.  Remove a TODO.
2421         * statement.cs (Block.Toplevel): Make into a field.
2422         (Block.Parameters): Move into ToplevelBlock.
2423         (Block.known_variables): Rename from child_variable_names.
2424         (Block.Block): Remove variants that take Parameters.  Initialize
2425         'Toplevel' with the immediately surrounding toplevel block.
2426         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2427         LocalInfo parameter.
2428         (Block.GetKnownVariableInfo): New.
2429         (Block.IsVariableNameUsedInChildBlock): Update.
2430         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2431         the block, even though it may not be in scope.
2432         (Block.AddVariable): Remove Parameters parameter.  Use
2433         Toplevel.Parameters instead.
2434         (Block.AddConstant): Remove Parameters parameter.
2435         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2436         (Block.IsParamaterReference): Likewise.
2437         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2438         (ToplevelBlock.Parameters): New.  Moved from Block.
2439         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2440         initialize Parameters to a non-null value.
2441         * cs-parser.jay: Update to changes.
2442         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2443         simple names that mean different things in the same block.  Use
2444         Block.IsVariableNameUsedInBlock.
2445
2446 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2447
2448         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2449         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2450         GetTypeHandle.  It is possible for a reflected type to derive from
2451         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2452         System.Array during mscorlib compilation).
2453         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2454         contain a method_hash, don't create one either.  Don't create a
2455         deep copy of the base cache's method_hash.
2456         (MemberCache.SetupCache): Rename back from DeepCopy.
2457         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2458         already initialized.  If we see an override function, add its
2459         underlying base virtual function to the member_hash too.
2460
2461         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2462
2463 2005-03-26  Raja R Harinath  <harinath@acm.org>
2464
2465         Fix #73038.
2466         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2467         fails to resolve, ensure that the LHS is still resolved as an
2468         lvalue.
2469
2470 2005-03-25  Raja R Harinath  <harinath@acm.org>
2471
2472         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2473         ec.ContainerType.
2474         (Enum.current_ec): Remove.
2475         (Enum.LookupEnumValue): Remove EmitContext argument.
2476         Just uses the one created during DefineType.
2477         (Enum.FindMembers): Update.
2478         * expression.cs (MemberAccess.DoResolve): Update.
2479
2480 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2481
2482         * assign.cs (Assign.DoResolve): Check for CS1717 when
2483         source and target are same (uses Equals).
2484
2485         * expression.cs (LocalVariableReference, ParameterReference,
2486         This): Implemented Equals, GetHashCode.
2487
2488         * statement.cs (Block.GetParameterReference): Removed useless
2489         local variable.
2490
2491 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2492
2493         Fix cs0128.cs
2494         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2495         blocks before deciding whether the error is cs0136 or cs0128.
2496
2497         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2498         (using_alias_directive, using_namespace_directive): Pass
2499         MemberName, not an expression to Namespace.UsingAlias and
2500         Namespace.Using.
2501         (MakeName): Use the MemberName of the namespace.
2502         * namespace.cs (Namespace.MemberName): New.
2503         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2504         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2505         Likewise.
2506         * decl.cs (MemberName.Name): Make readonly.
2507         (MemberName.FromDotted): New "constructor".
2508         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2509         (MemberCore.Name): Compute from MemberName on demand.
2510         (MemberCore.SetMemberName): Provide a way to change the
2511         MemberName.
2512         (MemberCore.AddToContainer): Don't take a fullname parameter.
2513         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2514         fully qualified name of the container to the member name.
2515         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2516         only if the type is a member of the root container.
2517         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2518         MemberName.Left rather than searching for an embedded ".".
2519         (PartialContainer.CreatePart): Update to changes in RootContext.
2520         (MemberBase.ShortName): Turn into a property.  Use
2521         MemberCore.SetMemberName.
2522         (MemberBase.ExplicitInterfaceName): Remove.
2523         (MemberBase.UpdateMemberName): Remove.
2524         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2525         (PropertyBase.SetMemberName): New override.
2526         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2527         (Tree.GetDecl): New.
2528         (Tree.AllDecls): Rename from Decls.
2529         * attribute.cs, enum.cs, report.cs: Update to changes.
2530         * driver.cs (MainDriver): Use MemberName.FromDotted on
2531         RootContext.MainClass.
2532
2533 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2534
2535         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2536         checks.
2537
2538         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2539
2540 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2541
2542         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2543         property accessor modifiers.
2544
2545         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2546         fixed buffer attribute (CS1716).
2547         (PropertyMethod.HasCustomAccessModifier): When property accessor
2548         has custom modifier.
2549
2550         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2551         modifiers.
2552         (PropertyExpr.DoResolveLValue): Add CS0272.
2553
2554 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2555
2556         * convert.cs: When converting to a pointer, use the proper Conv.U
2557         or Conv.I depending on the source data type.
2558
2559         * cs-tokenizer.cs: Make the size for large decimal constants,
2560         fixes #72957.
2561
2562 2005-03-17  Martin Baulig  <martin@ximian.com>
2563
2564         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2565         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2566
2567 2005-03-17  Martin Baulig  <martin@ximian.com>
2568
2569         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2570         to bool so we can return an error condition.
2571         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2572         returned an error.
2573
2574 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2575
2576         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2577         attributes.
2578
2579 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2580
2581         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2582         Refactor to avoid traversing the list of assemblies, and to avoid
2583         string concatenation.
2584         * typemanager.cs (guid_attr_type): Remove.
2585         (negative_hits, pointers, references): Remove hashes.
2586         (type_hash): New.
2587         (GetConstructedType): New.  Uses type_hash to handle constructed
2588         types (arrays, references, pointers).
2589         (GetReferenceType, GetPointerType): Use it.
2590         (GetNestedType): New.  Uses type_hash to handle nested types of
2591         reflected types.
2592         (LookupType, LookupTypeDirect): Remove.
2593         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2594         'types' hash and LookupTypeReflection directly.
2595         (params_string, params_object): Use GetConstructedType.
2596         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2597         top-level types.
2598         (Namespace.Lookup): Use cached_types.
2599         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2600         provided by old TypeManager.LookupType.
2601         * rootcontext.cs (MakeFQN): Remove.
2602         * decl.cs (DeclSpace.MakeFQN): Likewise.
2603         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2604         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2605         TypeManager.GetConstructedType.
2606         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2607
2608 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2609
2610         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2611         indexers.
2612
2613         * cs-parser.jay: Reports CS1527 for any namespace element.
2614
2615         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2616         Added CS0407.
2617
2618         * expression.cs (ParameterReference.IsAssigned): Changed error to
2619         CS0269.
2620         (Error_WrongNumArguments): Moved CS0245 detection here.
2621
2622         * statement.cs (Return.Resolve): Add CS1622 report.
2623
2624 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2625
2626         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2627
2628 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2629
2630         * attribute.cs expression.cs: Get rid of some allocations.
2631
2632 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2633
2634         * doc.cs : just eliminate the latest change.
2635
2636 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2637
2638         * doc.cs : commented out the latest change. It breaks xml-030.cs
2639
2640 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2641
2642         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2643           fail. So invoke CreateType() in FindDocumentedType().
2644
2645 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2646
2647         * cs-tokenizer.cs : added IsKeyword().
2648         * doc.cs : Detect keyword incorrectly used as identifier.
2649           Allow identifiers prefixed by @.
2650
2651 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2652
2653         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2654         It caused exception in namespace resolving (again!).
2655         
2656         * class.cs (Class.ctor): Removed exit.
2657         (PropertyMethod.ctor): ditto.
2658         
2659         * codegen.cs (Codegen.Reset): Reset static data.
2660         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2661         
2662         * cs-tokenizer.cs (Cleanup): Removed.
2663         
2664         * driver.cs (GetSystemDir): Rewrote to one line command.
2665         It caused problem with unloaded dynamic modules.
2666         (UnixParseOption): Removed Exit.
2667         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2668         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2669         Now can be mcs used as library.
2670         
2671         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2672         empty location.
2673         
2674         * location.cs (Reset): Reset static data.
2675         
2676         * namespace.cs (Reset): Reset static data.
2677         
2678         * report.cs (Report.Reset): Reset static data.
2679         
2680         * rootcontext.cs (RootContext.Reset): Reset static data.
2681         
2682         * tree.cs (RootTypes.ctor): Use Location.Null
2683         
2684         * typemanager.cs (TypeManager.Reset): Reset static data.
2685         (CoreLookupType): Removed Exit.
2686         (TypeHandle.Reset): Reset static data.
2687         
2688 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2689
2690         Fix #73516.
2691         * typemanager.cs (ComputeNamespaces): Import namespaces from
2692         referenced modules too.
2693
2694 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2695
2696         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2697         than '.'.
2698
2699 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2700
2701         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2702         enclosing DeclSpace.  This ensures that a name-lookup populates
2703         more caches and there are fewer 'TypeExpression's.  Carve out
2704         nested type lookup into ...
2705         (LookupNestedTypeInHierarchy): ... this.
2706
2707 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2708
2709         Clean up a few partial-class semantics.  
2710         Fixes test-357.cs and cs1618-2.cs.
2711         * cs-parser.jay (struct_declaration): Use 'current_class' as
2712         parent of newly-created struct.  Remove call to Register ().
2713         Use 'pop_current_class' to complete handing the current struct.
2714         (interface_declaration): Likewise.
2715         (class_declaration): Likewise.
2716         (enum_declaration): Use 'current_class' as parent of newly created
2717         enum.
2718         (delegate_declaration): Likewise.
2719         (pop_current_class): New function.  This is used to handle closing
2720         up the 'current_class' and 'current_container', and pointing them
2721         to the enclosing class/container.
2722         (CSharpParser): Initialize 'current_class' too.
2723         * decl.cs (MemberCore): Add check for invariant: a partial
2724         container is not a parsed entity, and thus does not enclose any
2725         parsed members.
2726         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2727         (DeclSpace.BaseTypeExpr): Use it.
2728         (DeclSpace.LookupType): Add check for invariant.
2729         * class.cs (TypeContainer): Add check for invariant: a nested
2730         class should have the same NamespaceEntry as its enclosing class.
2731         (TypeContainer.EmitFieldInitializers): Make virtual.
2732         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2733         MemberCore.
2734         (TypeContainer.Register): Remove.
2735         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2736         null.  Use TypeResolveEmitContext for resolving base types and
2737         interfaces.  Move initialization of Parts.TypeBuilder here from
2738         ...
2739         (TypeContainer.DefineNestedTypes): ... here.
2740         (PartialContainer): Take a Namespace not a NamespaceEntry.
2741         (PartialContainer.Create): Don't use Register.  Call the
2742         appropriate Add... function directly.
2743         (ClassPart): Take both the PartialContainer and the enclosing
2744         class as constructor arguments.
2745         (ClassPart.EmitFieldInitializers): Override.
2746         (ClassPart.PartFindNestedTypes): Remove.
2747         (FieldBase.GetInitializerExpression): Resolve the initializer
2748         expression in the emit context of the enclosing class.
2749         * tree.cs (RootTypes): Remove Register ().
2750         
2751 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2752
2753         * cs-parser.jay: Removed CS0134.
2754         
2755         * driver.cs: Removed CS1901.
2756         
2757         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2758         for predefined types.
2759
2760 2005-03-07  Duncan Mak  <duncan@novell.com>
2761
2762         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2763         well. Fixes bug #73454.
2764
2765 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2766
2767         * cs-tokenizer.cs (xtoken): Add CS1035.
2768         
2769         * class.cs (MethodData.Define): Add CS0683.
2770         (FieldMember.ctor): Add CS0681.
2771
2772 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2773
2774         * ecore.cs (SimpleName.DoResolve): Rename from
2775         SimpleName.DoResolveAllowStatic.
2776         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2777         Pass 'intermediate' flag to MemberStaticCheck.
2778         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2779         of "intermediate" lookups via MemberAccess.
2780         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2781         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2782
2783 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2784
2785         Fix #73394.
2786         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2787         slipped in because of variable names that are identical to a
2788         builtin type's BCL equivalent ('string String;', 'int Int32;').
2789         (PropertyExpr.EmitInstance): Likewise.
2790
2791 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2792
2793         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2794         
2795         * report.cs (warning_ignore_table): Made public.
2796
2797 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2798
2799         Fix #73282.
2800         * class.cs (MethodData.Emit): Pass 'container' to
2801         container.GetObsoleteAttribute instead of 'container.Parent'.
2802
2803 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2804
2805         * cs-parser.jay: Add 1534 error test.
2806
2807         * iterators.cs (Yield.CheckContext): Add error 1629.
2808         (Iterator.ctor): Save unsafe modifier.
2809         (MoveNextMethod.DoEmit): Restore unsafe context.
2810
2811         * namespace.cs (UsingAlias): Better error message.
2812
2813 2005-03-03  Dan Winship  <danw@novell.com>
2814
2815         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2816         the warning message [#73219]
2817
2818 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2819
2820         Fix compile with MCS 1.0.0.0.
2821         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2822         w_restore to not depend on string constant folding.
2823
2824 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2825
2826         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2827         CS0246 check to users who passed 'silent = false'.
2828         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2829         check.
2830         (SimpleName.SimpleNameResolve): Update.
2831         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2832         (MemberAccess.IdenticalNameAndTypeName): Update.
2833         * doc.cs (FindDocumentedTypeNonArray): Update.
2834
2835 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2836
2837         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2838         * parameters.cs (ComputeAndDefineParameters): Remove.
2839         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2840         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2841         Use GetParameterInfo.
2842
2843 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2844
2845         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2846
2847 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2848
2849         Unify DeclSpace.LookupType and DeclSpace.FindType.
2850         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2851         is in charge of defining nested types on demand.
2852         (DeclSpace.LookupType): Use it when the current_type is a
2853         TypeBuilder.  Use LookupTypeDirect for reflected types.
2854         (DeclSpace.FindType): Remove.
2855         (DeclSpace.LookupInterfaceOrClass): Likewise.
2856         (DeclSpace.DefineTypeAndParents): Likewise.
2857         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2858         DeclSpace.LookupType.
2859         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2860         * typemanager.cs (LookupType): Simplify.
2861         (AddUserType): Remove type from negative_hits.
2862         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2863         * class.cs (TypeContainer.FindMembers): Move handling of nested
2864         types ...
2865         (TypeContainer.FindMembers_NestedTypes): ... here.
2866         (TypeContainer.FindNestedType): Implement override.
2867         (ClassPart.FindNestedType): Delegate to PartialContainer.
2868         (ClassPart.PartFindNestedType): Looks up the nested types of the
2869         part alone.
2870
2871 2005-03-02  Martin Baulig  <martin@ximian.com>
2872
2873         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2874         static constructor in static classes.
2875
2876 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2877
2878         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2879         sizeParamIndex is not specified.
2880
2881 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2882
2883         Fix #73117
2884         * report.cs (WarningMessage.IsEnabled): Missing null check.
2885
2886 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2887
2888         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2889         in the fields and not in the properties.
2890
2891 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2892
2893         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2894         fields as well.
2895
2896 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2897
2898         * attribute.cs: Small refactoring (improved robustness).
2899         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2900         (ValidateGuid): Removed.
2901         (Resolve): Removed referenced to above mentioned.
2902         (GetAttributeUsage): Made private and changed to work without
2903         class assistance.
2904         (GetIndexerAttributeValue): Don't crash.
2905         (GetConditionalAttributeValue): Ditto.
2906         (GetClsCompliantAttributeValue): Ditto.
2907         (ExtractSecurityPermissionSet): All attributes exceptions are
2908         error 648.
2909         (GetPropertyValue): New helper.
2910         (GetMethodImplOptions): New method.
2911         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2912         some missing properties.
2913         
2914         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2915         (Method.ApplyAttributeBuilder): Updated.
2916         
2917         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2918         exception.
2919
2920 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2921
2922         Fix #73052.
2923         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2924         non-simple types (array, pointer, reference).
2925
2926 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2927
2928         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2929
2930         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2931         for operators.
2932         (Method.CheckBase): Catch wrong destructor here.
2933         (MethodData.Define): Add errors 550, 668.
2934
2935         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2936
2937         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2938
2939         * pending.cs (VerifyPendingMethods): Add error 551.
2940
2941         * typemanager.cs (CSharpName): Next error report helper.
2942
2943 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2944
2945         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2946         attributes. Removed useless attribute double check.
2947         It saves almost 2MBs for corlib.
2948
2949 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2950
2951         Fix #72924.
2952         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2953         called twice in case of error.
2954
2955 2005-02-23  Chris Toshok  <toshok@ximian.com>
2956
2957         Fix compiler portions of #72827.
2958         * statement.cs (Block.Emit): call Begin/EndScope on the
2959         EmitContext instead of the ILGenerator.
2960
2961         * codegen.cs (EmitContext.BeginScope): new method, call
2962         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2963         we have one.)
2964         (EmitContext.BeginScope): same, but EndScope and CloseScope
2965
2966         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2967         offset and call the superclass's OpenScope(int) with it.
2968         (SymbolWriter.CloseScope): get the current il
2969         offset and call superclass's CloseScope(int) with it.
2970
2971 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2972
2973         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2974         CS1677 for out and ref as well.
2975
2976         * class.cs (Method.Define): Add error CS1599 detection.
2977         
2978         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2979         
2980         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2981         
2982         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2983         
2984         * support.cs.cs (ModifierDesc): New helper method.
2985
2986 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2987             Abin Thomas  <projectmonokochi@rediffmail.com>
2988             Anoob V E  <projectmonokochi@rediffmail.com>
2989             Harilal P R  <projectmonokochi@rediffmail.com>
2990
2991         Fix #57851, #72718.
2992         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2993         MemberLookup (used for error reporting) actually returns a result.
2994         Fix error report number (122, not 112).
2995
2996 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2997             Anoob V E  <projectmonokochi@rediffmail.com>
2998             Harilal P R  <projectmonokochi@rediffmail.com>
2999
3000         Fix #71134.
3001         * pending.cs (PendingImplementation.GetAbstractMethods):
3002         Find NonPublic members too.
3003
3004 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3005
3006         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3007         Fixed error 217.
3008         
3009         * class.cs (MethodCore.CheckMethodAgainstBase):
3010         Add error 239 report.
3011
3012 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3013
3014         Fix #68955.
3015         * expression.cs (Invocation.IsApplicable): Make public.
3016         (Invocation.IsParamsMethodApplicable): Likewise.
3017         * delegate.cs (Delegate.VerifyApplicability): Don't use
3018         Invocation.VerifyArgumentCompat for parameter applicability
3019         testing.  Use Invocation.IsApplicable and
3020         Invocation.IsParamsMethodApplicable.
3021
3022 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3023
3024         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3025         
3026         * class.cs (Operator.Define): Add error 217 report.
3027         
3028 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3029
3030         * namespace.cs (UsingEntry.Resolve): Undo change below.
3031
3032 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3033
3034         Fix #72756.
3035         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3036         disable the error message when the extended MemberLookup also
3037         fails.
3038         (Expression.MemberLookupFinal): Update.
3039         (SimpleName.DoSimpleNameResolve): Update.
3040         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3041         Don't use MemberLookupFinal.
3042         (New.DoResolve): Update.
3043         (BaseAccess.CommonResolve): Update.
3044
3045 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3046
3047         Fix #72732.
3048         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3049         occured previously, don't resolve again.
3050
3051 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3052
3053         Fix #69949
3054         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3055         argument. Call ResolveAttributeUsage for unresolved.
3056         when types doesn't match ctor arguments.
3057         
3058         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3059         for nested attribute classes.
3060         (Class.attribute_usage): Removed.
3061         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3062         for attribute class.
3063         
3064         * ecore.cs (IsAttribute): Removed.
3065         
3066         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3067         
3068         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3069         now normal types.
3070         (attribute_types): Removed.
3071         (EmitCode): Global attributes are emited as the latest.
3072
3073 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3074
3075         * class.cs (EmitFieldInitializers): Don't emit field initializer
3076         for default values when optimilization is on.
3077         
3078         * constant.cs (Constant.IsDefaultValue): New property.
3079         
3080         * driver.cs: Add /optimize handling.
3081         
3082         * constant.cs,
3083         * ecore.cs,
3084         * literal.cs: Implement new IsDefaultValue property.
3085         
3086         * rootcontext.cs (Optimize): New field, holds /optimize option.
3087
3088 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3089
3090         Fix crasher in re-opened #72347.
3091         * namespace.cs (Namespace.Lookup): Return null if
3092         DeclSpace.DefineType returns null.
3093
3094         Fix #72678.
3095         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3096
3097 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3098
3099         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3100         now returns null if it cannot resolve to an lvalue.
3101         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3102         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3103         returned null.  Remove check for SimpleName.
3104         (EventExpr.DoResolveLValue): New.
3105         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3106         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3107         error from ...
3108         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3109         avoid CS0131 error.
3110         (Unary.ResolveOperator): Move CS0211 check ...
3111         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3112         CS0131 error.
3113         (Unary.DoResolveLValue): Simplify.
3114         (AddressOf.DoResolveLValue): New.
3115         (ArrayAccess.DoResolveLValue): New.
3116
3117 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3118
3119         * attribute.cs (Attribute.Resolve): Add arguments casting for
3120         when types doesn't match ctor arguments.
3121
3122 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3123
3124         Fix parts of #63202.
3125         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3126         lookup of operator in base type.  Ensure that all checks happen
3127         when the operator resolves to an "op_..." method.
3128
3129 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3130
3131         Fix #71992.
3132         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3133         'ignore_cs0104' parameter.  Pass it to ...
3134         (NamespaceEntry.Lookup): ... this.
3135         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3136         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3137         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3138         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3139         Update.  Request that cs0104 errors be ignored.
3140         (ComposedCast.ResolveAsTypeStep): Update.
3141
3142 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3143
3144         Fix #59209.
3145         * expression.cs (Invocation.BetterFunction): Remove support for
3146         comparing virtual functions and their overrides.
3147         (Invocation.IsOverride): New.
3148         (Invocation.OverloadResolve): Don't consider 'override' functions
3149         during candidate selection.  Store them in a lookaside list.
3150         If the selected method is a 'virtual' function, use the list to
3151         find any overrides that are closer to the LHS type.
3152
3153 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3154
3155         * expression.cs (New.DoResolve): Add complex core type reduction.
3156         (New.Constantify): Converts complex core type syntax like 'new int ()'
3157         to simple constant.
3158         
3159 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3160
3161         * decl.cs (EntryType.EntryType): New constructor to create an
3162         updated copy of a cache entry.
3163         (MemberCache.AddMethods): Use it.
3164         (MemberCache.ClearDeclaredOnly): Remove.
3165         (MemberCache.MemberCache): Update.
3166
3167 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3168
3169         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3170         variable.  This one is represents the actual low-level declaration
3171         of the method, as opposed to the semantic level `IsStatic'.   
3172
3173         An anonymous method which is hosted into a static method might be
3174         actually an instance method.  IsStatic would reflect the
3175         container, while MethodIsStatic represents the actual code
3176         generated.
3177
3178         * expression.cs (ParameterReference): Use the new MethodIsStatic
3179         instead of IsStatic.
3180
3181         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3182         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3183         set on the current EmitContext. 
3184
3185         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3186         resolve our casted expression as an LValue.  This triggers the
3187         proper LValue processing that is later required by Assign.
3188
3189         This fixes 72347.
3190
3191         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3192
3193 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3194
3195         C# 2.0 Fixed buffer implementation
3196
3197         * anonymous.cs: Update after RegisterHelperClass renaming.
3198
3199         * attribute.cs (AttributeTester.fixed_buffer_cache):
3200         Cache of external fixed buffers.
3201         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3202         implementation if field is fixed buffer else null.
3203
3204         * class.cs
3205         (TypeContainer.AddField): Accept FieldMember instead of Field.
3206         (FieldBase.IsFieldClsCompliant): Extracted code from
3207         VerifyClsCompliance descendant customization.
3208         (FixedField): New class handles fixed buffer fields.
3209         (FixedFieldExternal): Keeps information about imported fixed
3210         buffer.
3211         (IFixedField): Make access to internal or external fixed buffer
3212         same.
3213
3214         * cs-parser.jay: Add fixed buffer parsing.
3215
3216         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3217         buffer.
3218
3219         * expression.cs (Indirection): Extended implementation to accept
3220         fixed buffer field.
3221         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3222         (ElementAccess.MakePointerAccess): Get type as parameter.
3223         (DoResolve): Add fixed buffer field expression conversion.
3224         (DoResolveLValue): Ditto.
3225         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3226         (ArrayPtr): Derives from FixedBufferPtr.
3227         (ArrayPtr.Emit): Add extra emit for array elements.
3228
3229         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3230
3231         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3232         for compiler generated types.
3233         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3234
3235         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3236         and consume less memory.
3237         (Fixed.Resolve): Add fixed buffer case.
3238
3239         * typemanager.cs (compiler_generated_attr_ctor,
3240         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3241         (HasElementType): Add our own implementation to work on every
3242         runtime.
3243
3244 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3245
3246         * anonymous.cs (CaptureContext): Track whether `this' has been
3247         referenced.   
3248
3249         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3250         only captured `this' if it was implicitly done (instance
3251         methods/variables were used). 
3252
3253         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3254         `this' must be captured.
3255
3256 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3257  
3258         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3259         is null it means that there has been no need to capture anything,
3260         so we just create a sibling.
3261
3262         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3263
3264         Just a partial fix.  The other half is fairly elusive.
3265         
3266 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3267
3268         Fix #52586, cs0121-4.cs.
3269         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3270         and return a hashtable.
3271         (MemberCache.ClearDeclaredOnly): New.
3272         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3273         the method_hash of a base type too.
3274         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3275         type methods.  Overwrite entries with the same MethodHandle so
3276         that the ReflectedType is correct.  The process leaves in base
3277         virtual functions and their overrides as distinct entries.
3278         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3279         matters since it was boxed in a ArrayList before.
3280         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3281         modifier.
3282         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3283         case of a virtual function and its override (choose the overload
3284         as better).
3285         (Invocation.OverloadResolve): Avoid 'override' members during
3286         'applicable_type' calculation.
3287
3288 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3289
3290         Combine two near-redundant caches.
3291         * typemanager.cs (method_params): Rename from method_internal_params.
3292         (TypeManager.GetParameterData): New.  Replace
3293         Invocation.GetParameterData.
3294         (TypeManager.LookupParametersByBuilder): Remove.
3295         * expression.cs (Invocation.method_parameter_cache): Remove.
3296         (Invocation.GetParameterData): Remove.
3297         Update to changes.
3298         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3299         Update to changes.
3300
3301 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3302
3303         Fix #72015.
3304         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3305         TypeManager.multicast_delegate_type is null, resolve it by looking
3306         up "System.MulticastDelegate".
3307         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3308
3309 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3310             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3311             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3312
3313         Fix cs0164.cs.
3314         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3315         (LabeledStatement.AddReference): New.  Set 'referenced'.
3316         (Goto.Resolve): Use it.
3317
3318 2005-02-05  John Luke  <john.luke@gmail.com>
3319
3320         * driver.cs: remove duplicate -doc line in Usage ()
3321
3322 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3323
3324         * location.cs (Location.AddFile): Fix CS2002 error report.
3325
3326 2005-02-02  Martin Baulig  <martin@ximian.com>
3327
3328         * delegate.cs (Delegate.DefineType): Report an internal error if
3329         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3330         details.        
3331
3332 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3333
3334         Fix a crasher in a variant of #31984.
3335         * const.cs (Constant.CheckBase): New override that defers the
3336         new-or-override check in case the base type hasn't been populated
3337         yet.
3338         (Constant.Define): Ensure the new-or-override check is performed.
3339
3340 2005-02-01  Duncan Mak  <duncan@ximian.com>
3341
3342         * const.cs (LookupConstantValue): Check that `ce' is not null
3343         before calling GetValue ().
3344
3345 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3346
3347         Fix test-334.cs (#69519).
3348         * cs-parser.jay (using_alias_directive): Pass in an expression to
3349         NamespaceEntry.UsingAlias.
3350         (using_namespace_directive): Pass in an expression to
3351         NamespaceEntry.Using.
3352         (namespace_name): Don't flatten to a string.
3353         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3354         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3355         ResolveAsTypeStep.
3356         (NamespaceEntry.UsingEntry): Likewise.
3357         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3358         changes.
3359         (NamespaceEntry.LookupForUsing): Remove.
3360         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3361         names.
3362         (NamespaceEntry.Lookup): Remove support for dotted names.
3363
3364 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3365
3366         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3367         split into two.
3368         (NamespaceEntry.ImplicitParent): Compute on demand.
3369         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3370         parallels the current.
3371         (NamespaceEntry.LookupForUsing): Use it.
3372         (NamespaceEntry.Lookup): If the current namespace-entry is
3373         implicit, don't search aliases and using tables.
3374
3375 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3376
3377         Fix #31984.
3378         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3379         BaseCache here.
3380         (TypeContainer.BaseCache): Compute on demand.
3381         (TypeContainer.FindMembers): Define constants and types if they're
3382         not already created.
3383         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3384         check.
3385         * const.cs (Constant.Define): Make idempotent.
3386
3387 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3388
3389         * pending.cs: Produce better code (no nops produced by using Ldarg
3390         + value).
3391         
3392         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3393         i - 1' it should be arg + 1.
3394
3395         Fixes bug #71819.
3396
3397 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3398
3399         * attribute.cs (Attribute.CheckAttributeType): Make private
3400         non-virtual.
3401         (Attribute.ResolveType): Make virtual.
3402         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3403         handling of RootContext.Tree.Types.
3404
3405 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3406
3407         Update attribute-handling to use the SimpleName/MemberAccess
3408         mechanisms.
3409         * cs-parser.jay (attribute): Pass in an expression to the
3410         constructors of Attribute and GlobalAttribute.
3411         * attribute.cs (Attribute): Take an expression for the name.
3412         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3413         passed in attribute name expression.
3414         (Attribute.CheckAttributeType): Use it.
3415         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3416         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3417         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3418         argument to prevent error messages if the lookup fails.
3419
3420 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3421
3422         * expression.cs (Indirection): Implemented IVariable interface
3423         to support indirection in AddressOf operator.
3424         (PointerArithmetic.Emit): Add optimalization for case where
3425         result can be precomputed.
3426
3427 2005-01-26  Martin Baulig  <martin@ximian.com>
3428
3429         * class.cs (TypeContainer.AttributeTargets): Return the correct
3430         AttributeTargets depending on our `Kind' instead of throwing an
3431         exception; fixes #71632.
3432
3433 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3434
3435         Fix #71257
3436         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3437         constant members.
3438
3439 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3440
3441         Fix #71602.
3442         * expression.cs (MemberAccess.DoResolve): Don't complain with
3443         cs0572 when the LHS of a member access has identical name and type
3444         name.
3445
3446 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3447
3448         Fix #71651, #71675
3449         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3450         CreatePermission.
3451         Create custom PermissionSet only for PermissionSetAttribute.
3452
3453 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3454
3455         Fix #71649
3456         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3457         delegates in static class.
3458
3459 2005-01-24  Martin Baulig  <martin@ximian.com>
3460
3461         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3462         merging an implicit block, just use its reachability.
3463
3464         * statement.cs (Block.Resolve): Make the unreachable code check
3465         work wrt. implicit blocks; see test-337 from #63842.
3466
3467 2005-01-21  Alp Toker  <alp@atoker.com>
3468  
3469         * cs-parser.jay: destructor_declaration's container is PartialContainer
3470         not Class when partial types are used, so use Kind prop instead of
3471         'is'.
3472         
3473 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3474
3475         * cs-parser.jay: Improve error reporting when an interface
3476         declares new types.
3477
3478 2005-01-20  Dick Porter  <dick@ximian.com>
3479
3480         * support.cs: SeekableStreamReader fix from Sandor Dobos
3481         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3482         chars are read.  Fixes bug 70369.
3483
3484 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3485
3486         * cs-parser.jay (catch_clause): Simplify current_block handling
3487         somewhat.
3488
3489 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3490
3491         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3492         code with ImplicitStandardConversion to handle the implicit
3493         conversion of method groups into valid delegate invocations. 
3494
3495         The problem is that in parameter handling we were using this code
3496         path.  Fixes bug #64698
3497
3498 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3499
3500         * cs-parser.jay: Fix several infelicities.
3501         - Avoid assigning to the parser value stack.  Code like 
3502           '$3 = null' is unclean.  Synthesize a value for the code block
3503           instead. 
3504         - Avoid using oob_stack for storing location information.  Use ...
3505         (_mark_): ... this.  New (empty) rule.  Saves the current location
3506         in $$.
3507         (foreach_statement): Avoid using oob_stack for current_block
3508         handling.  Use technique used in for_statement and
3509         using_statement.  Synthesize a value for the code block to store
3510         additional intermediate information.
3511
3512 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3513
3514         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3515         of a different type is only allowed to private fields of a
3516         containing type, not on fields of a base class.
3517
3518         See test-174.cs and error cs0122-9.cs
3519
3520 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3521
3522         Fix test-335.cs (bug #58126).
3523         * cs-parser.jay (argument): Split out non-expression parts of the
3524         rule into 'non_simple_argument'.
3525         (invocation_expression): Support parenthesized invocations with
3526         multiple arguments, and with single non-simple arguments.
3527
3528 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3529
3530         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3531         places.
3532
3533 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3534
3535         Fix cs0038-1.cs, cs1640-6.cs.
3536         * ecore.cs (Expression.Resolve): Remove special-case for
3537         SimpleName in error-handling.
3538         (Expression.almostMatchedMembers): Relax access permission to
3539         protected.
3540         (Expression.MemberLookupFailed): Handle duplicates in
3541         almostMatchedMembers list.
3542         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3543         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3544         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3545         overload if the passed in MemberInfo is a MethodBase.
3546
3547 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3548
3549         Fix #70749
3550         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3551         for non-CAS & merge permission sets properly.
3552
3553 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3554
3555         Improve standard-compliance of simple name and member access 
3556         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3557         * ecore.cs (FullNamedExpression): New abstract base class 
3558         for Namespaces and TypeExpressions.
3559         (ResolveFlags.SimpleName): Remove.
3560         (SimpleName): Remove support for dotted names.
3561         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3562         DeclSpace.FindType and DeclSpace.LookupType.
3563         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3564         (Expression.ExprClassName): Make member function.
3565         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3566         a namespace.  Remove creation of dotted "SimpleName"s.
3567         (MemberAccess.DoResolve): Likewise.
3568         * decl.cs (DeclSpace.Cache): Make private.
3569         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3570         (DeclSpace.FindType): Update.
3571         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3572         FullNamedExpression.
3573         * namespace.cs (Namespace): Derive from FullNamedExpression
3574         so that it can be part of expression resolution.
3575         (Namespace.Lookup): Return an FullNamedExpression.
3576         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3577         namespace.
3578         * rootcontext.cs (NamespaceLookup): Remove.
3579         (LookupType): Move to DeclSpace.
3580         * attribute.cs (CheckAttributeType): Update.
3581         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3582         (FindDocumentedTypeNonArray): Likewise.
3583
3584 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3585
3586         Fix cs0509.cs, cs1632.cs.
3587         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3588         is the same as IsInterface.
3589         (TypeContainer.GetClassBases): Likewise.
3590         * statement.cs (LabeledStatement.ig): New field.
3591         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3592         label.
3593         (LabeledStatement.DoEmit): Check that the label was created with
3594         the same ILGenerator.
3595
3596 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3597
3598         Fix #71058
3599         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3600         accessors to its properties.
3601
3602         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3603         from accessors to property.
3604         
3605 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3606
3607         Fix #70722
3608         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3609         only for overrides.
3610         
3611 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3612
3613         * attribute.cs: Check for null and empty strings.  
3614
3615         I have lost another battle to Paolo.
3616
3617 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3618
3619         Fix #70942
3620         * class.cs (PropertyMethod): Set Parent field in ctors.
3621         (SetMethod.InternalParameters): Add unsafe switch hack.
3622         Override MarkForDuplicationCheck where it is appropriate.
3623
3624         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3625         It says whether container allows members with the same name.
3626         Base default is no.
3627         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3628         Removed is_method parameter.
3629
3630 2005-01-06  Duncan Mak  <duncan@ximian.com>
3631
3632         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3633         because the previous change led to incorrect reporting of CS1032
3634         ("Cannot define/undefine preprocessor symbols after first token in
3635         file"). Instead of using `tokens_seen' as the only flag that
3636         triggers CS1040, introduce `comments_seen'. This new flag is used
3637         to signify having seen comments on the current line, so it is
3638         unset after a newline.
3639
3640 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3641
3642         * doc.cs : When searching for a type, find nested type too.
3643           This fixes bug #71040.
3644
3645 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3646
3647         * doc.cs :
3648           - Warn missing member comment on those classes which also does not
3649             have doc comments. Fixed bug #71041.
3650           - Don't warn missing doc comment on default constructor.
3651             Fixed bug #71042.
3652
3653 2005-01-06  Duncan Mak  <duncan@ximian.com>
3654
3655         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3656         comments, set `tokens_seen' to true. This allows us to detect
3657         misplaced preprocessor directives (i.e. not at the beginning of
3658         the a line, nor after whitespaces). In that case, report error
3659         CS1040. This fixes bug #56460.
3660
3661         * cs-parser.jay (interface_member_declaration): Add checks for
3662         IsExplicitImpl, and report CS0541 error if an interface member is
3663         defined as an explicit interface declaration.
3664
3665 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3666
3667         Fix #70817
3668         * class.cs (PropertyMethod): Set Parent field in ctors.
3669         (SetMethod.InternalParameters): Add unsafe switch hack.
3670         
3671         * decl.cs (MemberCore.Parent): Cannot be readonly.
3672
3673 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3674
3675         * decl.cs (DeclSpace.ResolveType): Remove.
3676         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3677         Merge in code from ...
3678         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3679         * class.cs, enum.cs: Update to changes.
3680
3681 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3682
3683         * anonymous.cs: Ensure that we init the scope of our parent if it
3684         has not been initialized yet.
3685
3686 2004-12-30  Duncan Mak  <duncan@ximian.com>
3687
3688         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3689         if field.FieldBuilder is null. Fixes #70758.
3690
3691         * convert.cs: Fixed some typos and updated some of the comments.
3692         (ImplicitStandardConversionExists):
3693         (TryImplicitIntConversion): If `target_type' is an interface and
3694         the type of `ic' implements this interface, return true or a new
3695         BoxedCast instead of null. This fixes #70468.
3696
3697 2004-12-29  Duncan Mak  <duncan@ximian.com>
3698
3699         * expression.cs (Argument.Emit): Check that Expr is
3700         IMemoryLocation before casting to it, and report CS1510 otherwise.
3701
3702         This fixes #70402.
3703
3704 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3705
3706         * statement.cs (Block.ThisVariable): remove the recursion here, to
3707         make the --profile more sane.
3708
3709 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3710
3711         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3712         assembly, by JB Evain.
3713
3714 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3715
3716         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3717           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3718         "parent" refers to enclosing type/class.  "base" refers to superclass.
3719
3720 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3721
3722         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3723         Ensure that we only have GlobalAttributes.
3724         * attribute.cs (Attribute.Emit): Make non-virtual.
3725         (GlobalAttribute.Emit): Remove.
3726         (Attribute.Resolve): Make virtual.
3727         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3728         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3729         the argument. Don't create one.
3730         (Attribute.GetObsoleteAttribute): Likewise.
3731         (Attribute.GetClsCompliantAttributeValue): Likewise.
3732         * class.cs, decl.cs: Update to changes.
3733
3734 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3735
3736         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3737         
3738         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3739         
3740         * statement.cs (Foreach.Resolve): Add error 186 report.
3741
3742 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3743
3744         * expression.cs (Conditional.DoResolve): Add warning 429.
3745         
3746         * statement.cs (If.Resolve): Add warning 665.
3747
3748 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3749
3750         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3751         except when in the parser, and in GlobalAttribute.
3752         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3753         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3754         RootContext.Tree.Types.NamespaceEntry once work is done.
3755         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3756         and resets RootContext.Tree.Types.NamespaceEntry.
3757
3758 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3759
3760         * cs-parser.jay: Don't create a block for every variable.
3761
3762 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3763
3764         * location.cs: Provide extra information.
3765
3766         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3767         variables from the captured environment, it is the ldarg_0.
3768
3769 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3770
3771         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3772         find a conclusion.
3773         
3774         * class.cs: Changed warning level for 169 to avoid developer
3775         displeasure from warning flooding. It will be changed back when they
3776         fix most of current BCL warnings.
3777         
3778         * RootContext.cs: Pushed default WarningLevel to 3.
3779         
3780         * statement.cs: Removed unused variable.
3781
3782 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3783
3784         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3785         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3786         Add error 502 report.
3787         (StaticClass.DefineType): Add error 441 report.
3788         (Class.AllowedModifiersProp): New virtual property as temporary
3789         extension to AllowedModifiers.
3790         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3791         to share implementation with StaticClass and don't call virtual
3792         methods from ctor.
3793         
3794         * driver.cs (MainDriver): Add error 1558 test.
3795
3796         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3797         report. Moved error 36 test here.
3798
3799         * statement.cs (Throw.Resolve): Add error 724 report.
3800
3801         * typemanager.cs: Add out_attribute_type core type.
3802         
3803 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3804
3805         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3806         3018 report.
3807         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3808
3809         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3810         3017 report.
3811         
3812         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3813
3814         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3815         Add error 3023 report.
3816         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3817
3818         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3819         implementation.
3820
3821 2004-12-12  John Luke  <john.luke@gmail.com>
3822
3823         * driver.cs (AddArgs): take -- into account when
3824         adding arguments, fixes bug 65710 
3825
3826 2004-12-12  Martin Baulig  <martin@ximian.com>
3827
3828         * expression.cs (Unary.TryReduceNegative): Added support for
3829         SByteConstant and ByteConstant.
3830         (Unary.Reduce): Check error values from TryReduceNegative().
3831
3832 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3833
3834         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3835         and report exception as error 182.
3836
3837 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3838
3839         * driver.cs (Main): Fix message when there are warnings.
3840
3841 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3842
3843         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3844
3845 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3846
3847         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3848         Reduced number of warnings.
3849         
3850         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3851
3852 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3853
3854         * driver.cs: Removed message.
3855
3856         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3857
3858 2004-12-08    <vargaz@freemail.hu>
3859
3860         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3861
3862 2004-12-08  Martin Baulig  <martin@ximian.com>
3863
3864         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3865         instead of a CS3002 for properties and indexer.
3866
3867 2004-12-08  Martin Baulig  <martin@ximian.com>
3868
3869         * decl.cs (MemberName.ToString): Make this work again.
3870
3871 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3872
3873         * attribute.cs (Resolve): Add error 591 detection.
3874
3875         * class.cs (FieldMember.Define): Add error 1547 detection.
3876         (Indexer.Define): Add error 620 detection.
3877         (Operator.Define): Add error 590 detection.
3878
3879         * ecore.cs: Missing argument for error 79.
3880
3881         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3882         detection.
3883
3884 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3885
3886         Fix #70106
3887         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3888         only.
3889
3890 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3891
3892         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3893           Some operator comments were suppressed.
3894         * doc.cs : Implicit/explicit operator name in doc comments are like
3895           "op_Explicit(type)~returnType", so added suffix handling.
3896
3897 2004-12-07  Martin Baulig  <martin@ximian.com>
3898
3899         * decl.cs
3900         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3901         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3902         (DeclSpace.ec): New protected field; store the EmitContext here.
3903         (DeclSpace.EmitContext): New public property; moved here from
3904         `TypeContainer'.
3905         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3906         EmitContext.
3907
3908         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3909         (Enum.Emit): Don't create a new EmitContext.
3910
3911         * delegate.cs (Delegate.DefineType): Always create the
3912         EmitContext.
3913
3914         * iterators.cs (Iterators.DefineIterator): Create a new
3915         EmitContext and store it in `ec'.
3916
3917 2004-08-24  Martin Baulig  <martin@ximian.com>
3918
3919         * typemanager.cs
3920         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3921         this for accessibility checks.
3922         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3923         IsNestedFamilyAccessible.
3924         (TypeManager.IsSubclassOf): New method, do what the name actually
3925         says.   
3926
3927 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3928
3929         Fix crash on cs0657-17.cs.
3930         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3931         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3932         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3933         the case where the NamespaceEntry gets overwritten.
3934
3935 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3936
3937         Fixed #69195, #56821
3938         * ecore.cs (ResolveBoolean): Tiny refactoring.
3939
3940         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3941         of right expression resolving when left is false constant and
3942         operator is LogicalAnd OR true constant and operator is LogicalOr.
3943
3944         * statement.cs (ResolveUnreachable): Always reports warning.
3945
3946 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3947
3948         * class.cs: Distinguish between 1721 and 1722 (just a little help
3949         for the programmer).
3950
3951 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3952
3953         * delegate.cs: Only allow this on new versions of the language. 
3954
3955 2004-12-02  Duncan Mak  <duncan@ximian.com>
3956
3957         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3958         Expression class.
3959         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3960         here as a static method. Take an additional bool out parameter
3961         `must_do_cs1540_check' for signaling to InstanceResolve.
3962         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3963         member field from PropertyExpr class and made it an argument of
3964         the method instead.
3965         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3966         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3967         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3968         and `remove_accessor' as well as InstanceResolve: report CS0122
3969         where applicable.
3970
3971         Fixes #70129.
3972
3973 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3974
3975         Fix test-327.cs, test-328.cs, and put in early infrastructure
3976         for eventually fixing #52697.
3977         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3978         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3979         from other methods.
3980         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3981         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3982         (VerifyUsing, error246): Update.
3983         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3984         'NamespaceEntry.LookupNamespaceOrType'.
3985
3986 2004-12-03  Martin Baulig  <martin@ximian.com>
3987
3988         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3989         method as our child, call AnonymousMethod.Compatible() on it.
3990
3991 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3992
3993         Disable XML documentation support in 'basic' profile.
3994         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3995         Redirect XmlElement to System.Object.
3996         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3997         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3998         * mcs.exe.sources: Add doc-bootstrap.cs.
3999         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4000         of doc.cs.
4001
4002 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4003
4004         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4005           comments are allowed.
4006
4007 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4008
4009         * delegate.cs: Add checks for subtypes in paramaters and return values
4010         in VerifyMethod () to add support for Covariance/Contravariance
4011         in delegates.
4012         
4013 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4014
4015         * report.cs: Remove extra closing parenthesis.
4016
4017         * convert.cs (Error_CannotImplicitConversion): If the name of the
4018         types are the same, provide some extra information.
4019
4020         * class.cs (FieldBase): Use an unused bit field from the field to
4021         encode the `has_offset' property from the FieldMember.  This saves
4022         a couple of Ks on bootstrap compilation.
4023
4024         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4025         method as our child, return the AnonymousMethod resolved
4026         expression.
4027
4028         * expression.cs (New.DoResolve): Allow return values from
4029         NewDelegate to also include AnonymousMethods.
4030
4031         Fixes #70150.
4032
4033 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4034
4035         Fix bug #70102
4036         * attribute.cs (Resolve): Improved implementation of params
4037         attribute arguments.
4038
4039         * support.cs (ParameterData): Add HasParams to be faster.
4040
4041 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4042
4043         all things are for /doc support:
4044
4045         * doc.cs: new file that supports XML documentation generation.
4046         * mcs.exe.sources: added doc.cs.
4047         * driver.cs:
4048           Handle /doc command line option.
4049           Report error 2006 instead of 5 for missing file name for /doc.
4050           Generate XML documentation when required, after type resolution.
4051         * cs-tokenizer.cs:
4052           Added support for picking up documentation (/// and /** ... */),
4053           including a new XmlCommentState enumeration.
4054         * cs-parser.jay:
4055           Added lines to fill Documentation element for field, constant,
4056           property, indexer, method, constructor, destructor, operator, event
4057           and class, struct, interface, delegate, enum.
4058           Added lines to warn incorrect comment.
4059         * rootcontext.cs :
4060           Added Documentation field (passed only when /doc was specified).
4061         * decl.cs:
4062           Added DocComment, DocCommentHeader, GenerateDocComment() and
4063           OnGenerateDocComment() and some supporting private members for
4064           /doc feature to MemberCore.
4065         * class.cs:
4066           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4067         * delegate.cs:
4068           Added overriden DocCommentHeader.
4069         * enum.cs:
4070           Added overriden DocCommentHeader and GenerateDocComment().
4071
4072 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4073
4074         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4075         unwrapping the enumeration values, chain to
4076         DoConstantNumericPromotions again, so we can promote things to the
4077         fundamental types (takes care of enums that are bytes, sbytes).
4078
4079         Fixes bug #62054.
4080
4081 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4082
4083         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4084         Fix long-standing bug in type-lookup.  Use FindType instead of
4085         LookupType when ec.ResolvingTypeTree.
4086         (Attribute.ResolveType, Attribute.Resolve)
4087         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4088         Update to changes.
4089         (Attributes.Search): Remove internal version.  Update.
4090         (Attributes.SearchMulti): Update.
4091         (Attributes.GetClsCompliantAttribute): Remove.
4092         (Attributes.GetIndexerNameAttribute): Remove.
4093         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4094         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4095         * class.cs (Indexer.Define): Likewise.
4096
4097 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4098
4099         Fix bug #68790
4100         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4101         MarshallByReference members access.
4102
4103         * expression.cs: Use CheckMarshallByRefAccess;
4104         Better error CS0197 message.
4105
4106         * report.cs: Print whole related error message.
4107
4108 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4109
4110         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4111         the current directory to help debugging.
4112
4113 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4114
4115         * class (GetClassBases): Better error 60 report.
4116         (EventProperty): Disabled warning 67 detection.
4117
4118 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4119
4120         Fix bug #60324
4121         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4122
4123         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4124         precise values.
4125
4126 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4127
4128         Fix bug #49488
4129         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4130
4131         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4132
4133 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4134
4135         * attribute.cs (Attribute.Resolve): Refine error reporting and
4136         report a cs0117 if the identifier does not exist, to distinguish
4137         from 0617 which is a miss-use of the actual identifier.
4138
4139         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4140         between cs0070 and cs0079.
4141
4142         * class.cs (MemberBase.DoDefine): When reporting a wrong
4143         accessibility level, we use MethodCore to compare instead of
4144         Method (this was a regression in some refactoring effort).
4145
4146         So now we correctly report cs0056 again.
4147
4148         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4149         testing the target_type (which was known to be object_type) and
4150         not the source type (which is anonymous_method).
4151
4152         Fixed reporting of error cs1660.
4153
4154         * expression.cs (UserCast.Source): Expose the underlying cast.
4155
4156         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4157         allowed types to find a match to int32 first (most common).
4158
4159         In addition, it ignores any ImplicitUserConversions that did an
4160         internal implicit conversion (as the switch statement allows only
4161         one integral conversion to exist).
4162
4163         * class.cs (PartialContainer.Create): rename `name' to
4164         `member_name' for clarity.  Then replace the string calls with a
4165         call to MemberName.GetPartialName, as now using
4166         MemberName.ToString is an error (this is due to the side effects
4167         it had, that were fixed in the past).
4168
4169         This will restore the error reporting on a number of partial class
4170         errors that were missusing this (and getting an exception as a
4171         results, which is now just a plain textual warning, because
4172         yyparse debug output would crash otherwise).
4173
4174 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4175
4176         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4177
4178 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4179
4180         * rootcontext.cs (LookupType): Make sure to cache lookups that
4181         don't give us a negative result. This saves about 5% of corlib
4182         compilation time.
4183
4184 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4185
4186         * report.cs (AbstractMessage.Print): messages are sent to stderr
4187
4188         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4189         non-interface in the list of interfaces (at this point, either
4190         parent was properly set, or a base class is being listed in the
4191         interfaces section).
4192
4193         This flags error 1722, and resolves the crash from bug 69259.
4194
4195 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4196
4197         * statement.cs (Using.EmitExpressionFinally): make this work right
4198         for valuetypes. Fixes 69926.
4199
4200 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4201
4202         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4203         converted to an enum" here, before we try to change the underlying
4204         type.  This code exists, but it is a different code path than the
4205         one used while encoding constants.
4206
4207         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4208         old bug: when converting from the null literal to a pointer,
4209         return an EmptyCast, not the NullLiteral.
4210
4211         This fixes #69921, the recent null_type changes probably made this
4212         bug more prominent.
4213
4214         (ImplicitReferenceConversionExists): In addition, resynchronized
4215         the code here, so it matches the same code in
4216         ImplicitReferenceConversionExists for the `from any class-type S
4217         to any interface-type T'.
4218         
4219
4220 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4221
4222         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4223
4224 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4225
4226         * cs-parser.jay: Use verbosity accordingly. 
4227
4228 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4229
4230         * expression.cs (Unary.ResolveOperator): Do not report warning;
4231         AddressOf reads from variable.
4232         
4233         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4234
4235 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4236
4237         Fix bug #69462
4238
4239         * attribute.cs (Attributable): Removed CheckTargets.
4240         (Attributes.Emit): Explicit attribute targets are tested here.
4241
4242         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4243         not enabled for interfaces.
4244
4245         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4246         (GetAssemblyName): Ouch next bug there.
4247
4248 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4249
4250         * expression.cs: Error 275 added.
4251         
4252 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4253
4254         Fix bug #69177 (Implemented decimal constant support)
4255
4256         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4257         (BinaryFold): Add DecimalConstant.
4258
4259         * const.cs (Define): Decimal constant 
4260         (is not constant.
4261         (ChangeType): Add decimal type handling.
4262         (LookupConstantValue): Don't set value for decimal type but
4263         emit DecimalConstantAttribute. Needed for constant optimization.
4264
4265         * constant.cs (ToDecimal): New method.
4266         (ConvertToDecimal): New method.
4267         (IntConstant): Implemented ConvertToDecimal.
4268         (DecimalConstant.Emit): Emit optimized version for decimals in
4269         int range.
4270
4271         * expression.cs (ResolveOperator): Changed order of constant
4272         reduction to work correctly with native types which have
4273         overloaded operators.
4274         (ResolveMemberAccess): Extract constant value from attribute
4275         for decimal type.
4276
4277         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4278
4279         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4280         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4281         (ChangeType): Decimal is special.
4282         (TypeToCoreType): Add decimal type.
4283
4284 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4285
4286         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4287         decimal types.
4288
4289 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4290
4291         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4292         test cs1667-5.cs.
4293
4294 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4295
4296         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4297
4298         * pending.cs (PendingImplementation): Grab only interfaces.
4299
4300 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4301
4302         * statement.cs (ForeachHelperMethods): Add location member and
4303         error 202 detection.
4304
4305 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4306
4307         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4308         automatically handled by executable.make.
4309         (PROGRAM): Make profile-specific.
4310
4311 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4312
4313         * expression.cs (DoResolveBase): Fixed wrong warning for out
4314         variables.
4315
4316 2004-11-18  Martin Baulig  <martin@ximian.com>
4317
4318         Merged latest changes into gmcs.  Please keep this comment in
4319         here, it makes it easier for me to see what changed in MCS since
4320         the last time I merged.
4321
4322 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4323
4324         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4325         (TypeHandle.GetMemberCache): New.
4326         (TypeHandle.TypeHandle): Update.
4327         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4328         (TypeManager.LookupParentInterfacesCache):
4329         Rename from LookupInterfaceCache.  Optimize slightly.
4330         (TypeManager.MemberLookup_FindMembers): Update.
4331         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4332         multi-type variant.
4333         (AddCacheContents): Rename from AddHashtable.
4334         * class.cs (TypeContainer.parent_container): Remove.
4335         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4336         (TypeContainer.DoDefineMembers): Don't initialize it.
4337         Update to name changes.
4338         
4339 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4340
4341         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4342         that factors the code to check access modifiers on override.  
4343
4344         (PropertyBase): Use the code here.
4345
4346         Patch from Lluis S'anchez, fixes bug #69361.
4347
4348 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4349
4350         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4351         routine that is used to report the use of a captured variable
4352         whose address has been taken.
4353
4354         There are two checks: one when variables are being captured and
4355         the other check is when the address of a variable is taken. 
4356         
4357         (because an anonymous methods might be resolved before *or* after
4358         the address has been taken) and 
4359
4360         * expression.cs (Conditional.DoResolve): Remove the special
4361         casing that Martin added to trueExpr and falseExpr being both
4362         NullLiteral.  We get the right behavior now just by introducing
4363         the null_type into the compiler. 
4364
4365         * convert.cs (ExplicitConversion): Change the code to use
4366         null_type instead of testing `expr is NullLiteral'.
4367         (ImplicitConversionStandard): use null_type too.
4368         (ImplicitReferenceConversionExists): use null_type too.
4369         (ImplicitReferenceConversion): use null_type too.
4370
4371         * literal.cs: The type of `NullLiteral' is now null_type instead
4372         of object_type. 
4373         (Resolve): Set the type here.
4374
4375         * typemanager.cs: Introduce null_type.
4376
4377 2004-11-17  Martin Baulig  <martin@ximian.com>
4378
4379         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4380         direction, like FindMembers() does.  Fixes #69546, testcase is in
4381         test-315.cs.    
4382
4383 2004-11-16  Martin Baulig  <martin@ximian.com>
4384
4385         This is based on a patch from Marek Safar, see bug #69082.
4386         Fixes bugs #63705 and #67130.
4387
4388         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4389         method; create a MemberCache for an interface type and cache the
4390         result.
4391
4392         * decl.cs (IMemberContainer.ParentContainer): Removed.
4393         (IMemberContainer.ParentCache): New property.
4394         (MemberCache.SetupCacheForInterface): Removed.
4395         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4396         to create a cache for an interface's "parent".
4397
4398         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4399         interfaces too.
4400
4401 2004-11-16  Martin Baulig  <martin@ximian.com>
4402
4403         Merged back from gmcs; these changes already went into gmcs a
4404         couple of weeks ago.
4405
4406         * typemanager.cs
4407         (TypeManager.AddUserType): Removed the `ifaces' argument.
4408         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4409         `TypeExpr []'.
4410         (TypeManager.AddUserInterface): Removed.
4411         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4412         `TypeExpr []'.
4413         (TypeManager.GetInterfaces): Likewise.
4414         (TypeManager.GetExplicitInterfaces): Likewise.
4415
4416         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4417
4418         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4419         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4420
4421 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4422
4423         * statement.cs: Avoid adding bools to a hashtable.
4424
4425 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4426
4427         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4428         calling an unsafe method from a safe location.
4429
4430 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4431
4432         Fix #69167
4433         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4434
4435 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4436
4437         * namespace.cs (VerifyUsing): use GetPartialName instead of
4438         ToString. 
4439
4440 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4441
4442         * statement.cs (Return.Resolve): Fix regression in typo: if
4443         `in_exc', we have to request a NeedReturnLabel, this was a typo
4444         introduced in the anonymous method check-in.  Fixes #69131.
4445
4446         * Indexers were using the ShortName when defining themselves,
4447         causing a regression in the compiler bootstrap when applying the
4448         patch from 2004-11-02 (first part), now they use their full name
4449         and the bug is gone.
4450
4451 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4452
4453         * driver.cs: Strip the path from the names of embedded resources. Fixes
4454         #68519.
4455
4456 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4457
4458         Fix error message regression: cs0104-2.cs.
4459         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4460         (AliasEntry.Resolve): Update.
4461         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4462         'silent' flag.
4463         (RootContext.LookupType): Update.
4464
4465 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4466
4467         * cs-parser.jay: Add support for handling accessor modifiers
4468         * class: Add support port accessor modifiers and error checking,
4469         define PropertyMethod.Define as virtual (not abstract anymore)
4470         * ecore.cs: Add checking for proeprties access with access modifiers
4471         * iterators.cs: Modify Accessor constructor call based in the modified
4472         constructor
4473 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4474
4475         * expression.cs (StringConcat): Handle being called twice,
4476         as when we have a concat in a field init with more than two
4477         ctors in the class
4478
4479 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4480
4481         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4482         special case explicit implementations, we should always produce
4483         the .property or .event declaration.
4484         
4485         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4486         since it will not return correct data if people use this
4487         unresolved in the presence of using statements (see test-313).
4488
4489         * class.cs (MethodData.Define): If we are an explicit interface
4490         implementation, set the method name to the full name of the
4491         interface plus the name of the method.  
4492
4493         Notice that using the method.MethodName.GetFullName() does not
4494         work, as it will only contain the name as declared on the source
4495         file (it can be a shorthand in the presence of using statements)
4496         and not the fully qualifed type name, for example:
4497
4498         using System;
4499
4500         class D : ICloneable {
4501                 object ICloneable.Clone ()  {
4502                 }
4503         }
4504
4505         Would produce a method called `ICloneable.Clone' instead of
4506         `System.ICloneable.Clone'.
4507
4508         * namespace.cs (Alias.Resolve): Use GetPartialName.
4509         
4510 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4511
4512         * cs-parser.jay: Add error 1055 report.
4513
4514 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4515
4516         * assign.cs (Assign.DoResolve): Only do the transform of
4517         assignment into a New if the types are compatible, if not, fall
4518         through and let the implicit code deal with the errors and with
4519         the necessary conversions. 
4520
4521 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4522
4523         * cs-parser.jay: Add error 1031 report.
4524
4525         * cs-tokenizer.cs: Add location for error 1038.
4526
4527 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4528
4529         * cs-parser.jay: Add error 1016 report.
4530
4531 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4532
4533         * cs-parser.jay: Add errors 1575,1611 report.
4534
4535 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4536
4537         * cs-parser.jay: Add error 1001 report.
4538
4539 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4540
4541         Fix #68850
4542         * attribute.cs (GetMarshal): Add method argument for
4543         caller identification.
4544
4545         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4546         agument for GetMarshal and RuntimeMissingSupport.
4547
4548 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4549
4550         * attribute.cs (ExtractSecurityPermissionSet): Removed
4551         TypeManager.code_access_permission_type.
4552
4553         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4554
4555 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4556
4557         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4558         for obsolete use of a variable here.   Fixes regression on errors
4559         cs0619-25 and cs0619-26.
4560
4561 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4562
4563         Fix #62358, implemented security attribute encoding.
4564
4565         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4566         Tests permitted SecurityAction for assembly or other types.
4567         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4568         data from SecurityPermissionAttribute to PermisionSet class.
4569
4570         * class.cs (ApplyAttributeBuilder): Added special handling
4571         for System.Security.Permissions.SecurityAttribute based types.
4572
4573         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4574         special handling for System.Security.Permissions.SecurityAttribute
4575         based types.
4576
4577         * enum.cs (ApplyAttributeBuilder): Added special handling
4578         for System.Security.Permissions.SecurityAttribute based types.
4579
4580         * parameter.cs (ApplyAttributeBuilder): Added special handling
4581         for System.Security.Permissions.SecurityAttribute based types.
4582
4583         * rootcontext.cs: Next 2 core types.
4584
4585         * typemanager.cs (TypeManager.security_permission_attr_type):
4586         Built in type for the SecurityPermission Attribute.
4587         (code_access_permission_type): Build in type.
4588
4589 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4590
4591         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4592         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4593         all of this information into
4594         EmitContext.EmitCapturedVariableInstance.
4595         
4596         * codegen.cs (EmitCapturedVariableInstance): move here the
4597         funcionality of emitting an ldarg.0 in the presence of a
4598         remapping.   This centralizes the instance emit code.
4599
4600         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4601         then emit a load of this: it means that we have reached the
4602         topmost ScopeInfo: the one that contains the pointer to the
4603         instance of the class hosting the anonymous method.
4604
4605         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4606         captures to the topmost CaptureContext.
4607
4608 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4609
4610         * expression.cs (LocalVariableReference): Move the knowledge about
4611         the iterators into codegen's EmitCapturedVariableInstance.
4612
4613 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4614
4615         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4616         all code paths return a value from an anonymous method (it is the
4617         same as the 161 error, but for anonymous methods).
4618
4619 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4620
4621         The introduction of anonymous methods in the compiler changed
4622         various ways of doing things in the compiler.  The most
4623         significant one is the hard split between the resolution phase
4624         and the emission phases of the compiler.
4625
4626         For instance, routines that referenced local variables no
4627         longer can safely create temporary variables during the
4628         resolution phase: they must do so from the emission phase,
4629         since the variable might have been "captured", hence access to
4630         it can not be done with the local-variable operations from the runtime.
4631         
4632         * statement.cs 
4633
4634         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4635         is a toplevel block.
4636
4637         (ToplevelBlock): A new kind of Block, these are the blocks that
4638         are created by the parser for all toplevel method bodies.  These
4639         include methods, accessors and anonymous methods.
4640
4641         These contain some extra information not found in regular blocks:
4642         A pointer to an optional CaptureContext (for tracking captured
4643         local variables and parameters).  A pointer to the parent
4644         ToplevelBlock.
4645         
4646         (Return.Resolve): Catch missmatches when returning a value from an
4647         anonymous method (error 1662).
4648         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4649         phase.
4650
4651         (Break.Resolve): ditto.
4652
4653         (SwitchLabel): instead of defining the labels during the
4654         resolution phase, we now turned the public ILLabel and ILLabelCode
4655         labels into methods called GetILLabelCode() and GetILLabel() that
4656         only define the label during the Emit phase.
4657
4658         (GotoCase): Track the SwitchLabel instead of the computed label
4659         (its contained therein).  Emit the code by using
4660         SwitchLabel.GetILLabelCode ().
4661
4662         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4663         whether the Local has been captured or not.
4664
4665         (LocalInfo.IsCaptured): New property, used to tell whether the
4666         local has been captured.
4667         
4668         * anonymous.cs: Vastly updated to contain the anonymous method
4669         support.
4670
4671         The main classes here are: CaptureContext which tracks any
4672         captured information for a toplevel block and ScopeInfo used to
4673         track the activation frames for various local variables.   
4674
4675         Each toplevel block has an optional capture context associated
4676         with it.  When a method contains an anonymous method both the
4677         toplevel method and the anonymous method will create a capture
4678         context.   When variables or parameters are captured, they are
4679         recorded on the CaptureContext that owns them, for example:
4680
4681         void Demo () {
4682              int a;
4683              MyDelegate d = delegate {
4684                  a = 1;
4685              }
4686         }
4687
4688         Here `a' will be recorded as captured on the toplevel
4689         CapturedContext, the inner captured context will not have anything
4690         (it will only have data if local variables or parameters from it
4691         are captured in a nested anonymous method.
4692
4693         The ScopeInfo is used to track the activation frames for local
4694         variables, for example:
4695
4696         for (int i = 0; i < 10; i++)
4697                 for (int j = 0; j < 10; j++){
4698                    MyDelegate d = delegate {
4699                         call (i, j);
4700                    }
4701                 }
4702
4703         At runtime this captures a single captured variable `i', but it
4704         captures 10 different versions of the variable `j'.  The variable
4705         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4706         recorded on a child.  
4707
4708         The toplevel ScopeInfo will also track information like the `this'
4709         pointer if instance variables were referenced (this is necessary
4710         as the anonymous method lives inside a nested class in the host
4711         type of the method). 
4712
4713         (AnonymousMethod): Expanded to track the Toplevel, implement
4714         `AnonymousMethod.Compatible' to tell whether an anonymous method
4715         can be converted to a target delegate type. 
4716
4717         The routine now also produces the anonymous method content
4718
4719         (AnonymousDelegate): A helper class that derives from
4720         DelegateCreation, this is used to generate the code necessary to
4721         produce the delegate for the anonymous method that was created. 
4722
4723         * assign.cs: API adjustments for new changes in
4724         Convert.ImplicitStandardConversionExists.
4725
4726         * class.cs: Adjustments to cope with the fact that now toplevel
4727         blocks are of type `ToplevelBlock'. 
4728
4729         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4730         insteda of standard blocks.
4731
4732         Flag errors if params arguments are passed to anonymous methods.
4733
4734         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4735         `CurrentAnonymousMethod' which points to the current Anonymous
4736         Method.  The variable points to the AnonymousMethod class that
4737         holds the code being compiled.  It is set in the new EmitContext
4738         created for the anonymous method.
4739
4740         (EmitContext.Phase): Introduce a variable and an enumeration to
4741         assist in enforcing some rules about when and where we are allowed
4742         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4743         only one that enfonces this right now).
4744
4745         (EmitContext.HaveCaptureInfo): new helper method that returns
4746         whether we have a CapturedContext initialized.
4747
4748         (EmitContext.CaptureVariable): New method used to register that a
4749         LocalInfo must be flagged for capturing. 
4750
4751         (EmitContext.CapturedParameter): New method used to register that a
4752         parameters must be flagged for capturing. 
4753         
4754         (EmitContext.CapturedField): New method used to register that a
4755         field must be flagged for capturing. 
4756
4757         (EmitContext.HaveCapturedVariables,
4758         EmitContext.HaveCapturedFields): Return whether there are captured
4759         variables or fields. 
4760
4761         (EmitContext.EmitMethodHostInstance): This is used to emit the
4762         instance for the anonymous method.  The instance might be null
4763         (static methods), this (for anonymous methods that capture nothing
4764         and happen to live side-by-side with the current method body) or a
4765         more complicated expression if the method has a CaptureContext.
4766
4767         (EmitContext.EmitTopBlock): Routine that drives the emission of
4768         code: it will first resolve the top block, then emit any metadata
4769         and then emit the code.  The split is done so that we can extract
4770         any anonymous methods and flag any captured variables/parameters.
4771         
4772         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4773         during this phase, the ILGenerator should not be used as labels
4774         and local variables declared here might not be accessible to any
4775         code that is part of an anonymous method.  
4776
4777         Exceptions to this include the temporary variables that are
4778         created by some statements internally for holding temporary
4779         variables. 
4780         
4781         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4782         metadata for a cb
4783
4784         (EmitContext.TemporaryReturn): This method is typically called
4785         from the Emit phase, and its the only place where we allow the
4786         ReturnLabel to be defined other than the EmitMeta.  The reason is
4787         that otherwise we would have to duplicate a lot of logic in the
4788         Resolve phases of various methods that today is on the Emit
4789         phase. 
4790
4791         (EmitContext.NeedReturnLabel): This no longer creates the label,
4792         as the ILGenerator is not valid during the resolve phase.
4793
4794         (EmitContext.EmitThis): Extended the knowledge in this class to
4795         work in anonymous methods in addition to iterators. 
4796
4797         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4798         code is necessary on the stack to access the instance to a local
4799         variable (the variable will be accessed as a field).
4800
4801         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4802         EmitContext.EmitAddressOfParameter): Routines to support
4803         parameters (not completed at this point). 
4804         
4805         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4806         will also remove the parameters.
4807
4808         * convert.cs (Convert): Define a `ConstantEC' which points to a
4809         null.  This is just to prefity some code that uses
4810         ImplicitStandardConversion code and do not have an EmitContext
4811         handy.
4812
4813         The idea is to flag explicitly that at that point in time, it is
4814         known that the conversion will not trigger the delegate checking
4815         code in implicit conversions (which requires a valid
4816         EmitContext). 
4817
4818         Everywhere: pass new EmitContext parameter since
4819         ImplicitStandardConversionExists now requires it to check for
4820         anonymous method conversions. 
4821
4822         (Convert.ImplicitStandardConversionExists): If the type of an
4823         expression is the anonymous_method_type, and the type is a
4824         delegate, we invoke the AnonymousMethod.Compatible method to check
4825         whether an implicit conversion is possible. 
4826
4827         (Convert.ImplicitConversionStandard): Only do implicit method
4828         group conversions if the language level is not ISO_1.
4829
4830         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4831         MethodInfo for the Invoke method.  used by Delegate and
4832         AnonymousDelegate.
4833
4834         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4835         method conversions if the target type is a delegate.
4836
4837         Removed extra debugging nops.
4838
4839         (LocalVariableReference): Turn the `local_info' into a public
4840         field. 
4841
4842         Add `prepared' field, the same hack used for FieldExprs to cope
4843         with composed assignments, as Local variables do not necessarily
4844         operate purely on the stack as they used to: they can be captured
4845         fields. 
4846
4847         Add `temp' for a temporary result, like fields.
4848
4849         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4850
4851         It now copes with Local variables that are captured and emits the
4852         proper instance variable to load it from a field in the captured
4853         case. 
4854
4855         (ParameterReference.DoResolveBase): During the resolve phase,
4856         capture parameters if we are in an anonymous method.
4857
4858         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4859         anonymous method, use the EmitContext helper routines to emit the
4860         parameter reference.
4861
4862         * iterators.cs: Set RemapToProxy to true/false during the
4863         EmitDispose class.
4864
4865         * parameters.cs (GetParameterByName): New helper method. 
4866
4867         * typemanager.cs (anonymous_method_type) a new type that
4868         represents an anonyous method.  This is always an internal type,
4869         used as a fencepost to test against the anonymous-methodness of an
4870         expression. 
4871         
4872 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4873
4874         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4875         561 report.
4876         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4877
4878 2004-10-18  Martin Baulig  <martin@ximian.com>
4879
4880         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4881         `Type' directly, but call ResolveType() on it.
4882         (Catch.Resolve): Likewise.
4883         (Foreach.Resolve): Likewise.
4884
4885 2004-10-18  Martin Baulig  <martin@ximian.com>
4886
4887         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4888         `Type' directly, but call ResolveType() on it.
4889         (Probe.DoResolve): Likewise.
4890         (ArrayCreation.LookupType): Likewise.
4891         (TypeOf.DoResolve): Likewise.
4892         (SizeOf.DoResolve): Likewise.
4893
4894 2004-10-18  Martin Baulig  <martin@ximian.com>
4895
4896         * expression.cs (Invocation.BetterFunction): Put back
4897         TypeManager.TypeToCoreType().
4898
4899 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4900
4901         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4902         the ResolveType.
4903
4904 2004-10-18  Martin Baulig  <martin@ximian.com>
4905
4906         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4907         `Type' directly, but call ResolveType() on it.
4908
4909 2004-10-18  Martin Baulig  <martin@ximian.com>
4910
4911         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4912         `Type' directly, but call ResolveType() on it.
4913         (MemberBase.DoDefine): Likewise.
4914
4915         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4916         `Type' directly, but call ResolveType() on it.
4917         (ComposedCast.DoResolveAsTypeStep): Likewise.
4918
4919         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4920         `Type' directly, but call ResolveType() on it.
4921
4922 2004-10-17  John Luke  <john.luke@gmail.com>
4923
4924         * class.cs (Operator.GetSignatureForError): use CSharpName
4925
4926         * parameter.cs (Parameter.GetSignatureForError): Returns
4927         correct name even if was not defined.
4928
4929 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4930
4931         Fix #65816.
4932         * class.cs (TypeContainer.EmitContext): New property.
4933         (DefineNestedTypes): Create an emitcontext for each part.
4934         (MethodCore.DoDefineParameters): Use container's emitcontext.
4935         Pass type array to InternalParameters.
4936         (MemberBase.DoDefine): Use container's emitcontext.
4937         (FieldMember.Define): Likewise.
4938         (Event.Define): Likewise.
4939         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4940         Pass type array to InternalParameters.
4941         (SetIndexerMethod.GetParameterInfo): Likewise.
4942         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4943         * delegate.cs (Define): Pass emitcontext to
4944         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4945         array to InternalParameters.
4946         * expression.cs (ParameterReference.DoResolveBase): Pass
4947         emitcontext to GetParameterInfo.
4948         (ComposedCast.DoResolveAsTypeStep): Remove check on
4949         ec.ResolvingTypeTree.
4950         * parameter.cs (Parameter.Resolve): Change argument to
4951         EmitContext.  Use ResolveAsTypeTerminal.
4952         (Parameter.GetSignature): Change argument to EmitContext.
4953         (Parameters.ComputeSignature): Likewise.
4954         (Parameters.ComputeParameterTypes): Likewise.
4955         (Parameters.GetParameterInfo): Likewise.
4956         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4957         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4958         * support.cs (InternalParameters..ctor): Remove variant that takes
4959         a DeclSpace.
4960         * typemanager.cs (system_intptr_expr): New.
4961         (InitExpressionTypes): Initialize it.
4962
4963 2004-10-12  Chris Toshok  <toshok@ximian.com>
4964
4965         * cs-parser.jay: fix location for try_statement and catch_clause.
4966
4967 2004-10-11  Martin Baulig  <martin@ximian.com>
4968
4969         * report.cs: Don't make --fatal abort on warnings, we have
4970         -warnaserror for that.
4971
4972 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4973
4974         More DeclSpace.ResolveType avoidance.
4975         * decl.cs (MemberCore.InUnsafe): New property.
4976         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4977         with newly created EmitContext.
4978         (FieldMember.Define): Likewise.
4979         * delegate.cs (Delegate.Define): Likewise.
4980         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4981         only if normal name-lookup fails.
4982         (TypeExpr.DoResolve): Enable error-checking.
4983         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4984         (SizeOf.DoResolve): Likewise.
4985         (ComposedCast.DoResolveAsTypeStep): Likewise.
4986         (StackAlloc.DoResolve): Likewise.
4987         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4988         (Block.Unsafe): New property.
4989         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4990         (Unsafe): Set 'unsafe' flag of contained block.
4991         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4992         (Fixed.Resolve): Likewise.
4993         (Catch.Resolve): Likewise.
4994         (Using.ResolveLocalVariableDecls): Likewise.
4995         (Foreach.Resolve): Likewise.
4996
4997 2004-10-05  John Luke <john.luke@gmail.com>
4998
4999         * cs-parser.jay: add location to error CS0175
5000
5001 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5002
5003         * ecore.cs (Expression.Constantity): Add support for turning null
5004         into a constant.
5005
5006         * const.cs (Const.Define): Allow constants to be reference types
5007         as long as the value is Null.
5008
5009 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5010
5011         * namespace.cs (NamespaceEntry.Using): No matter which warning
5012         level is set, check if this namespace name has already been added.
5013
5014 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5015
5016         * expression.cs: reftype [!=]= null should always use br[true,false].
5017         # 67410
5018
5019 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5020
5021         Fix #67108
5022         * attribute.cs: Enum conversion moved to 
5023         GetAttributeArgumentExpression to be applied to the all
5024         expressions.
5025
5026 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5027
5028         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5029         * class.c (TypeContainer.DefineType): Flag error if
5030         base types aren't accessible due to access permissions.
5031         * decl.cs (DeclSpace.ResolveType): Move logic to
5032         Expression.ResolveAsTypeTerminal.
5033         (DeclSpace.ResolveTypeExpr): Thin layer over
5034         Expression.ResolveAsTypeTerminal.
5035         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5036         Refactor code into NestedAccess.  Use it.
5037         (DeclSpace.NestedAccess): New.
5038         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5039         argument to silence errors.  Check access permissions.
5040         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5041         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5042         (Cast.DoResolve): Likewise.
5043         (New.DoResolve): Likewise.
5044         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5045         (TypeOf.DoResolve): Likewise.
5046
5047         * expression.cs (Invocation.BetterConversion): Return the Type of
5048         the better conversion.  Implement section 14.4.2.3 more faithfully.
5049         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5050         section 14.4.2.2 explicit.
5051         (Invocation.OverloadResolve): Update.
5052         (Invocation): Remove is_base field.
5053         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5054         (Invocation.Emit): Likewise.
5055
5056 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5057
5058         * README: Update to changes.
5059
5060 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5061
5062         * cs-parser.jay: Reverted 642 warning fix.
5063
5064 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5065
5066         Fix bug #66615
5067         * decl.cs (FindMemberWithSameName): Indexer can have more than
5068         1 argument.
5069
5070 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5071
5072         * expression.cs (LocalVariableReference.DoResolveLValue):
5073         Do not report warning 219 for out values.
5074         (EmptyExpression.Null): New member to avoid extra allocations.
5075
5076 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5077
5078         * cs-parser.jay: Fix wrong warning 642 report.
5079
5080         * cs-tokenizer.cs (CheckNextToken): New helper;
5081         Inspect next character if is same as expected.
5082
5083 2004-09-23  Martin Baulig  <martin@ximian.com>
5084
5085         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5086         (Convert.ImplicitReferenceConversionExists): Likewise.
5087
5088 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5089
5090         * class.cs (Operator.Define): Add error 448 and 559 report.
5091
5092 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5093
5094         * class.cs (MemberBase.IsTypePermitted): New protected
5095         method for checking error CS0610.
5096
5097 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5098
5099         * class.cs (TypeContainer.HasExplicitLayout): New property
5100         Returns whether container has StructLayout attribute set Explicit.
5101         (FieldMember): New abstract class for consts and fields.
5102         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5103         (Field): Reuse FieldMember.
5104
5105         * const.cs (Const): Reuse FieldMember.
5106
5107         * rootcontext.cs: EmitConstants call moved to class.
5108
5109 2004-09-22  Martin Baulig  <martin@ximian.com>
5110
5111         Thanks to Peter Sestoft for this bug report.
5112
5113         * expression.cs (Conditional): If both the `trueExpr' and the
5114         `falseExpr' is a NullLiteral, return a NullLiteral.
5115
5116 2004-09-22  Martin Baulig  <martin@ximian.com>
5117
5118         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5119         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5120         for the "get_Current" call.
5121
5122 2004-09-22  Martin Baulig  <martin@ximian.com>
5123
5124         Marek and me just fixed one of our oldest bugs: #28562 :-)
5125
5126         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5127
5128         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5129         we're an EnumConstant, just return that.
5130         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5131         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5132         to get the value which'll actually be written into the attribute.
5133         However, we have to use GetValue() to access the attribute's value
5134         in the compiler.        
5135
5136 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5137
5138         * constant.cs (Constant.IsNegative): New abstract property
5139         IsNegative.
5140
5141         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5142         (StackAlloc.DoResolve): Reused IsNegative.
5143
5144 2004-09-21  Martin Baulig  <martin@ximian.com>
5145
5146         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5147         if we're used in an iterator, we may be called from different
5148         methods.
5149
5150         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5151         we actually have an exception block.
5152
5153 2004-09-20  John Luke <jluke@cfl.rr.com>
5154
5155         * class.cs, cs-parser.jay: Improve the error report for 1520:
5156         report the actual line where the error happens, not where the
5157         class was declared.
5158
5159         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5160         Pass location information that was available elsewhere.
5161
5162 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5163
5164         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5165         runtime to delay sign assemblies.
5166
5167 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5168
5169         * cs-parser.jay: Do not report the stack trace, this is barely
5170         used nowadays.
5171
5172 2004-08-22  John Luke  <john.luke@gmail.com>
5173  
5174         * driver.cs : check that a resource id is not already used
5175         before adding it, report CS1508 if it is, bug #63637
5176
5177 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5178
5179         * ecore.cs: Removed dead code.
5180
5181 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5182
5183         * class.cs: Do not report warning CS0067 on the interfaces.
5184
5185 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5186
5187         * cs-parser.jay: Add error 504 report.
5188
5189 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5190
5191         * rootcontext.cs: WarningLevel is 4 by default now.
5192
5193         * statement.cs (Fixed.Resolve): Do not null
5194         VariableInfo.
5195
5196 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5197
5198         Fixed bug #55780
5199         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5200         deep search when property is not virtual.
5201         (PropertyExpr.ResolveAccessors): Make one call for both
5202         accessors.
5203
5204 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5205
5206         Fixed bug #65766
5207         * statement.cs: Error 152 report constains also location.
5208
5209 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5210
5211         Fixed bug #65766
5212         * const.cs: Explicitly set constant as static.
5213
5214 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5215
5216         Fixed bug #64226
5217         * cs-parser.jay: Add error 1017 report.
5218
5219 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5220
5221         Fixed bug #59980, #64224
5222         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5223
5224         * typemanager.cs (IsSpecialMethod): Simplified
5225
5226 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5227
5228         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5229         condition with better params.
5230
5231 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5232
5233         Fixed bug #65238
5234         * attribute.cs (Resolve): Property has to have both
5235         accessors.
5236
5237 2004-09-14  Martin Baulig  <martin@ximian.com>
5238
5239         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5240
5241 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5242
5243         Fixed bug #61902
5244         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5245         called and is obsolete then this member suppress message
5246         when call is inside next [Obsolete] method or type.
5247
5248         * expression.cs: Use TestObsoleteMethodUsage member.
5249
5250 2004-09-14  Martin Baulig  <martin@ximian.com>
5251
5252         * cs-parser.jay: Sync a bit with the GMCS version.
5253
5254 2004-09-14  Martin Baulig  <martin@ximian.com>
5255
5256         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5257         (CSharpParser.yacc_verbose_flag): New public field.
5258
5259         * genericparser.cs: Removed.
5260
5261 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5262
5263         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5264
5265 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5266
5267         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5268
5269 2004-09-10  Martin Baulig  <martin@ximian.com>
5270
5271         Backported my MemberName changes from GMCS into MCS.
5272
5273         - we are now using a special `MemberName' class instead of using
5274         strings; in GMCS, the `MemberName' also contains the type
5275         arguments.
5276
5277         - changed the grammar rules a bit:
5278           * the old `member_name' is now a `namespace_or_type_name':
5279             The rule is that we use `namespace_or_type_name' everywhere
5280             where we expect either a "member name" (GetEnumerator) or a
5281             "member name" with an explicit interface name
5282             (IEnumerable.GetEnumerator).
5283             In GMCS, the explicit interface name may include type arguments
5284             (IEnumerable<T>.GetEnumerator).
5285           * we use `member_name' instead of just `IDENTIFIER' for
5286             "member names":
5287             The rule is that we use `member_name' wherever a member may
5288             have type parameters in GMCS.       
5289
5290         * decl.cs (MemberName): New public class.
5291         (MemberCore.MemberName): New public readonly field.
5292         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5293         (DeclSpace): Likewise.
5294
5295         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5296         * enum.cs (Enum.ctor): Likewise.
5297
5298         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5299         MemberName.     
5300         (AliasEntry.ctor): Take a MemberName, not an Expression.
5301         (AliasEntry.UsingAlias): Likewise.
5302
5303         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5304         (IMethodData.MemberName): Changed type from string to MemberName.
5305         (MemberBase.ExplicitInterfaceName): Likewise.
5306         (AbstractPropertyEventMethod.SetupName): Make this private.
5307         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5308         argument; compute the member name here.
5309         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5310         on the `member.MemberName' and the `prefix'.
5311
5312         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5313         not `type_name'.
5314         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5315         thus, we get a `MemberName' instead of a `string'.  These
5316         declarations may have type parameters in GMCS.
5317         (interface_method_declaration, delegate_declaration): Likewise.
5318         (class_declaration, interface_declaration): Likewise.
5319         (method_header): Use `namespace_or_type_name' instead of
5320         `member_name'.  We may be an explicit interface implementation.
5321         (property_declaration, event_declaration): Likewise.
5322         (member_name): This is now just an `IDENTIFIER', not a
5323         `namespace_or_type_name'.
5324         (type_name, interface_type): Removed.
5325         (namespace_or_type_name): Return a MemberName, not an Expression.
5326         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5327         call GetTypeExpression() on the MemberName to get an expression.
5328         (IndexerDeclaration.interface_type): Changed type from string to
5329         MemberName.
5330         (MakeName): Operate on MemberName's instead of string's.
5331
5332 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5333
5334         Fix bug #55770.
5335         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5336         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5337         lookup to avoid symbols introduced by 'using'.
5338         * rootcontext.cs (NamespaceLookup): Update.
5339
5340 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5341
5342         * class.cs (TypeContainer.DoDefineMembers): Do not call
5343         DefineDefaultConstructor for static classes.
5344
5345 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * attribute.cs (Attribute.Resolve): Add error 653 report.
5348
5349         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5350         report.
5351         (Method.ApplyAttributeBuilder): Add error 685 report.
5352         (Operator.Define): Add error 564 report.
5353
5354         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5355
5356         * expression.cs (Invocation.DoResolve): Add error
5357         245 and 250 report.
5358
5359         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5360         error 674 report.
5361
5362 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5363
5364         * class.cs (ConstructorInitializer.Resolve):
5365         Wrong error number (515->516).
5366
5367 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5368
5369         * class.cs (Indexer.Define): Add error 631 report.
5370
5371 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5372
5373         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5374
5375 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5376
5377         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5378
5379 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5380
5381         * cs-parser.jay: Added error CS0241 report.
5382
5383 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5384
5385         * cs-parser.jay (fixed_statement): Introduce a scope for the
5386         declaration in the 'fixed' statement.
5387
5388 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5389
5390         * cs-parser.jay: Added CS0230 error report.
5391
5392 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5393
5394         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5395
5396 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5397
5398         * expression.cs (Argument.Resolve): Added error CS0192 and
5399         CS0199 report.
5400
5401 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5402
5403         C# 2.0 #pragma warning feature
5404
5405         * cs-tokenizer.cs (PreProcessPragma): New method; 
5406         Handles #pragma directive.
5407
5408         * report.cs (WarningRegions): New class; Support
5409         class for #pragma warning directive. It tests whether
5410         warning is enabled for a given line.
5411
5412 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5413
5414         * const.cs: Add more descriptive error report, tahnks to
5415         Sebastien. 
5416
5417 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5418
5419         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5420
5421 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5422
5423         * expression.cs: Apply patch from Ben: Remove dead code from
5424         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5425         as that code just threw an exception anwyays.
5426
5427         * const.cs: Remove the call to the turnintoconstant, for details
5428         see bug: #63144
5429         
5430         * literal.cs: The type of the null-literal is the null type;  So
5431         we use a placeholder type (literal.cs:System.Null, defined here)
5432         for it.
5433
5434         * expression.cs (Conditional.DoResolve): Remove some old code that
5435         is no longer needed, conversions have been fixed.
5436
5437         (ArrayCreationExpression.DoResolve): Return false if we fail to
5438         resolve the inner expression.
5439
5440 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5441
5442         Fix test-290.cs.
5443         * cs-parser.jay (delegate_declaration): Record a delegate
5444         declaration as a type declaration.
5445         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5446
5447 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5448
5449         * parameter.cs: Do not crash if the type can not be resolved. 
5450
5451         * expression.cs: Report errors with unsafe pointers, fixes #64896
5452
5453 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5454
5455         * expression.cs: Pointer arith always needs to do a conv.i
5456         if the operand is a long. fix 65320
5457
5458 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5459
5460         Fixed cs0619-37.cs, cs0619-38.cs
5461
5462         * enum.cs (GetObsoleteAttribute): Removed.
5463
5464         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5465         on Enum member is double staged. The first is tested member
5466         and then enum.
5467
5468 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5469
5470         Fixed #56986, #63631, #65231
5471
5472         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5473         adds member to name container.
5474         (TypeContainer.AddToTypeContainer): New method, adds type to
5475         name container.
5476         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5477         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5478         AddOperator): Simplified by reusing AddToMemberContainer.
5479         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5480         instead of field.
5481         (Method.CheckForDuplications): Fixed implementation to test all
5482         possibilities.
5483         (MemberBase): Detection whether member is explicit interface
5484         implementation is now in constructor.
5485         (MemberBase.UpdateMemberName): Handles IndexerName.
5486         (Accessor): Changed to keep also location information.
5487         (AbstractPropertyEventMethod): Is derived from MemberCore.
5488         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5489         will be emited or not.
5490         (PropertyBase.AreAccessorsDuplicateImplementation):
5491         Tests whether accessors are not in collision with some method.
5492         (Operator): Is derived from MethodCore to simplify common
5493         operations.
5494
5495         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5496         must be performed.
5497         (DeclSpace.AddToContainer): Adds the member to defined_names
5498         table. It tests for duplications and enclosing name conflicts.
5499
5500         * enum.cs (EnumMember): Clean up to reuse the base structures
5501
5502 2004-09-03  Martin Baulig  <martin@ximian.com>
5503
5504         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5505         into TypeContainer, to make partial classes work again.
5506
5507 2004-09-03  Martin Baulig  <martin@ximian.com>
5508
5509         * rootcontext.cs (RootContext.V2): Removed.
5510
5511 2004-03-23  Martin Baulig  <martin@ximian.com>
5512
5513         * expression.cs (Invocation.OverloadResolve): Added `bool
5514         may_fail' argument and use it instead of the Location.IsNull() hack.
5515
5516 2004-09-03  Martin Baulig  <martin@ximian.com>
5517
5518         Merged latest changes into gmcs.  Please keep this comment in
5519         here, it makes it easier for me to see what changed in MCS since
5520         the last time I merged.
5521
5522 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5523
5524         Fix #61128.
5525         * expression.cs (BetterConversion): Don't allow either conversion 
5526         to be null.  Remove redundant implicit conversion test when 'q ==
5527         null' -- when this function is invoked, we already know that the
5528         implicit conversion exists.
5529         (BetterFunction): Assume that 'best' is non-null.  Remove
5530         redundant reimplementation of IsApplicable when 'best' is null.
5531         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5532         number of arguments.
5533         (IsAncestralType): Extract from OverloadResolve.
5534         (OverloadResolve): Make robust to the MethodGroupExpr being
5535         unsorted.  Implement all the logic of Section 14.5.5.1, and
5536         support overloading of methods from multiple applicable types.
5537         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5538
5539         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5540         (RealError, Warning): Append type of report to related symbol.
5541
5542 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5543
5544         * enum.cs: Fixed CLS-Compliance checks for enum members.
5545         Error tests cs3008-8.cs, cs3014-8.cs
5546
5547 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5548
5549         Fixed bug #62342, #63102
5550         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5551         like ImplementMethod.
5552
5553 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5554
5555         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5556         Fixed bug #65170.
5557
5558 2004-09-02  Martin Baulig  <martin@ximian.com>
5559
5560         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5561         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5562         on the MethodBase.
5563
5564 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5565
5566         C# 2.0 Static classes implemented
5567
5568         * class.cs (TypeContainer): instance_constructors,
5569         initialized_fields, initialized_static_fields,
5570         default_constructor, base_inteface_types are protected to be
5571         accessible from StaticClass.
5572         (TypeContainer.DefineDefaultConstructor): New virtual method
5573         for custom default constructor generating
5574         (StaticClass): New class to handle "Static classes" feature.
5575
5576         * cs-parser.jay: Handle static keyword on class like instance
5577         of StaticClass.
5578
5579         * driver.cs: Added "/langversion" command line switch with two
5580         options (iso-1, default).
5581
5582 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5583
5584         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5585
5586 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5587
5588         * delegate.cs: Style.
5589
5590 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5591
5592         * delegate.cs: Add seperate instance expr field for miguel.
5593
5594 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5595
5596         * PointerArithmetic (Resolve): make sure we are not doing
5597         pointer arith on void*. Also, make sure we are resolved
5598         by not setting eclass until resolve.
5599
5600         All callers: Make sure that PointerArithmetic gets resolved.
5601
5602 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5603
5604         * ArrayCreation (LookupType): If the type does not resolve 
5605         to an array, give an error.
5606
5607 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5608
5609         * statement.cs (Try.Resolve): Fixed bug #64222
5610
5611 2004-08-27  Martin Baulig  <martin@ximian.com>
5612
5613         * class.cs
5614         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5615         crash here.     
5616
5617 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5618
5619         * ecore.cs (Constantify): Get underlying type via
5620         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5621         Windows in special cases.
5622
5623 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5624
5625         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5626         for obtaining also private methods.
5627         (GetRemoveMethod): Used GetRemoveMethod (true)
5628         for obtaining also private methods.
5629
5630 2004-08-24  Martin Baulig  <martin@ximian.com>
5631
5632         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5633         MethodAttributes.HideBySig for operators.
5634
5635 2004-08-23  Martin Baulig  <martin@ximian.com>
5636
5637         Back to the old error reporting system :-)
5638
5639         * report.cs (Message): Removed.
5640         (Report.MessageData, ErrorData, WarningData): Removed.
5641         (Report.Error, Warning): Back to the old system.
5642
5643 2004-08-23  Martin Baulig  <martin@ximian.com>
5644
5645         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5646
5647         * class.cs (TypeContainer.ParentContainer): New public virtual
5648         method; replaces the explicit interface implementation.
5649         (ClassPart.ParentContainer): Override.
5650
5651 2004-08-23  Martin Baulig  <martin@ximian.com>
5652
5653         * statement.cs (Switch): Added support for constant switches; see
5654         #59428 or test-285.cs.
5655
5656 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5657
5658         Fixed bug #62740.
5659         * statement.cs (GetEnumeratorFilter): Removed useless
5660         logic because C# specs is strict. GetEnumerator must be
5661         public.
5662
5663 2004-08-22  Martin Baulig  <martin@ximian.com>
5664
5665         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5666         a switch and may break, reset the barrier.  Fixes #59867.
5667
5668 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5669
5670         CLS-Compliance speed up (~5% for corlib)
5671
5672         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5673         New method. Tests container for CLS-Compliant names
5674
5675         * class.cs (TypeContainer.VerifyClsName): New method.
5676         Checks whether container name is CLS Compliant.
5677         (Constructor): Implements IMethodData.
5678
5679         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5680         low-case table for CLS Compliance test.
5681         (MemberCache.VerifyClsParameterConflict): New method.
5682         Checks method parameters for CS3006 error.
5683
5684         * enum.cs (EnumMember): Is derived from MemberCore.
5685         (Enum.VerifyClsName): Optimized for better performance.
5686
5687 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5688
5689         * report.cs: Renamed Error_T to Error and changed all
5690         references.
5691
5692 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5693
5694         * class.cs (TypeContainer.IndexerArrayList): New inner class
5695         container for indexers.
5696         (TypeContainer.DefaultIndexerName): New constant for default
5697         indexer name. Replaced all "Item" with this constant.
5698         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5699
5700         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5701         DefaultMemberAttribute constructor.
5702
5703 2004-08-05  Martin Baulig  <martin@ximian.com>
5704
5705         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5706         Fix bug #59429.
5707
5708 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5709
5710         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5711         multi platforms problem.
5712
5713         * compiler.csproj: Included shared files.
5714
5715 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5716
5717         Fix bug 60333, 55971 in the more general way
5718         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5719         Added arg_type argument for constant conversion.
5720         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5721
5722 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5723
5724         Fix bug #59760
5725         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5726         OperatorArrayList, MethodCoreArrayList for typecontainer
5727         containers. Changed class member types to these new types.
5728         (MethodArrayList.DefineMembers): Added test for CS0659.
5729
5730 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5731
5732         * cfold.cs: Synchronize the folding with the code in expression.cs
5733         Binary.DoNumericPromotions for uint operands.
5734
5735         * attribute.cs: Revert patch from Raja, it introduced a regression
5736         while building Blam-1.2.1 (hard to isolate a test case).
5737
5738 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5739
5740         Fix for #55382
5741         * class.cs:
5742         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5743         name collision.
5744         (MethodCore.parent_method): New member. The method we're overriding
5745         if this is an override method.
5746         (MethodCore.CheckBase): Moved from Method class and made common.
5747         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5748         private.
5749         (MethodCore.CheckForDuplications): New abstract method. For custom
5750         member duplication search in a container
5751         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5752         method and its return type.
5753         (Event.conflict_symbol): New member. Symbol with same name in the
5754         parent class.
5755
5756         * decl.cs:
5757         (MemberCache.FindMemberWithSameName): New method. The method
5758         is looking for conflict with inherited symbols.
5759
5760 2004-08-04  Martin Baulig  <martin@ximian.com>
5761
5762         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5763
5764         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5765
5766 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5767
5768         * report.cs (Message): New enum for better error, warning reference in
5769         the code.
5770         (MessageData): New inner abstract class. It generally handles printing of
5771         error and warning messages.
5772         Removed unused Error, Warning, Message methods.
5773
5774 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5775
5776         Fix for cs0592-8.cs test
5777         * attribute.cs
5778         (Attributable.ValidAttributeTargets): Made public.
5779         (Attribute.ExplicitTarget): New member for explicit target value.
5780         (Attribute.CheckTargets): Now we translate explicit attribute
5781         target to Target here.
5782
5783 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5784
5785         * ecore.cs (MethodGroupExpr): new IsBase property.
5786
5787         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5788
5789         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5790         rather than an instance expr.
5791
5792         (DelegateCreation.Emit): Use the method group rather than
5793         the instance expression. Also, if you have base.Foo as the
5794         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5795
5796         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5797
5798         (NewDelegate.DoResolve): Only check for the existance of Invoke
5799         if the method is going to be needed. Use MethodGroupExpr.
5800
5801         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5802
5803         * expression.cs: For pointer arith., make sure to use
5804         the size of the type, not the size of the pointer to
5805         the type.
5806
5807 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5808
5809         Fix for #60722
5810         * class.cs (Class): Added error CS0502 test.
5811
5812 2004-08-03  John Luke  <jluke@cfl.rr.com>
5813             Raja R Harinath  <rharinath@novell.com>
5814
5815         Fix for #60997.
5816         * attribute.cs (Attribute.complained_before): New flag.
5817         (Attribute.ResolveType, Attribute.Resolve),
5818         (Attribute.DefinePInvokeMethod): Set it.
5819         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5820         
5821 2004-08-03  Martin Baulig  <martin@ximian.com>
5822
5823         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5824         use a user-defined operator; we still need to do numeric
5825         promotions in case one argument is a builtin type and the other
5826         one has an implicit conversion to that type.  Fixes #62322.
5827
5828 2004-08-02  Martin Baulig  <martin@ximian.com>
5829
5830         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5831         (LocalInfo.IsThis): New public property.
5832         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5833
5834 2004-08-01  Martin Baulig  <martin@ximian.com>
5835
5836         * class.cs (TypeContainer.GetClassBases): Don't set the default
5837         here since we may get called from GetPartialBases().
5838         (TypeContainer.DefineType): If GetClassBases() didn't return a
5839         parent, use the default one.
5840
5841 2004-07-30  Duncan Mak  <duncan@ximian.com>
5842
5843         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5844
5845 2004-07-30  Martin Baulig  <martin@ximian.com>
5846
5847         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5848
5849         * class.cs (SourceMethod): New public class, derive from the
5850         symbol writer's ISourceMethod.
5851         (Method): Use the new symbol writer API.
5852
5853         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5854         as argument and use the new symbol writer.
5855
5856         * location.cs
5857         (SourceFile): Implement the symbol writer's ISourceFile.
5858         (Location.SymbolDocument): Removed.
5859         (Location.SourceFile): New public property.
5860
5861         * symbolwriter.cs: Use the new symbol writer API.
5862
5863 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5864
5865         * Makefile (install-local): Remove.  Functionality moved to
5866         executable.make.
5867
5868 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5869
5870         * Makefile: Install mcs.exe.config file together with mcs.exe.
5871         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5872         correct runtime version.
5873         
5874 2004-07-25  Martin Baulig  <martin@ximian.com>
5875
5876         * class.cs
5877         (TypeContainer.RegisterOrder): Removed, this was unused.
5878         (TypeContainer, interface_order): Removed.
5879         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5880         TypeContainer as argument since we can also be called with a
5881         `PartialContainer' for a partial class/struct/interface.
5882         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5883         of checking whether we're an `Interface' - we could be a
5884         `PartialContainer'.
5885         (PartialContainer.Register): Override; call
5886         AddClass()/AddStruct()/AddInterface() on our parent.
5887
5888         * cs-parser.jay (interface_member_declaration): Add things to the
5889         `current_container', not the `current_class'.
5890
5891         * rootcontext.cs (RegisterOrder): The overloaded version which
5892         takes an `Interface' was unused, removed.
5893
5894         * typemanager.cs (TypeManager.LookupInterface): Return a
5895         `TypeContainer', not an `Interface'.
5896         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5897         contain a `PartialContainer' for an interface, so check it's
5898         `Kind' to figure out what it is.
5899
5900 2004-07-25  Martin Baulig  <martin@ximian.com>
5901
5902         * class.cs (Class.DefaultTypeAttributes): New public constant.
5903         (Struct.DefaultTypeAttributes): Likewise.
5904         (Interface.DefaultTypeAttributes): Likewise.
5905         (PartialContainer.TypeAttr): Override this and add the
5906         DefaultTypeAttributes.
5907
5908 2004-07-25  Martin Baulig  <martin@ximian.com>
5909
5910         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5911         we can just use the `Parent' field instead.
5912
5913 2004-07-25  Martin Baulig  <martin@ximian.com>
5914
5915         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5916
5917 2004-07-25  Martin Baulig  <martin@ximian.com>
5918
5919         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5920         our parts before defining any methods.
5921         (TypeContainer.VerifyImplements): Make this virtual.
5922         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5923         on our PartialContainer.
5924
5925 2004-07-25  Martin Baulig  <martin@ximian.com>
5926
5927         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5928
5929         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5930         argument, we can just use the `Parent' field instead.
5931
5932         * class.cs
5933         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5934         (MemberBase.DoDefine): Likewise.
5935
5936 2004-07-24  Martin Baulig  <martin@ximian.com>
5937
5938         * decl.cs (MemberCore.Parent): New public field.
5939         (DeclSpace.Parent): Moved to MemberCore.
5940
5941         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5942         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5943         parent's .ctor.
5944         (FieldBase, Field, Operator): Likewise.
5945         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5946         (EventField, Event): Likewise.
5947
5948 2004-07-23  Martin Baulig  <martin@ximian.com>
5949
5950         * class.cs (PartialContainer): New public class.
5951         (ClassPart): New public class.
5952         (TypeContainer): Added support for partial classes.
5953         (TypeContainer.GetClassBases): Splitted some of the functionality
5954         out into GetNormalBases() and GetPartialBases().
5955
5956         * cs-tokenizer.cs (Token.PARTIAL): New token.
5957         (Tokenizer.consume_identifier): Added some hacks to recognize
5958         `partial', but only if it's immediately followed by `class',
5959         `struct' or `interface'.
5960
5961         * cs-parser.jay: Added support for partial clases.
5962
5963 2004-07-23  Martin Baulig  <martin@ximian.com>
5964
5965         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5966         a `DeclSpace' and also made it readonly.
5967         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5968         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5969         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5970
5971         * cs-parser.jay: Pass the `current_class', not the
5972         `current_container' (at the moment, this is still the same thing)
5973         to a new Method, Property, Event, Indexer or Constructor.
5974
5975 2004-07-23  Martin Baulig  <martin@ximian.com>
5976
5977         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5978         and removed the `current_interface' one.
5979         (struct_declaration, class_declaration, interface_declaration):
5980         Set `current_class' to the newly created class/struct/interface;
5981         set their `Bases' and call Register() before parsing their body.
5982
5983 2004-07-23  Martin Baulig  <martin@ximian.com>
5984
5985         * class.cs (Kind): New public enum.
5986         (TypeContainer): Made this class abstract.
5987         (TypeContainer.Kind): New public readonly field.
5988         (TypeContainer.CheckDef): New public method; moved here from
5989         cs-parser.jay.
5990         (TypeContainer.Register): New public abstract method.
5991         (TypeContainer.GetPendingImplementations): New public abstract
5992         method.
5993         (TypeContainer.GetClassBases): Removed the `is_class' and
5994         `is_iface' parameters.
5995         (TypeContainer.DefineNestedTypes): Formerly known as
5996         DoDefineType().
5997         (ClassOrStruct): Made this class abstract.
5998
5999         * tree.cs (RootTypes): New public type. 
6000
6001 2004-07-20  Martin Baulig  <martin@ximian.com>
6002
6003         * tree.cs (Tree.RecordNamespace): Removed.
6004         (Tree.Namespaces): Removed.
6005
6006         * rootcontext.cs (RootContext.IsNamespace): Removed.
6007
6008         * cs-parser.jay (namespace_declaration): Just create a new
6009         NamespaceEntry here.
6010
6011 2004-07-20  Martin Baulig  <martin@ximian.com>
6012
6013         * statement.cs (ExceptionStatement): New abstract class.  This is
6014         now used as a base class for everyone who's using `finally'.
6015         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6016         our local variables before using them.
6017
6018         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6019         virtual method.  This is used by Yield.Resolve() to "steal" an
6020         outer block's `finally' clauses.
6021         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6022         argument.
6023
6024         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6025         version which takes an ExceptionStatement.  This version must be
6026         used to create exception branchings.
6027
6028         * iterator.cs
6029         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6030         (Iterator.EmitMoveNext): Added exception support; protect the
6031         block with a `fault' clause, properly handle 'finally' clauses.
6032         (Iterator.EmitDispose): Run all the `finally' clauses here.
6033
6034 2004-07-20  Martin Baulig  <martin@ximian.com>
6035
6036         * iterator.cs: This is the first of a set of changes in the
6037         iterator code.  Match the spec more closely: if we're an
6038         IEnumerable, then GetEnumerator() must be called.  The first time
6039         GetEnumerator() is called, it returns the current instance; all
6040         subsequent invocations (if any) must create a copy.
6041
6042 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6043
6044         * expression.cs: Resolve the constant expression before returning
6045         it. 
6046
6047 2004-07-19  Martin Baulig  <martin@ximian.com>
6048
6049         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6050         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6051         the return type of the new EmitContext.
6052
6053 2004-07-18  Martin Baulig  <martin@ximian.com>
6054
6055         * class.cs (Property.Define): Fix iterators.
6056
6057         * iterators.cs (Iterator.Define): Moved the
6058         `container.AddInterator (this)' call here from the .ctor; only do
6059         it if we resolved successfully.
6060
6061 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6062
6063         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6064         `true' for preprocessing directives that we parse.  The return
6065         value indicates whether we should return to regular tokenizing or
6066         not, not whether it was parsed successfully.
6067
6068         In the past if we were in: #if false ... #line #endif, we would
6069         resume parsing after `#line'.  See bug 61604.
6070
6071         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6072         building: IsEnumType should return true only for enums, not for
6073         enums or System.Enum itself.  This fixes #61593.
6074
6075         Likely what happened is that corlib was wrong: mcs depended on
6076         this bug in some places.  The bug got fixed, we had to add the
6077         hack, which caused bug 61593.
6078
6079         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6080         that was a workaround for the older conditions.
6081
6082 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6083
6084         * assign.cs: IAssignMethod has a new interface, as documented
6085         inline. All assignment code now uses this new api.
6086
6087         * ecore.cs, expression.cs: All classes which implement
6088         IAssignMethod now use the new interface.
6089
6090         * expression.cs (Invocation): add a hack to EmitCall so that
6091         IndexerAccess can be the target of a compound assignment without
6092         evaluating its arguments twice.
6093
6094         * statement.cs: Handle changes in Invocation api.
6095
6096 2004-07-16  Martin Baulig  <martin@ximian.com>
6097
6098         * iterators.cs: Rewrote this.  We're now using one single Proxy
6099         class for both the IEnumerable and the IEnumerator interface and
6100         `Iterator' derives from Class so we can use the high-level API.
6101
6102         * class.cs (TypeContainer.AddIterator): New method.
6103         (TypeContainer.DoDefineType): New protected virtual method, which
6104         is called from DefineType().
6105         (TypeContainer.DoDefineMembers): Call DefineType() and
6106         DefineMembers() on all our iterators.
6107         (TypeContainer.Emit): Call Emit() on all our iterators.
6108         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6109
6110         * codegen.cs (EmitContext.CurrentIterator): New public field.
6111
6112 2004-07-15  Martin Baulig  <martin@ximian.com>
6113
6114         * typemanager.cs
6115         (TypeManager.not_supported_exception_type): New type.   
6116
6117 2004-07-14  Martin Baulig  <martin@ximian.com>
6118
6119         * iterators.cs: Use real error numbers.
6120
6121 2004-07-14  Martin Baulig  <martin@ximian.com>
6122
6123         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6124         requires this to be a System.Collection.IEnumerable and not a
6125         class implementing that interface.
6126         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6127
6128 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6129
6130         * class.cs: Fixed previous fix, it broke some error tests.
6131
6132 2004-07-12  Martin Baulig  <martin@ximian.com>
6133
6134         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6135         Fixes #61293.
6136
6137 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6138
6139         * assign.cs (LocalTemporary): Add new argument: is_address,If
6140         `is_address' is true, then the value that we store is the address
6141         to the real value, and not the value itself.
6142         
6143         * ecore.cs (PropertyExpr): use the new local temporary
6144         stuff to allow us to handle X.Y += z (where X is a struct)
6145
6146 2004-07-08  Martin Baulig  <martin@ximian.com>
6147
6148         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6149         not always return, just like we're doing in Using.Resolve().
6150
6151 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6152
6153         * cs-parser.jay (fixed_statement): flag this as Pinned.
6154
6155 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6156
6157         * typemanager.cs (TypeManager): Removed MakePinned method, this
6158         mechanism is replaced with the .NET 2.x compatible mechanism of
6159         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6160
6161         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6162         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6163         `IsFixed' property which has a different meaning.
6164
6165 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6166
6167         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6168         visible from inside a nested class, not just the names of the
6169         immediately enclosing class.
6170         Fix for bug #60730.
6171
6172 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6173
6174         * expression.cs (BetterConversion): Remove buggy special-case
6175         handling of "implicit constant expression conversions".  At this
6176         point, we already know that the conversion is possible -- we're
6177         only checking to see which is better.
6178
6179 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6180
6181         * cs-parser.jay: Added error CS0210 test.
6182
6183 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6184
6185         * cs-parser.jay: Added error CS0134 test.
6186
6187 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6188
6189         Fix bug #52507
6190         * cs-parser.jay: Added error CS0145 test.
6191
6192 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6193
6194         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6195
6196 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6197         
6198         * expression.cs (StackAlloc.Resolve): The argument may not
6199         be a constant; deal with this case.
6200         
6201 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6202
6203         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6204         GetIndexerAttributeValue.
6205         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6206
6207         * class.cs (Indexer.Define): Added error tests for CS0415,
6208         CS0609.
6209
6210 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6211
6212         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6213         property code.
6214
6215 2004-06-23  Martin Baulig  <martin@ximian.com>
6216
6217         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6218         neither return nor throw, reset the barrier as well.  Fixes #60457.
6219
6220 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6221
6222         * class.cs : EventAttributes is now set to None by default.
6223           This fixes bug #60459.
6224
6225 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6226
6227         Fix bug #60219
6228         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6229         Don't throw exception but return null (it's sufficient now).
6230
6231 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6232
6233         * typemanager.cs (GetArgumentTypes): Faster implementation.
6234
6235 2004-06-18  Martin Baulig  <martin@ximian.com>
6236
6237         * attribute.cs (Attribute.Resolve): Check whether we're an
6238         EmptyCast which a Constant child.  Fixes #60333.
6239
6240 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6241
6242         * statement.cs (EmitCollectionForeach): Account for the fact that
6243         not all valuetypes are in areas which we can take the address of.
6244         For these variables, we store to a temporary variable. Also, make
6245         sure that we dont emit a `callvirt' on a valuetype method.
6246
6247 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6248
6249         * expression.cs (StackAlloc.DoReSolve): Added test for
6250         negative parameter (CS0247).
6251
6252 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6253
6254         Fix bug #59792
6255         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6256
6257 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6258
6259         Fix bug #59781
6260         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6261         ulong.
6262
6263 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6264
6265         Fix bug #58254 & cs1555.cs, cs1556.cs
6266         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6267
6268 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6269
6270         * cs-parser.jay: Added error CS1669 test for indexers.
6271
6272 2004-06-11  Martin Baulig  <martin@ximian.com>
6273
6274         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6275         call this twice: for params and varargs methods.
6276
6277 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6278
6279         * class.cs:
6280         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6281
6282 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6283
6284         * attribute.cs (Attribute.GetValidTargets): Made public.
6285
6286         * class.cs: 
6287         (AbstractPropertyEventMethod): New class for better code sharing.
6288         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6289         CS1667 report.
6290         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6291
6292 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6293
6294         Fix bug #59477.
6295         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6296         that the call to Resolve is part of a MemberAccess.
6297         (Expression.Resolve): Use it for SimpleName resolution.
6298         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6299         Add 'intermediate' boolean argument.
6300         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6301         error message when the SimpleName can be resolved ambiguously
6302         between an expression and a type.
6303         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6304         public.
6305         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6306         call on the left-side.
6307
6308 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6309
6310         * class.cs:
6311         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6312
6313 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6314
6315         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6316
6317 2004-06-11  Martin Baulig  <martin@ximian.com>
6318
6319         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6320         varargs methods if applicable.
6321
6322 2004-06-11  Martin Baulig  <martin@ximian.com>
6323
6324         * expression.cs (Invocation.EmitCall): Don't use
6325         `method.CallingConvention == CallingConventions.VarArgs' since the
6326         method could also have `CallingConventions.HasThis'.
6327
6328 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6329
6330         * class.cs (Event.GetSignatureForError): Implemented.
6331         Fixed crash in error test cs3010.cs
6332
6333 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6334
6335         * cs-tokenizer.cs: Change the way we track __arglist to be
6336         consistent with the other keywords.
6337
6338 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6339
6340         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6341         tomorrow.
6342
6343 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6344
6345         * codegen.cs: Check that all referenced assemblies have a strongname
6346         before strongnaming the compiled assembly. If not report error CS1577.
6347         Fix bug #56563. Patch by Jackson Harper.
6348         * typemanager.cs: Added a method to return all referenced assemblies.
6349         Fix bug #56563. Patch by Jackson Harper.
6350
6351 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6352
6353         * class.cs:
6354         (Method.ApplyAttributeBuilder): Moved and added conditional
6355         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6356
6357         * delegate.cs:
6358         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6359
6360 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6361
6362         Fixed #59640
6363         * class.cs: (EventField.attribute_targets): Changed default target.
6364
6365 2004-06-08  Martin Baulig  <martin@ximian.com>
6366
6367         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6368
6369 2004-06-08  Martin Baulig  <martin@ximian.com>
6370
6371         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6372
6373 2004-06-07  Martin Baulig  <martin@ximian.com>
6374
6375         Added support for varargs methods.
6376
6377         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6378         keyword.
6379
6380         * cs-parser.jay: Added support for `__arglist'.
6381
6382         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6383
6384         * expression.cs (Argument.AType): Added `ArgList'.
6385         (Invocation): Added support for varargs methods.
6386         (ArglistAccess): New public class.
6387         (Arglist): New public class.
6388
6389         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6390
6391         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6392         a method's top-level block if the method has varargs.
6393
6394         * support.cs (ReflectionParameters, InternalParameters): Added
6395         support for varargs methods.    
6396
6397 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6398
6399         * class.cs: Provide location in indexer error report.
6400
6401         * driver.cs: Use standard names.
6402
6403         * namespace.cs: Catch the use of using after a namespace has been
6404         declared also on using aliases.
6405
6406 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6407
6408         Bug #50820.
6409         * typemanager.cs (closure_private_ok, closure_invocation_type)
6410         (closure_qualifier_type, closure_invocation_assembly)
6411         (FilterWithClosure): Move to ...
6412         (Closure): New internal nested class.
6413         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6414         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6415         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6416         (MemberLookup, MemberLookupFailed): Use it.
6417         * expression.cs (New.DoResolve): Treat the lookup for the
6418         constructor as being qualified by the 'new'ed type.
6419         (Indexers.GetIndexersForTypeOrInterface): Update.
6420
6421 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6422
6423         * attribute.cs
6424         (GetConditionalAttributeValue): New method. Returns
6425         condition of ConditionalAttribute.
6426         (SearchMulti): New method.  Returns all attributes of type 't'.
6427         Use it when attribute is AllowMultiple = true.
6428         (IsConditionalMethodExcluded): New method.
6429
6430         * class.cs
6431         (Method.IsExcluded): Implemented. Returns true if method has conditional
6432         attribute and the conditions is not defined (method is excluded).
6433         (IMethodData): Extended interface for ConditionalAttribute support.
6434         (PropertyMethod.IsExcluded): Implemented.
6435
6436         * decl.cs
6437         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6438
6439         * expression.cs
6440         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6441         on the method.
6442
6443 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6444
6445         * expression.cs (ArrayCreationExpression): Make this just an
6446         `expression'. It can't be a statement, so the code here was
6447         dead.
6448
6449 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6450
6451         Fixed #59072
6452         * typemanager.cs (GetFullNameSignature): New method for
6453         MethodBase types.
6454
6455 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6456
6457         Fixed #56452
6458         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6459         Use this method when MethodBuilder is null.
6460         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6461         Added test for error CS0626 (MONO reports error for this situation).
6462         (IMethodData.GetSignatureForError): Extended interface.
6463
6464 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6465
6466         * attribute.cs
6467         (AttributeTester.GetObsoleteAttribute): Returns instance of
6468         ObsoleteAttribute when type is obsolete.
6469
6470         * class.cs
6471         (TypeContainer.VerifyObsoleteAttribute): Override.
6472         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6473         (MethodCode.VerifyObsoleteAttribute): Override.
6474         (MemberBase.VerifyObsoleteAttribute): Override.
6475
6476         * decl.cs
6477         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6478         and report proper error.
6479
6480         *delegate.cs
6481         Delegate.VerifyObsoleteAttribute): Override.
6482
6483         * ecore.cs
6484         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6485         and report proper error.
6486         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6487
6488         * enum.cs
6489         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6490         and enum member.
6491
6492         * expression.cs
6493         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6494         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6495         Added test for ObsoleteAttribute.
6496
6497         * statement.cs
6498         (Catch): Derived from Statement.
6499
6500 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6501  
6502         Fixed bug #59071 & cs0160.cs
6503  
6504         * statement.cs (Try.Resolve): Check here whether order of catch
6505         clauses matches their dependencies.
6506
6507 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6508
6509         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6510         caused a regression: #59343.  Referencing nested classes from an
6511         assembly stopped working.
6512
6513 2004-05-31  Martin Baulig  <martin@ximian.com>
6514
6515         MCS is now frozen for beta 2.
6516
6517 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6518
6519         * convert.cs: add a trivial cache for overload operator resolution.
6520
6521 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6522
6523         * decl.cs: If possible, use lookuptypedirect here. We can only do
6524         this if there is no `.' after the namespace. Avoids using
6525         LookupType, which does lots of slow processing.
6526         (FindNestedType) New method, does what it says :-).
6527         * namespace.cs: use LookupTypeDirect.
6528         * rootcontext.cs: use membercache, if possible.
6529         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6530
6531 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6532
6533         * expression.cs:
6534         According to the spec, 
6535
6536         In a member access of the form E.I, if E is a single identifier,
6537         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6538         field, property, localvariable, or parameter with the same type as
6539         the meaning of E as a type-name (§3.8), then both possible
6540         meanings of E are permitted.
6541
6542         We did not check that E as a simple-name had the same type as E as
6543         a type name.
6544
6545         This trivial check gives us 5-7% on bootstrap time.
6546
6547 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6548
6549         * expression.cs (Invocation.OverloadResolve): Avoid the
6550         use of hashtables and boxing here by allocating on demand.
6551
6552 2004-05-30  Martin Baulig  <martin@ximian.com>
6553
6554         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6555         we're doing a silent lookup.  Don't try to lookup nested types in
6556         TypeManager.object_type (thanks to Ben Maurer).
6557
6558 2004-05-30  Martin Baulig  <martin@ximian.com>
6559
6560         Committing a patch from Ben Maurer.
6561
6562         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6563
6564 2004-05-29  Martin Baulig  <martin@ximian.com>
6565
6566         * class.cs (IMethodData.ShouldIgnore): New method.
6567
6568         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6569         `Location' argument, we don't need it anywhere.  Use
6570         `IMethodData.ShouldIgnore ()' instead of
6571         `MethodData.GetMethodFlags ()'.
6572         (TypeManager.AddMethod): Removed.
6573         (TypeManager.AddMethod2): Renamed to AddMethod.
6574
6575 2004-05-29  Martin Baulig  <martin@ximian.com>
6576
6577         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6578
6579         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6580         converting from a class type S to an interface type and we already
6581         have an object on the stack, don't box it again.  Fixes #52578.
6582
6583 2004-05-29  Martin Baulig  <martin@ximian.com>
6584
6585         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6586         Added support for `params' parameters.  Fixes #59267.
6587
6588 2004-05-29  Martin Baulig  <martin@ximian.com>
6589
6590         * literal.cs (NullPointer): Provide a private .ctor which sets
6591         `type' to TypeManager.object_type.  Fixes #59048.
6592
6593 2004-05-29  Martin Baulig  <martin@ximian.com>
6594
6595         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6596         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6597
6598         * ecore.cs (EventExpr.instance_expr): Make the field private.
6599
6600 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6601
6602         Fixed bug #50080 & cs0214-2.cs
6603         * expression.cs (Cast.DoResolve): Check unsafe context here.
6604         
6605         * statement.cs (Resolve.DoResolve): Likewise.
6606
6607 2004-05-26  Martin Baulig  <martin@ximian.com>
6608
6609         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6610
6611         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6612         (RootContext.LookupType): Pass down the `silent' flag.
6613
6614 2004-05-25  Martin Baulig  <martin@ximian.com>
6615
6616         * expression.cs
6617         (MethodGroupExpr.IdenticalTypeName): New public property.
6618         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6619         expression actually refers to a type.
6620
6621 2004-05-25  Martin Baulig  <martin@ximian.com>
6622
6623         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6624         for #56176 and made it actually work.
6625
6626 2004-05-25  Martin Baulig  <martin@ximian.com>
6627
6628         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6629         (FieldExpr, PropertyExpr): Override and implement
6630         CacheTemporaries.  Fixes #52279.
6631
6632 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6633
6634         * location.cs: In the new compiler listing a file twice is a
6635         warning, not an error.
6636
6637 2004-05-24  Martin Baulig  <martin@ximian.com>
6638
6639         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6640         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6641
6642 2004-05-24  Martin Baulig  <martin@ximian.com>
6643
6644         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6645         walking the `using' list.  Fixes #53921.
6646
6647 2004-05-24  Martin Baulig  <martin@ximian.com>
6648
6649         * const.cs (Const.LookupConstantValue): Added support for
6650         EmptyCast's; fixes #55251.
6651
6652 2004-05-24  Martin Baulig  <martin@ximian.com>
6653
6654         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6655         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6656         which does the CS0135 check.  The reason is that we first need to
6657         check whether the variable actually exists.
6658
6659 2004-05-24  Martin Baulig  <martin@ximian.com>
6660
6661         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6662         than RootContext.LookupType() to find the explicit interface
6663         type.  Fixes #58584.
6664
6665 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6666
6667         * Makefile: Simplify.  Use executable.make.
6668         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6669
6670 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6671
6672         * decl.cs:
6673         * enum.cs:
6674         Use the invariant culture when doing String.Compare for CLS case
6675         sensitivity.
6676         
6677 2004-05-23  Martin Baulig  <martin@ximian.com>
6678
6679         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6680         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6681
6682         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6683         
6684 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6685
6686         * class.cs (MemberBase.Define): Reuse MemberType member for 
6687         resolved type. Other methods can use it too.
6688
6689 2004-05-23  Martin Baulig  <martin@ximian.com>
6690
6691         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6692         the variable also exists in the current block (otherwise, we need
6693         to report a CS0103).  Fixes #58670.
6694
6695 2004-05-23  Martin Baulig  <martin@ximian.com>
6696
6697         * flowanalysis.cs (Reachability.Reachable): Compute this
6698         on-the-fly rather than storing it as a field.
6699
6700 2004-05-23  Martin Baulig  <martin@ximian.com>
6701
6702         * flowanalysis.cs (Reachability.And): Manually compute the
6703         resulting `barrier' from the reachability.      
6704        
6705 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6706
6707         Fix bug #57835
6708         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6709         instance of ObsoleteAttribute when symbol is obsolete.
6710
6711         * class.cs
6712         (IMethodData): Extended interface for ObsoleteAttribute support.
6713
6714 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6715
6716         * attribute.cs: Fix bug #55970
6717
6718 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6719
6720         Fix bug #52705
6721         * attribute.cs
6722         (GetObsoleteAttribute): New method. Creates the instance of
6723         ObsoleteAttribute.
6724         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6725         ObsoleteAttribute when member is obsolete.
6726         (AttributeTester.Report_ObsoleteMessage): Common method for
6727         Obsolete error/warning reporting.
6728
6729         * class.cs
6730         (TypeContainer.base_classs_type): New member for storing parent type.
6731
6732         * decl.cs
6733         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6734         for this MemberCore.
6735
6736 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6737
6738         * attribute.cs, const.cs: Fix bug #58590
6739
6740 2004-05-21  Martin Baulig  <martin@ximian.com>
6741
6742         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6743         out parameters if the end of the method is unreachable.  Fixes
6744         #58098. 
6745
6746 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6747
6748         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6749         Hari was right, why extra method.
6750
6751 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6752
6753         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6754
6755 2004-05-20  Martin Baulig  <martin@ximian.com>
6756
6757         Merged this back from gmcs to keep the differences to a minumum.
6758
6759         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6760         instead of a Declspace.
6761         (Attribute.ResolveType): Likewise.
6762         (Attributes.Search): Likewise.
6763         (Attributes.Contains): Likewise.
6764         (Attributes.GetClsCompliantAttribute): Likewise.
6765
6766         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6767         argument.
6768         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6769         DeclSpace.
6770
6771 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6772
6773         Fix bug #58688 (MCS does not report error when the same attribute
6774         is assigned twice)
6775
6776         * attribute.cs (Attribute.Emit): Distinction between null and default.
6777
6778 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6779
6780         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6781         of a top-level attribute without an attribute target.
6782         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6783         Make non-static.
6784         (Attribute.Conditional_GetConditionName), 
6785         (Attribute.Obsolete_GetObsoleteMessage): Update.
6786         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6787         part of ScanForIndexerName.
6788         (Attribute.CanIgnoreInvalidAttribute): New function.
6789         (Attribute.ScanForIndexerName): Move to ...
6790         (Attributes.ScanForIndexerName): ... here.
6791         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6792         (Attributes.Search): New internal variant that can choose not to
6793         complain if types aren't resolved.  The original signature now
6794         complains.
6795         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6796         complaints suppressed.
6797         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6798         only if it not useful.
6799         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6800         top-level for attributes that are shared between the assembly
6801         and a top-level class.
6802         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6803         * class.cs: Update to reflect changes.
6804         (DefineIndexers): Fuse loops.
6805         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6806         a couple more variants of attribute names.
6807
6808 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6809
6810         Fix bug #52585 (Implemented explicit attribute declaration)
6811
6812         * attribute.cs:
6813         (Attributable.ValidAttributeTargets): New abstract method. It gets
6814         list of valid attribute targets for explicit target declaration.
6815         (Attribute.Target): It holds target itself.
6816         (AttributeSection): Removed.
6817         (Attribute.CheckTargets): New method. It checks whether attribute
6818         target is valid for the current element.
6819
6820         * class.cs:
6821         (EventProperty): New class. For events that are declared like
6822         property (with add and remove accessors).
6823         (EventField): New class. For events that are declared like field.
6824         class.cs
6825
6826         * cs-parser.jay: Implemented explicit attribute target declaration.
6827
6828         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6829         Override ValidAttributeTargets.
6830
6831         * parameter.cs:
6832         (ReturnParameter): Class for applying custom attributes on 
6833         the return type.
6834         (ParameterAtribute): New class. Class for applying custom
6835         attributes on the parameter type.
6836
6837 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6838
6839         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6840         definitions. 
6841
6842         (Method): Allow UNSAFE here.
6843
6844         * modifiers.cs: Support unsafe reporting.
6845
6846 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6847
6848         * decl.cs: Fix bug #58478.
6849
6850 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6851
6852         * statement.cs: When checking for unreachable code on an EmptyStatement,
6853         set the location. Fixes bug #58488.
6854
6855 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6856
6857         * driver.cs: Add -pkg handling.
6858
6859         From Gonzalo: UseShelLExecute=false
6860
6861 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6862
6863         * attribute.cs:
6864         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6865         for attribute.
6866         (Attribute.IsClsCompliaceRequired): Moved to base for better
6867         accesibility.
6868         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6869         when attribute is AttributeUsageAttribute.
6870         (Attribute.GetValidTargets): Simplified.
6871         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6872         attribute for this type.
6873         (Attribute.ApplyAttributes): Method renamed to Emit and make
6874         non-static.
6875         (GlobalAttributeSection): New class for special handling of global
6876         attributes (assembly, module).
6877         (AttributeSection.Emit): New method.
6878
6879         * class.cs: Implemented Attributable abstract methods.
6880         (MethodCore.LabelParameters): Moved to Parameter class.
6881         (Accessor): Is back simple class.
6882         (PropertyMethod): Implemented Attributable abstract class.
6883         (DelegateMethod): Implemented Attributable abstract class.
6884         (Event): New constructor for disctintion between normal Event
6885         and Event with accessors.
6886
6887         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6888
6889         * codegen.cs, const.cs, decl.cs, delegate.cs:
6890         (CommonAssemblyModulClass): Implemented Attributable abstract class
6891         and simplified.
6892
6893         * enum.cs: Implement IAttributeSupport interface.
6894         (EnumMember): New class for emum members. Implemented Attributable
6895         abstract class
6896
6897         * parameter.cs:
6898         (ParameterBase): Is abstract.
6899         (ReturnParameter): New class for easier [return:] attribute handling.
6900
6901         * typemanager.cs: Removed builder_to_attr.
6902
6903 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6904
6905         Fix bug #57151.
6906         * attribute.cs (Attribute.GetPositionalValue): New function.
6907         * class.cs (TypeContainer.VerifyMembers): New function.
6908         (TypeContainer.Emit): Use it.
6909         (ClassOrStruct): New base class for Class and Struct.
6910         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6911         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6912         class.
6913         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6914         then each non-static field should have a FieldOffset attribute.
6915         Otherwise, none of the fields should have a FieldOffset attribute.
6916         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6917         and FieldOffset attributes.
6918         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6919         (TypeManager.field_offset_attribute_type): New core types.
6920         (TypeManager.InitCoreTypes): Initialize them.
6921
6922 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6923
6924         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6925         Return correct type.
6926         From bug #58270.
6927
6928 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6929
6930         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6931         be implicitly converted to ulong.
6932         
6933         * expression.cs: The logic for allowing operator &, | and ^ worked
6934         was wrong, it worked before because we did not report an error in
6935         an else branch.  Fixes 57895.
6936
6937         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6938         allow volatile fields to be reference types.
6939
6940 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6941
6942         * driver.cs: Add support for /debug-
6943
6944 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6945
6946         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6947         Add a 'complain' parameter to silence errors.
6948         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6949         silently overlooked type-resolutions.
6950         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6951         to reflect changes.
6952         (Attributes.Search): New function.
6953         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6954         (Attributes.GetAttributeFullName): Remove hack.
6955         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6956         Update to reflect changes.
6957         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6958         Use Attributes.Search instead of nested loops.
6959
6960 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6961
6962         * decl.cs:
6963         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6964         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6965         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6966
6967         * report.cs: (Report.Warning): Renamed to Warning_T because of
6968         parameter collision.
6969
6970 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6971
6972         * expression.cs (MemberAccess.ResolveMemberAccess):
6973         Exit with non-zero status after Report.Error.
6974         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6975         Likewise.
6976         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6977
6978 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6979
6980         * support.cs: Don't hang when the file is empty.
6981
6982 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6983
6984         * support.cs: In SeekableStreamReader, compute the preamble size of the
6985           underlying stream. Position changes should take into account that initial
6986           count of bytes.
6987
6988 2004-05-03  Todd Berman  <tberman@sevenl.net>
6989
6990         * driver.cs: remove unused GetSysVersion function.
6991
6992 2004-05-03  Todd Berman  <tberman@sevenl.net>
6993
6994         * driver.cs: Remove the hack from saturday, as well as the hack
6995         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6996         link_paths to get that bit proper.
6997
6998 2004-05-01  Todd Berman  <tberman@sevenl.net>
6999
7000         * driver.cs: Try a LoadFrom before a Load, this checks the current
7001         path. This is currently a bug in mono that is be fixed, however, this
7002         provides a workaround for now. This will be removed when the bug
7003         is fixed.
7004
7005 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7006
7007         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7008         incomplete key pairs (#57941).
7009
7010 2004-05-01  Todd Berman  <tberman@sevenl.net>
7011
7012         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7013         from the GAC
7014
7015 2004-04-30  Jackson Harper  <jackson@ximian.com>
7016
7017         * codegen.cs: Open keys readonly.
7018         
7019 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7020
7021         * typemanager.cs: don't report cyclic struct layout when a struct
7022         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7023         which has 2 Pango.Rectangle fields.
7024
7025 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7026
7027         * expression.cs: Handle IntPtr comparisons with IL code
7028         rather than a method call.
7029
7030 2004-04-29  Martin Baulig  <martin@ximian.com>
7031
7032         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7033         the list of PropertyInfo's in class hierarchy and find the
7034         accessor.  Fixes #56013.
7035
7036 2004-04-29  Martin Baulig  <martin@ximian.com>
7037
7038         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7039
7040 2004-04-29  Martin Baulig  <martin@ximian.com>
7041
7042         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7043
7044         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7045
7046 2004-04-29  Martin Baulig  <martin@ximian.com>
7047
7048         * class.cs (ConstructorInitializer.Resolve): Check whether the
7049         parent .ctor is accessible.  Fixes #52146.
7050
7051 2004-04-29  Martin Baulig  <martin@ximian.com>
7052
7053         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7054
7055         * statement.cs (Using.EmitLocalVariableDecls): Use
7056         TypeManager.idisposable_type, not typeof (IDisposable).
7057         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7058
7059 2004-04-29  Martin Baulig  <martin@ximian.com>
7060
7061         * class.cs (Event.Define): Don't emit the field and don't set
7062         RTSpecialName and SpecialName for events on interfaces.  Fixes
7063         #57703. 
7064
7065 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7066
7067         Refactor Attribute.ApplyAttributes.
7068         * attribute.cs (Attributable): New base class for objects that can
7069         have Attributes applied on them.
7070         (Attribute): Make AttributeUsage fields public.
7071         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7072         (Attribute.IsInternalCall): New property.
7073         (Attribute.UsageAttr): Convert to a public read-only property.
7074         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7075         (Attribute.ResolveType, Attribute.Resolve)
7076         (Attribute.ScanForIndexerName): Update to reflect changes.
7077         (Attribute.CheckAttributeTarget): Re-format.
7078         (Attribute.ApplyAttributes): Refactor, to various
7079         Attributable.ApplyAttributeBuilder methods.
7080         * decl.cs (MemberCore): Make Attributable.
7081         * class.cs (Accessor): Make Attributable.
7082         (MethodData.ApplyAttributes): Use proper attribute types, not
7083         attribute names.
7084         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7085         (TypeContainer.ApplyAttributeBuilder)
7086         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7087         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7088         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7089         (Operator.ApplyAttributeBuilder): New factored-out methods.
7090         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7091         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7092         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7093         * parameter.cs (ParameterBase): New Attributable base class
7094         that can also represent Return types.
7095         (Parameter): Update to the changes.
7096
7097 2004-04-29  Jackson Harper  <jackson@ximian.com>
7098
7099         * driver.cs: Prefer the corlib system version when looking for
7100         assemblies in the GAC. This is still a hack, but its a better hack
7101         now.
7102         
7103 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7104
7105         * decl.cs, enum.cs: Improved error 3005 reporting.
7106   
7107         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7108         (related_symbols): New private member for list of symbols
7109         related to reported error/warning.
7110         
7111         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7112
7113 2004-04-29  Martin Baulig  <martin@ximian.com>
7114
7115         * ecore.cs (Expression.Constantify): If we're an enum and
7116         TypeManager.TypeToCoreType() doesn't give us another type, use
7117         t.UnderlyingSystemType.  Fixes #56178.  
7118
7119 2004-04-29  Martin Baulig  <martin@ximian.com>
7120
7121         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7122         interfaces and for each interface, only add members directly
7123         declared in that interface.  Fixes #53255.
7124
7125 2004-04-28  Martin Baulig  <martin@ximian.com>
7126
7127         * expression.cs (ConditionalLogicalOperator): Use a temporary
7128         variable for `left' to avoid that we evaluate it more than once;
7129         bug #52588.
7130
7131 2004-04-28  Martin Baulig  <martin@ximian.com>
7132
7133         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7134         `void[]' (CS1547).
7135
7136 2004-04-28  Martin Baulig  <martin@ximian.com>
7137
7138         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7139         void (CS1547).
7140
7141         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7142         whether the type is not void (CS1547).
7143
7144 2004-04-28  Martin Baulig  <martin@ximian.com>
7145
7146         * expression.cs (Unary.DoResolveLValue): Override this and report
7147         CS0131 for anything but Operator.Indirection.
7148
7149 2004-04-28  Martin Baulig  <martin@ximian.com>
7150
7151         Committing a patch from Ben Maurer; see bug #50820.
7152
7153         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7154         check for classes.
7155
7156         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7157         classes.        
7158
7159 2004-04-28  Martin Baulig  <martin@ximian.com>
7160
7161         Committing a patch from Ben Maurer; see bug #50820.
7162
7163         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7164         check for classes.
7165
7166         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7167         classes.        
7168
7169 2004-04-28  Martin Baulig  <martin@ximian.com>
7170
7171         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7172         (Block.AddLabel): Call DoLookupLabel() to only search in the
7173         current block.
7174
7175 2004-04-28  Martin Baulig  <martin@ximian.com>
7176
7177         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7178         comparing StringConstants and NullLiterals in Equality and Inequality.
7179
7180 2004-04-28  Jackson Harper  <jackson@ximian.com>
7181
7182         * driver.cs: Attempt to load referenced assemblies from the
7183         GAC. This is the quick and dirty version of this method that
7184         doesnt take into account versions and just takes the first
7185         canidate found. Will be good enough for now as we will not have more
7186         then one version installed into the GAC until I update this method.
7187
7188 2004-04-28  Martin Baulig  <martin@ximian.com>
7189
7190         * typemanager.cs (TypeManager.CheckStructCycles): New public
7191         static method to check for cycles in the struct layout.
7192
7193         * rootcontext.cs (RootContext.PopulateTypes): Call
7194         TypeManager.CheckStructCycles() for each TypeContainer.
7195         [Note: We only need to visit each type once.]
7196
7197 2004-04-28  Martin Baulig  <martin@ximian.com>
7198
7199         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7200
7201         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7202         success and added `out object value'.  Use a `bool resolved' field
7203         to check whether we've already been called rather than
7204         `ConstantValue != null' since this breaks for NullLiterals.
7205
7206 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7207
7208         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7209         setting of this flag, since the 'set' method may be non-public.
7210
7211 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7212
7213         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7214         check on current_vector.Block.
7215
7216 2004-04-27  Martin Baulig  <martin@ximian.com>
7217
7218         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7219         a field initializer.  Fixes #56459.
7220
7221 2004-04-27  Martin Baulig  <martin@ximian.com>
7222
7223         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7224         we're not attempting to use an indexer.  Fixes #52154.
7225
7226 2004-04-27  Martin Baulig  <martin@ximian.com>
7227
7228         * statement.cs (Return): Don't create a return label if we don't
7229         need it; reverts my change from January 20th.  Thanks to Ben
7230         Maurer for this.
7231
7232 2004-04-27  Martin Baulig  <martin@ximian.com>
7233
7234         According to the spec, `goto' can only leave a nested scope, but
7235         never enter it.
7236
7237         * statement.cs (Block.LookupLabel): Only lookup in the current
7238         block, don't recurse into parent or child blocks.
7239         (Block.AddLabel): Check in parent and child blocks, report
7240         CS0140/CS0158 if we find a duplicate.
7241         (Block): Removed this indexer for label lookups.
7242         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7243         this already does the error reporting for us.
7244
7245         * flowanalysis.cs
7246         (FlowBranching.UsageVector.Block): New public variable; may be null.
7247         (FlowBranching.CreateSibling): Added `Block' argument.
7248         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7249         label for the target of a `goto' and check whether we're not
7250         leaving a `finally'.
7251
7252 2004-04-27  Martin Baulig  <martin@ximian.com>
7253
7254         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7255         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7256         just for returns).
7257
7258 2004-04-27  Martin Baulig  <martin@ximian.com>
7259
7260         * statement.cs (Block.AddLabel): Also check for implicit blocks
7261         and added a CS0158 check.
7262
7263 2004-04-27  Martin Baulig  <martin@ximian.com>
7264
7265         * flowanalysis.cs (FlowBranchingLoop): New class.
7266         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7267         UsageVector's instead of an ArrayList.
7268         (FlowBranching.Label): Likewise.
7269         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7270         (FlowBranching.AddBreakVector): New method.
7271
7272 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7273
7274         * attribute.cs: Small regression fix: only convert the type if we
7275         the type is different, fixes System.Drawing build.
7276
7277 2004-04-27  Martin Baulig  <martin@ximian.com>
7278
7279         * attribute.cs (Attribute.Resolve): If we have a constant value
7280         for a named field or property, implicity convert it to the correct
7281         type.
7282
7283 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7284
7285         * statement.cs (Block.Block): Implicit blocks share
7286         'child_variable_names' fields with parent blocks.
7287         (Block.AddChildVariableNames): Remove.
7288         (Block.AddVariable): Mark variable as "used by a child block" in
7289         every surrounding block.
7290         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7291         been used in a child block, complain about violation of "Invariant
7292         meaning in blocks" rule.
7293         * cs-parser.jay (declare_local_variables): Don't use
7294         AddChildVariableNames.
7295         (foreach_statement): Don't create an implicit block: 'foreach'
7296         introduces a scope.
7297
7298 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7299
7300         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7301         converting from 0L to ulong.  Fixes 57522.
7302
7303 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7304
7305         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7306         derived class hides via 'new' keyword field from base class (test-242.cs).
7307         TODO: Handle this in the more general way.
7308         
7309         * class.cs (CheckBase): Ditto.
7310
7311 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7312
7313         * decl.cs (caching_flags): New member for storing cached values
7314         as bit flags.
7315         (MemberCore.Flags): New enum where bit flags for caching_flags
7316         are defined.
7317         (MemberCore.cls_compliance): Moved to caching_flags.
7318         (DeclSpace.Created): Moved to caching_flags.
7319
7320         * class.cs: Use caching_flags instead of DeclSpace.Created
7321         
7322 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7323
7324         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7325         if we are only a derived class, not a nested class.
7326
7327         * typemanager.cs: Same as above, but do this at the MemberLookup
7328         level (used by field and methods, properties are handled in
7329         PropertyExpr).   Allow for the qualified access if we are a nested
7330         method. 
7331
7332 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7333
7334         * class.cs: Refactoring.
7335         (IMethodData): New inteface; Holds links to parent members
7336         to avoid member duplication (reduced memory allocation).
7337         (Method): Implemented IMethodData interface.
7338         (PropertyBase): New inner classes for get/set methods.
7339         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7340         (Event): New inner classes for add/remove methods.
7341         (Event.DelegateMethod): Implemented IMethodData interface.
7342
7343         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7344         EmitContext (related to class.cs refactoring).
7345
7346 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7347
7348         * delegate.cs (Delegate.VerifyApplicability): If the number of
7349         arguments are the same as the number of parameters, first try to
7350         verify applicability ignoring  any 'params' modifier on the last
7351         parameter.
7352         Fixes #56442.
7353
7354 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7355
7356         * class.cs (TypeContainer.AddIndexer): Use
7357         'ExplicitInterfaceName' to determine if interface name was
7358         explicitly specified.  'InterfaceType' is not initialized at this time.
7359         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7360         Indexers array is already in the required order.  Initialize
7361         'IndexerName' only if there are normal indexers.
7362         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7363         (TypeContainer.Emit): Emit DefaultMember attribute only if
7364         IndexerName is initialized.
7365         Fixes #56300.
7366
7367 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7368
7369         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7370         Fixes #57007
7371
7372 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7373
7374         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7375         attributes.
7376         Fix for #56456.
7377
7378         * attribute.cs (Attribute.Resolve): Check for duplicate named
7379         attributes.
7380         Fix for #56463.
7381
7382 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7383
7384         * iterators.cs (MarkYield): track whether we are in an exception,
7385         and generate code accordingly.  Use a temporary value to store the
7386         result for our state.
7387
7388         I had ignored a bit the interaction of try/catch with iterators
7389         since their behavior was not entirely obvious, but now it is
7390         possible to verify that our behavior is the same as MS .NET 2.0
7391
7392         Fixes 54814
7393
7394 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7395
7396         * iterators.cs: Avoid creating temporaries if there is no work to
7397         do. 
7398
7399         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7400         Enumerations, use TypeManager.EnumToUnderlying and call
7401         recursively. 
7402
7403         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7404         bug #57013
7405
7406         (This.Emit): Use EmitContext.EmitThis to emit our
7407         instance variable.
7408
7409         (This.EmitAssign): Ditto.
7410
7411         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7412         codepaths, we will move all the functionality into
7413         Mono.CSharp.This 
7414
7415         (FieldExpr.EmitAssign): Ditto.
7416
7417         This fixes several hidden bugs that I uncovered while doing a code
7418         review of this today.
7419
7420         * codegen.cs (EmitThis): reworked so the semantics are more clear
7421         and also support value types "this" instances.
7422
7423         * iterators.cs: Changed so that for iterators in value types, we
7424         do not pass the value type as a parameter.  
7425
7426         Initialization of the enumerator helpers is now done in the caller
7427         instead of passing the parameters to the constructors and having
7428         the constructor set the fields.
7429
7430         The fields have now `assembly' visibility instead of private.
7431
7432 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * expression.cs (Argument.Resolve): Check if fields passed as ref
7435         or out are contained in a MarshalByRefObject.
7436
7437         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7438         another compiler type.
7439
7440 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7441
7442         * class.cs (Indexer.Define): use the new name checking method.
7443         Also, return false on an error.
7444         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7445         (is_identifier_[start/part]_character): make static.
7446
7447 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7448
7449         * expression.cs (Binary.ResolveOperator): Do no append strings
7450         twice: since we can be invoked more than once (array evaluation)
7451         on the same concatenation, take care of this here.  Based on a fix
7452         from Ben (bug #56454)
7453
7454 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7455
7456         * codegen.cs: Fix another case where CS1548 must be reported (when 
7457         delay-sign isn't specified and no private is available #56564). Fix
7458         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7459         error when MCS is used on the MS runtime and we need to delay-sign 
7460         (which seems unsupported by AssemblyBuilder - see #56621).
7461
7462 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7463
7464         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7465         (TypeManager.ComputeNamespaces): Faster implementation for
7466         Microsoft runtime.
7467
7468         * compiler.csproj: Updated AssemblyName to mcs.
7469
7470 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7471
7472         * rootcontext.cs: Add new types to the boot resolution.
7473
7474         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7475         MulticastDelegate is not allowed.
7476
7477         * typemanager.cs: Add new types to lookup: System.TypedReference
7478         and ArgIterator.
7479
7480         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7481         check for TypedReference or ArgIterator, they are not allowed. 
7482
7483         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7484         makes us properly catch 1510 in some conditions (see bug 56016 for
7485         details). 
7486
7487 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7488
7489         * CryptoConvert.cs: update from corlib version
7490         with endian fixes.
7491
7492 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7493
7494         * class.cs (Indexer.Define): Check indexername declaration
7495
7496 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7497
7498         * attribute.cs (IsClsCompliant): Fixed problem with handling
7499         all three states (compliant, not-compliant, undetected).
7500
7501 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7502
7503         * attribute.cs (Attribute): Location is now public.
7504         (Resolve): Store resolved arguments (pos_values) in attribute class.
7505         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7506         (GetClsCompliantAttributeValue): New method that gets
7507         CLSCompliantAttribute value.
7508         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7509         if exists else null.
7510         (AttributeTester): New class for CLS-Compliant verification routines.
7511
7512         * class.cs (Emit): Add CLS-Compliant verification.
7513         (Method.GetSignatureForError): Implemented.
7514         (Constructor.GetSignatureForError): Implemented
7515         (Constructor.HasCompliantArgs): Returns if constructor has
7516         CLS-Compliant arguments.
7517         (Constructor.Emit): Override.
7518         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7519         is needed to test only parameters.
7520         (FieldBase.GetSignatureForError): Implemented.
7521         (TypeContainer): New member for storing base interfaces.
7522         (TypeContainer.FindMembers): Search in base interfaces too.
7523
7524         * codegen.cs (GetClsComplianceAttribute): New method that gets
7525         assembly or module CLSCompliantAttribute value.
7526         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7527         for assembly.
7528         (ModuleClass.Emit): Add error 3012 test.
7529
7530         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7531
7532         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7533         state for all decl types.
7534         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7535         if CLS-Compliant tests are required.
7536         (IsClsCompliaceRequired): New method. Analyze whether code
7537         must be CLS-Compliant.
7538         (IsExposedFromAssembly): New method. Returns true when MemberCore
7539         is exposed from assembly.
7540         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7541         value or gets cached value.
7542         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7543         is explicitly marked with CLSCompliantAttribute.
7544         (IsIdentifierClsCompliant): New abstract method. This method is
7545         used to testing error 3005.
7546         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7547         for identifier and parameters CLS-Compliant testing.
7548         (VerifyClsCompliance): New method. The main virtual method for
7549         CLS-Compliant verifications.
7550         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7551         null. I don't know why is null (too many public members !).
7552         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7553         and get value of first CLSCompliantAttribute that found.
7554
7555         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7556         (VerifyClsCompliance): Override and add extra tests.
7557
7558         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7559         clscheck- disable CLS-Compliant verification event if assembly is has
7560         CLSCompliantAttribute(true).
7561
7562         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7563         ApllyAttribute is now called in emit section as in the other cases.
7564         Possible future Emit integration.
7565         (IsIdentifierClsCompliant): New override.
7566         (VerifyClsCompliance): New override.
7567         (GetEnumeratorName): Returns full enum name.
7568
7569         * parameter.cs (GetSignatureForError): Implemented.
7570
7571         * report.cs (WarningData): New struct for Warning message information.
7572         (LocationOfPreviousError): New method.
7573         (Warning): New method. Reports warning based on the warning table.
7574         (Error_T): New method. Reports error based on the error table.
7575
7576         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7577         verifications are done here.
7578
7579         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7580
7581         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7582         CLSCompliantAttribute.
7583         (all_imported_types): New member holds all imported types from other
7584         assemblies.
7585         (LoadAllImportedTypes): New method fills static table with exported types
7586         from all referenced assemblies.
7587         (Modules): New property returns all assembly modules.
7588
7589 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7590
7591         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7592         throwing a parser error.
7593
7594         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7595         which removes the hardcoded get_/set_ prefixes for properties, as
7596         IL allows for the properties to be named something else.  
7597
7598         Bug #56013
7599
7600         * expression.cs: Do not override operand before we know if it is
7601         non-null.  Fix 56207
7602
7603 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7604
7605         * typemanager.cs: support for pinned variables.
7606
7607 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7608
7609         * decl.cs, typemanager.cs: Avoid using an arraylist
7610         as a buffer if there is only one result set.
7611
7612 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7613
7614         * expression.cs: Make sure you cant call a static method
7615         with an instance expression, bug #56174.
7616
7617 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7618
7619         * class.cs (IsDuplicateImplementation): Improve error reporting to
7620         flag 663 (method only differs in parameter modifier).
7621
7622         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7623         in preprocessor directives.
7624
7625         * location.cs (LookupFile): Allow for the empty path.
7626
7627         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7628         better approach for some of that patch, but its failing with the
7629         CharSet enumeration.  For now try/catch will do.
7630
7631         * typemanager.cs: Do not crash if a struct does not have fields.
7632         Fixes 56150.
7633
7634 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7635
7636         * expression.cs: cs0213, cant fix a fixed expression.
7637         fixes 50231.
7638
7639 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7640
7641         * cs-parser.jay: detect invalid embeded statements gracefully.
7642         bug #51113.
7643
7644 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7645
7646         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7647         As a regex:
7648         s/
7649         the invocation type may not be a subclass of the tye of the item/
7650         The type of the item must be a subclass of the invocation item.
7651         /g
7652
7653         Fixes bug #50820.
7654
7655 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7656
7657         * attribute.cs: Added methods to get a string and a bool from an
7658         attribute. Required to information from AssemblyKeyFileAttribute,
7659         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7660         * codegen.cs: Modified AssemblyName creation to include support for
7661         strongnames. Catch additional exceptions to report them as CS1548.
7662         * compiler.csproj: Updated include CryptoConvert.cs.
7663         * compiler.csproj.user: Removed file - user specific configuration.
7664         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7665         Mono.Security assembly. The original class is maintained and tested in
7666         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7667         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7668         like CSC 8.0 (C# v2) supports.
7669         * Makefile: Added CryptoConvert.cs to mcs sources.
7670         * rootcontext.cs: Added new options for strongnames.
7671
7672 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7673
7674         * driver.cs: For --expect-error, report error code `2'
7675         if the program compiled with no errors, error code `1' if
7676         it compiled with an error other than the one expected.
7677
7678 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7679
7680         * compiler.csproj: Updated for Visual Studio .NET 2003.
7681         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7682         * compiler.sln: Updated for Visual Studio .NET 2003.
7683
7684 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7685
7686         * expression.cs: Fix bug #47234. We basically need to apply the
7687         rule that we prefer the conversion of null to a reference type
7688         when faced with a conversion to 'object' (csc behaviour).
7689
7690 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7691
7692         * statement.cs: Shorter form for foreach, eliminates
7693         a local variable. r=Martin.
7694
7695 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7696
7697         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7698         checks if we can use brtrue/brfalse to test for 0.
7699         * expression.cs: use the above in the test for using brtrue/brfalse.
7700         cleanup code a bit.
7701
7702 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7703
7704         * expression.cs: Rewrite string concat stuff. Benefits:
7705
7706         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7707         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7708         rather than a concat chain.
7709
7710         * typemanager.cs: Add lookups for more concat overloads.
7711
7712 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7713
7714         * expression.cs: Emit shorter il code for array init.
7715
7716         newarr
7717         dup
7718         // set 1
7719
7720         // set 2
7721
7722         newarr
7723         stloc.x
7724
7725         ldloc.x
7726         // set 1
7727
7728         ldloc.x
7729         // set 2
7730
7731 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7732
7733         * statement.cs: Before, two switch blocks would be merged if the
7734         total size of the blocks (end_item - begin_item + 1) was less than
7735         two times the combined sizes of the blocks.
7736
7737         Now, it will only merge if after the merge at least half of the
7738         slots are filled.
7739
7740         fixes 55885.
7741
7742 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7743
7744         * class.cs : csc build fix for GetMethods(). See bug #52503.
7745
7746 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7747
7748         * expression.cs: Make sure fp comparisons work with NaN.
7749         This fixes bug #54303. Mig approved this patch a long
7750         time ago, but we were not able to test b/c the runtime
7751         had a related bug.
7752
7753 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7754
7755         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7756
7757 2004-03-19  Martin Baulig  <martin@ximian.com>
7758
7759         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7760         error here and not in our caller.
7761
7762 2004-03-19  Martin Baulig  <martin@ximian.com>
7763
7764         * interface.cs: Completely killed this file.
7765         (Interface): We're now a TypeContainer and live in class.cs.
7766
7767         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7768         argument; we're now also called for interfaces.
7769         (TypeContainer.DefineMembers): Allow this method being called
7770         multiple times.
7771         (TypeContainer.GetMethods): New public method; formerly known as
7772         Interface.GetMethod().  This is used by PendingImplementation.
7773         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7774         it's now private and non-static.
7775         (Interface): Moved this here; it's now implemented similar to
7776         Class and Struct.
7777         (Method, Property, Event, Indexer): Added `bool is_interface'
7778         argument to their .ctor's.
7779         (MemberBase.IsInterface): New public field.
7780
7781         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7782         instances instead of InterfaceMethod, InterfaceProperty, etc.
7783         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7784         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7785
7786 2004-03-19  Martin Baulig  <martin@ximian.com>
7787
7788         * class.cs (MethodCore.IsDuplicateImplementation): New private
7789         method which does the CS0111 checking.
7790         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7791         Use IsDuplicateImplementation().
7792
7793 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7794
7795         * decl.cs (FindMemberToOverride): New method to find the correct
7796         method or property to override in the base class.
7797         * class.cs
7798             - Make Method/Property use the above method to find the
7799               version in the base class.
7800             - Remove the InheritableMemberSignatureCompare as it is now
7801               dead code.
7802
7803         This patch makes large code bases much faster to compile, as it is
7804         O(n) rather than O(n^2) to do this validation.
7805
7806         Also, it fixes bug 52458 which is that nested classes are not
7807         taken into account when finding the base class member.
7808
7809         Reviewed/Approved by Martin.
7810
7811 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7812
7813         * interface.cs: In all interface classes removed redundant
7814         member initialization.
7815
7816 2004-03-16  Martin Baulig  <martin@ximian.com>
7817
7818         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7819
7820 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7821
7822         * decl.cs (DefineTypeAndParents): New helper method to define a
7823         type's containers before the type itself is defined;  This is a
7824         bug exposed by the recent changes to Windows.Forms when an
7825         implemented interface was defined inside a class that had not been
7826         built yet.   
7827
7828         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7829
7830         (Check): Loop correctly to report errors modifiers
7831         (UNSAFE was not in the loop, since it was the same as TOP).
7832
7833         * interface.cs: Every interface member now takes a ModFlags,
7834         instead of a "is_new" bool, which we set on the base MemberCore. 
7835
7836         Every place where we called "UnsafeOk" in the interface, now we
7837         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7838         the unsafe settings from the member declaration instead of the
7839         container interface. 
7840
7841         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7842
7843         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7844         `set_indexer_name' to the pending bits (one per type).
7845
7846         We fixed a bug today that was picking the wrong method to
7847         override, since for properties the existing InterfaceMethod code
7848         basically ignored the method name.  Now we make sure that the
7849         method name is one of the valid indexer names.
7850
7851 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7852  
7853         * support.cs (SeekableStreamReader): Keep track of stream byte
7854         positions and don't mix them with character offsets to the buffer.
7855
7856         Patch from Gustavo Giráldez
7857
7858 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7859
7860         * interface.cs (InterfaceSetGetBase): Removed double member
7861         initialization, base class does it as well.
7862
7863 2004-03-13  Martin Baulig  <martin@ximian.com>
7864
7865         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7866         when compiling corlib.
7867
7868 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7869
7870         * convert.cs (ExplicitConversion): We were reporting an error on
7871         certain conversions (object_type source to a value type, when the
7872         expression was `null') before we had a chance to pass it through
7873         the user defined conversions.
7874
7875         * driver.cs: Replace / and \ in resource specifications to dots.
7876         Fixes 50752
7877
7878         * class.cs: Add check for duplicate operators.  Fixes 52477
7879
7880 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7881
7882         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7883         that are in the middle of the statements, not only at the end.
7884         Fixes #54987
7885
7886         * class.cs (TypeContainer.AddField): No longer set the
7887         `HaveStaticConstructor' flag, now we call it
7888         `UserDefineStaticConstructor' to diferentiate the slightly
7889         semantic difference.
7890
7891         The situation is that we were not adding BeforeFieldInit (from
7892         Modifiers.TypeAttr) to classes that could have it.
7893         BeforeFieldInit should be set to classes that have no static
7894         constructor. 
7895
7896         See:
7897
7898         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7899
7900         And most importantly Zoltan's comment:
7901
7902         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7903
7904         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7905          before its static fields are used', i.e. initialization does not need
7906          to be triggered by the first access to the type. Setting this flag
7907          helps the JIT to compile better code, since it can run the static
7908          constructor at JIT time, and does not need to generate code to call it
7909          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7910          this flag for lots of classes like String. 
7911          
7912          csc sets this flag if the type does not have an explicit static 
7913          constructor. The reasoning seems to be that if there are only static
7914          initalizers for a type, and no static constructor, then the programmer
7915          does not care when this initialization happens, so beforefieldinit
7916          can be used.
7917          
7918          This bug prevents the AOT compiler from being usable, since it 
7919          generates so many calls to mono_runtime_class_init that the AOT code
7920          is much slower than the JITted code. The JITted code is faster, 
7921          because it does not generate these calls if the vtable is type is
7922          already initialized, which is true in the majority of cases. But the
7923          AOT compiler can't do this."
7924
7925 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7926
7927         * class.cs (MethodData.Emit): Refactor the code so symbolic
7928         information is generated for destructors;  For some reasons we
7929         were taking a code path that did not generate symbolic information
7930         before. 
7931
7932 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7933
7934         * class.cs: Create a Constructor.CheckBase method that
7935         takes care of all validation type code. The method
7936         contains some code that was moved from Define.
7937
7938         It also includes new code that checks for duplicate ctors.
7939         This fixes bug #55148.
7940
7941 2004-03-09  Joshua Tauberer <tauberer@for.net>
7942
7943         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7944         a { ... }-style array creation invokes EmitStaticInitializers
7945         which is not good for reference-type arrays.  String, decimal
7946         and now null constants (NullCast) are not counted toward
7947         static initializers.
7948
7949 2004-03-05  Martin Baulig  <martin@ximian.com>
7950
7951         * location.cs (SourceFile.HasLineDirective): New public field;
7952         specifies whether the file contains or is referenced by a "#line"
7953         directive.
7954         (Location.DefineSymbolDocuments): Ignore source files which
7955         either contain or are referenced by a "#line" directive.        
7956
7957 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7958
7959         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7960         direct access to our parent, so check the method inline there.
7961
7962 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7963
7964         * expression.cs (Invocation.EmitCall): Miguel's last commit
7965         caused a regression. If you had:
7966
7967             T t = null;
7968             t.Foo ();
7969
7970         In Foo the implict this would be null.
7971
7972 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7973
7974         * expression.cs (Invocation.EmitCall): If the method is not
7975         virtual, do not emit a CallVirt to it, use Call.
7976
7977         * typemanager.cs (GetFullNameSignature): Improve the method to
7978         cope with ".ctor" and replace it with the type name.
7979
7980         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7981         as an argument the ConstructorBuilder where it is being defined,
7982         to catch the recursive constructor invocations.
7983
7984 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7985
7986         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7987         routines to check if a type is an enumerable/enumerator allow
7988         classes that implement the IEnumerable or IEnumerator interfaces.
7989
7990         * class.cs (Property, Operator): Implement IIteratorContainer, and
7991         implement SetYields.
7992
7993         (Property.Define): Do the block swapping for get_methods in the
7994         context of iterators.   We need to check if Properties also
7995         include indexers or not.
7996
7997         (Operator): Assign the Block before invoking the
7998         OperatorMethod.Define, so we can trigger the Iterator code
7999         replacement. 
8000
8001         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8002         Property and Operator classes are not created when we parse the
8003         declarator but until we have the block completed, so we use a
8004         singleton SimpleIteratorContainer.Simple to flag whether the
8005         SetYields has been invoked.
8006
8007         We propagate this setting then to the Property or the Operator to
8008         allow the `yield' to function.
8009
8010 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8011
8012         * codegen.cs: Implemented attribute support for modules.
8013         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8014         Assembly/Module functionality.
8015
8016         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8017         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8018         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8019
8020 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8021
8022         * interface.cs (FindMembers): The operation is performed on all base
8023         interfaces and not only on the first. It is required for future CLS Compliance patch.
8024
8025 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8026
8027         * statement.cs, codegen.cs:
8028         This patch deals with patterns such as:
8029
8030         public class List : IEnumerable {
8031
8032                 public MyEnumerator GetEnumerator () {
8033                         return new MyEnumerator(this);
8034                 }
8035
8036                 IEnumerator IEnumerable.GetEnumerator () {
8037                         ...
8038                 }
8039                 
8040                 public struct MyEnumerator : IEnumerator {
8041                         ...
8042                 }
8043         }
8044
8045         Before, there were a few things we did wrong:
8046         1) we would emit callvirt on a struct, which is illegal
8047         2) we emited ldarg when we needed to emit ldarga
8048         3) we would mistakenly call the interface methods on an enumerator
8049         type that derived from IEnumerator and was in another assembly. For example:
8050
8051         public class MyEnumerator : IEnumerator
8052
8053         Would have the interface methods called, even if there were public impls of the
8054         method. In a struct, this lead to invalid IL code.
8055
8056 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8059           renamed to Emit.
8060
8061         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8062
8063 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8064
8065         * cs-parser.jay: Fix small regression: we were not testing V2
8066         compiler features correctly.
8067
8068         * interface.cs: If the emit context is null, then create one
8069
8070 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8071
8072         * decl.cs (GetSignatureForError): New virtual method to get full name
8073           for error messages.
8074
8075         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8076           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8077
8078         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8079           Duplicated members and code in these classes has been removed.
8080           Better encapsulation in these classes.
8081
8082 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8083
8084         * assign.cs (Assign.DoResolve): When dealing with compound
8085         assignments, there is a new rule in ECMA C# 2.4 (might have been
8086         there before, but it is documented here) that states that in:
8087
8088         a op= b;
8089
8090         If b is of type int, and the `op' is a shift-operator, then the
8091         above is evaluated as:
8092
8093         a = (int) a op b 
8094
8095         * expression.cs (Binary.ResolveOperator): Instead of testing for
8096         int/uint/long/ulong, try to implicitly convert to any of those
8097         types and use that in pointer arithmetic.
8098
8099         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8100         method to print information for from the type, not from the
8101         null-method we were given.
8102
8103 2004-02-01  Duncan Mak  <duncan@ximian.com>
8104
8105         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8106         parsing for cmd, fixes bug #53694.
8107
8108 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8109
8110         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8111         in the member name duplication tests. Property and operator name duplication
8112         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8113
8114 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8115
8116         * interface.cs (PopulateMethod): Fixed crash when interface method
8117         returns not existing type (error test cs0246-3.cs).
8118
8119 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8120
8121         * cs-parser.jay (interface_accessors): Re-write actions to also
8122         store attributes attached to get and set methods. Fix spelling
8123         while at it.
8124
8125         (inteface_property_declaration): Modify accordingly.
8126
8127         (InterfaceAccessorInfo): New helper class to store information to pass
8128         around between rules that use interface_accessors.
8129
8130         * interface.cs (Emit): Apply attributes on the get and set
8131         accessors of properties and indexers too.
8132
8133         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8134         right MethodBuilder when applying attributes to the get and set accessors.
8135
8136 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8137
8138         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8139
8140 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8141
8142         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8143
8144 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8145
8146         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8147         changes that treat `yield' specially when present before `break'
8148         or `return' tokens.
8149
8150         * cs-tokenizer.cs: yield is no longer a keyword.
8151
8152 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8153
8154         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8155         setting for default constructors.
8156         For default constructors are almost every time set wrong Modifier. The
8157         generated IL code has been alright. But inside mcs this values was
8158         wrong and this was reason why several of my CLS Compliance tests
8159         failed.
8160
8161 2004-01-22  Martin Baulig  <martin@ximian.com>
8162
8163         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8164         not a QualifiedIdentifier.  This is what `type_name_expression'
8165         was previously doing.
8166         (type_name_expression): Removed; the code is now in
8167         `namespace_or_type_name'.
8168         (qualified_identifier): Removed, use `namespace_or_type_name'
8169         instead.
8170         (QualifiedIdentifier): Removed this class.      
8171
8172 2004-01-22  Martin Baulig  <martin@ximian.com>
8173
8174         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8175         not a string as alias name.
8176
8177 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8178
8179         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8180         #52730 bug, and instead compute correctly the need to use a
8181         temporary variable when requesting an address based on the
8182         static/instace modified of the field and the constructor.
8183  
8184 2004-01-21  Martin Baulig  <martin@ximian.com>
8185
8186         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8187         class and namespace before looking up aliases.  Fixes #52517.
8188
8189 2004-01-21  Martin Baulig  <martin@ximian.com>
8190
8191         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8192         assinged in a 'try'; fixes exception4.cs.
8193
8194 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8195         * class.cs : Implemented parameter-less constructor for TypeContainer
8196
8197         * decl.cs: Attributes are now stored here. New property OptAttributes
8198
8199         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8200
8201         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8202
8203 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8204
8205         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8206           (CSharpSignature): New method for indexer and property signature.
8207
8208 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8209
8210         * pending.cs (IsVirtualFilter): Faster implementation.
8211
8212 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8213
8214         * typemanager.cs: Avoid inclusion of same assembly more than once.
8215
8216 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8217
8218         * cs-parser.jay: Fixed problem where the last assembly attribute
8219           has been applied also to following declaration (class, struct, etc.)
8220           
8221 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8222
8223         * class.cs: Added error CS0538, CS0539 reporting.
8224         Fixed crash on Microsoft runtime when field type is void.
8225
8226         * cs-parser.jay: Added error CS0537 reporting.
8227
8228         * pending.cs: Added error CS0535 reporting.
8229         Improved error report for errors CS0536, CS0534.
8230
8231 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8232
8233         Merge a few bits from the Anonymous Method MCS tree.
8234
8235         * statement.cs (ToplevelBlock): New class for toplevel methods,
8236         will hold anonymous methods, lifted variables.
8237
8238         * cs-parser.jay: Create toplevel blocks for delegates and for
8239         regular blocks of code. 
8240
8241 2004-01-20  Martin Baulig  <martin@ximian.com>
8242
8243         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8244         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8245         and `NeedExplicitReturn'; added `IsLastStatement'.
8246         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8247         have a `ReturnLabel' or we're not unreachable.
8248
8249         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8250         child's reachability; don't just override ours with it.  Fixes
8251         #58058 (lluis's example).
8252         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8253         InFinally(), InLoop(), InSwitch() and
8254         BreakCrossesTryCatchBoundary() methods.
8255
8256         * statement.cs (Return): Do all error checking in Resolve().
8257         Unless we are the last statement in a top-level block, always
8258         create a return label and jump to it.
8259         (Break, Continue): Do all error checking in Resolve(); also make
8260         sure we aren't leaving a `finally'.
8261         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8262         statement in a top-level block.
8263         (Block.Flags): Added `IsDestructor'.
8264         (Block.IsDestructor): New public property.
8265
8266 2004-01-20  Martin Baulig  <martin@ximian.com>
8267
8268         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8269
8270 2004-01-20  Martin Baulig  <martin@ximian.com>
8271
8272         * statement.cs (Statement.ResolveUnreachable): New public method.
8273         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8274         (Block.Resolve): Resolve unreachable statements.
8275
8276 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8277
8278         * expression.cs: We need to fix the case where we do
8279         not have a temp variable here.
8280
8281         * assign.cs: Only expression compound assignments need
8282         temporary variables.
8283
8284 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8285
8286         * flowanalysis.cs: Reduce memory allocation in a few ways:
8287           - A block with no variables should not allocate a bit
8288             vector for itself.
8289           - A method with no out parameters does not need any tracking
8290             for assignment of the parameters, so we need not allocate
8291             any data for it.
8292           - The arrays:
8293                 public readonly Type[] VariableTypes;
8294                 public readonly string[] VariableNames;
8295             Are redundant. The data is already stored in the variable
8296             map, so we need not allocate another array for it.
8297           - We need to add alot of checks for if (params | locals) == null
8298             due to the first two changes.
8299
8300 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8301
8302         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8303         implement IMemoryLocation, we store a copy on a local variable and
8304         take the address of it.  Patch from Benjamin Jemlich
8305
8306         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8307         to use a special "type_name_expression" rule which reduces the
8308         number of "QualifiedIdentifier" classes created, and instead
8309         directly creates MemberAccess expressions.
8310
8311 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8312
8313         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8314         that fixes #52853.  Null literal assignment to ValueType
8315
8316         * class.cs (MethodData.Emit): Instead of checking the name of the
8317         method to determine if its a destructor, create a new derived
8318         class from Method called Destructor, and test for that.  
8319
8320         * cs-parser.jay: Create a Destructor object instead of a Method.  
8321
8322         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8323
8324         Fixes: 52933
8325
8326 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8327
8328         * expression.cs (Binary.ResolveOperator): Perform an implicit
8329         conversion from MethodGroups to their delegate types on the
8330         Addition operation.
8331
8332         * delegate.cs: Introduce a new class DelegateCreation that is the
8333         base class for `NewDelegate' and `ImplicitDelegateCreation',
8334         factor some code in here.
8335
8336         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8337         conversion from MethodGroups to compatible delegate types. 
8338
8339         * ecore.cs (Expression.Resolve): Do not flag error 654
8340         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8341         we allow conversions from MethodGroups to delegate types now.
8342
8343         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8344         assignments in v2 either.
8345
8346 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8347
8348         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8349         static read-only fields in ctors.
8350
8351         Applied patch from Benjamin Jemlich 
8352
8353         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8354
8355 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8356
8357         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8358         here to return true, as they can be used like this:
8359
8360                 (XXX) int.MEMBER ()
8361
8362         Fixed 49836 and all the other dups
8363
8364 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8365
8366         * driver.cs: Implement /win32res and /win32icon.
8367
8368 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8369
8370         * cs-parser.jay: Add a rule to improve error handling for the
8371         common mistake of placing modifiers after the type.
8372
8373 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8374
8375         * cs-parser.jay (interface_event_declaration): Catch
8376         initialization of events on interfaces, and report cs0068
8377
8378         * cs-parser.jay (interface_event_declaration): Catch
8379         initialization of events. 
8380
8381         * ecore.cs: Better report missing constructors.
8382
8383         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8384         the error reporting done in the wrong place.  Fix.
8385
8386         * expression.cs (Binary.ResolveOperator): Catch the 
8387         operator + (E x, E y) error earlier, and later allow for implicit
8388         conversions in operator +/- (E e, U x) from U to the underlying
8389         type of E.
8390
8391         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8392         52596, if the container class is abstract, the default constructor
8393         is protected otherwise its public (before, we were always public).
8394
8395         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8396         fixed statement.
8397
8398         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8399         Jemlich that fixes bug #52597, MCS was generating invalid code for
8400         idisposable structs.   Thanks to Ben for following up with this
8401         bug as well.
8402
8403 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8404
8405         * driver.cs: Allow assemblies without code to be generated, fixes
8406         52230.
8407
8408 2004-01-07  Nick Drochak <ndrochak@gol.com>
8409
8410         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8411
8412 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8413
8414         * cs-parser.jay: Add rules to improve error reporting if fields or
8415         methods are declared at the namespace level (error 116)
8416
8417         * Add rules to catch event add/remove
8418
8419 2004-01-04  David Sheldon <dave-mono@earth.li>
8420
8421   * expression.cs: Added matching ")" to error message for 
8422   CS0077
8423
8424 2004-01-03 Todd Berman <tberman@gentoo.org>
8425
8426         * ecore.cs, attribute.cs:
8427         Applying fix from #52429.
8428
8429 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8430
8431         * ecore.cs, expression.cs, statement.cs:
8432         Total rewrite of how we handle branching. We
8433         now handle complex boolean expressions with fewer
8434         jumps. As well if (x == 0) no longer emits a ceq.
8435
8436         if (x is Foo) is much faster now, because we generate
8437         better code.
8438
8439         Overall, we get a pretty big improvement on our benchmark
8440         tests. The code we generate is smaller and more readable.
8441
8442         I did a full two-stage bootstrap. The patch was reviewed
8443         by Martin and Miguel.
8444
8445 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8446
8447         * cs-parser.jay: Make primary_expression not take a QI.
8448         we dont need this because the member_access rule covers
8449         us here. So we replace the rule with just IDENTIFIER.
8450
8451         This has two good effects. First, we remove a s/r conflict.
8452         Second, we allocate many fewer QualifiedIdentifier objects.
8453
8454 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8455
8456         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8457         set the correct information via SRE. This prevents
8458         hanging on the MS runtime. Fixes #29374.
8459
8460 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8461
8462         * convert.cs: correctly handle conversions to value types
8463         from Enum and ValueType as unboxing conversions.
8464
8465         Fixes bug #52569. Patch by Benjamin Jemlich.
8466
8467 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8468
8469         * expression.cs (BetterConversion): Prefer int -> uint
8470         over int -> ulong (csc's behaviour). This fixed bug #52046.
8471
8472 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8473
8474         * decl.cs (MemberCache.FindMembers): now returns a
8475         MemberInfo [].
8476
8477         * typemanager.cs: In general, go with with ^^.
8478         (CopyNewMethods): take an IList.
8479         (RealMemberLookup): Only allocate an arraylist
8480         if we copy from two sets of methods.
8481
8482         This change basically does two things:
8483         1) Fewer array lists allocated due to CopyNewMethods.
8484         2) the explicit cast in MemberList costed ALOT.
8485
8486 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8487
8488         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8489         a hashtable to avoid needless string allocations when an identifier is
8490         used more than once (the common case).
8491
8492 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8493
8494         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8495         is broken, it will not return anything. So, we
8496         have to use the information we have in mcs to
8497         do the task.
8498
8499         * typemanager.cs: Add a cache for GetInterfaces,
8500         since this will now be used more often (due to ^^)
8501
8502         (GetExplicitInterfaces) New method that gets the
8503         declared, not effective, interfaces on a type
8504         builder (eg, if you have interface IFoo, interface
8505         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8506         { IBar }.
8507
8508         This patch makes MCS able to bootstrap itself on
8509         Windows again.
8510
8511 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8512
8513         * expression.cs: Remove the Nop's that Miguel put
8514         in by mistake.
8515
8516 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8517
8518         * report.cs, codegen.cs: Give the real stack trace to
8519         the error when an exception is thrown.
8520
8521 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8522
8523         * decl.cs: only allocate hashtables for ifaces if 
8524         it is an iface!
8525
8526 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8527
8528         * expression.cs: fix the error from cs0121-2.cs
8529         (a parent interface has two child interfaces that
8530         have a function with the same name and 0 params
8531         and the function is called through the parent).
8532
8533 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8534
8535         * class.cs, rootcontext.cs, typmanager.cs: do not
8536         leak pointers.
8537
8538 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8539
8540         * codegen.cs: remove stack for the ec flow branching.
8541         It is already a linked list, so no need.
8542
8543 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8544
8545         * Makefile: Allow custom profiler here.
8546
8547 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8548
8549         * typemanager.cs (LookupType):
8550           - Use a static char [], because split takes
8551             a param array for args, so it was allocating
8552             every time.
8553           - Do not store true in a hashtable, it boxes.
8554
8555 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8556
8557         * flowanalysis.cs: bytify common enums.
8558
8559 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8560
8561         * modifiers.cs: Add a new set of flags for the
8562         flags allowed on explicit interface impls.
8563         * cs-parser.jay: catch the use of modifiers in
8564         interfaces correctly.
8565         * class.cs: catch private void IFoo.Blah ().
8566
8567         All related to bug #50572.
8568
8569 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8570
8571         * decl.cs: Rewrite the consistant accessability checking.
8572         Accessability is not linear, it must be implemented in
8573         a tableish way. Fixes #49704.
8574
8575 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8576
8577         * expression.cs: Handle negation in a checked context.
8578         We must use subtraction from zero. Fixes #38674.
8579
8580 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8581
8582         * class.cs: Ignore static void main in DLLs.
8583         * rootcontext.cs: Handle the target type here,
8584         since we are have to access it from class.cs
8585         * driver.cs: account for the above.
8586
8587 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8588
8589         * report.cs: Give line numbers and files if available.
8590
8591 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8592
8593         * driver.cs: Implement /addmodule.
8594
8595         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8596         ModuleBuilders.
8597
8598 2003-12-20  Martin Baulig  <martin@ximian.com>
8599
8600         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8601         (FieldBase.IsAssigned): Removed this field.
8602         (FieldBase.SetAssigned): New public method.
8603         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8604
8605 2003-12-20  Martin Baulig  <martin@ximian.com>
8606
8607         * expression.cs (LocalVariableReference.DoResolve): Don't set
8608         `vi.Used' if we're called from DoResolveLValue().
8609
8610         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8611         returns the usage vector it just merged into the current one -
8612         pass this one to UsageWarning().
8613         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8614         of the `EmitContext', don't call this recursively on our children.
8615
8616 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8617
8618         * driver.cs: Implement /target:module.
8619
8620 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8621
8622         * support.cs (CharArrayHashtable): New helper class.
8623
8624         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8625         char arrays, not strings, so we can avoid creating a string in
8626         consume_identifier if the identifier is a keyword.
8627
8628 2003-12-16  Martin Baulig  <martin@ximian.com>
8629
8630         * statement.cs (LocalInfo.Assigned): Removed this property.
8631         (LocalInfo.Flags): Removed `Assigned'.
8632         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8633         and uses flow analysis.
8634         (Block.UsageWarning): Made this method private.
8635         (Block.Resolve): Call UsageWarning() if appropriate.
8636
8637         * expression.cs (LocalVariableReference.DoResolve): Always set
8638         LocalInfo.Used here.
8639
8640 2003-12-13  Martin Baulig  <martin@ximian.com>
8641
8642         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8643         any value here; we're now using flow analysis to figure out
8644         whether a statement/block returns a value.
8645
8646 2003-12-13  Martin Baulig  <martin@ximian.com>
8647
8648         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8649         working again.
8650         (FlowBranching.MergeFinally): Don't call
8651         `branching.CheckOutParameters()' here, this is called in
8652         MergeTopBlock().
8653         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8654         when adding the `finally' vector.       
8655
8656 2003-12-13  Martin Baulig  <martin@ximian.com>
8657
8658         * flowanalysis.cs
8659         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8660         actually work and also fix #48962.
8661
8662 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8663
8664         * decl.cs: Do not check System.Object for nested types,
8665         since we know it does not have any. Big bang for buck:
8666
8667         BEFORE:
8668            Run 1:   8.35 seconds
8669            Run 2:   8.32 seconds
8670            corlib:  17.99 seconds
8671         AFTER:
8672            Run 1:   8.17 seconds
8673            Run 2:   8.17 seconds
8674            corlib:  17.39 seconds
8675
8676 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8677
8678         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8679         time we are returning 0 members, so we save alot here.
8680
8681 2003-12-11  Martin Baulig  <martin@ximian.com>
8682
8683         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8684         `MergeChild()', also just take the `FlowBranching' as argument;
8685         call Merge() on it and return the result.
8686         (FlowBranching.Merge): We don't need to do anything if we just
8687         have one sibling.
8688
8689 2003-12-11  Martin Baulig  <martin@ximian.com>
8690
8691         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8692         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8693         Maurer for this idea.
8694
8695 2003-12-11  Martin Baulig  <martin@ximian.com>
8696
8697         * flowanalysis.cs (MergeResult): This class is now gone; we now
8698         use the `UsageVector' for this.  The reason for this is that if a
8699         branching just has one sibling, we don't need to "merge" them at
8700         all - that's the next step to do.
8701         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8702         `MergeResult'.
8703
8704 2003-12-11  Martin Baulig  <martin@ximian.com>
8705
8706         Reworked flow analyis and made it more precise and bug-free.  The
8707         most important change is that we're now using a special `Reachability'
8708         class instead of having "magic" meanings of `FlowReturns'.  I'll
8709         do some more cleanups and optimizations and also add some more
8710         documentation this week.
8711
8712         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8713         largely reworked this class.
8714         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8715         the new `Reachability' class instead of having "magic" values here.
8716         (FlowBranching): We're now using an instance of `Reachability'
8717         instead of having separate `Returns', `Breaks' etc. fields.
8718
8719         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8720         based on flow analysis; ignore the return value of block.Emit ().
8721
8722 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8723
8724         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8725         if they are private.
8726
8727 2003-12-09  Martin Baulig  <martin@ximian.com>
8728
8729         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8730         call them directly on the UsageVector.
8731
8732 2003-12-09  Martin Baulig  <martin@ximian.com>
8733
8734         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8735         Changed return type from `FlowReturns' to `Reachability'.
8736
8737 2003-12-09  Martin Baulig  <martin@ximian.com>
8738
8739         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8740         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8741         `Reachable' fields with a single `Reachability' one.
8742
8743 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8744
8745         * class.cs (FindMembers): Remove foreach's.
8746
8747         Bootstrap times:
8748
8749         BEFORE
8750                 Run 1:   8.74 seconds
8751                 Run 2:   8.71 seconds
8752
8753         AFTER
8754                 Run 1:   8.64 seconds
8755                 Run 2:   8.58 seconds
8756
8757
8758 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8759
8760         * cs-parser.jay:
8761         * gen-treedump.cs:
8762         * statement.cs:
8763         This patch does a few things:
8764                 1. EmptyStatement is now a singleton, so it is never reallocated.
8765                 2. All blah is EmptyStatement constructs have been changed to
8766                    blah == EmptyStatement.Value, which is much faster and valid
8767                    now that EmptyStatement is a singleton.
8768                 3. When resolving a block, rather than allocating a new array for
8769                    the non-empty statements, empty statements are replaced with
8770                    EmptyStatement.Value
8771                 4. Some recursive functions have been made non-recursive.
8772         Mainly the performance impact is from (3), however (1) and (2) are needed for
8773         this to work. (4) does not make a big difference in normal situations, however
8774         it makes the profile look saner.
8775
8776         Bootstrap times:
8777
8778         BEFORE
8779         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8780         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8781         Total memory allocated: 56397 KB
8782
8783         AFTER
8784         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8785         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8786         Total memory allocated: 55666 KB
8787
8788 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8789
8790         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8791         than the hashtable in a hashtable version
8792
8793         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8794         we always end up concating a string. This results in a huge perf
8795         loss, because many strings have to be tracked by the GC. In this
8796         patch, we first use a hashtable that works with two keys, so that
8797         the strings do not need to be concat'ed.
8798
8799         Bootstrap times:
8800         BEFORE
8801                 Run 1:   8.74 seconds
8802                 Run 2:   8.71 seconds
8803
8804         AFTER
8805                 Run 1:   8.65 seconds
8806                 Run 2:   8.56 seconds
8807
8808 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8809
8810         * Makefile: Add a new target `do-time' that does a quick and simple
8811         profile, leaving easy to parse output.
8812
8813 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8814
8815         * codegen.cs (Init): Create the dynamic assembly with 
8816         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8817
8818 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8819
8820         * support.cs: Make the PtrHashtable use only one
8821         instance of its comparer.
8822
8823 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8824
8825         * typemanager.cs: Fix lookup of GetNamespaces.
8826
8827 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8828
8829         * expression.cs: Removed redundant line.
8830
8831         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8832         ArrayLists, use for loops with bounds.  
8833
8834         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8835         arraylist.
8836
8837         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8838         arraylists, use for loop with bounds.
8839
8840         The above three changes give us a 0.071 second performance
8841         improvement out of 3.294 seconds down to 3.223.  On my machine
8842         the above changes reduced the memory usage by 1,387 KB during
8843         compiler bootstrap.
8844
8845         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8846         QualifiedIdentifiers.  Before we created a new string through
8847         concatenation, and mostly later on, the result would be
8848         manipulated by DecomposeQI through string manipulation.
8849
8850         This reduced the compiler memory usage for bootstrapping from
8851         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8852         compile times in 0.05 seconds.
8853
8854 2003-11-28  Dick Porter  <dick@ximian.com>
8855
8856         * support.cs: Do string compares with the Invariant culture.
8857
8858         * rootcontext.cs: 
8859         * gen-treedump.cs: 
8860         * expression.cs: 
8861         * driver.cs: 
8862         * decl.cs: 
8863         * codegen.cs: 
8864         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8865         the comparison is done with the Invariant culture.
8866
8867 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8868
8869         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8870         GetEnumerator method.
8871
8872         (ProbeCollectionType): Iterate starting at the most specific type
8873         upwards looking for a GetEnumerator
8874
8875         * expression.cs: Shift count can be up to 31 for int/uint and 63
8876         for long/ulong.
8877
8878 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8879
8880         * statement.cs (Block.LookupLabel): Also look for the label on the
8881         children blocks.  Use a hash table to keep track of visited
8882         nodes. 
8883
8884         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8885         we actually did transform the other operand, otherwise fall back
8886         to the common codepath that casts to long.
8887
8888         * cs-tokenizer.cs: Use the same code pattern as the int case.
8889         Maybe I should do the parsing myself, and avoid depending on the
8890         Parse routines to get this done.
8891
8892 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8893
8894         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8895         which fixes bug 51347.  This time test it.
8896
8897         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8898         attributes for example can not tell the difference between these.
8899         The difference was only a syntax feature of the language. 
8900
8901         * attribute.cs: Apply attributes to delegates.
8902
8903         * delegate.cs: Call the apply attributes method.
8904
8905 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8906
8907         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8908         comparing 0 vs Byte.MinValue, not the value
8909
8910         (ImplicitConversionRequired): When reporting a conversion error,
8911         use error 31 to print out the constant error instead of the
8912         simpler 29.
8913
8914         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8915         which fixes bug 51347.
8916
8917 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8918
8919         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8920         which fixes the -warnaserror command line option.
8921
8922 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8923
8924         * cfold.cs (DoNumericPromotions): During constant folding of
8925         additions on UIntConstant, special case intconstants with
8926         IntConstants like we do on the expression binary operator. 
8927
8928 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8929
8930         * convert.cs (ImplicitReferenceConversion): We were missing a case
8931         (System.Enum are not value types or class types, so we need to
8932         classify them separatedly).
8933
8934         * driver.cs: We do not support error 2007.
8935
8936 2003-11-12 Jackson Harper <jackson@ximian.com>
8937
8938         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8939         system directory. Also use the full file name so users can
8940         libraries names mscorlib-o-tron.dll in a non system dir.
8941
8942 2003-11-10  Martin Baulig  <martin@ximian.com>
8943
8944         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8945         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8946         calling `ResolveType()' on them, directly assign their `Type'.
8947
8948 2003-11-08  Martin Baulig  <martin@ximian.com>
8949
8950         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8951         return value and the `out parent' parameter.
8952         (TypeContainer.DefineType): Moved the CS0644 check into
8953         GetClassBases().  Don't pass the interface types to the
8954         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8955         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8956
8957         * ecore.cs (TypeExpr.IsAttribute): New property.
8958         (TypeExpr.GetInterfaces): New method.
8959
8960         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8961         TypeExpr instead of a Type.
8962         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8963         (Interface.DefineType): Don't pass the interface types to the
8964         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8965         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8966
8967         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8968         instead of a `Type[]'.
8969         (TypeManager.RegisterBuilder): Likewise.
8970         (TypeManager.AddUserInterface): Likewise.
8971         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8972         `Type[]' and also return a `TypeExpr[]'.
8973         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8974
8975 2003-11-08  Martin Baulig  <martin@ximian.com>
8976
8977         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8978         Expression.     
8979
8980 2003-11-08  Martin Baulig  <martin@ximian.com>
8981
8982         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8983         TypeManager.ResolveExpressionTypes().
8984
8985         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8986         instead of an Expression.
8987         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8988         (TypeExpression): New public class; formerly known as `TypeExpr'.
8989
8990         * expression.cs (ComposedCast): Derive from TypeExpr.
8991
8992         * typemanager.cs (TypeManager.system_*_expr): These are now
8993         TypExpr's instead of Expression's.
8994         (TypeManager.ResolveExpressionTypes): New public static function;
8995         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8996         of them.        
8997
8998 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8999
9000         * expression.cs (New.DoResolve): Do not dereference value that
9001         might be a null return.
9002
9003         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9004         sure that the constant value has the right type.  Fixes an
9005         unreported bug, similar to 50425.
9006
9007         * const.cs (Const.LookupConstantValue): Call
9008         ImplicitStandardConversionExists before doing a conversion to
9009         avoid havng the TypeManager.ChangeType do conversions.
9010
9011         Reduced the number of casts used
9012
9013         (Const.ChangeType): New routine to enable reuse of the constant
9014         type changing code from statement.
9015
9016         * typemanager.cs (ChangeType): Move common initialization to
9017         static global variables.
9018
9019         Fixes #50425.
9020
9021         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9022         every value type to go through, even if it was void.  Fix that. 
9023
9024         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9025         character of the define, and the is_identifier_part_character for
9026         the rest of the string.
9027
9028 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9029
9030         * expression.cs (UnaryMutator.EmitCode): When I updated
9031         LocalVariableReference.DoResolve, I overdid it, and dropped an
9032         optimization done on local variable references.
9033
9034 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9035
9036         * ecore.cs: Convert the return from Ldlen into an int.
9037
9038 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9039
9040         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9041         the accessibility, this is a special case for toplevel non-public
9042         classes (internal for instance).
9043
9044 2003-10-20  Nick Drochak <ndrochak@gol.com>
9045
9046         * ecore.cs: Fix typo and build.  Needed another right paren.
9047
9048 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9049
9050         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9051         `internal' case regular and protected, but not allowing protected
9052         to be evaluated later.  Bug 49840
9053
9054 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9055
9056         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9057         to kb.Nlast, and not the kb.nFirst to isolate the switch
9058         statement.
9059
9060         Extract the underlying type, so enumerations of long/ulong are
9061         treated like long/ulong.
9062
9063 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9064
9065         * expression.cs (New): Overload the meaning of RequestedType to
9066         track the possible creation of the NewDelegate type, since
9067         DoResolve is invoked more than once for new constructors on field
9068         initialization.
9069
9070         See bugs: #48800 and #37014
9071
9072         * cs-parser.jay (declare_local_constants): Take an arraylist
9073         instead of a single constant.
9074
9075         (local_constant_declaration): It should take a
9076         constant_declarators, not a constant_declarator.  Fixes 49487
9077
9078         * convert.cs: Fix error report.
9079
9080 2003-10-13 Jackson Harper <jackson@ximian.com>
9081
9082         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9083         bug #49611
9084
9085 2003-10-09  Martin Baulig  <martin@ximian.com>
9086
9087         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9088         to the .ctor.
9089         (MethodCore.DoDefineParameters): Removed the TypeContainer
9090         argument; use the DeclSpace which was passed to the .ctor instead.
9091         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9092         TypeContainer; we only need a DeclSpace here.
9093
9094 2003-10-09  Martin Baulig  <martin@ximian.com>
9095
9096         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9097         to the .ctor.
9098         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9099         EmitContext's .ctor.    
9100
9101 2003-10-09  Martin Baulig  <martin@ximian.com>
9102
9103         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9104         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9105         AsAccessible(), moved them as well.
9106
9107         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9108
9109 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9110
9111         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9112
9113 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9114
9115         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9116         generation for >=, as spotted by Paolo, bug 48679.  
9117         Patch from David Waite.
9118
9119         * cs-tokenizer.cs: Add handling for #pragma.
9120
9121         * cs-parser.jay: Allow for both yield and yield return in the
9122         syntax.  The anti-cobolization of C# fight will go on!
9123
9124         * class.cs (TypeBuilder.DefineType): Catch error condition here
9125         (Parent.DefineType erroring out and returning null).
9126
9127         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9128         coping with enumerations variables, we were mistakenly processing
9129         them as a regular value type instead of built-in types.  Fixes the
9130         bug #48063
9131
9132         * typemanager.cs (IsBuiltinOrEnum): New method.
9133
9134 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9135
9136         * cs-parser.jay: Upgrade: yield now needs the return clause.
9137
9138 2003-09-19  Martin Baulig  <martin@ximian.com>
9139
9140         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9141         `MemberCache parent' argument.  Normally, an interface doesn't
9142         have a parent type except System.Object, but we use this in gmcs
9143         for generic type parameters.
9144
9145 2003-09-18  Martin Baulig  <martin@ximian.com>
9146
9147         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9148         on `type.IsInterface'; don't check whether the type has a parent
9149         to determine whether it's an interface.
9150
9151 2003-09-15  Martin Baulig  <martin@ximian.com>
9152
9153         * class.cs (TypeContainer.DefineType): Added an error flag to
9154         avoid reporting duplicate CS0146's ("class definition is
9155         circular.").
9156
9157         * driver.cs (Driver.MainDriver): Abort if
9158         RootContext.ResolveTree() reported any errors.
9159
9160 2003-09-07  Martin Baulig  <martin@ximian.com>
9161
9162         * report.cs (Error, Warning): Added overloaded versions which take
9163         a `params object[] args' and call String.Format().
9164
9165 2003-09-07  Martin Baulig  <martin@ximian.com>
9166
9167         * decl.cs (DeclSpace..ctor): Don't call
9168         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9169         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9170         (DeclSpace.RecordDecl): New method.
9171
9172         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9173
9174 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9175
9176         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9177         value attributes to be applied to ParameterBuilders.
9178
9179         * class.cs (MethodCore.LabelParameters): Make static and more
9180         generic so that it can be used from other places - like interface
9181         methods, for instance.
9182
9183         * interface.cs (Interface.Emit): Call LabelParameters before
9184         emitting attributes on the InterfaceMethod.
9185
9186 2003-08-26  Martin Baulig  <martin@ximian.com>
9187
9188         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9189         resolving aliases; fixes #47927.
9190
9191 2003-08-26  Martin Baulig  <martin@ximian.com>
9192
9193         * statement.cs (Using.DoResolve): This is internally emitting a
9194         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9195         do not always return.  Fixes #47681.
9196
9197 2003-08-26  Martin Baulig  <martin@ximian.com>
9198
9199         * decl.cs (MemberCore): Moved WarningNotHiding(),
9200         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9201         into MemberBase.
9202         (AdditionResult): Make this nested in DeclSpace.
9203         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9204         argument; call NamespaceEntry.Define() unless we're nested in a
9205         class or struct.
9206
9207         * namespace.cs (Namespace.DefineName): New public function.  This
9208         is called from DeclSpace's .ctor to add 
9209         (Namespace.Lookup): Include DeclSpaces in the lookup.
9210
9211         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9212
9213         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9214
9215 2003-08-25  Martin Baulig  <martin@ximian.com>
9216
9217         * convert.cs (Convert.ExplicitReferenceConversion): When
9218         converting from an interface type to a class, unbox if the target
9219         type is a struct type.  Fixes #47822.
9220
9221 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9222
9223         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9224         #47854.
9225
9226 2003-08-22  Martin Baulig  <martin@ximian.com>
9227
9228         * class.cs (TypeManager.DefineType): When defining a nested type,
9229         call DefineType() on our parent; fixes #47801.
9230
9231 2003-08-22  Martin Baulig  <martin@ximian.com>
9232
9233         * class.cs (MethodData.Define): While checking if a method is an
9234         interface implementation, improve the test a bit more to fix #47654.
9235
9236 2003-08-22  Martin Baulig  <martin@ximian.com>
9237
9238         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9239         correctly; fixes #47722.
9240
9241 2003-08-22  Martin Baulig  <martin@ximian.com>
9242
9243         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9244         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9245
9246         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9247
9248 2003-08-22  Martin Baulig  <martin@ximian.com>
9249
9250         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9251         can only be assigned in static constructors.  Fixes #47161.
9252
9253 2003-08-22  Martin Baulig  <martin@ximian.com>
9254
9255         Rewrote and improved the flow analysis code.
9256
9257         * flowbranching.cs (FlowBranching): Make this class abstract.
9258         (FlowBranching.CreateBranching): New static function to create a
9259         new flow branching.
9260         (FlowBranchingBlock, FlowBranchingException): New classes.
9261         (FlowBranching.UsageVector.Type): New public readonly field.
9262         (FlowBranching.UsageVector.Breaks): Removed the setter.
9263         (FlowBranching.UsageVector.Returns): Removed the setter.
9264         (FlowBranching.UsageVector): Added Break(), Return(),
9265         NeverReachable() and Throw() methods to modify the reachability.
9266         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9267         done by FlowBranching.Merge().
9268         (FlowBranching.UsageVector.MergeChild): New method; merges the
9269         merge result into the current vector.
9270         (FlowBranching.Merge): New abstract method to merge a branching.
9271
9272 2003-08-12  Martin Baulig  <martin@ximian.com>
9273
9274         * expression.cs (Indirection.CacheTemporaries): Create the
9275         LocalTemporary with the pointer type, not its element type.
9276
9277 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9278
9279         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9280         token was a keyword or not.
9281
9282         Add `error' options where an IDENTIFIER was expected;  Provide
9283         CheckToken and CheckIdentifierToken convenience error reporting
9284         functions. 
9285
9286         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9287
9288         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9289         NameSpaceEntry NameSpaceEntry.
9290
9291         (LookupInterfaceOrClass): Avoid creating a full qualified name
9292         from namespace and name: avoid doing lookups when we know the
9293         namespace is non-existant.   Use new Tree.LookupByNamespace which
9294         looks up DeclSpaces based on their namespace, name pair.
9295
9296         * driver.cs: Provide a new `parser verbose' to display the
9297         exception thrown during parsing.  This is turned off by default
9298         now, so the output of a failure from mcs is more graceful.
9299
9300         * namespace.cs: Track all the namespaces defined in a hashtable
9301         for quick lookup.
9302
9303         (IsNamespace): New method
9304
9305 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9306
9307         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9308         we know that we need to concatenate (full typename can never be
9309         null). 
9310
9311         * class.cs: ditto.
9312
9313         * statement.cs: Use a bitfield;  Do not initialize to null things
9314         which are done by the constructor by default.
9315
9316         * cs-parser.jay: bug fix, parameter was 4, not 3.
9317
9318         * expression.cs: Just use the property;
9319
9320         * statement.cs: No need for GetVariableInfo method.
9321
9322 2003-08-08  Martin Baulig  <martin@ximian.com>
9323
9324         * flowanalysis.cs (FlowReturns): This is now nested in the
9325         `FlowBranching' class.
9326         (MyBitVector): Moved this here from statement.cs.
9327         (FlowBranching.SiblingType): New enum type.
9328         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9329
9330 2003-08-07  Martin Baulig  <martin@ximian.com>
9331
9332         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9333         `FlowBranching' class and called `BranchingType'.
9334
9335 2003-08-07  Martin Baulig  <martin@ximian.com>
9336
9337         * flowanalysis.cs: Moved all the control flow analysis code into
9338         its own file.
9339
9340 2003-08-07  Martin Baulig  <martin@ximian.com>
9341
9342         * assign.cs (Assign.DoResolve): `target' must either be an
9343         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9344         #37319.
9345
9346 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9347
9348         * expression.cs (BinaryMethod): This kind of expression is created by the
9349         Binary class if it determines that the operator has to be handled
9350         by a method.
9351
9352         (BinaryDelegate): This kind of expression is created if we are
9353         dealing with a + or - operator on delegates.
9354
9355         (Binary): remove method, argumetns, and DelegateOperator: when
9356         dealing with methods, 
9357
9358         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9359
9360         * statement.cs (Block): use bitfields for the three extra booleans
9361         we had in use.   Remove unused topblock parameter.
9362
9363         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9364
9365         * assign.cs: Drop extra unneeded tests.
9366
9367 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9368
9369         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9370
9371         * statement.cs (Foreach): Use VariableStorage instead of
9372         LocalBuilders.   
9373
9374         * codegen.cs (VariableStorage): New class used by clients that
9375         require a variable stored: locals or fields for variables that
9376         need to live across yield.
9377
9378         Maybe provide a convenience api for EmitThis+EmitLoad?
9379
9380         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9381         these bad boys.
9382
9383 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9384
9385         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9386         RemapParameterLValue): New methods that are used to turn a
9387         precomputed FieldInfo into an expression like this:
9388
9389                 instance.FieldInfo
9390
9391         The idea is to use this instead of making LocalVariableReference
9392         have more than one meaning.
9393
9394         * cs-parser.jay: Add error production to BASE.
9395
9396         * ecore.cs: Deal with TypeManager.GetField returning null, which
9397         is now a valid return value.
9398
9399         (FieldExprNoAddress): New expression for Fields whose address can
9400         not be taken.
9401
9402         * expression.cs (LocalVariableReference): During the resolve
9403         phases, create new expressions if we are in a remapping context.
9404         Remove code that dealt with remapping here.
9405
9406         (ParameterReference): same.
9407
9408         (ProxyInstance): New expression, like the `This' expression, but
9409         it is born fully resolved.  We know what we are doing, so remove
9410         the errors that are targeted to user-provided uses of `this'.
9411
9412         * statement.cs (Foreach): our variable is now stored as an
9413         Expression;  During resolution, follow the protocol, dont just
9414         assume it will return this.
9415
9416 2003-08-06  Martin Baulig  <martin@ximian.com>
9417
9418         * support.cs (SeekableStreamReader.cs): New public class.
9419
9420         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9421         SeekableStreamReader instead of the normal StreamReader.
9422
9423 2003-08-04  Martin Baulig  <martin@ximian.com>
9424
9425         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9426         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9427         deambiguate casts and delegate invocations.
9428         (parenthesized_expression): Use the new tokens to ensure this is
9429         not a cast of method invocation.
9430
9431         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9432         when reading a `)' and Deambiguate_CloseParens () was previously
9433         called.
9434
9435         * expression.cs (ParenthesizedExpression): New class.  This is
9436         just used for the CS0075 test.
9437         (Binary.DoResolve): Check for CS0075.   
9438
9439 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9440
9441         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9442         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9443         reference comparison.
9444
9445         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9446         examine the ReturnType for equality - this is necessary in the
9447         cases of implicit and explicit operators whose signature also
9448         includes the return type.
9449
9450 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9451
9452         * namespace.cs: Cache the result of the namespace computation,
9453         instead of computing it every time.
9454
9455 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9456
9457         * decl.cs: Use a global arraylist that we reuse over invocations
9458         to avoid excesive memory consumption.  Reduces memory usage on an
9459         mcs compile by one meg (45 average).
9460
9461         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9462         private, work around that.
9463
9464 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9465
9466         * literal.cs (IntLiteral): Define Zero and One static literals. 
9467
9468         * cs-parser.jay (integer_literal): use static literals to reduce
9469         memory usage for the most used literals (0, 1 and -1).  211kb
9470         reduced in memory usage.
9471
9472         Replace all calls to `new ArrayList' with `new
9473         ArrayList(4)' which is a good average number for most allocations,
9474         and also requires only 16 bytes of memory for its buffer by
9475         default. 
9476
9477         This reduced MCS memory usage in seven megabytes for the RSS after
9478         bootstrapping.
9479
9480 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9481
9482         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9483         handle params methods the correct way by forming only one
9484         applicable set with params and normal methods in them. Earlier we
9485         were looking at params methods only if we found no normal methods
9486         which was not the correct thing to do.
9487
9488         (Invocation.BetterFunction): Take separate arguments indicating
9489         when candidate and the best method are params methods in their
9490         expanded form.
9491
9492         This fixes bugs #43367 and #46199.
9493
9494         * attribute.cs: Documentation updates.
9495
9496         (CheckAttribute): Rename to CheckAttributeTarget.
9497         (GetValidPlaces): Rename to GetValidTargets.
9498
9499         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9500         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9501
9502         Fixes bug #44468.
9503
9504 2003-07-28  Martin Baulig  <martin@ximian.com>
9505
9506         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9507         name when looking up the base class of a nested class.  Fixes #46977.
9508
9509 2003-07-26  Martin Baulig  <martin@ximian.com>
9510
9511         * expression.cs (Indexers.Indexer): New nested struct; contains
9512         getter, setter and the indexer's type.
9513         (Indexers.Properties): This is now an ArrayList of
9514         Indexers.Indexer's.
9515         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9516         indexer doesn't have any getters.
9517
9518         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9519         for embedded property and indexer assignments.
9520
9521 2003-07-26  Martin Baulig  <martin@ximian.com>
9522
9523         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9524         preprocessor directive is not the first non-whitespace character
9525         on a line.
9526
9527 2003-07-26  Martin Baulig  <martin@ximian.com>
9528
9529         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9530         namespace parsing, follow the spec more closely.
9531
9532         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9533         NamespaceEntry.Lookup().
9534
9535 2003-07-25  Martin Baulig  <martin@ximian.com>
9536
9537         * MethodCore.cs (OverridesSomething): New public field; it's set
9538         from TypeContainer.DefineMembers if this method overrides
9539         something (which doesn't need to be a method).  Fix #39462.
9540
9541 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9542
9543         * typemanager.cs (GetMembers): Ensure that the list of members is
9544         reversed. This keeps things in sync.
9545
9546         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9547         find an AttributeUsage attribute.
9548
9549         * expression.cs (Invocation.OverloadResolve): Perform the check
9550         which disallows Invoke to be directly called on a Delegate.
9551
9552         (Error_InvokeOnDelegate): Report error cs1533.
9553
9554 2003-07-25  Martin Baulig  <martin@ximian.com>
9555
9556         * expression.cs (Indexers.GetIndexersForType): Only look in the
9557         interface hierarchy if the requested type is already an
9558         interface.  Fixes #46788 while keeping #46502 fixed.
9559
9560 2003-07-25  Martin Baulig  <martin@ximian.com>
9561
9562         * class.cs (TypeContainer.DefineMembers): Check whether all
9563         readonly fields have been assigned and report warning CS0649 if
9564         not.
9565
9566         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9567         a valuetype.
9568
9569 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9570
9571         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9572         returned from GetMethods to make things consistent with the
9573         assumptions MCS makes about ordering of methods.
9574
9575         This should comprehensively fix bug #45127 and it does :-)
9576
9577         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9578         ordering is actually reverse.
9579
9580         * Clean up some debug messages I left lying around.
9581
9582         * interface.cs (Populate*): Get rid of code which emits attributes
9583         since the stage in which we emit attributes is the 'Emit' stage,
9584         not the define stage.
9585
9586         (Emit): Move attribute emission for interface members here.
9587
9588 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9589
9590         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9591         closely: we eliminate methods in base types when we have an
9592         applicable method in a top-level type.
9593
9594         Please see section 14.5.5.1 for an exact description of what goes
9595         on. 
9596
9597         This fixes bug #45127 and a host of other related to corlib compilation.
9598
9599         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9600         array is the method corresponding to the top-level type (this is
9601         because of the changes made to icall.c) so we change this
9602         accordingly.
9603
9604         (MethodGroupExpr.Name): This too.
9605
9606         * typemanager.cs (GetElementType): New method which does the right
9607         thing when compiling corlib. 
9608
9609         * everywhere: Make use of the above in the relevant places.
9610
9611 2003-07-22  Martin Baulig  <martin@ximian.com>
9612
9613         * cs-parser.jay (invocation_expression): Moved
9614         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9615         `cast_expression', but create a InvocationOrCast which later
9616         resolves to either an Invocation or a Cast.
9617
9618         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9619         method; call this before EmitStatement() to make sure that this
9620         expression can be used as a statement.
9621
9622         * expression.cs (InvocationOrCast): New class; resolves to either
9623         an Invocation or a Cast.
9624
9625         * statement.cs (StatementExpression): Call ResolveStatement() on
9626         the ExpressionStatement before emitting it.
9627
9628 2003-07-21  Martin Baulig  <martin@ximian.com>
9629
9630         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9631         `ref' and `out' attributes match; fixes #46220.
9632         (MemberAccess.ResolveMemberAccess): You can't reference a type
9633         through an expression; fixes #33180.
9634         (Indexers.GetIndexersForType): Don't return the indexers from
9635         interfaces the class implements; fixes #46502.
9636
9637 2003-07-21  Martin Baulig  <martin@ximian.com>
9638
9639         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9640         CS0661 checks; fixes bug #30442.
9641
9642 2003-07-21  Martin Baulig  <martin@ximian.com>
9643
9644         * decl.cs (AdditionResult): Added `Error'.
9645
9646         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9647
9648         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9649         makes cs0031.cs actually work.
9650
9651 2003-07-20  Martin Baulig  <martin@ximian.com>
9652
9653         * namespace.cs: Fixed that bug which caused a crash when compiling
9654         the debugger's GUI.
9655
9656 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9657
9658         * typemanager.cs (LookupTypeReflection): Never expose types which
9659         are NotPublic, NestedPrivate, NestedAssembly, or
9660         NestedFamANDAssem.  We used to return these, and later do a check
9661         that would report a meaningful error, but the problem is that we
9662         would not get the real match, if there was a name override.
9663
9664 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9665
9666         * namespace.cs (Namespace, Name): Do not compute the namespace
9667         name dynamically, compute it in the constructor.  This reduced
9668         memory usage by 1697 KB.
9669
9670         * driver.cs: Use --pause to pause at the end.
9671
9672 2003-07-17  Peter Williams  <peter@newton.cx>
9673
9674         * Makefile: Change the name of the test target so that it doesn't
9675         conflict with the recursive test target.
9676
9677 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9678
9679         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9680         AddressOf): Do not use EmitThis, that was wrong, use the actual
9681         this pointer.
9682
9683 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9684
9685         * class.cs (MethodData.Define): While checking if a method is an
9686         interface implementation, improve the test: If we are not public
9687         (use new test here: use the computed MethodAttributes directly,
9688         instead of the parsed modifier flags) check if the `implementing'
9689         method comes from an interface or not.
9690
9691         * pending.cs (VerifyPendingMethods): Slightly better error
9692         message.
9693
9694         * makefile: add test target that does the mcs bootstrap.
9695
9696 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9697
9698         * interface.cs (Define): Do nothing here since there are no
9699         members to populate etc. Move the attribute emission out of here
9700         since this was just totally the wrong place to put it. Attribute
9701         application happens during the 'Emit' phase, not in the 'Define'
9702         phase.
9703
9704         (Emit): Add this method and move the attribute emission here
9705
9706         * rootcontext.cs (EmitCode): Call the Emit method on interface
9707         types too.
9708
9709 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9710
9711         * expression.cs (OverloadResolve): Report error only if Location
9712         is not 'Null' which means that there was a probe going on.
9713
9714 2003-07-14  Martin Baulig  <martin@ximian.com>
9715
9716         * expression.cs (ConditionalLogicalOperator): New public class to
9717         implement user defined conditional logical operators.
9718         This is section 14.11.2 in the spec and bug #40505.
9719
9720 2003-07-14  Martin Baulig  <martin@ximian.com>
9721
9722         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9723
9724 2003-07-14  Martin Baulig  <martin@ximian.com>
9725
9726         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9727
9728         * ecore.cs (IVariable.VerifyFixed): New interface method.
9729
9730         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9731         operator, check whether the variable is actually fixed.  Fixes bug
9732         #36055.  Set a variable definitely assigned when taking its
9733         address as required by the spec.
9734
9735         * statement.cs (LocalInfo.IsFixed): New field.
9736         (LocalInfo.MakePinned): Set `IsFixed' to true.
9737
9738 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9739
9740         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9741         for .ctors, ensure that we only ask for members declared in the
9742         attribute type (BindingFlags.DeclaredOnly).
9743
9744         Fixes bug #43632.
9745
9746         * expression.cs (Error_WrongNumArguments): Report error 1501
9747         correctly the way CSC does.
9748
9749 2003-07-13  Martin Baulig  <martin@ximian.com>
9750
9751         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9752         lookup on the fully qualified name, to make things like "X.X" work
9753         where "X.X" is a fully qualified type name, but we also have a
9754         namespace "X" in the using list.  Fixes #41975.
9755
9756 2003-07-13  Martin Baulig  <martin@ximian.com>
9757
9758         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9759         function. If we're a CompoundAssign, we need to create an embedded
9760         CompoundAssign, not an embedded Assign.
9761         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9762         Fixes #45854.
9763
9764 2003-07-13  Martin Baulig  <martin@ximian.com>
9765
9766         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9767         work to fix bug #46088.
9768
9769 2003-07-13  Ravi Pratap <ravi@ximian.com>
9770
9771         * class.cs (Operator.Emit): Do not emit attributes here - it is
9772         taken care of by the Method class that we delegate too. This takes
9773         care of bug #45876.
9774
9775 2003-07-10  Martin Baulig  <martin@ximian.com>
9776
9777         * expression.cs (TypeOfVoid): New class.
9778         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9779
9780 2003-07-10  Martin Baulig  <martin@ximian.com>
9781
9782         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9783         bug #35957.
9784
9785 2003-07-10  Martin Baulig  <martin@ximian.com>
9786
9787         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9788         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9789
9790         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9791
9792         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9793
9794 2003-07-10  Martin Baulig  <martin@ximian.com>
9795
9796         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9797         of decimal.  Fixes #42850.
9798
9799         NOTE: I also fixed the created byte blob, but this doesn't work on
9800         the MS runtime and csc never produces any byte blobs for decimal
9801         arrays.
9802
9803 2003-07-10  Martin Baulig  <martin@ximian.com>
9804
9805         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9806         structs; fixes #32068.
9807         (Block.AddChildVariableNames): Fixed #44302.
9808
9809 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9810
9811         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9812
9813 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9814
9815         * attribute.cs: And this test is onger needed.
9816
9817 2003-07-08  Martin Baulig  <martin@ximian.com>
9818
9819         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9820         inaccessible types.  Fixes #36313.
9821
9822         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9823
9824         * namespace.cs (NamespaceEntry): Create implicit entries for all
9825         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9826         implicit entries for N1.N2 and N1.
9827
9828 2003-07-08  Martin Baulig  <martin@ximian.com>
9829
9830         Rewrote the handling of namespaces to fix a lot of the issues
9831         wrt. `using' aliases etc.
9832
9833         * namespace.cs (Namespace): Splitted this class into a
9834         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9835
9836         * typemanager.cs (TypeManager.IsNamespace): Removed.
9837         (TypeManager.ComputeNamespaces): Only compute namespaces from
9838         loaded assemblies here, not the namespaces from the assembly we're
9839         currently compiling.
9840
9841 2003-07-08  Martin Baulig  <martin@ximian.com>
9842
9843         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9844
9845 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9846
9847         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9848         already fixed it.  
9849
9850         I thought about the memory savings here, but LookupTypeReflection
9851         is used under already very constrained scenarios.  Compiling
9852         corlib or mcs only exposes one hit, so it would not really reduce
9853         any memory consumption.
9854
9855 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9856
9857         * typemanager.cs: fixes bug #45889 by only adding public types from
9858         other assemblies to the list of known types.
9859
9860 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9861
9862         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9863         on the type we resolved.
9864
9865 2003-07-05  Martin Baulig  <martin@ximian.com>
9866
9867         * pending.cs (PendingImplementation.ParentImplements): Don't
9868         create the proxy if the parent is abstract.
9869
9870         * class.cs (TypeContainer.DefineIndexers): Process explicit
9871         interface implementations first.  Fixes #37714.
9872
9873 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9874
9875         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9876         defined recursively;  but since we modify the input parameters
9877         (left is set to `this' temporarily), we reset this value if the
9878         left_is_explicit is false, which gives the original semantics to
9879         the code.  
9880
9881         * literal.cs (NullPointer): new class used to represent a null
9882         literal in a pointer context.
9883
9884         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9885         type is a pointer, use a NullPointer object instead of a
9886         NullLiteral.   Closes 43687
9887
9888         (ExplicitConversion): Convert pointer values using
9889         the conv opcode to the proper type.
9890
9891         * ecore.cs (New): change ValueTypeVariable property into a method,
9892         that returns whether the valuetype is suitable for being used.
9893
9894         * expression.cs (Binary.DoNumericPromotions): Only return if we
9895         the int constant was a valid uint, and we can return both left and
9896         right as uints.  If not, we continue processing, to trigger the
9897         type conversion.  This fixes 39018.
9898
9899         * statement.cs (Block.EmitMeta): During constant resolution, set
9900         the CurrentBlock property on the emitcontext, so that we resolve
9901         constants propertly.
9902
9903 2003-07-02  Martin Baulig  <martin@ximian.com>
9904
9905         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9906         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9907
9908         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9909         than emitting it here.
9910
9911         * statement.cs: Fixed some more flow analysis bugs.
9912
9913 2003-07-02  Martin Baulig  <martin@ximian.com>
9914
9915         * class.cs (MethodData.Define): When implementing interface
9916         methods, set Final unless we're Virtual.
9917
9918         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9919         check work for interface methods.
9920
9921 2003-07-01  Martin Baulig  <martin@ximian.com>
9922
9923         * ecore.cs (EmitContext.This): Replaced this property with a
9924         GetThis() method which takes a Location argument.  This ensures
9925         that we get the correct error location for a CS0188.
9926
9927 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9928
9929         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9930         ImplicitStandardConversion.
9931
9932         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9933
9934 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9935
9936         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9937         optimization.
9938
9939 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9940
9941         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9942         constructors.
9943
9944         (MethodData.Define): Turn off initlocals for unsafe methods.
9945
9946 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9947
9948         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9949         complete;  Fixes #37521.
9950
9951         * delegate.cs: Use Modifiers.TypeAttr to compute the
9952         TypeAttributes, instead of rolling our own.  This makes the flags
9953         correct for the delegates.
9954
9955 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9956
9957         * class.cs (Constructor.Define): Set the private flag for static
9958         constructors as well.
9959
9960         * cs-parser.jay (statement_expression): Set the return value to
9961         null, to avoid a crash when we catch an error.
9962
9963 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9964
9965         * cs-parser.jay: Applied patch from Jackson that adds support for
9966         extern and unsafe modifiers to destructor declarations.
9967
9968         * expression.cs: Report error 21 if the user is trying to index a
9969         System.Array.
9970
9971         * driver.cs: Add an error message, suggested by the bug report.
9972
9973         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9974         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9975
9976 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9977
9978         * namespace.cs: Add some information to reduce FAQs.
9979
9980 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9981
9982         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9983         underlying enumeration types.  Fixes #43915.
9984
9985         * expression.cs: Treat ushort/short as legal values to be used in
9986         bitwise operations.
9987
9988 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9989
9990         * delegate.cs: transfer custom attributes for paramenters from
9991         the delegate declaration to Invoke and BeginInvoke.
9992
9993 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9994
9995         * attribute.cs: handle custom marshalers and emit marshal info
9996         for fields, too.
9997
9998 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9999
10000         * makefile.gnu: Added anonymous.cs to the compiler sources.
10001
10002 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10003
10004         * iterators.cs: Change the name of the proxy class to include two
10005         underscores.
10006
10007         * cs-parser.jay: Update grammar to include anonymous methods.
10008
10009         * anonymous.cs: new file.
10010
10011 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10012
10013         * class.cs (Field.Define): Add missing test for pointers and
10014         safety. 
10015
10016 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10017
10018         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10019         we use the stobj opcode.
10020
10021         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10022         since it wasn't the correct fix. 
10023
10024         It still is puzzling that we are required to use stobj for IntPtr
10025         which seems to be a ValueType.
10026
10027 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10030         during regular simple name resolution.   Now, the trick is that
10031         instead of returning for processing the simplename, we do a
10032         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10033         contextual lookup type).   If a match is found, return that, if
10034         not, return for further composition.
10035
10036         This fixes long-standing 30485.
10037
10038         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10039         using the address to initialize an object, do an Stobj instead of
10040         using the regular Stelem.
10041
10042         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10043         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10044         Because if we are a BaseIndexerAccess that value will be true.
10045         Fixes 43643.
10046
10047         * statement.cs (GotoCase.Resolve): Return after reporting an
10048         error, do not attempt to continue. 
10049
10050         * expression.cs (PointerArithmetic.Emit): If our operand is a
10051         long, convert our constants to match the operand before
10052         multiplying.  Convert to I type before adding.   Fixes 43670.
10053
10054 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10055
10056         * enum.cs (ImplicitConversionExists) : Rename to
10057         ImplicitEnumConversionExists to remove ambiguity. 
10058
10059         * ecore.cs (NullCast): New type of cast expression class which
10060         basically is very similar to EmptyCast with the difference being
10061         it still is a constant since it is used only to cast a null to
10062         something else
10063         (eg. (string) null)
10064
10065         * convert.cs (ImplicitReferenceConversion): When casting a null
10066         literal, we return a NullCast.
10067
10068         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10069         should be around anymore.
10070
10071         The renaming (reported was slightly wrong). Corrections:
10072
10073         ConvertImplicitStandard -> ImplicitConversionStandard
10074         ConvertExplicitStandard -> ExplicitConversionStandard
10075
10076         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10077         before passing them in !
10078
10079         * convert.cs (ImplicitConversionStandard): When comparing for
10080         equal expr and target types, ensure that expr is not a
10081         NullLiteral.
10082
10083         In general, we must not be checking (expr_type ==
10084         target_type) in the top level conversion methods
10085         (ImplicitConversion, ExplicitConversion etc). This checking is
10086         done in the methods that they delegate to.
10087
10088 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10089
10090         * convert.cs: Move Error_CannotConvertType,
10091         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10092         ImplicitNumericConversion, ImplicitConversionExists,
10093         ImplicitUserConversionExists, StandardConversionExists,
10094         FindMostEncompassedType, FindMostSpecificSource,
10095         FindMostSpecificTarget, ImplicitUserConversion,
10096         ExplicitUserConversion, GetConversionOperators,
10097         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10098         TryImplicitIntConversion, Error_CannotConvertImplicit,
10099         ConvertImplicitRequired, ConvertNumericExplicit,
10100         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10101         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10102         its own file.
10103
10104         Perform the following renames:
10105
10106         StandardConversionExists -> ImplicitStandardConversionExists
10107         ConvertImplicit -> ImplicitConversion
10108         ConvertImplicitStandard -> ImplicitStandardConversion
10109         TryImplicitIntConversion -> ImplicitIntConversion
10110         ConvertImplicitRequired -> ImplicitConversionRequired
10111         ConvertNumericExplicit -> ExplicitNumericConversion
10112         ConvertReferenceExplicit -> ExplicitReferenceConversion
10113         ConvertExplicit -> ExplicitConversion
10114         ConvertExplicitStandard -> ExplicitStandardConversion
10115
10116 2003-05-19  Martin Baulig  <martin@ximian.com>
10117
10118         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10119         (TypeInfo): Added support for structs having structs as fields.
10120
10121         * ecore.cs (FieldExpr): Implement IVariable.
10122         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10123         VariableInfo for the field.
10124
10125 2003-05-18  Martin Baulig  <martin@ximian.com>
10126
10127         * expression.cs (This.DoResolve): Report a CS0027 if we're
10128         emitting a field initializer.
10129
10130 2003-05-18  Martin Baulig  <martin@ximian.com>
10131
10132         * expression.cs (This.ResolveBase): New public function.
10133         (This.DoResolve): Check for CS0188.
10134
10135         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10136         This.Resolve().
10137
10138         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10139         `instance_expression' to null if we don't have any non-static
10140         methods.
10141
10142 2003-05-18  Martin Baulig  <martin@ximian.com>
10143
10144         Reworked the way how local variables and parameters are handled by
10145         the flow analysis code.
10146
10147         * statement.cs (TypeInfo, VariableMap): New public classes.
10148         (VariableInfo): New public class.  This is now responsible for
10149         checking whether a variable has been assigned.  It is used for
10150         parameters and local variables.
10151         (Block.EmitMeta): Take the InternalParameters as argument; compute
10152         the layout of the flow vectors here.
10153         (Block.LocalMap, Block.ParameterMap): New public properties.
10154         (FlowBranching): The .ctor doesn't get the InternalParameters
10155         anymore since Block.EmitMeta() now computes the layout of the flow
10156         vector.
10157         (MyStructInfo): This class is now known as `StructInfo' and nested
10158         in `TypeInfo'; we don't access this directly anymore.
10159
10160         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10161         property and removed IsAssigned(), IsFieldAssigned(),
10162         SetAssigned() and SetFieldAssigned(); we now call them on the
10163         VariableInfo so we don't need to duplicate this code everywhere.
10164
10165         * expression.cs (ParameterReference): Added `Block block' argument
10166         to the .ctor.
10167         (LocalVariableReference, ParameterReference, This): The new
10168         VariableInfo class is now responsible for all the definite
10169         assignment stuff.
10170
10171         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10172         IsParameterAssigned, SetParameterAssigned): Removed.
10173
10174 2003-05-18  Martin Baulig  <martin@ximian.com>
10175
10176         * typemanager.cs (InitCoreTypes): Try calling
10177         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10178         the 3-args-version.  Corlib now also needs our `void_type'.
10179         (GetMethod): Added overloaded version which takes an optional
10180         `bool report_errors' to allow lookups of optional methods.
10181
10182 2003-05-12  Martin Baulig  <martin@ximian.com>
10183
10184         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10185         only used for locals and not for parameters.
10186
10187 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10188
10189         * support.cs (InternalParameters.ParameterType): Return the
10190         ExternalType of the parameter.
10191
10192         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10193         they were unused.
10194
10195 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10196
10197         * class.cs (MethodData.Define): Do not set the `newslot' on
10198         interface members, if they are also flagged as "override".
10199
10200         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10201         better code for ++i and i++.  This only works for static fields
10202         and local variables.
10203
10204         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10205         want to pull the DeclSpace out of the builder_to_declspace instead
10206         of the TypeBuilder (like in TypeContainer.FindMembers).
10207
10208         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10209         instead of LookupTypeContainer.  Fixes the crash on .NET for
10210         looking up interface members.
10211
10212         * const.cs: Create our own emit context during the Definition
10213         stage, so that constants are evaluated in the proper context, when
10214         a recursive definition happens.
10215
10216 2003-05-11  Martin Baulig  <martin@ximian.com>
10217
10218         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10219         new block for a switch section.
10220         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10221         the adding/lookup in the switch block.  Fixes #39828.
10222
10223 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10224
10225         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10226         functionality: I needed to convert the data after I had performed
10227         the add/sub operation into the operands type size.
10228
10229         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10230         pass the type for the box operation, otherwise the resulting
10231         object would have been of type object.
10232
10233         (BoxedCast): Add constructor to specify the type to box as.
10234
10235 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10236
10237         * iterators.cs: I was reusing the `count' variable inadvertently,
10238         take steps to not allow this to happen.
10239
10240 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10241
10242         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10243         by creating an array at the point where the params starts and
10244         putting all those arguments there, then adjusting the size of the
10245         array.
10246
10247 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10248
10249         * expression.cs (New.AddressOf): Implement interface
10250         IMemoryLocation.  This is used when the `new' operator is used in
10251         the context of an invocation to a method on a value type.
10252
10253         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10254         example. 
10255
10256         * namespace.cs: Also check the using aliases here.
10257
10258         * driver.cs: Move the test for using validity after the types have
10259         been entered, so we do a single pass that also includes the using
10260         aliases. 
10261
10262         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10263         in the regular case.   CreateSiblingForFinally is doing extra
10264         error checking.
10265
10266         * attribute.cs (GetAttributeArgumentExpression): Store the result
10267         on an out value, and use the return value to indicate failure
10268         instead of using null (which is a valid return for Constant.GetValue).
10269
10270         * statement.cs: Perform the analysis flow for the increment
10271         portion after the statement, because this will be the real flow of
10272         execution.  Fixes #42385
10273
10274         * codegen.cs (EmitContext.EmitArgument,
10275         EmitContext.EmitStoreArgument): New helper functions when the
10276         RemapToProxy flag is set.
10277
10278         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10279         function.
10280
10281         Add support for remapping parameters. 
10282
10283         * iterators.cs: Propagate parameter values;  Store parameter
10284         values in the proxy classes.
10285
10286 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10287
10288         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10289         need a proxy reference;  I do not know what I was thinking
10290
10291         * cs-parser.jay (constructor_initializer): catch another error,
10292         and display nice message.
10293
10294         (field_declaration): catch void field declaration
10295         to flag a better error. 
10296
10297         * class.cs (MemberBase.CheckBase): Report an error instead of a
10298         warning if a new protected member is declared in a struct. 
10299         (Field.Define): catch the error of readonly/volatile.
10300
10301         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10302
10303         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10304         volatile variable is taken
10305
10306 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10307
10308         * statement.cs (Fixed.Resolve): Report an error if we are not in
10309         an unsafe context.
10310
10311 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10312
10313         * typemanager.cs: reuse the code that handles type clashes for
10314         delegates and enumerations.
10315
10316         * class.cs (Report28): Always report.
10317
10318         * expression.cs (EncodeAsAttribute): Allow nulls here.
10319
10320 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10321
10322         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10323         the functionality for testing whether an expression is valid for
10324         an attribute here.  Also handle the case of arrays of elements
10325         being stored. 
10326
10327         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10328         encoding a linear array into an array of objects that are suitable
10329         to be passed to an CustomAttributeBuilder.
10330
10331         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10332
10333         * ecore.cs: (FieldExpr): Handle field remapping here.
10334
10335         * iteratators.cs: Pass the instance variable (if the method is an
10336         instance method) to the constructors, so we can access the field
10337         variables on the class.
10338
10339         TODO: Test this with structs.  I think the THIS variable on
10340         structs might have to be a pointer, and not a refenrece
10341
10342 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10343
10344         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10345         local variables to fields in a proxy class.
10346
10347         * iterators.cs (PopulateProxy): Rename our internal fields to
10348         <XXX>.  
10349         Create a <THIS> field if we are an instance method, so we can
10350         reference our parent container variables.
10351         (MapVariable): Called back from the EmitContext code to enter a
10352         new variable to field mapping into the proxy class (we just create
10353         a FieldBuilder).
10354
10355         * expression.cs
10356         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10357         for using the remapped locals to fields.
10358
10359         I placed the code here, because that gives the same semantics to
10360         local variables, and only changes the Emit code.
10361
10362         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10363         statements inside iterators.
10364         (VariableInfo): Add a FieldBuilder for the cases when we are
10365         remapping local variables to fields in a proxy class
10366
10367         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10368         current_block != null.
10369
10370         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10371         not cope with strings, as it has been moved to the
10372         TableSwitchEmit.  Fixed bug in switch generation.
10373
10374         * expression.cs (New.DoResolve): Provide more context for the user
10375         when reporting an error.
10376
10377         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10378         pointers. 
10379
10380         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10381         check the permissions for it.  Note than in a type-resolution
10382         context the check was already present in DeclSpace.ResolveType,
10383         but was missing from the MemberAccess.
10384
10385         (ArrayCreation.CheckIndices): warn if the user has
10386         more nested levels of expressions, but there are no more
10387         dimensions specified.  Avoids crash on bug 41906.
10388
10389 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10390
10391         * statement.cs (Block): replace Implicit bool, for a generic
10392         flags.   
10393         New flag: `Unchecked'.  This is used during the EmitMeta phase
10394         (which is out-of-line with the regular Resolve/Emit process for a
10395         statement, as this is done ahead of time, but still gets a chance
10396         to call constant resolve).
10397
10398         (Block.Flags): new enum for adding a new flag.
10399
10400         (Block.EmitMeta): track the state of unchecked.
10401
10402         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10403         to enable constant resolution to work there as well.
10404
10405 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10406
10407         * typemanager.cs (ienumerable_type): Also look up
10408         System.Collections.IEnumerable. 
10409
10410 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10411
10412         TODO: Test more than one conditional per method.
10413
10414         * class.cs (Indexer.Define): Report the location where the user is
10415         referencing the unsupported feature.
10416
10417         (MethodData): Overload the use of `conditionals' to
10418         minimize the creation of needless ArrayLists.   This saves roughly
10419         212kb on my machine.
10420
10421         (Method): Implement the new IIteratorContainer interface.
10422         (Method.SetYields): Implement the method by setting the ModFlags
10423         to contain METHOD_YIELDS.
10424
10425         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10426         which just got set to null.
10427
10428         * iterators.cs: New file.
10429
10430         (Yield, YieldBreak): New statements.
10431
10432         * statement.cs (Return.Resolve): Flag an error if we are used in
10433         an iterator method.
10434
10435         * codegen.cs (InIterator): New flag set if the code is being
10436         compiled in an iterator method.
10437
10438         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10439         internal modifier, and we just use it to avoid adding extra
10440         fields, as this is seldom used.  
10441
10442         * cs-parser.jay: Add yield_statement (yield and yield break).
10443
10444         * driver.cs: New flag -v2 to turn on version 2 features. 
10445
10446         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10447         hashtable when v2 is enabled.
10448
10449 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10450
10451         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10452         there is already a namespace defined with this name.
10453
10454         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10455         people upgraded their corlibs.
10456
10457         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10458         always use fully qualified types, no need to use the compiler
10459         front end.
10460
10461         (TypeManager.IsNamespace): Use binarysearch.
10462
10463         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10464         AddDelegate): I did not quite use the new IsValid API properly: I
10465         have to pass the short-name and the fullname.  I was passing only
10466         the basename instead of the fullname sometimes. 
10467
10468         (TypeContainer.DefineType): call NamespaceClash.
10469
10470         * interface.cs (Interface.DefineType): use NamespaceClash before
10471         defining the type.
10472
10473         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10474         defining the type.
10475
10476         * enum.cs: (Enum.DefineType): use NamespaceClash before
10477         defining the type.
10478
10479         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10480         speed increase.  First, use the negative_hits cache when we get a
10481         negative.  Second, add the type with its full original name
10482         instead of the new . and + encoded name (reflection uses + to
10483         separate type from a nested type).  Use LookupTypeReflection
10484         directly which bypasses the type->name hashtable (that we already
10485         know does not contain the type.
10486
10487         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10488         location/container type. 
10489
10490         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10491
10492 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10493
10494         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10495
10496         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10497         method is being referenced in the method group from a static
10498         context, and report error 120 if so.
10499
10500         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10501         Error118. 
10502
10503         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10504         is created, we create the A namespace).
10505
10506         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10507         Fixes #41591
10508
10509 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10510
10511         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10512         invocation to ModuleBuilder.GetType with the same values will
10513         return a new type instance, so we need to cache its return
10514         values. 
10515
10516         * expression.cs (Binary.ResolveOperator): Only allow the compare
10517         operators on enums if they are of the same type.
10518
10519         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10520         types of ValueType on their own case.  Before we were giving them
10521         the same treatment as objects.
10522
10523         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10524         fullname.  Short name is used to compare against container name.
10525         Fullname is used to check against defined namespace names.
10526
10527         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10528         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10529
10530         (Method.CheckBase): Call parent.
10531         (MemberBase.CheckBase): Check for protected members on sealed
10532         classes.
10533         (PropertyBase.CheckBase): Call parent.
10534         (Field.Define): Call parent.
10535
10536         * report.cs: Negative error codes are now mapped to 8000 - code,
10537         so that the display is render more nicely.
10538
10539         * typemanager.cs: Do not use try/catch, instead report a regular
10540         error. 
10541
10542         (GetPointerType, GetReferenceType): These methods provide
10543         mechanisms to obtain the T* and T& from a T.  We had the code
10544         previously scattered around the code base, and it also used
10545         TypeManager.LookupType that would go through plenty of caches.
10546         This one goes directly to the type source.
10547
10548         In some places we did the Type.GetType followed by
10549         ModuleBuilder.GetType, but not in others, so this unifies the
10550         processing as well.
10551
10552         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10553         statements now that we have namespace information.
10554
10555         * typemanager.cs (IsNamespace): New method, returns whether the
10556         string presented is a namespace or not.
10557
10558         (ComputeNamespaces): New public entry point, computes the list of
10559         available namespaces, using the GetNamespaces API call in Mono, or
10560         the slower version in MS.NET.   
10561
10562         Now before we start the semantic analysis phase, we have a
10563         complete list of namespaces including everything that the user has
10564         provided.
10565
10566         Deleted old code to cache namespaces in .nsc files.
10567
10568 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10569
10570         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10571         class/struct location definition Location for the implicit
10572         constructor location.
10573
10574         (Operator.Define): Use the location of the operator for the
10575         implicit Method definition.
10576
10577         (Constructor.Emit): use the constructor location for the implicit
10578         base initializer constructor.
10579
10580         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10581         and the Expression class now contains two new methods:
10582
10583         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10584         isolate type lookup from the rest of the resolution process.
10585
10586         Since we use Expressions to hold type definitions due to the way
10587         we parse the input we have historically overloaded Resolve to
10588         perform the Type lookups if a special flag is passed.  Now this is
10589         eliminated and two methods take their place. 
10590
10591         The differences in the two methods between xStep and xTerminal is
10592         that xStep is involved in our current lookup system that uses
10593         SimpleNames to compose a name, while xTerminal is used just to
10594         catch the case where the simplename lookup failed.
10595
10596 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10597
10598         * expression.cs (ResolveMemberAccess): Remove redundant code.
10599         TypeExpr expressions are always born fully resolved.
10600
10601         * interface.cs (PopulateMethod): Do not lookup the types twice.
10602         We were doing it once during SemanticAnalysis and once during
10603         PopulateMethod.
10604
10605         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10606         in local variable type definitions, were being returned as a
10607         SimpleName (we decomposed everything into a string), that is
10608         because primary_expression was being used instead of a type in the
10609         grammar (reduce/reduce conflicts).
10610
10611         The part that was wrong is that we converted the expression into a
10612         string (an oversimplification in one hand, compounded with primary
10613         expressions doing string concatenation).
10614
10615         So things like:
10616
10617         A.B.C [] x;
10618
10619         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10620         using clauses from working on this particular context.  And a type
10621         was being matched directly against "A.B.C[]".
10622
10623         We now use the correct approach, and allow for ComposedCast to be
10624         part of the unary expression.  So the "A.B.C []" become a composed
10625         cast of "A.B.C" (as a nested group of MemberAccess with a
10626         SimpleName at the end) plus the rank composition "[]". 
10627
10628         Also fixes 35567
10629
10630 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10631
10632         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10633         for the access level checking.
10634
10635         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10636         `TypeContainer container', because I kept getting confused when I
10637         was debugging this code.
10638
10639         * expression.cs (Indexers): Instead of tracking getters/setters,
10640         we now track them in parallel.  We create one arraylist less, but
10641         most importantly it is possible now for the LValue code to find a
10642         matching get for a set.
10643
10644         (IndexerAccess.DoResolveLValue): Update the code.
10645         GetIndexersForType has been modified already to extract all the
10646         indexers from a type.  The code assumed it did not.
10647
10648         Also make the code set the correct return type for the indexer.
10649         This was fixed a long time ago for properties, but was missing for
10650         indexers.  It used to be void_type.
10651
10652         (Binary.Emit): Test first for doubles instead of
10653         floats, as they are more common.
10654
10655         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10656         when dealing with floats and the <=, >= operators.  This fixes bug
10657         #39314 
10658
10659         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10660         to load the array value by emitting a load on the foreach variable
10661         type.  This was incorrect.  
10662
10663         We now emit the code to load an element using the the array
10664         variable type, and then we emit the conversion operator.
10665
10666         Fixed #40176
10667
10668 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10669
10670         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10671
10672 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10673
10674         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10675         test for protection before we test for signatures. 
10676
10677         (MethodSignature.ToString): implement.
10678
10679         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10680         to the case where we reduced into a LongConstant.
10681
10682         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10683         depend on whether the information is acurrate, because the
10684         Microsoft runtime will always claim that the array type is public,
10685         regardless of the real state.
10686
10687         If the type is a pointer, another problem happens: the type is
10688         reported as non-public in Microsoft.  
10689
10690         In both cases we have to call CheckAccessLevel recursively with
10691         the underlying type as the argument to be tested.
10692
10693 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10694
10695         * assign.cs (Assign.Emit): If we are dealing with a compound
10696         assignment expression, we should use the code path that stores the
10697         intermediate result in a temporary value.  This fixes #40903.
10698
10699         *expression.cs (Indirection.ToString): Provide ToString method for
10700         debugging. 
10701
10702 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10703
10704         * class.cs: Null out fields holding references to Block objects so
10705         they can be garbage collected.
10706
10707         * expression.cs (OverloadResolve): Remove unused local.
10708
10709 2003-04-07  Martin Baulig  <martin@ximian.com>
10710
10711         * codegen.cs (EmitContext.CurrentFile): New public field.
10712         (EmitContext.Mark): Use the CurrentFile to check whether the
10713         location is in the correct file.
10714         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10715
10716 2003-04-07  Martin Baulig  <martin@ximian.com>
10717
10718         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10719
10720         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10721         location.  [FIXME: The location argument which gets passed to this
10722         method is sometimes wrong!]
10723
10724 2003-04-07  Nick Drochak <ndrochak@gol.com>
10725
10726         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10727
10728 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * expression.cs (Indirection.EmitAssign): We were using the
10731         temporary, but returning immediately instead of continuing the
10732         EmitAssing flow.
10733
10734 2003-04-06  Martin Baulig  <martin@ximian.com>
10735
10736         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10737         if it's a nested child, but also deriving from the outer class.
10738         See test 190.cs.
10739
10740         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10741         nested child, but also deriving from the outer class.  See
10742         test-190.cs.
10743         (FilterWithClosure): We may access private members of the outer
10744         class if we're a nested child and deriving from the outer class.
10745         (RealMemberLookup): Only set `closure_private_ok' if the
10746         `original_bf' contained BindingFlags.NonPublic.
10747
10748 2003-04-05  Martin Baulig  <martin@ximian.com>
10749
10750         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10751
10752 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10753
10754         * class.cs (Event.Define): Do not allow abstract events to have
10755         initializers. 
10756
10757 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10758
10759         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10760         block in event declarations.
10761
10762         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10763         value type, get its address.
10764
10765         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10766         leaving a class on the stack instead of a boolean value (int
10767         0/1).  Change the code so we compare against null, and then the
10768         result against zero.
10769
10770         * class.cs (TypeContainer.GetClassBases): We were checking for the
10771         parent class being sealed too late.
10772
10773         * expression.cs (Binary.Emit): For <= and >= when dealing with
10774         floating point values, use cgt.un and clt.un instead of cgt and
10775         clt alone.
10776
10777 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10778
10779         * statement.cs: Apply the same optimization as MS: skip the 
10780         GetEnumerator returning an IEnumerator, and use the one returning a 
10781         CharEnumerator instead. This allows us to avoid the try-finally block 
10782         and the boxing.
10783
10784 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10785
10786         * cs-parser.jay: Attributes cannot be applied to
10787                          namespaces. Fixes #40473
10788
10789 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10790
10791         * class.cs:
10792         (Add*): check if the name is valid using the full name for constants,
10793         fields, properties and events.
10794
10795 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10796
10797         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10798         char constants to be part of the enumeration.
10799
10800         * expression.cs (Conditional.DoResolve): Add support for operator
10801         true. Implements the missing functionality from 14.12
10802
10803         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10804         operator true/false as required by the spec.
10805
10806         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10807         implicit conversion to boolean.
10808
10809         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10810         also one where the type implements `operator true'. 
10811
10812         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10813         get an expression that will invoke operator true based on an
10814         expression.  
10815
10816         (GetConversionOperators): Removed the hack that called op_True
10817         here.  
10818
10819         (Expression.ResolveBoolean): Move this from Statement.
10820
10821 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10822
10823         * ecore.cs (FieldExpr): do not allow initialization of initonly
10824         fields on derived classes
10825
10826 2003-03-13  Martin Baulig  <martin@ximian.com>
10827
10828         * statement.cs (Block.Emit): Call ig.BeginScope() and
10829         ig.EndScope() when compiling with debugging info; call
10830         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10831
10832 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10833
10834         * expression.cs (Indexers): Do not construct immediately, allow
10835         for new members to be appended as we go.  Fixes 38143
10836
10837 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10838
10839         * expression.cs: save/restore context when resolving an unchecked
10840         expression.
10841
10842 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10843
10844         * cfold.cs: Catch division by zero in modulus operator during
10845         constant folding.
10846
10847 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10848
10849         * interface.cs (Interface.DefineMembers): Avoid defining members
10850         twice. 
10851
10852 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10853
10854         * driver.cs: handle the +/- options for -noconfig
10855
10856         * statement.cs (Unckeched.Resolve): Also track the state of
10857         unchecked in the Resolve phase.
10858
10859 2003-02-27  Martin Baulig  <martin@ximian.com>
10860
10861         * ecore.cs (Expression.MemberLookup): Don't create a
10862         MethodGroupExpr for something which is not a method.  Fixes #38291.
10863
10864 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10865
10866         * class.cs (MemberBase.CheckParameters): Also check that the type
10867         is unmanaged if it is a pointer.
10868
10869         * expression.cs (SizeOf.Resolve): Add location information.
10870
10871         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10872         a managed type is declared.
10873
10874         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10875         parameter modifiers as well.  Fixes bug 38606
10876
10877         * class.cs: Very sad.  Am backing out the speed up changes
10878         introduced by the ArrayList -> Array in the TypeContainer, as they
10879         were not actually that much faster, and introduced a bug (no error
10880         reports on duplicated methods).
10881
10882         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10883         source first, this will guarantee that we have a valid expression
10884         before calling in lower levels functions that will require a
10885         resolved object.  Then use this original_source in the
10886         target.ResolveLValue instead of the original source that was
10887         passed to us.
10888
10889         Another change.  Use target.Resolve instead of LValueResolve.
10890         Although we are resolving for LValues, we will let the Assign code
10891         take care of that (it will be called again from Resolve).  This
10892         basically allows code like this:
10893
10894         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10895         class Y { void A (X x) { x [0] += o; }
10896
10897         The problem was that the indexer was trying to resolve for
10898         set_Item (idx, object o) and never finding one.  The real set_Item
10899         was set_Item (idx, X).  By delaying the process we get the right
10900         semantics. 
10901
10902         Fixes bug 36505
10903
10904 2003-02-23  Martin Baulig  <martin@ximian.com>
10905
10906         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10907         while calling DoEmit ().
10908
10909         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10910         source files; if you use the #line directive inside a method, the
10911         compiler stops emitting line numbers for the debugger until it
10912         reaches the end of the method or another #line directive which
10913         restores the original file.
10914
10915 2003-02-23  Martin Baulig  <martin@ximian.com>
10916
10917         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10918
10919 2003-02-23  Martin Baulig  <martin@ximian.com>
10920
10921         * statement.cs (Block.AddChildVariableNames): We need to call this
10922         recursively, not just for our immediate children.
10923
10924 2003-02-23  Martin Baulig  <martin@ximian.com>
10925
10926         * class.cs (Event.Define): Always make the field private, like csc does.
10927
10928         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10929         actually work, fixes bug #37521.
10930
10931 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10932
10933         * delegate.cs: When creating the various temporary "Parameters"
10934         classes, make sure that we call the ComputeAndDefineParameterTypes
10935         on those new parameters (just like we do with the formal ones), to
10936         allow them to be resolved in the context of the DeclSpace.
10937
10938         This fixes the bug that Dick observed in Bugzilla #38530.
10939
10940 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10941
10942         * expression.cs (ResolveMemberAccess): When resolving a constant,
10943         do not attempt to pull a constant if the value was not able to
10944         generate a valid constant.
10945
10946         * const.cs (LookupConstantValue): Do not report more errors than required.
10947
10948 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10949
10950         * expression.cs: fixes bug #38328.
10951
10952 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10953
10954         * class.cs: Changed all the various members that can be part of a
10955         class from being an ArrayList to be an Array of the right type.
10956         During the DefineType type_list, interface_list, delegate_list and
10957         enum_list are turned into types, interfaces, delegates and enums
10958         arrays.  
10959
10960         And during the member population, indexer_list, event_list,
10961         constant_list, field_list, instance_constructor_list, method_list,
10962         operator_list and property_list are turned into their real arrays.
10963
10964         Although we could probably perform this operation earlier, for
10965         good error reporting we need to keep the lists and remove the
10966         lists for longer than required.
10967
10968         This optimization was triggered by Paolo profiling the compiler
10969         speed on the output of `gen-sample-program.pl' perl script. 
10970
10971         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10972         not crash in methods like MemberLookupFailed that use this field.  
10973
10974         This problem arises when the compiler fails to resolve a type
10975         during interface type definition for example.
10976
10977 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10978
10979         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10980         inherit from System.Object, so we have to stop at null, not only
10981         when reaching System.Object.
10982
10983 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10984
10985         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10986         DeclaredOnly because the parent indexer might have had a different
10987         name, but did not loop until the top of the hierarchy was reached.
10988
10989         The problem this one fixes is 35492: when a class implemented an
10990         indexer from an interface, we were getting the interface method
10991         (which was abstract) and we were flagging an error (can not invoke
10992         abstract method).
10993
10994         This also keeps bug 33089 functioning, and test-148 functioning.
10995
10996         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10997         out if a method is special is to see if it is declared in a
10998         property or event, or whether it is one of the predefined operator
10999         names.   This should fix correctly #36804.
11000
11001 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11002
11003         The goal here is to remove the dependency on EmptyCast.Peel ().
11004         Killing it completely.
11005
11006         The problem is that currently in a number of places where
11007         constants are expected, we have to "probe" for an EmptyCast, and
11008         Peel, which is not the correct thing to do, as this will be
11009         repetitive and will likely lead to errors. 
11010
11011         The idea is to remove any EmptyCasts that are used in casts that
11012         can be reduced to constants, so we only have to cope with
11013         constants. 
11014
11015         This bug hunt was triggered by Bug 37363 and the desire to remove
11016         the duplicate pattern where we were "peeling" emptycasts to check
11017         whether they were constants.  Now constants will always be
11018         constants.
11019
11020         * ecore.cs: Use an enumconstant here instead of wrapping with
11021         EmptyCast.  
11022
11023         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11024         throwing me off.  By handling this we can get rid of a few hacks.
11025
11026         * statement.cs (Switch): Removed Peel() code.
11027
11028 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11029
11030         * class.cs: Location information for error 508
11031
11032         * expression.cs (New.DoResolve): Add a guard against double
11033         resolution of an expression.  
11034
11035         The New DoResolve might be called twice when initializing field
11036         expressions (see EmitFieldInitializers, the call to
11037         GetInitializerExpression will perform a resolve on the expression,
11038         and later the assign will trigger another resolution
11039
11040         This leads to bugs (#37014)
11041
11042         * delegate.cs: The signature for EndInvoke should contain any ref
11043         or out parameters as well.  We were not doing this in the past. 
11044
11045         * class.cs (Field.Define): Do not overwrite the type definition
11046         inside the `volatile' group.  Turns out that volatile enumerations
11047         were changing the type here to perform a validity test, which
11048         broke conversions. 
11049
11050 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11051
11052         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11053         and structs, we do not want to load the instance variable
11054
11055         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11056         enum_type has to be handled like an object reference (implicit
11057         conversions exists from this to object), but the regular IsClass
11058         and IsValueType tests will never return true for this one.
11059
11060         Also we use TypeManager.IsValueType instead of type.IsValueType,
11061         just for consistency with the rest of the code (this is only
11062         needed if we ever use the construct exposed by test-180.cs inside
11063         corlib, which we dont today).
11064
11065 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11066
11067         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11068         just InternalCall.
11069
11070 2003-02-09  Martin Baulig  <martin@ximian.com>
11071
11072         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11073         (Namespace.DefineNamespaces): New static public method; this is
11074         called when we're compiling with debugging to add all namespaces
11075         to the symbol file.
11076
11077         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11078         pass it to the Namespace's .ctor.
11079
11080         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11081         and MethodBase arguments; pass the namespace ID to the symwriter;
11082         pass the MethodBase instead of the token to the symwriter.
11083         (SymbolWriter.DefineNamespace): New method to add a namespace to
11084         the symbol file.
11085
11086 2003-02-09  Martin Baulig  <martin@ximian.com>
11087
11088         * symbolwriter.cs: New file.  This is a wrapper around
11089         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11090         methods here in near future.
11091
11092 2003-02-09  Martin Baulig  <martin@ximian.com>
11093
11094         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11095         ILGenerator.MarkSequencePoint() which are actually used by the
11096         symbol writer.
11097
11098 2003-02-09  Martin Baulig  <martin@ximian.com>
11099
11100         * location.cs (SourceFile): New public sealed class.  This
11101         contains the name and an index which is used in the location's token.
11102         (Location): Reserve an appropriate number of bits in the token for
11103         the source file instead of walking over that list, this gives us a
11104         really huge performance improvement when compiling with debugging.
11105
11106         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11107         `SourceFile' argument instead of a string.
11108         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11109         but don't parse/tokenize here, we need to generate the list of all
11110         source files before we do that.
11111         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11112         the files.
11113
11114         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11115         instead of a string.
11116
11117         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11118         of a string.
11119
11120 2003-02-09  Martin Baulig  <martin@ximian.com>
11121
11122         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11123         filename on `#line default'.
11124
11125 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11126
11127         * statement.cs: don't clear the pinned var when the fixed statement
11128         returns from the method (fixes bug#37752).
11129
11130 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11131
11132         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11133         to IsValueType.
11134
11135 2003-02-07  Martin Baulig  <martin@ximian.com>
11136
11137         * driver.cs: Removed the `--debug-args' command line argument.
11138
11139         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11140         automatically by the AsssemblyBuilder.
11141         (CodeGen.InitializeSymbolWriter): We don't need to call any
11142         initialization function on the symbol writer anymore.  This method
11143         doesn't take any arguments.
11144
11145 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11146
11147         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11148         from referenced assemblies as well.
11149
11150 2003-02-02  Martin Baulig  <martin@ximian.com>
11151
11152         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11153
11154 2003-02-02  Martin Baulig  <martin@ximian.com>
11155
11156         * class.cs (Constructor.Emit): Open the symbol writer before
11157         emitting the constructor initializer.
11158         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11159         single-stepping through constructor initializers.
11160
11161 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11162
11163         * class.cs: Handle error 549: do not allow virtual methods in
11164         sealed classes. 
11165
11166 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11167
11168         * decl.cs: Check access levels when resolving types
11169
11170 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11171
11172         * statement.cs: Add parameters and locals set in catch blocks that might 
11173         return to set vector
11174
11175 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11176
11177         * class.cs (Operator): Set the SpecialName flags for operators.
11178
11179         * expression.cs (Invocation.DoResolve): Only block calls to
11180         accessors and operators on SpecialName methods.
11181
11182         (Cast.TryReduce): Handle conversions from char constants.
11183
11184
11185 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11186
11187         * statement.cs: small memory and time optimization in FlowBranching.
11188
11189 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11190
11191         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11192         problem that the last fix but in the other sid (Set).
11193
11194         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11195         access when there is no indexer in the hierarchy.
11196
11197 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11198
11199         * class.cs: Combine some if statements.
11200
11201 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11202
11203         * driver.cs: fixed bug #37187.
11204
11205 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11206
11207         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11208         any indexer, it's needed to build a list with all the indexers in the
11209         hierarchy (AllGetters), else we have problems. Fixes #35653.
11210
11211 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11212
11213         * class.cs (MethodData.Define): It is wrong for an interface
11214         implementation to be static in both cases: explicit and implicit.
11215         We were only handling this in one case.
11216
11217         Improve the if situation there to not have negations.
11218
11219         * class.cs (Field.Define): Turns out that we do not need to check
11220         the unsafe bit on field definition, only on usage.  Remove the test.
11221
11222 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11223
11224         * driver.cs: use assembly.Location instead of Codebase (the latest
11225         patch made mcs fail when using MS assemblies).
11226
11227 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11228
11229         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11230         get the path to *corlib.dll.
11231
11232 2003-01-21  Nick Drochak <ndrochak@gol.com>
11233
11234         * cs-tokenizer.cs:
11235         * pending.cs:
11236         * typemanager.cs: Remove compiler warnings
11237
11238 2003-01-20  Duncan Mak  <duncan@ximian.com>
11239
11240         * AssemblyInfo.cs: Bump the version number to 0.19.
11241
11242 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11243
11244         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11245
11246 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11247
11248         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11249
11250 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11251
11252         * cs-parser.jay: Small fix: we were not comparing the constructor
11253         name correctly.   Thanks to Zoltan for the initial pointer.
11254
11255 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11256
11257         * cs-tokenizer.cs: Set file name when specified with #line
11258
11259 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11260
11261         * cs-parser.jay: Only perform the constructor checks here if we
11262         are named like the class;  This will help provider a better
11263         error.  The constructor path is taken when a type definition is
11264         not found, but most likely the user forgot to add the type, so
11265         report that rather than the constructor error.
11266
11267 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11268
11269         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11270         allocations.
11271
11272 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11273
11274         * cs-parser.jay: Add cleanup call.
11275
11276 2003-01-13  Duncan Mak  <duncan@ximian.com>
11277
11278         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11279         consistent with other methods.
11280
11281 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11282
11283         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11284
11285 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11286
11287         * attribute.cs: only set GuidAttr to true when we have a
11288         GuidAttribute.
11289
11290 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11291
11292         * ecore.cs:
11293         * expression.cs:
11294         * typemanager.cs: fixes to allow mcs compile corlib with the new
11295         Type.IsSubclassOf fix.
11296
11297 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11298
11299         * expression.cs (LocalVariableReference.DoResolve): Classify a
11300         constant as a value, not as a variable.   Also, set the type for
11301         the variable.
11302
11303         * cs-parser.jay (fixed_statement): take a type instead of a
11304         pointer_type, so we can produce a better error message later.
11305
11306         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11307         as an error.  
11308
11309         (For.DoEmit): Make inifinite loops have a
11310         non-conditional branch back.
11311
11312         (Fixed.DoEmit): First populate the pinned variables, then emit the
11313         statement, then clear the variables.  Before I was emitting the
11314         code once for each fixed piece.
11315
11316
11317 2003-01-08  Martin Baulig  <martin@ximian.com>
11318
11319         * statement.cs (FlowBranching.MergeChild): A break in a
11320         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11321
11322 2003-01-08  Martin Baulig  <martin@ximian.com>
11323
11324         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11325         lives in the same number space than `param_map'.  Fixes #36154.
11326
11327 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11328
11329         * cs-parser.jay (constructor_declaration): Set the
11330         Constructor.ModFlags before probing for it.  This makes the
11331         compiler report 514, 515 and 132 (the code was there, but got
11332         broken). 
11333
11334         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11335         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11336         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11337
11338 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11339
11340         * enum.cs: create the enum static fields using the enum type.
11341
11342 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11343
11344         * class.cs: don't try to create the ParamBuilder for the return
11345         type if it's not needed (and handle it breaking for the ms runtime
11346         anyway).
11347
11348 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11349
11350         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11351
11352 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11353
11354         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11355         the command.   This showed up while compiling the JANET source
11356         code, which used \r as its only newline separator.
11357
11358 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11359
11360         * class.cs (Method.Define): If we are an operator (because it
11361         reuses our code), then set the SpecialName and HideBySig.  #36128
11362
11363 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11364
11365         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11366         exception, report error 120 `object reference required'.
11367
11368         * driver.cs: Add --pause option, used during to measure the size
11369         of the process as it goes with --timestamp.
11370
11371         * expression.cs (Invocation.DoResolve): Do not allow methods with
11372         SpecialName to be invoked.
11373
11374 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11375
11376         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11377         number before adding it.
11378
11379 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11380
11381         * ecore.cs (StandardImplicitConversion): When in an unsafe
11382         context, we allow conversion between void * to any other pointer
11383         type. This fixes bug #35973.
11384
11385 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11386
11387         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11388         is not thrown when extensionless outputs are used 
11389
11390 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11391
11392         * rootcontext.cs: fixed compilation of corlib.
11393
11394 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11395
11396         * attribute.cs (Attributes.Contains): Add new method.
11397
11398         * class.cs (MethodCore.LabelParameters): if the parameter is an
11399         `out' parameter, check that no attribute `[In]' has been passed.
11400
11401         * enum.cs: Handle the `value__' name in an enumeration.
11402
11403 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11404
11405         * decl.cs: Added special case to allow overrides on "protected
11406         internal" methods
11407
11408 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11409
11410         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11411         since it makes much more sense.
11412
11413         (Attributes.ctor): Don't require a Location parameter.
11414
11415         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11416
11417         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11418         since we already have that information per attribute.
11419
11420         * everywhere : make appropriate changes.
11421
11422         * class.cs (LabelParameters): Write the code which actually
11423         applies attributes to the return type. We can't do this on the MS
11424         .NET runtime so we flag a warning in the case an exception is
11425         thrown.
11426
11427 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11428
11429         * const.cs: Handle implicit null conversions here too.
11430
11431 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11432
11433         * class.cs (MethodCore.LabelParameters): Remove the extra
11434         Type [] parameter since it is completely unnecessary. Instead
11435         pass in the method's attributes so that we can extract
11436         the "return" attribute.
11437
11438 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11439
11440         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11441         of ignoring it and letting the compile continue.
11442
11443         * typemanager.cs (ChangeType): use an extra argument to return an
11444         error condition instead of throwing an exception.
11445
11446 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11447
11448         * expression.cs (Unary.TryReduce): mimic the code for the regular
11449         code path.  Perform an implicit cast in the cases where we can
11450         implicitly convert to one of the integral types, and then reduce
11451         based on that constant.   This fixes bug #35483.
11452
11453 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11454
11455         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11456
11457 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11458
11459         * namespace.cs: fixed bug #35489.
11460
11461 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11462
11463         * class.cs: Remove some dead code.
11464
11465         * cs-parser.jay: Estimate the number of methods needed
11466         (RootContext.MethodCount);
11467
11468         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11469         numbers instead of StringBuilders.
11470
11471         * support.cs (PtrHashtable): Add constructor with initial size;
11472         We can now reduce reallocations of the method table.
11473
11474 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11475
11476         * attribute.cs (ApplyAttributes): Keep track of the emitted
11477         attributes on a per-target basis. This fixes bug #35413.
11478
11479 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11480
11481         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11482         default to the Windows 1252 encoding.
11483
11484         (UnixParseOption): Support version, thanks to Alp for the missing
11485         pointer. 
11486
11487         * AssemblyInfo.cs: Add nice assembly information.
11488
11489         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11490         (bug 35169).
11491
11492         * cs-parser.jay: Allow a trailing comma before the close bracked
11493         in the attribute_section production.
11494
11495         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11496         address of the instance was being taken, I will take this out,
11497         because we take the address of the object immediately here.
11498
11499 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11500
11501         * typemanager.cs (AreMultipleAllowed): Take care of the most
11502         obvious case where attribute type is not in the current assembly -
11503         stupid me ;-)
11504
11505 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11506
11507         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11508         definitions, instead of doing that afterwards.  
11509
11510         Also we use a nice little hack, depending on the constructor, we
11511         know if we are a "composed" name or a simple name.  Hence, we
11512         avoid the IndexOf test, and we avoid 
11513
11514         * codegen.cs: Add code to assist in a bug reporter to track down
11515         the source of a compiler crash. 
11516
11517 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11518
11519         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11520         types have been emitted for a given element and flag an error
11521         if something which does not have AllowMultiple set is used more
11522         than once.
11523
11524         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11525         attribute types and their corresponding AllowMultiple properties
11526
11527         (AreMultipleAllowed): Check the property for a given type.
11528
11529         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11530         property in the case we have a TypeContainer.
11531
11532         (Attributes.AddAttribute): Detect duplicates and just skip on
11533         adding them. This trivial fix catches a pretty gross error in our
11534         attribute emission - global attributes were being emitted twice!
11535
11536         Bugzilla bug #33187 is now fixed.
11537
11538 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11539
11540         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11541         instead of pp_and).
11542
11543         * expression.cs (Binary.ResolveOperator): I can only use the
11544         Concat (string, string, string) and Concat (string, string,
11545         string, string) if the child is actually a concatenation of
11546         strings. 
11547
11548 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11549
11550         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11551         context where we need a 2-character lookahead.
11552
11553         * pending.cs (PendingImplementation): Rework so we can keep track
11554         of interface types all the time, and flag those which were
11555         implemented by parents as optional.
11556
11557 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11558
11559         * expression.cs (Binary.ResolveOperator): Use
11560         String.Concat(string,string,string) or
11561         String.Concat(string,string,string,string) when possible. 
11562
11563         * typemanager: More helper methods.
11564
11565
11566 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11567
11568         * pending.cs: remove the bogus return from GetMissingInterfaces()
11569         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11570
11571 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11572
11573         * namespace.cs: avoid duplicated 'using xxx' being added to
11574         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11575         when we get more than one 'using' statement for the same namespace.
11576         Report a CS0105 warning for it.
11577
11578 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11579
11580         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11581         of calling getChar/putback, uses internal knowledge of it.    
11582
11583         (xtoken): Reorder tokenizer so most common patterns are checked
11584         first.  This reduces the compilation time in another 5% (from 8.11s
11585         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11586
11587         The parsing time is 22% of the compilation in mcs, and from that
11588         64% is spent on the tokenization process.  
11589
11590         I tried using a binary search for keywords, but this is slower
11591         than the hashtable.  Another option would be to do a couple of
11592         things:
11593
11594                 * Not use a StringBuilder, instead use an array of chars,
11595                   with a set value.  Notice that this way we could catch
11596                   the 645 error without having to do it *afterwards*.
11597
11598                 * We could write a hand-parser to avoid the hashtable
11599                   compares altogether.
11600
11601         The identifier consumption process takes 37% of the tokenization
11602         time.  Another 15% is spent on is_number.  56% of the time spent
11603         on is_number is spent on Int64.Parse:
11604
11605                 * We could probably choose based on the string length to
11606                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11607                   computations. 
11608
11609         Another 3% is spend on wrapping `xtoken' in the `token' function.
11610
11611         Handle 0xa0 as whitespace (#34752)
11612
11613 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11614
11615         * typemanager.cs (IsCLRType): New routine to tell whether a type
11616         is one of the builtin types.  
11617
11618         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11619         typecode in more places instead of doing pointer comparissions.
11620         We could leverage some knowledge about the way the typecodes are
11621         laid out.
11622
11623         New code to cache namespaces in assemblies, it is currently not
11624         invoked, to be used soon.
11625
11626         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11627
11628         * expression.cs (Binary.ResolveOperator): specially handle
11629         strings, and do not perform user-defined operator overloading for
11630         built-in types.
11631
11632 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11633
11634         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11635         internalcall as it is a pretty simple operation;  Avoid whenever
11636         possible to call Char.IsLetter.
11637
11638         (consume_identifier): Cut by half the number of
11639         hashtable calls by merging the is_keyword and GetKeyword behavior.
11640
11641         Do not short-circuit, because if we do, we
11642         report errors (ie, #if false && true would produce an invalid
11643         directive error);
11644
11645
11646 2002-11-24  Martin Baulig  <martin@ximian.com>
11647
11648         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11649         check constant ranges and report a CS0221.  Fixes #33186.
11650
11651 2002-11-24  Martin Baulig  <martin@ximian.com>
11652
11653         * cs-parser.jay: Make this work for uninitialized variable
11654         declarations in the `for' initializer.  Fixes #32416.
11655
11656 2002-11-24  Martin Baulig  <martin@ximian.com>
11657
11658         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11659         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11660
11661 2002-11-24  Martin Baulig  <martin@ximian.com>
11662
11663         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11664         argument; if true, we also check for user-defined conversions.
11665         This is only needed if both arguments are of a user-defined type.
11666         Fixes #30443, added test-175.cs.
11667         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11668
11669         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11670
11671 2002-11-24  Martin Baulig  <martin@ximian.com>
11672
11673         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11674         function to get the store opcode.
11675         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11676         only emit the Ldelema if the store opcode is Stobj.  You must run
11677         both test-34 and test-167 to test this.  Fixes #34529.
11678
11679 2002-11-23  Martin Baulig  <martin@ximian.com>
11680
11681         * ecore.cs (Expression.MemberLookup): Added additional
11682         `qualifier_type' argument which is used when we're being called
11683         from MemberAccess.DoResolve() and null if we're called from a
11684         SimpleName lookup.
11685         (Expression.MemberLookupFailed): New method to report errors; this
11686         does the CS1540 check and reports the correct error message.
11687
11688         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11689         argument for the CS1540 check and redone the way how we're dealing
11690         with private members.  See the comment in the source code for details.
11691         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11692         `closure_start_type' to `closure_qualifier_type' and check whether
11693         it's not null.  It was not this filter being broken, it was just
11694         being called with the wrong arguments.
11695
11696         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11697         and pass it the correct `qualifier_type'; this also does the error
11698         handling for us.
11699
11700 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11701
11702         * expression.cs (Invocation.EmitParams): If the we are dealing
11703         with a non-built-in value type, load its address as well.
11704
11705         (ArrayCreation): Use a a pretty constant instead
11706         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11707         static initializers.  
11708
11709         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11710         because they are not really value types, just glorified integers. 
11711
11712         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11713
11714         * ecore.cs: Remove redundant code for enumerations, make them use
11715         the same code path as everything else, fixes the casting issue
11716         with enumerations in Windows.Forms.
11717
11718         * attribute.cs: Do only cast to string if it is a string, the
11719         validation happens later.
11720
11721         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11722         people upgrade their corlibs.
11723
11724         * ecore.cs: Oops, enumerations were not following the entire code path
11725
11726 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11727
11728         * typemanager.cs (FilterWithClosure): Commented out the test for
11729         1540 in typemanager.cs, as it has problems when accessing
11730         protected methods from a parent class (see test-174.cs). 
11731
11732         * attribute.cs (Attribute.ValidateGuid): new method.
11733         (Attribute.Resolve): Use above.
11734
11735 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11736
11737         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11738
11739         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11740         handling for enumerations, as we only needed the TypeContainer
11741         functionality to begin with (this is required for the fix below to
11742         work for enums that reference constants in a container class for
11743         example). 
11744
11745         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11746
11747         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11748         a valid TypeBuilder to perform lookups on.o
11749
11750         * class.cs (InheritableMemberSignatureCompare): Use true in the
11751         call to GetGetMethod and GetSetMethod, because we are comparing
11752         the signature, and we need to get the methods *even* if they are
11753         private. 
11754
11755         (PropertyBase.CheckBase): ditto.
11756
11757         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11758         GotoCase.Resolve): Use Peel on EmpytCasts.
11759
11760         * ecore.cs (EmptyCast): drop child, add Peel method.
11761
11762 2002-11-17  Martin Baulig  <martin@ximian.com>
11763
11764         * ecore.cs (EmptyCast.Child): New public property.
11765
11766         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11767         label resolved to an EmptyCast.  Fixes #34162.
11768         (GotoCase.Resolve): Likewise.
11769         (Block.EmitMeta): Likewise.
11770
11771 2002-11-17  Martin Baulig  <martin@ximian.com>
11772
11773         * expression.cs (Invocation.BetterConversion): Prefer int over
11774         uint; short over ushort; long over ulong for integer literals.
11775         Use ImplicitConversionExists instead of StandardConversionExists
11776         since we also need to check for user-defined implicit conversions.
11777         Fixes #34165.  Added test-173.cs.
11778
11779 2002-11-16  Martin Baulig  <martin@ximian.com>
11780
11781         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11782         with the `true' and `false' literals.  Fixes #33151.
11783
11784 2002-11-16  Martin Baulig  <martin@ximian.com>
11785
11786         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11787         October 22nd; don't do the cs1540 check for static members.
11788
11789         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11790         now using our own filter here and doing the cs1540 check again.
11791
11792 2002-11-16  Martin Baulig  <martin@ximian.com>
11793
11794         * support.cs (InternalParameters): Don't crash if we don't have
11795         any fixed parameters.  Fixes #33532.
11796
11797 2002-11-16  Martin Baulig  <martin@ximian.com>
11798
11799         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11800         when looking up static methods to make this work on Windows.
11801         Fixes #33773.
11802
11803 2002-11-16  Martin Baulig  <martin@ximian.com>
11804
11805         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11806         a setter rather than using PropertyInfo.CanWrite.
11807
11808 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11809
11810         * class.cs: Allow acces to block member by subclasses. Fixes build
11811         breaker.
11812
11813 2002-11-14  Martin Baulig  <martin@ximian.com>
11814
11815         * class.cs (Constructor.Emit): Added the extern/block check.
11816         Fixes bug #33678.
11817
11818 2002-11-14  Martin Baulig  <martin@ximian.com>
11819
11820         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11821         iteration while looking for indexers, this is needed because the
11822         indexer may have a different name in our base classes.  Fixed the
11823         error reporting (no indexers at all, not get accessor, no
11824         overloaded match).  Fixes bug #33089.
11825         (IndexerAccess.DoResolveLValue): Likewise.
11826
11827 2002-11-14  Martin Baulig  <martin@ximian.com>
11828
11829         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11830         indexers.  Fixes the first part of bug #33089.
11831         (MethodSignature.InheritableMemberSignatureCompare): Added support
11832         for properties.
11833
11834 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11835
11836         * attribute.cs (Attribute.Resolve): Catch the
11837         NullReferenceException and report it since it isn't supposed to
11838         happen. 
11839
11840 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11841
11842         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11843         LogicalOr and LogicalAnd that can benefit from recursively
11844         handling EmitBranchable.  The code now should be nice for Paolo.
11845
11846 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11847
11848         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11849         the Type lookups, as we perform quite a number of lookups on
11850         non-Types.  This can be removed once we can deterministically tell
11851         whether we have a type or a namespace in advance.
11852
11853         But this might require special hacks from our corlib.
11854
11855         * TODO: updated.
11856
11857         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11858         and double which avoids a conversion from an integer to a double.
11859
11860         * expression.cs: tiny optimization, avoid calling IsConstant,
11861         because it effectively performs the lookup twice.
11862
11863 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11864
11865         But a bogus return here to keep the semantics of the old code
11866         until the Mono runtime is fixed.
11867
11868         * pending.cs (GetMissingInterfaces): New method used to remove all
11869         the interfaces that are already implemented by our parent
11870         classes from the list of pending methods. 
11871
11872         * interface.cs: Add checks for calls after ResolveTypeExpr.
11873
11874 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11875
11876         * class.cs (Class.Emit): Report warning 67: event not used if the
11877         warning level is beyond 3.
11878
11879         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11880         being a NullLiteral.
11881
11882         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11883         specifiers. 
11884
11885         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11886         path that might fail if a type can not be resolved.
11887
11888         * expression.cs (Binary.Emit): Emit unsigned versions of the
11889         operators. 
11890
11891         * driver.cs: use error 5.
11892
11893 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11894
11895         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11896
11897 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11898
11899         * cs-parser.jay (switch_section): A beautiful patch from Martin
11900         Baulig that fixed 33094.
11901
11902 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11903
11904         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11905         Check whether the base is abstract and report an error if so.
11906
11907         * expression.cs (IndexerAccess.DoResolveLValue,
11908         IndexerAccess.DoResolve): ditto. 
11909
11910         (Invocation.DoResolve): ditto.
11911
11912         (Invocation.FullMethodDesc): Improve the report string.
11913
11914         * statement.cs (Block): Eliminate IsVariableDefined as it is
11915         basically just a wrapper for GetVariableInfo.
11916
11917         * ecore.cs (SimpleName): Use new 
11918
11919         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11920         type, as we return the actual parameter ref/unref state on a
11921         different call.
11922
11923 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11924
11925         * support.cs: Return proper flags REF/OUT fixing the previous
11926         commit.  
11927
11928         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11929         not used to mean `ref' but `ref or out' in ParameterReference
11930
11931         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11932         full type signature instead of calling TypeManger.CSharpName
11933         ourselves. 
11934
11935         * support.cs (InternalParameters.ParameterDesc): Do not compare
11936         directly to the modflags, because REF/OUT will actually be bitsets
11937         if set. 
11938
11939         * delegate.cs (VerifyMethod): Check also the modifiers.
11940
11941         * cs-tokenizer.cs: Fix bug where floating point values with an
11942         exponent where a sign was missing was ignored.
11943
11944         * driver.cs: Allow multiple assemblies to be specified in a single
11945         /r: argument
11946
11947 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11948
11949         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11950         because identifiers after a parenthesis would end up in this kind
11951         of production, and we needed to desamiguate it for having casts
11952         like:
11953
11954                 (UserDefinedType *) xxx
11955
11956 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11957
11958         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11959         we should set on the Bindingflags.NonPublic, but not turn on
11960         private_ok.  private_ok controls whether a Private member is
11961         returned (this is chekced on the filter routine), while the
11962         BindingFlags.NonPublic just controls whether private/protected
11963         will be allowed.   This fixes the problem part of the problem of
11964         private properties being allowed to be used in derived classes.
11965
11966         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11967         so we can call the children DoResolveLValue method (this will
11968         properly signal errors on lvalue assignments to base properties)
11969
11970         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11971         getter are null, and we have a property info, we know that this
11972         happened because the lookup failed, so we report an error 122 for
11973         protection level violation.
11974
11975         We also silently return if setter and getter are null in the
11976         resolve functions, this condition only happens if we have flagged
11977         the error before.  This is the other half of the problem. 
11978
11979         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11980         not have accessibility information, that is why we were returning
11981         true in the filter function in typemanager.cs.
11982
11983         To properly report 122 (property is inaccessible because of its
11984         protection level) correctly, we report this error in ResolveAccess
11985         by failing if both the setter and the getter are lacking (ie, the
11986         lookup failed). 
11987
11988         DoResolve and DoLResolve have been modified to check for both
11989         setter/getter being null and returning silently, the reason being
11990         that I did not want to put the knowledge about this error in upper
11991         layers, like:
11992
11993         int old = Report.Errors;
11994         x = new PropertyExpr (...);
11995         if (old != Report.Errors)
11996                 return null;
11997         else
11998                 return x;
11999
12000         So the property expr is returned, but it is invalid, so the error
12001         will be flagged during the resolve process. 
12002
12003         * class.cs: Remove InheritablePropertySignatureCompare from the
12004         class, as we no longer depend on the property signature to compute
12005         whether it is possible to implement a method or not.
12006
12007         The reason is that calling PropertyInfo.GetGetMethod will return
12008         null (in .NET, in Mono it works, and we should change this), in
12009         cases where the Get Method does not exist in that particular
12010         class.
12011
12012         So this code:
12013
12014         class X { public virtual int A { get { return 1; } } }
12015         class Y : X { }
12016         class Z : Y { public override int A { get { return 2; } } }
12017
12018         Would fail in Z because the parent (Y) would not have the property
12019         defined.  So we avoid this completely now (because the alternative
12020         fix was ugly and slow), and we now depend exclusively on the
12021         method names.
12022
12023         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12024         reference method, instead of using the property.
12025
12026         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12027         routines are gone now.
12028
12029         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12030         names, they were incorrectly named.
12031
12032         * cs-tokenizer.cs: Return are more gentle token on failure. 
12033
12034         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12035         had an out-of-sync index variable, which caused it to remove from
12036         the list of pending methods the wrong method sometimes.
12037
12038 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12039
12040         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12041         CanWrite, because those refer to this particular instance of the
12042         property, and do not take into account the fact that we can
12043         override single members of a property.
12044
12045         Constructor requires an EmitContext.  The resolution process does
12046         not happen here, but we need to compute the accessors before,
12047         because the resolution does not always happen for properties.
12048
12049         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12050         subclass, before we did not update this flag, but we did update
12051         bindingflags. 
12052
12053         (GetAccessors): Drop this routine, as it did not work in the
12054         presence of partially overwritten set/get methods. 
12055
12056         Notice that this broke the cs1540 detection, but that will require
12057         more thinking. 
12058
12059 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12060
12061         * class.cs:
12062         * codegen.cs:
12063         * driver.cs: issue a warning instead of an error if we don't support
12064         debugging for the platform. Also ignore a couple of errors that may
12065         arise when trying to write the symbols. Undo my previous patch.
12066
12067 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12068
12069         * driver.cs: ignore /debug switch except for Unix platforms.
12070
12071 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12072
12073         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12074
12075 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12076
12077         * driver.cs: Do not make mcs-debug conditional, so we do not break
12078         builds that use it.
12079
12080         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12081         review this patch.  But basically after all the children variables
12082         have been merged, the value of "Breaks" was not being set to
12083         new_breaks for Switch blocks.  I think that it should be set after
12084         it has executed.  Currently I set this to the value of new_breaks,
12085         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12086         conservative, but I do not understand this code very well.
12087
12088         I did not break anything in the build, so that is good ;-)
12089
12090         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12091
12092 2002-10-20  Mark Crichton  <crichton@gimp.org>
12093
12094         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12095
12096 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12097
12098         * cfold.cs: Fixed compile blocker.
12099
12100 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12101
12102         * driver.cs: I was chekcing the key, not the file.
12103
12104 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12105
12106         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12107         message that we were generating - we just need to silently return
12108         a null.
12109
12110 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12111
12112         * class.cs (Event.Define): Change my previous commit, as this
12113         breaks the debugger.  This is a temporary hack, as it seems like
12114         the compiler is generating events incorrectly to begin with.
12115
12116         * expression.cs (Binary.ResolveOperator): Added support for 
12117         "U operator - (E x, E y)"
12118
12119         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12120         y)".
12121
12122         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12123         init-only variables, but this path did not take into account that
12124         there might be also instance readonly variables.  Correct this
12125         problem. 
12126
12127         This fixes bug 32253
12128
12129         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12130         delegates as well.
12131
12132         * driver.cs: Change the extension for modules to `netmodule'
12133
12134         * cs-parser.jay: Improved slightly the location tracking for
12135         the debugger symbols.
12136
12137         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12138         modifiers that were specified instead of the hardcoded value
12139         (FamAndAssem).  This was basically ignoring the static modifier,
12140         and others.  Fixes 32429.
12141
12142         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12143         fixed a bug in the process (32476)
12144
12145         * expression.cs (ArrayAccess.EmitAssign): Patch from
12146         hwang_rob@yahoo.ca that fixes bug 31834.3
12147
12148 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12149
12150         * driver.cs: Make the module extension .netmodule.
12151
12152 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12153
12154         * driver.cs: Report an error if the resource file is not found
12155         instead of crashing.
12156
12157         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12158         false, like Emit does.
12159
12160 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12161
12162         * typemanager.cs: Remove unused private member.  Also reported mcs
12163         bug to report this as a warning like csc.
12164
12165 2002-10-15  Martin Baulig  <martin@gnome.org>
12166
12167         * statement.cs (Statement.Emit): Made this a virtual method; emits
12168         the line number info and calls DoEmit().
12169         (Statement.DoEmit): New protected abstract method, formerly knows
12170         as Statement.Emit().
12171
12172         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12173
12174 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12175
12176         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12177         have fixed a remaining problem: not every AddXXXX was adding a
12178         fully qualified name.  
12179
12180         Now everyone registers a fully qualified name in the DeclSpace as
12181         being defined instead of the partial name.  
12182
12183         Downsides: we are slower than we need to be due to the excess
12184         copies and the names being registered this way.  
12185
12186         The reason for this is that we currently depend (on the corlib
12187         bootstrap for instance) that types are fully qualified, because
12188         we dump all the types in the namespace, and we should really have
12189         types inserted into the proper namespace, so we can only store the
12190         basenames in the defined_names array.
12191
12192 2002-10-10  Martin Baulig  <martin@gnome.org>
12193
12194         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12195         from bug #31834, see the bug report for a testcase which is
12196         miscompiled.
12197
12198 2002-10-10  Martin Baulig  <martin@gnome.org>
12199
12200         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12201         flow analysis code for this.
12202
12203         * statement.cs (Do, While, For): Tell the flow analysis code about
12204         infinite loops.
12205         (FlowBranching.UsageVector): Added support for infinite loops.
12206         (Block.Resolve): Moved the dead code elimination here and use flow
12207         analysis to do it.
12208
12209 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12210
12211         * class.cs (Field.Define): Catch cycles on struct type
12212         definitions. 
12213
12214         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12215         fields if the fields are static.  We only need to check instance
12216         fields. 
12217
12218         * expression.cs (As.DoResolve): Test for reference type.
12219
12220         * statement.cs (Using.ResolveExpression): Use
12221         ConvertImplicitRequired, not ConvertImplicit which reports an
12222         error on failture
12223         (Using.ResolveLocalVariableDecls): ditto.
12224
12225         * expression.cs (Binary.ResolveOperator): Report errors in a few
12226         places where we had to.
12227
12228         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12229
12230 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12231
12232         * expression.cs: Use StoreFromPtr instead of extracting the type
12233         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12234
12235         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12236         an enumeration value to a System.Enum, but System.Enum is not a
12237         value type, but an class type, so we need to box.
12238
12239         (Expression.ConvertExplicit): One codepath could return
12240         errors but not flag them.  Fix this.  Fixes #31853
12241
12242         * parameter.cs (Resolve): Do not allow void as a parameter type.
12243
12244 2002-10-06  Martin Baulig  <martin@gnome.org>
12245
12246         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12247         if it's a class type and not a struct.  Fixes #31815.
12248
12249 2002-10-06  Martin Baulig  <martin@gnome.org>
12250
12251         * statement.cs: Reworked the flow analysis code a bit to make it
12252         usable for dead code elimination.
12253
12254 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12255
12256         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12257
12258 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12259
12260         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12261         to fix the test 165, will investigate deeper.
12262
12263 2002-10-04  Martin Baulig  <martin@gnome.org>
12264
12265         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12266         finally blocks actually work.
12267         (Try.Resolve): We don't need to create a sibling for `finally' if
12268         there is no finally block.
12269
12270 2002-10-04  Martin Baulig  <martin@gnome.org>
12271
12272         * class.cs (Constructor.Define): The default accessibility for a
12273         non-default constructor is private, not public.
12274
12275 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12276
12277         * class.cs (Constructor): Make AllowedModifiers public, add
12278         EXTERN.
12279
12280         * cs-parser.jay: Perform the modifiers test here, as the
12281         constructor for the Constructor class usually receives a zero
12282         because of the way we create it (first we create, later we
12283         customize, and we were never checking the modifiers).
12284
12285         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12286         is a version of LookupTypeReflection that includes the type-name
12287         cache.  This can be used as a fast path for functions that know
12288         the fully qualified name and are only calling into *.GetType() to
12289         obtain a composed type.
12290
12291         This is also used by TypeManager.LookupType during its type
12292         composition.
12293
12294         (LookupType): We now also track the real type name, as sometimes
12295         we can get a quey for the real type name from things like
12296         ComposedCast.  This fixes bug 31422.
12297
12298         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12299         complete type fullname, it does not have to go through the type
12300         resolution system to obtain the composed version of the type (for
12301         obtaining arrays or pointers).
12302
12303         (Conditional.Emit): Use the EmitBoolExpression to
12304         generate nicer code, as requested by Paolo.
12305
12306         (ArrayCreation.CheckIndices): Use the patch from
12307         hwang_rob@yahoo.ca to validate the array initializers. 
12308
12309 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12310
12311         * class.cs (ConstructorInitializer.Emit): simplify code by using
12312         Invocation.EmitCall, and at the same time, fix the bugs in calling
12313         parent constructors that took variable arguments. 
12314
12315         * ecore.cs (Expression.ConvertNumericExplicit,
12316         Expression.ImplicitNumericConversion): Remove the code that
12317         manually wrapped decimal (InternalTypeConstructor call is now gone
12318         as well).
12319
12320         * expression.cs (Cast.TryReduce): Also handle decimal types when
12321         trying to perform a constant fold on the type.
12322
12323         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12324
12325         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12326         that only turned off an error report, and did nothing else. 
12327
12328 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12329
12330         * driver.cs: Handle and ignore /fullpaths
12331
12332 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12333
12334         * expression.cs (Binary.ResolveOperator): Catch the case where
12335         DoNumericPromotions returns true, 
12336
12337         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12338
12339 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12340
12341         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12342         report error 70.
12343
12344 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12345
12346         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12347         conversion exists, but it is also required that the conversion be
12348         performed.  This manifested in "(Type64Enum) 2".  
12349
12350         * class.cs (TypeManager.AddMethod): The fix is not to change
12351         AddEnum, because that one was using a fully qualified name (every
12352         DeclSpace derivative does), but to change the AddMethod routine
12353         that was using an un-namespaced name.  This now correctly reports
12354         the duplicated name.
12355
12356         Revert patch until I can properly fix it.  The issue
12357         is that we have a shared Type space across all namespaces
12358         currently, which is wrong.
12359
12360         Options include making the Namespace a DeclSpace, and merge
12361         current_namespace/current_container in the parser.
12362
12363 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12364
12365         * cs-parser.jay: Improve error reporting when we get a different
12366         kind of expression in local_variable_type and
12367         local_variable_pointer_type. 
12368
12369         Propagate this to avoid missleading errors being reported.
12370
12371         * ecore.cs (ImplicitReferenceConversion): treat
12372         TypeManager.value_type as a target just like object_type.   As
12373         code like this:
12374
12375         ValueType v = 1;
12376
12377         Is valid, and needs to result in the int 1 being boxed before it
12378         is assigned to the value type v.
12379
12380         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12381         to validate the enumeration name.
12382
12383         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12384         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12385         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12386
12387         * ecore.cs (TryImplicitIntConversion): When doing an
12388         implicit-enumeration-conversion, check if the type is 64-bits and
12389         perform a conversion before passing to EnumConstant.
12390
12391 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12392
12393         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12394         report ambiguous type references.  Unlike the MS version, we
12395         report what the ambiguity is.   Innovation at work ;-)
12396
12397         (DeclSpace.FindType): Require a location argument to
12398         display when we display an ambiguous error.
12399
12400         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12401
12402         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12403
12404         * expression.cs (EmitDynamicInitializers): Apply patch from
12405         hwang_rob@yahoo.ca that fixes the order in which we emit our
12406         initializers. 
12407
12408 2002-09-21  Martin Baulig  <martin@gnome.org>
12409
12410         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12411         delegate takes no arguments.
12412
12413 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12414
12415         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12416         from integers.
12417
12418         * expression.cs: Extract the underlying type.
12419
12420         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12421
12422         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12423
12424 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12425
12426         * class.cs (TypeContainer.DefineType): We can not use the nice
12427         PackingSize with the size set to 1 DefineType method, because it
12428         will not allow us to define the interfaces that the struct
12429         implements.
12430
12431         This completes the fixing of bug 27287
12432
12433         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12434         means also structs.  This fixes part of the problem. 
12435         (Expresion.ImplicitReferenceConversionExists): ditto.
12436
12437         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12438         error if there were no errors reported during the type lookup
12439         process, to avoid duplicates or redundant errors.  Without this
12440         you would get an ambiguous errors plus a type not found.  We have
12441         beaten the user enough with the first error.  
12442
12443         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12444         reference. 
12445
12446         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12447         during the resolution process, stop the lookup, this avoids
12448         repeated error reports (same error twice).
12449
12450         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12451
12452         * typemanager.cs (LookupType): Redo the type lookup code to match
12453         the needs of System.Reflection.  
12454
12455         The issue is that System.Reflection requires references to nested
12456         types to begin with a "+" sign instead of a dot.  So toplevel
12457         types look like: "NameSpace.TopLevelClass", and nested ones look
12458         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12459         levels. 
12460
12461 2002-09-19  Martin Baulig  <martin@gnome.org>
12462
12463         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12464         says that a method always returns or always throws an exception,
12465         don't report the CS0161.
12466
12467         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12468         set `Returns = new_returns'.
12469
12470 2002-09-19  Martin Baulig  <martin@gnome.org>
12471
12472         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12473         to an enum constant, check for a CS0176.
12474
12475 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12476
12477         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12478         for operators that must be in pairs and report errors.
12479
12480         * ecore.cs (SimpleName.DoResolveType): During the initial type
12481         resolution process, when we define types recursively, we must
12482         check first for types in our current scope before we perform
12483         lookups in the enclosing scopes.
12484
12485         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12486
12487         (Invocation.VerifyArgumentsCompat): Call
12488         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12489         I thought we were supposed to always call this, but there are a
12490         few places in the code where we dont do it.
12491
12492 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12493
12494         * driver.cs: Add support in -linkres and -resource to specify the
12495         name of the identifier.
12496
12497 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12498
12499         * ecore.cs (StandardConversionExists): Sync with the conversion
12500         code: allow anything-* to void* conversions.
12501
12502         (FindMostSpecificSource): Use an Expression argument
12503         instead of a Type, because we might be handed over a Literal which
12504         gets a few more implicit conversions that plain types do not.  So
12505         this information was being lost.
12506
12507         Also, we drop the temporary type-holder expression when not
12508         required.
12509
12510 2002-09-17  Martin Baulig  <martin@gnome.org>
12511
12512         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12513         this is an explicit interface implementation.
12514
12515 2002-09-17  Martin Baulig  <martin@gnome.org>
12516
12517         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12518         different `IndexerName' attributes.
12519
12520         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12521         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12522         virtual CommonResolve().
12523
12524 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12525
12526         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12527         and convert that to the UnderlyingType.
12528
12529         * statement.cs (Foreach.Resolve): Indexers are just like variables
12530         or PropertyAccesses.
12531
12532         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12533         inside quoted strings, we were not doing this before.
12534
12535 2002-09-16  Martin Baulig  <martin@gnome.org>
12536
12537         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12538         resolve it.  This is needed for the definite assignment check of the
12539         instance expression, fixes bug #29846.
12540         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12541
12542 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12543
12544         * parameter.cs: Fix compile error.  Cannot reference static member
12545         from an instance object.  Is this an mcs bug?
12546
12547 2002-09-14  Martin Baulig  <martin@gnome.org>
12548
12549         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12550         multiple times.  Fixes bug #30295, added test-166.cs.
12551
12552 2002-09-14  Martin Baulig  <martin@gnome.org>
12553
12554         * statement.cs (Block.Emit): Don't emit unreachable code.
12555         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12556         `break' statements.
12557         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12558
12559 2002-09-14  Martin Baulig  <martin@gnome.org>
12560
12561         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12562         is set.
12563
12564 2002-09-14  Martin Baulig  <martin@gnome.org>
12565
12566         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12567         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12568         be false on the ms runtime.
12569
12570 2002-09-13  Martin Baulig  <martin@gnome.org>
12571
12572         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12573         the CS0038 error message.
12574
12575 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12576
12577         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12578         constant inside, return it.
12579
12580 2002-09-12  Martin Baulig  <martin@gnome.org>
12581
12582         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12583         implicit conversion can be done between enum types.
12584
12585         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12586         check whether an implicit conversion to the current enum's UnderlyingType
12587         exists and report an error if not.
12588
12589         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12590         without debugging support.
12591
12592         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12593         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12594
12595 2002-09-12  Martin Baulig  <martin@gnome.org>
12596
12597         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12598
12599         * ecore.cs (IMemberExpr.DeclaringType): New property.
12600         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12601         nonstatic member of an outer type (CS0038).
12602
12603 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12604
12605         * driver.cs: Activate the using-error detector at warning level
12606         4 (at least for MS-compatible APIs).
12607
12608         * namespace.cs (VerifyUsing): Small buglett fix.
12609
12610         * pending.cs (PendingImplementation): pass the container pointer. 
12611
12612         * interface.cs (GetMethods): Allow for recursive definition.  Long
12613         term, I would like to move every type to support recursive
12614         definitions, not the current ordering mechanism that we have right
12615         now.
12616
12617         The situation is this: Attributes are handled before interfaces,
12618         so we can apply attributes to interfaces.  But some attributes
12619         implement interfaces, we will now handle the simple cases
12620         (recursive definitions will just get an error).  
12621
12622         * parameter.cs: Only invalidate types at the end if we fail to
12623         lookup all types.  
12624
12625 2002-09-09  Martin Baulig  <martin@gnome.org>
12626
12627         * ecore.cs (PropertyExpr.Emit): Also check for
12628         TypeManager.system_int_array_get_length so this'll also work when
12629         compiling corlib.  Fixes #30003.
12630
12631 2002-09-09  Martin Baulig  <martin@gnome.org>
12632
12633         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12634         and throw an exception if we can't get the type's size.  Fixed #30040,
12635         added test-165.cs.
12636
12637 2002-09-09  Martin Baulig  <martin@gnome.org>
12638
12639         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12640
12641         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12642         context.  Fixes bug #30027.
12643
12644         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12645         virtual functions.  Fixes bug #30043, added test-164.cs.
12646
12647 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12648
12649         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12650
12651 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12652
12653         * driver.cs: Use an object to get the windows codepage since it's not a
12654         static property.
12655
12656 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12657
12658         * statement.cs (For.Emit): for infinite loops (test == null)
12659         return whether there is a break inside, not always "true".
12660
12661         * namespace.cs (UsingEntry): New struct to hold the name of the
12662         using definition, the location where it is defined, and whether it
12663         has been used in a successful type lookup.
12664
12665         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12666         strings.
12667
12668         * decl.cs: ditto.
12669
12670 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12671
12672         * attribute.cs : Fix incorrect code which relied on catching
12673         a NullReferenceException to detect a null being passed in
12674         where an object was expected.
12675
12676 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12677
12678         * statement.cs (Try): flag the catch variable as assigned
12679
12680         * expression.cs (Cast): Simplified by using ResolveType instead of
12681         manually resolving.
12682
12683         * statement.cs (Catch): Fix bug by using ResolveType.
12684
12685 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12686
12687         * expression.cs (BetterConversion): Special case for when we have
12688         a NullLiteral as the argument and we have to choose between string
12689         and object types - we choose string the way csc does.
12690
12691         * attribute.cs (Attribute.Resolve): Catch the
12692         NullReferenceException and report error #182 since the Mono
12693         runtime no more has the bug and having this exception raised means
12694         we tried to select a constructor which takes an object and is
12695         passed a null.
12696
12697 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12698
12699         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12700         message (1502, 1503) when we can't locate a method after overload
12701         resolution. This is much more informative and closes the bug
12702         Miguel reported.
12703
12704         * interface.cs (PopulateMethod): Return if there are no argument
12705         types. Fixes a NullReferenceException bug.
12706
12707         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12708         expressions too. Previously we were checking only in one place for
12709         positional arguments leaving out named arguments.
12710
12711         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12712         type to the enum type is not allowed. Remove code corresponding to
12713         that.
12714
12715         (ConvertNumericExplicit): Allow explicit conversions from
12716         the underlying type to enum type. This precisely follows the spec
12717         and closes a bug filed by Gonzalo.
12718
12719 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12720
12721         * compiler.csproj:
12722         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12723
12724 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12725
12726         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12727         it was important that we stored the right value after the
12728         reduction in `converted'.
12729
12730 2002-09-04  Martin Baulig  <martin@gnome.org>
12731
12732         * location.cs (Location.SymbolDocument): Use full pathnames for the
12733         source files.
12734
12735 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12736
12737         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12738         of the expression resolve mechanism, because that will catch the
12739         SimpleName error failures.
12740
12741         (Conditional): If we can not resolve the
12742         expression, return, do not crash.
12743
12744 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12745
12746         * cs-tokenizer.cs:
12747         (location): display token name instead of its number.
12748
12749 2002-08-28  Martin Baulig  <martin@gnome.org>
12750
12751         * expression.cs (Binary.ResolveOperator): Don't silently return
12752         but return an error if an operator cannot be applied between two
12753         enum types.
12754
12755 2002-08-28  Martin Baulig  <martin@gnome.org>
12756
12757         * class.cs (Constructor.Define): Set the permission attributes
12758         correctly instead of making all constructors public.
12759
12760 2002-08-28  Martin Baulig  <martin@gnome.org>
12761
12762         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12763         for private members before reporting a CS0103; if we find anything,
12764         it's a CS0122.
12765
12766 2002-08-28  Martin Baulig  <martin@gnome.org>
12767
12768         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12769         to check whether `closure_start_type == closure_invocation_type',
12770         we also need to check whether `m.DeclaringType == closure_invocation_type'
12771         before bypassing the permission checks.  We might be accessing
12772         protected/private members from the base class.
12773         (TypeManager.RealMemberLookup): Only set private_ok if private
12774         members were requested via BindingFlags.NonPublic.
12775
12776         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12777
12778         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12779         MethodGroupExpr.IsExplicitImpl if appropriate.
12780         (Invocation.DoResolve): Don't report the CS0120 for explicit
12781         interface implementations.
12782
12783 2002-08-27  Martin Baulig  <martin@gnome.org>
12784
12785         * expression.cs (Invocation.DoResolve): If this is a static
12786         method and we don't have an InstanceExpression, we must report
12787         a CS0120.
12788
12789 2002-08-25  Martin Baulig  <martin@gnome.org>
12790
12791         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12792         `==' between a valuetype and an object.
12793
12794 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12795
12796         * ecore.cs (TypeExpr): Provide a ToString method.
12797
12798 2002-08-24  Martin Baulig  <martin@gnome.org>
12799
12800         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12801         now called proggie.dbg and it's a binary file.
12802
12803 2002-08-23  Martin Baulig  <martin@gnome.org>
12804
12805         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12806
12807 2002-08-23  Martin Baulig  <martin@gnome.org>
12808
12809         * struct.cs (MyStructInfo.ctor): Make this work with empty
12810         structs; it's not allowed to use foreach() on null.
12811
12812 2002-08-23  Martin Baulig  <martin@gnome.org>
12813
12814         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12815         writer the full pathname of the generated assembly.
12816
12817 2002-08-23  Martin Baulig  <martin@gnome.org>
12818
12819         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12820         A `finally' block never returns or breaks; improved handling of
12821         unreachable code.
12822
12823 2002-08-23  Martin Baulig  <martin@gnome.org>
12824
12825         * statement.cs (Throw.Resolve): Allow `throw null'.
12826
12827 2002-08-23  Martin Baulig  <martin@gnome.org>
12828
12829         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12830         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12831         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12832         MemberLookup would return a wrong event if this is an explicit
12833         interface implementation and the class has an event with the same
12834         name.
12835
12836 2002-08-23  Martin Baulig  <martin@gnome.org>
12837
12838         * statement.cs (Block.AddChildVariableNames): New public method.
12839         (Block.AddChildVariableName): Likewise.
12840         (Block.IsVariableNameUsedInChildBlock): Likewise.
12841         (Block.AddVariable): Check whether a variable name has already
12842         been used in a child block.
12843
12844         * cs-parser.jay (declare_local_variables): Mark all variable names
12845         from the current block as being used in a child block in the
12846         implicit block.
12847
12848 2002-08-23  Martin Baulig  <martin@gnome.org>
12849
12850         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12851         find the symbol writer.
12852
12853         * driver.cs: csc also allows the arguments to /define being
12854         separated by commas, not only by semicolons.
12855
12856 2002-08-23  Martin Baulig  <martin@gnome.org>
12857
12858         * interface.cs (Interface.GetMembers): Added static check for events.
12859
12860 2002-08-15  Martin Baulig  <martin@gnome.org>
12861
12862         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12863         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12864
12865         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12866         why the MethodData.EmitDestructor() change was necessary.
12867
12868 2002-08-20  Martin Baulig  <martin@gnome.org>
12869
12870         * class.cs (TypeContainer.FindMembers): Added static check for events.
12871
12872         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12873
12874         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12875         use Type.GetEvents(), not Type.FindMembers().
12876
12877 2002-08-20  Martin Baulig  <martin@gnome.org>
12878
12879         * decl.cs (MemberCache): Added a special method cache which will
12880         be used for method-only searched.  This ensures that a method
12881         search will return a MethodInfo with the correct ReflectedType for
12882         inherited methods.      
12883
12884 2002-08-20  Martin Baulig  <martin@gnome.org>
12885
12886         * decl.cs (DeclSpace.FindMembers): Made this public.
12887
12888 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12889
12890         * delegate.cs: fixed build on windows.
12891         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12892
12893 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12894
12895         * ecore.cs (StandardConversionExists): Return a false
12896         if we are trying to convert the void type to anything else
12897         since that is not allowed.
12898
12899         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12900         we flag error 70 in the event an event is trying to be accessed
12901         directly from outside the declaring type.
12902
12903 2002-08-20  Martin Baulig  <martin@gnome.org>
12904
12905         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12906         MemberCache from typemanager.cs to decl.cs.
12907
12908 2002-08-19  Martin Baulig  <martin@gnome.org>
12909
12910         * class.cs (TypeContainer): Implement IMemberContainer.
12911         (TypeContainer.DefineMembers): Create the MemberCache.
12912         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12913         return public members if BindingFlags.Public was given, check
12914         whether members are static.
12915
12916 2002-08-16  Martin Baulig  <martin@gnome.org>
12917
12918         * decl.cs (DeclSpace.Define): Splitted this in Define and
12919         DefineMembers.  DefineMembers is called first and initializes the
12920         MemberCache.
12921
12922         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12923         DefineMembers() on all our DeclSpaces.
12924
12925         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12926         but call DefineMembers() on all nested interfaces.  We call their
12927         Define() in our new Define() function.
12928
12929         * interface.cs (Interface): Implement IMemberContainer.
12930         (Interface.Define): Moved all code except the attribute stuf to
12931         DefineMembers().
12932         (Interface.DefineMembers): Initialize the member cache.
12933
12934         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12935         need this anymore since we can use MemberCache.FindMembers directly.
12936
12937 2002-08-19  Martin Baulig  <martin@gnome.org>
12938
12939         * typemanager.cs (MemberCache): When creating the cache for an
12940         interface type, add all inherited members.
12941         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12942         to `out bool used_cache' and documented it.
12943         (TypeManager.MemberLookup): If we already used the cache in the first
12944         iteration, we don't need to do the interfaces check.
12945
12946 2002-08-19  Martin Baulig  <martin@gnome.org>
12947
12948         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12949         here from IMemberFinder and don't implement this interface anymore.
12950         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12951
12952         * typemanager.cs (IMemberFinder): This interface is now only used by
12953         classes which actually support the member cache.
12954         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12955         since we only put DeclSpaces into this Hashtable.
12956         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12957         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12958
12959 2002-08-16  Martin Baulig  <martin@gnome.org>
12960
12961         * typemanager.cs (ICachingMemberFinder): Removed.
12962         (IMemberFinder.MemberCache): New property.
12963         (TypeManager.FindMembers): Merged this with RealFindMembers().
12964         This function will never be called from TypeManager.MemberLookup()
12965         so we can't use the cache here, just the IMemberFinder.
12966         (TypeManager.MemberLookup_FindMembers): Check whether the
12967         IMemberFinder has a MemberCache and call the cache's FindMembers
12968         function.
12969         (MemberCache): Rewrote larger parts of this yet another time and
12970         cleaned it up a bit.
12971
12972 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12973
12974         * driver.cs (LoadArgs): Support quoting.
12975
12976         (Usage): Show the CSC-like command line arguments.
12977
12978         Improved a few error messages.
12979
12980 2002-08-15  Martin Baulig  <martin@gnome.org>
12981
12982         * typemanager.cs (IMemberContainer.Type): New property.
12983         (IMemberContainer.IsInterface): New property.
12984
12985         The following changes are conditional to BROKEN_RUNTIME, which is
12986         defined at the top of the file.
12987
12988         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12989         class'es members, but add all members from TypeHandle.ObjectType
12990         if we're an interface.
12991         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12992         is the current type.
12993         (MemberCache.CacheEntry.Container): Removed this field.
12994         (TypeHandle.GetMembers): Include inherited members.
12995
12996 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12997
12998         * typemanager.cs: fixed compilation and added a comment on a field that
12999         is never used.
13000
13001 2002-08-15  Martin Baulig  <martin@gnome.org>
13002
13003         * class.cs (ConstructorInitializer.Resolve): In the
13004         Expression.MemberLookup call, use the queried_type as
13005         invocation_type.
13006
13007         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13008         declared' attribute, it's always true.
13009         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13010         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13011         temporary wrapper for FindMembers which tells MemberLookup whether
13012         members from the base classes are included in the return value.
13013         This will go away soon.
13014         (TypeManager.MemberLookup): Use this temporary hack here; once the
13015         new MemberCache is completed, we don't need to do the DeclaredOnly
13016         looping here anymore since the MemberCache will take care of this.
13017         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13018         (MemberCache): When creating the MemberCache for a class, get
13019         members from the current class and all its base classes.
13020         (MemberCache.CacheEntry.Container): New field.  This is a
13021         temporary hack until the Mono runtime is fixed to distinguish
13022         between ReflectedType and DeclaringType.  It allows us to use MCS
13023         with both the MS runtime and the unfixed Mono runtime without
13024         problems and without accecting performance.
13025         (MemberCache.SearchMembers): The DeclaredOnly looping from
13026         TypeManager.MemberLookup is now done here.      
13027
13028 2002-08-14  Martin Baulig  <martin@gnome.org>
13029
13030         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13031         Type.GetFields on dynamic types but get the fields from the
13032         corresponding TypeContainer.
13033         (MyStructInfo.GetStructInfo): Added check for enum types.
13034
13035         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13036         (MemberList.SyncRoot): Implemented.
13037         (TypeManager.FilterWithClosure): No need to check permissions if
13038         closure_start_type == closure_invocation_type, don't crash if
13039         closure_invocation_type is null.
13040
13041 2002-08-13  Martin Baulig  <martin@gnome.org>
13042
13043         Rewrote TypeContainer.FindMembers to use a member cache.  This
13044         gives us a speed increase of about 35% for the self-hosting MCS
13045         build and of about 15-20% for the class libs (both on GNU/Linux).
13046
13047         * report.cs (Timer): New class to get enhanced profiling.  This
13048         whole class is "TIMER" conditional since it remarkably slows down
13049         compilation speed.
13050
13051         * class.cs (MemberList): New class.  This is an IList wrapper
13052         which we're now using instead of passing MemberInfo[]'s around to
13053         avoid copying this array unnecessarily.
13054         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13055         (ICachingMemberFinder, IMemberContainer): New interface.
13056         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13057         has already been checked, otherwise use it for the name comparision.
13058         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13059         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13060         if possible.  Returns a MemberList, not a MemberInfo [].
13061         (TypeHandle): New class, implements IMemberContainer.  We create
13062         one instance of this class per type, it contains a MemberCache
13063         which is used to do the member lookups.
13064         (MemberCache): New class.  Each instance of this class contains
13065         all members of a type and a name-based hash table.
13066         (MemberCache.FindMembers): This is our new member lookup
13067         function.  First, it looks up all members of the requested name in
13068         the hash table.  Then, it walks this list and sorts out all
13069         applicable members and returns them.
13070
13071 2002-08-13  Martin Baulig  <martin@gnome.org>
13072
13073         In addition to a nice code cleanup, this gives us a performance
13074         increase of about 1.4% on GNU/Linux - not much, but it's already
13075         half a second for the self-hosting MCS compilation.
13076
13077         * typemanager.cs (IMemberFinder): New interface.  It is used by
13078         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13079         Enum, Delegate or Interface.
13080         (TypeManager.finder_to_member_finder): New PtrHashtable.
13081         (TypeManager.finder_to_container): Removed.
13082         (TypeManager.finder_to_delegate): Removed.
13083         (TypeManager.finder_to_interface): Removed.
13084         (TypeManager.finder_to_enum): Removed.
13085
13086         * interface.cs (Interface): Implement IMemberFinder.
13087
13088         * delegate.cs (Delegate): Implement IMemberFinder.
13089
13090         * enum.cs (Enum): Implement IMemberFinder.
13091
13092         * class.cs (TypeContainer): Implement IMemberFinder.
13093
13094 2002-08-12  Martin Baulig  <martin@gnome.org>
13095
13096         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13097
13098 2002-08-12  Martin Baulig  <martin@gnome.org>
13099
13100         * ecore.cs (ITypeExpression): New interface for expressions which
13101         resolve to a type.
13102         (TypeExpression): Renamed to TypeLookupExpression.
13103         (Expression.DoResolve): If we're doing a types-only lookup, the
13104         expression must implement the ITypeExpression interface and we
13105         call DoResolveType() on it.
13106         (SimpleName): Implement the new ITypeExpression interface.
13107         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13108         hack, the situation that we're only looking up types can't happen
13109         anymore when this method is called.  Moved the type lookup code to
13110         DoResolveType() and call it.
13111         (SimpleName.DoResolveType): This ITypeExpression interface method
13112         is now doing the types-only lookup.
13113         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13114         (ResolveFlags): Added MaskExprClass.
13115
13116         * expression.cs (MemberAccess): Implement the ITypeExpression
13117         interface.
13118         (MemberAccess.DoResolve): Added support for a types-only lookup
13119         when we're called via ITypeExpression.DoResolveType().
13120         (ComposedCast): Implement the ITypeExpression interface.
13121
13122         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13123         Expression.Resolve() with ResolveFlags.Type instead.
13124
13125 2002-08-12  Martin Baulig  <martin@gnome.org>
13126
13127         * interface.cs (Interface.Define): Apply attributes.
13128
13129         * attribute.cs (Attribute.ApplyAttributes): Added support for
13130         interface attributes.
13131
13132 2002-08-11  Martin Baulig  <martin@gnome.org>
13133
13134         * statement.cs (Block.Emit): Only check the "this" variable if we
13135         do not always throw an exception.
13136
13137         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13138         whether the property has a set accessor.
13139
13140 2002-08-11  Martin Baulig  <martin@gnome.org>
13141
13142         Added control flow analysis support for structs.
13143
13144         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13145         with control flow analysis turned off.
13146         (IVariable): New interface.
13147         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13148         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13149         (FieldExpr.DoResolve): Resolve the instance expression with flow
13150         analysis turned off and do the definite assignment check after the
13151         resolving when we know what the expression will resolve to.
13152
13153         * expression.cs (LocalVariableReference, ParameterReference):
13154         Implement the new IVariable interface, only call the flow analysis
13155         code if ec.DoFlowAnalysis is true.
13156         (This): Added constructor which takes a Block argument.  Implement
13157         the new IVariable interface.
13158         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13159         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13160         This does the definite assignment checks for struct members.
13161
13162         * class.cs (Constructor.Emit): If this is a non-static `struct'
13163         constructor which doesn't have any initializer, call
13164         Block.AddThisVariable() to tell the flow analysis code that all
13165         struct elements must be initialized before control returns from
13166         the constructor.
13167
13168         * statement.cs (MyStructInfo): New public class.
13169         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13170         argument to this indexer.  If non-zero, check an individual struct
13171         member, not the whole struct.
13172         (FlowBranching.CheckOutParameters): Check struct members.
13173         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13174         overloaded versions of these methods which take an additional
13175         `int field_idx' argument to check struct members.
13176         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13177         overloaded versions of these methods which take an additional
13178         `string field_name' argument to check struct member.s
13179         (VariableInfo): Implement the IVariable interface.
13180         (VariableInfo.StructInfo): New public property.  Returns the
13181         MyStructInfo instance of the variable if it's a struct or null.
13182         (Block.AddThisVariable): New public method.  This is called from
13183         Constructor.Emit() for non-static `struct' constructor which do
13184         not have any initializer.  It creates a special variable for the
13185         "this" instance variable which will be checked by the flow
13186         analysis code to ensure that all of the struct's fields are
13187         initialized before control returns from the constructor.
13188         (UsageVector): Added support for struct members.  If a
13189         variable/parameter is a struct with N members, we reserve a slot
13190         in the usage vector for each member.  A struct is considered fully
13191         initialized if either the struct itself (slot 0) or all its
13192         members are initialized.
13193
13194 2002-08-08  Martin Baulig  <martin@gnome.org>
13195
13196         * driver.cs (Driver.MainDriver): Only report an error CS5001
13197         if there were no compilation errors.
13198
13199         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13200         `UnsafeContext' property to determine whether the parent is in
13201         unsafe context rather than checking the parent's ModFlags:
13202         classes nested in an unsafe class are unsafe as well.
13203
13204 2002-08-08  Martin Baulig  <martin@gnome.org>
13205
13206         * statement.cs (UsageVector.MergeChildren): Distinguish between
13207         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13208         we return.  Added test17() and test18() to test-154.cs.
13209
13210 2002-08-08  Martin Baulig  <martin@gnome.org>
13211
13212         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13213         Family access, make sure the invoking type isn't a subclass of the
13214         queried type (that'd be a CS1540).
13215
13216         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13217         this method which takes an additional `Type invocation_type'.
13218
13219         * expression.cs (BaseAccess.DoResolve): Use the base type as
13220         invocation and query type.
13221         (MemberAccess.DoResolve): If the lookup failed and we're about to
13222         report a CS0122, try a lookup with the ec.ContainerType - if this
13223         succeeds, we must report a CS1540.
13224
13225 2002-08-08  Martin Baulig  <martin@gnome.org>
13226
13227         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13228         (MethodGroupExpr): Implement the IMemberExpr interface.
13229
13230         * expression (MemberAccess.ResolveMemberAccess): No need to have
13231         any special code for MethodGroupExprs anymore, they're now
13232         IMemberExprs.   
13233
13234 2002-08-08  Martin Baulig  <martin@gnome.org>
13235
13236         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13237         Family, FamANDAssem and FamORAssem permissions.
13238         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13239
13240 2002-08-08  Martin Baulig  <martin@gnome.org>
13241
13242         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13243         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13244         or loop block.
13245
13246 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13247
13248         * driver.cs: implemented /resource option to embed managed resources.
13249
13250 2002-08-07  Martin Baulig  <martin@gnome.org>
13251
13252         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13253         (FieldBase.HasFieldInitializer): New public property.
13254         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13255         returns the field initializer and makes sure it is only resolved once.
13256         (TypeContainer.EmitFieldInitializers): Call
13257         FieldBase.GetInitializerExpression to get the initializer, this ensures
13258         that it isn't resolved multiple times.
13259
13260         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13261         the resolving process (SimpleName/MemberLookup) that we're currently
13262         emitting a field initializer (which must not access any instance members,
13263         this is an error CS0236).
13264
13265         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13266         argument, if the `IsFieldInitializer' flag is set, we must report and
13267         error CS0236 and not an error CS0120.   
13268
13269 2002-08-07  Martin Baulig  <martin@gnome.org>
13270
13271         * ecore.cs (IMemberExpr): New public interface.
13272         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13273         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13274         if the expression is an IMemberExpr.
13275
13276         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13277         to be null, implicitly default to `this' if we're non-static in
13278         this case.  Simplified the code a lot by using the new IMemberExpr
13279         interface.  Also fixed bug #28176 here.
13280
13281 2002-08-06  Martin Baulig  <martin@gnome.org>
13282
13283         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13284         ParameterReferences during semantic analysis so that we can do a
13285         type-only search when resolving Cast, TypeOf and SizeOf.
13286         (block): Pass the `current_local_parameters' to the Block's
13287         constructor.
13288
13289         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13290         argument to the constructor.
13291         (ConstructorInitializer.Resolve): Create a temporary implicit
13292         block with the parameters.
13293
13294         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13295         references here if we aren't doing a type-only search.
13296
13297         * statement.cs (Block): Added constructor which takes a
13298         `Parameters parameters' argument.
13299         (Block.Parameters): New public property.
13300
13301         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13302         to `Parameters' and made it public readonly.
13303
13304 2002-08-06  Martin Baulig  <martin@gnome.org>
13305
13306         * ecore.cs (Expression.Warning): Made this public as well.
13307
13308         * report.cs (Report.Debug): Print the contents of collections.
13309
13310 2002-08-06  Martin Baulig  <martin@gnome.org>
13311
13312         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13313         used to tell Resolve() which kinds of expressions it may return.
13314         (Expression.Resolve): Added overloaded version of this method which
13315         takes a `ResolveFlags flags' argument.  This can be used to tell
13316         Resolve() which kinds of expressions it may return.  Reports a
13317         CS0118 on error.
13318         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13319         ResolveFlags.SimpleName.
13320         (Expression.Error118): Added overloaded version of this method which
13321         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13322         which kinds of expressions are allowed.
13323
13324         * expression.cs (Argument.ResolveMethodGroup): New public method.
13325         Resolves an argument, but allows a MethodGroup to be returned.
13326         This is used when invoking a delegate.
13327
13328         * TODO: Updated a bit.
13329
13330 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13331
13332         Fixed compilation with csc.
13333
13334         * ecore.cs: Expression.Error made public. Is this correct? Should
13335         Warning be made public too?
13336
13337         * expression.cs: use ea.Location instead of ea.loc.
13338         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13339
13340 2002-08-06  Martin Baulig  <martin@gnome.org>
13341
13342         * ecore.cs (Expression.loc): Moved the location here instead of
13343         duplicating it in all derived classes.
13344         (Expression.Location): New public property.
13345         (Expression.Error, Expression.Warning): Made them non-static and
13346         removed the location argument.
13347         (Expression.Warning): Added overloaded version which takes an
13348         `int level' argument.
13349         (Expression.Error118): Make this non-static and removed the
13350         expression and location arguments.
13351         (TypeExpr): Added location argument to the constructor.
13352
13353         * expression.cs (StaticCallExpr): Added location argument to
13354         the constructor.
13355         (Indirection, PointerArithmetic): Likewise.
13356         (CheckedExpr, UnCheckedExpr): Likewise.
13357         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13358         (StringPtr): Likewise.
13359
13360
13361 2002-08-05  Martin Baulig  <martin@gnome.org>
13362
13363         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13364
13365         * assign.cs (Assign.DoResolve): Check whether the source
13366         expression is a value or variable.
13367
13368         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13369         while resolving the corresponding blocks.
13370
13371         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13372         an error, don't silently return null.
13373
13374         * statement.cs (Block.AddVariable): Do the error reporting here
13375         and distinguish between CS0128 and CS0136.
13376         (Block.DoResolve): Report all unused labels (warning CS0164).
13377         (LabeledStatement): Pass the location to the constructor.
13378         (LabeledStatement.HasBeenReferenced): New property.
13379         (LabeledStatement.Resolve): Set it to true here.
13380
13381         * statement.cs (Return.Emit): Return success even after reporting
13382         a type mismatch error (CS0126 or CS0127), this is what csc does and
13383         it avoids confusing the users with any consecutive errors.
13384
13385 2002-08-05  Martin Baulig  <martin@gnome.org>
13386
13387         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13388
13389         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13390
13391         * expression.cs (MemberAccess.DoResolve): Silently return if an
13392         error has already been reported.
13393
13394         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13395         error has already been reported.
13396
13397 2002-08-05  Martin Baulig  <martin@gnome.org>
13398
13399         * statement.cs (UsageVector): Only initialize the `parameters'
13400         vector if we actually have any "out" parameters.
13401
13402 2002-08-05  Martin Baulig  <martin@gnome.org>
13403
13404         * expression.cs (Binary.ResolveOperator): When combining delegates,
13405         they must have the same type.
13406
13407 2002-08-05  Martin Baulig  <martin@gnome.org>
13408
13409         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13410         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13411         work with the ms runtime and we also don't need it: if we're a
13412         PropertyBuilder and not in the `indexer_arguments' hash, then we
13413         are a property and not an indexer.
13414
13415         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13416         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13417         since the latter one doesn't work with the ms runtime.
13418
13419 2002-08-03  Martin Baulig  <martin@gnome.org>
13420
13421         Fixed bugs #27998 and #22735.
13422
13423         * class.cs (Method.IsOperator): New public field.
13424         (Method.CheckBase): Report CS0111 if there's already a method
13425         with the same parameters in the current class.  Report CS0508 when
13426         attempting to change the return type of an inherited method.
13427         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13428         and it's not marked abstract or extern.
13429         (PropertyBase): New abstract base class for Property and Indexer.
13430         (PropertyBase.CheckBase): Moved here from Property and made it work
13431         for indexers.
13432         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13433         the same so we can reuse it there.
13434         (Property, Indexer): Derive from PropertyBase.
13435         (MethodSignature.inheritable_property_signature_filter): New delegate
13436         to find properties and indexers.
13437
13438         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13439         argument and improved error reporting.
13440
13441         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13442         EmptyReadOnlyParameters and made it a property.
13443
13444         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13445         version of this method which takes a `PropertyInfo indexer'.
13446         (TypeManager.RegisterIndexer): New method.
13447
13448         * class.cs: Added myself as author of this file :-)
13449
13450 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13451
13452         * class.cs: fixed compilation on windoze.
13453
13454 2002-08-03  Martin Baulig  <martin@gnome.org>
13455
13456         * interface.cs (Interface.GetInterfaceBases): Check whether all
13457         base interfaces are at least as accessible than the current one.
13458
13459         * class.cs (TypeContainer.GetClassBases): Check whether base types
13460         are at least as accessible than the current type.
13461         (TypeContainer.AsAccessible): Implemented and made non-static.
13462         (MemberBase.CheckParameters): Report errors if the accessibility
13463         checks fail.
13464
13465         * delegate.cs (Delegate.Delegate): The default visibility is
13466         internal for top-level types and private for nested types.
13467         (Delegate.Define): Report errors if the accessibility checks fail.
13468
13469         * enum.cs (Enum.Enum): The default visibility is internal for
13470         top-level types and private for nested types.
13471         (Enum.DefineType): Compute the correct visibility.
13472
13473         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13474         function which takes a `bool is_toplevel' instead of a TypeContainer.
13475
13476         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13477         builtin type.
13478
13479 2002-08-02  Martin Baulig  <martin@gnome.org>
13480
13481         * expression.cs (LocalVariableReferenc): Added constructor which
13482         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13483         (LocalVariableReference.IsReadOnly): New property.
13484         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13485         variable is readonly, use our own readonly flag to do this; you can
13486         use the new constructor to get a writable reference to a read-only
13487         variable.
13488
13489         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13490         reference to the local variable.
13491
13492 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13493
13494         * rootcontext.cs (ResolveCore): Also include System.Exception
13495
13496         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13497         we reach an EmptyStatement.
13498
13499         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13500         is also fine.
13501
13502         * expression.cs (Binary.ResolveOperator): Check error result in
13503         two places.
13504
13505         use brtrue/brfalse directly and avoid compares to null.
13506
13507 2002-08-02  Martin Baulig  <martin@gnome.org>
13508
13509         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13510         Fixes bug #28407, added test-155.cs.
13511
13512 2002-08-01  Martin Baulig  <martin@gnome.org>
13513
13514         * class.cs (Event.EmitDefaultMethod): Make this work with static
13515         events.  Fixes #28311, added verify-3.cs.
13516
13517 2002-08-01  Martin Baulig  <martin@gnome.org>
13518
13519         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13520         `is_disposable' fields.
13521         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13522         `hm.is_disposable' if we're using the collection pattern.
13523         (Foreach.EmitCollectionForeach): Use the correct type for the
13524         enumerator's local variable, only emit the try/finally block if
13525         necessary (fixes #27713).
13526
13527 2002-08-01  Martin Baulig  <martin@gnome.org>
13528
13529         * ecore.cs (Expression.report118): Renamed to Error118 and made
13530         it public static.
13531
13532         * statement.cs (Throw.Resolve): Check whether the expression is of
13533         the correct type (CS0118) and whether the type derives from
13534         System.Exception (CS0155).
13535         (Catch.Resolve): New method.  Do the type lookup here and check
13536         whether it derives from System.Exception (CS0155).
13537         (Catch.CatchType, Catch.IsGeneral): New public properties.
13538
13539         * typemanager.cs (TypeManager.exception_type): Added.
13540
13541 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13542
13543         * driver.cs: Updated About function.
13544
13545 2002-07-31  Martin Baulig  <martin@gnome.org>
13546
13547         Implemented Control Flow Analysis.
13548
13549         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13550         (EmitContext.CurrentBranching): Added.
13551         (EmitContext.StartFlowBranching): Added.
13552         (EmitContext.EndFlowBranching): Added.
13553         (EmitContext.KillFlowBranching): Added.
13554         (EmitContext.IsVariableAssigned): Added.
13555         (EmitContext.SetVariableAssigned): Added.
13556         (EmitContext.IsParameterAssigned): Added.
13557         (EmitContext.SetParameterAssigned): Added.
13558         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13559         Added control flow analysis stuff here.
13560
13561         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13562         resolve the expression as lvalue.
13563         (LocalVariableReference.DoResolve): Check whether the variable has
13564         already been assigned.
13565         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13566         the parameter as assigned here.
13567         (ParameterReference.DoResolve): Check whether the parameter has already
13568         been assigned.
13569         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13570         expression as lvalue.
13571
13572         * statement.cs (FlowBranching): New class for the flow analysis code.
13573         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13574         (LabeledStatement.IsDefined): New public property.
13575         (LabeledStatement.AddUsageVector): New public method to tell flow
13576         analyis that the label may be reached via a forward jump.
13577         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13578         flow analysis.
13579         (VariableInfo.Number): New public field.  This is used by flow analysis
13580         to number all locals of a block.
13581         (Block.CountVariables): New public property.  This is the number of
13582         local variables in this block (including the locals from all parent
13583         blocks).
13584         (Block.EmitMeta): Number all the variables.
13585
13586         * statement.cs: Added flow analysis support to all classes.
13587
13588 2002-07-31  Martin Baulig  <martin@gnome.org>
13589
13590         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13591         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13592         then use this argument.
13593
13594         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13595
13596         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13597         use this to specify /define options.
13598
13599 2002-07-29  Martin Baulig  <martin@gnome.org>
13600
13601         * statement.cs (Fixed): Moved all code that does variable lookups
13602         and resolvings from Emit to Resolve.
13603
13604         * statement.cs (For): Moved all code that does variable lookups
13605         and resolvings from Emit to Resolve.
13606
13607         * statement.cs (Using): Moved all code that does variable lookups
13608         and resolvings from Emit to Resolve.
13609
13610 2002-07-29  Martin Baulig  <martin@gnome.org>
13611
13612         * attribute.cs (Attribute.Resolve): Explicitly catch a
13613         System.NullReferenceException when creating the
13614         CustromAttributeBuilder and report a different warning message.
13615
13616 2002-07-29  Martin Baulig  <martin@gnome.org>
13617
13618         * support.cs (ParameterData.ParameterName): Added method to
13619         get the name of a parameter.
13620
13621         * typemanager.cs (TypeManager.IsValueType): New public method.
13622
13623 2002-07-29  Martin Baulig  <martin@gnome.org>
13624
13625         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13626         is a flag which specifies that it's either ref or out.
13627         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13628         the out parameter to `out Parameter.Modifier mod', also set the
13629         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13630
13631         * support.cs (InternalParameters.ParameterModifier): Distinguish
13632         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13633         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13634
13635         * expression.cs (Argument.GetParameterModifier): Distinguish
13636         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13637         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13638
13639 2002-07-29  Martin Baulig  <martin@gnome.org>
13640
13641         * expression.cs (ParameterReference.ParameterReference): Added
13642         `Location loc' argument to the constructor.
13643
13644         * cs-parser.jay: Pass location to ParameterReference.
13645
13646 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13647
13648         * statement.cs (Try): Initialize the location.
13649
13650         * cs-parser.jay: pass location to Try.
13651
13652         * expression.cs (Unary.Reduce): Change the prototype to return
13653         whether a constant fold could be performed or not.  The result is
13654         returned in an out parameters.  In the case of Indirection and
13655         AddressOf, we want to perform the full tests.
13656
13657 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13658
13659         * statement.cs (Statement.Emit): Flag dead code.
13660
13661 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13662
13663         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13664
13665 2002-07-27  Martin Baulig  <martin@gnome.org>
13666
13667         * class.cs (MethodData.Define): Put back call to
13668         TypeManager.AddMethod(), accidentally commented this out.
13669
13670         * report.cs (Debug): New public method to print debugging information,
13671         this is `[Conditional ("DEBUG")]'.
13672
13673 2002-07-26  Martin Baulig  <martin@gnome.org>
13674
13675         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13676         (switch_statement): Push the current_block to the switch_stack and
13677         pop it again when we're done with the switch.
13678         (switch_section): The new block is a child of the current_block.
13679         Fixes bug #24007, added test-152.cs.
13680
13681 2002-07-27  Martin Baulig  <martin@gnome.org>
13682
13683         * expression.cs (Invocation.EmitArguments): When calling a varargs
13684         function with only its fixed arguments, we need to pass an empty
13685         array.
13686
13687 2002-07-27  Martin Baulig  <martin@gnome.org>
13688
13689         Mono 0.13 has been released.
13690
13691 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13692
13693         * driver.cs: Rename --resource to --linkres, because that is what
13694         we do currently, we dont support --resource yet.
13695
13696         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13697
13698 2002-07-25  Martin Baulig  <martin@gnome.org>
13699
13700         * class.cs (MethodData): New public class.  This is a `method builder'
13701         class for a method or one accessor of a Property/Indexer/Event.
13702         (MethodData.GetMethodFlags): Moved here from MemberBase.
13703         (MethodData.ApplyAttributes): Likewise.
13704         (MethodData.ApplyObsoleteAttribute): Likewise.
13705         (MethodData.ApplyConditionalAttribute): Likewise.
13706         (MethodData.ApplyDllImportAttribute): Likewise.
13707         (MethodData.CheckAbstractAndExternal): Likewise.
13708         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13709         (MethodData.Emit): Formerly known as Method.Emit().
13710         (MemberBase): Moved everything which was specific to a single
13711         accessor/method to MethodData.
13712         (Method): Create a new MethodData and call Define() and Emit() on it.
13713         (Property, Indexer, Event): Create a new MethodData objects for each
13714         accessor and call Define() and Emit() on them.
13715
13716 2002-07-25  Martin Baulig  <martin@gnome.org>
13717
13718         Made MethodCore derive from MemberBase to reuse the code from there.
13719         MemberBase now also checks for attributes.
13720
13721         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13722         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13723         as virtual.
13724         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13725         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13726         (MemberBase.ApplyAttributes): New virtual method; applies the
13727         attributes to a method or accessor.
13728         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13729         (MemberBase.ApplyConditionalAttribute): Likewise.
13730         (MemberBase.ApplyDllImportAttribute): Likewise.
13731         (MemberBase.CheckAbstractAndExternal): Likewise.
13732         (MethodCore.ParameterTypes): This is now a property instead of a
13733         method, it's initialized from DoDefineParameters().
13734         (MethodCore.ParameterInfo): Removed the set accessor.
13735         (MethodCore.DoDefineParameters): New protected virtual method to
13736         initialize ParameterTypes and ParameterInfo.
13737         (Method.GetReturnType): We can now simply return the MemberType.
13738         (Method.GetMethodFlags): Override the MemberBase version and add
13739         the conditional flags.
13740         (Method.CheckBase): Moved some code from Define() here, call
13741         DoDefineParameters() here.
13742         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13743         here to avoid some larger code duplication.
13744         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13745         ensure that abstract and external accessors don't declare a body.
13746
13747         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13748         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13749         lookup in the attribute's parent classes, so we need to abort as soon
13750         as we found the first match.
13751         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13752         the attribute has no arguments.
13753
13754         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13755         of a Method.
13756
13757 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13758
13759         * cs-parser.jay: reverted previous patch.
13760
13761 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13762
13763         * cs-parser.jay: fixed bug #22119.
13764
13765 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13766
13767         * attribute.cs: fixed compilation. The error was:
13768         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13769         be assigned to before control leaves the current method."
13770         [FIXME:  Filed as bug #28186: MCS must report this error.]
13771
13772 2002-07-25  Martin Baulig  <martin@gnome.org>
13773
13774         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13775         method to pull the condition name ouf of a Conditional attribute.
13776         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13777         the obsolete message and error flag out of an Obsolete attribute.
13778
13779         * class.cs (Method.GetMethodFlags): New public method to get the
13780         TypeManager.MethodFlags for this method.
13781         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13782         private methods.
13783         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13784         if we're overriding a virtual function, set the new private variable
13785         `parent_method'; call the new TypeManager.AddMethod().
13786
13787         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13788         the MethodBuilder and the Method in a PtrHashtable.
13789         (TypeManager.builder_to_method): Added for this purpose.
13790         (TypeManager.MethodFlags): Added IsObsoleteError.
13791         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13792         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13793         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13794         the message from the attribute.
13795
13796 2002-07-24  Martin Baulig  <martin@gnome.org>
13797
13798         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13799         preprocessor directives, ensure that the argument to #define/#undef is
13800         exactly one identifier and that it's actually an identifier.
13801
13802         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13803         did not work ....
13804
13805 2002-07-24  Martin Baulig  <martin@gnome.org>
13806
13807         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13808         initialize it to TypeManager.object_type in the constructor.
13809         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13810         of the `hm.get_current' method if we're using the collection pattern.
13811         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13812         for the explicit conversion to make it work when we're using the collection
13813         pattern and the `Current' property has a different return type than `object'.
13814         Fixes #27713.
13815
13816 2002-07-24  Martin Baulig  <martin@gnome.org>
13817
13818         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13819         does not match, but don't report any errors.  This method is called in
13820         order for all methods in a MethodGroupExpr until a matching method is
13821         found, so we don't want to bail out if the first method doesn't match.
13822         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13823         matches, report the 123.  Fixes #28070.
13824
13825 2002-07-24  Martin Baulig  <martin@gnome.org>
13826
13827         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13828         TypeManager.TypeToCoreType() to the top of the method so the
13829         following equality checks will work.  Fixes #28107.
13830
13831 2002-07-24  Martin Baulig  <martin@gnome.org>
13832
13833         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13834         operand is of type uint, and the other operand is of type sbyte,
13835         short or int, the operands are converted to type long." -
13836         Actually do what this comment already told us.  Fixes bug #28106,
13837         added test-150.cs.
13838
13839 2002-07-24  Martin Baulig  <martin@gnome.org>
13840
13841         * class.cs (MethodBase): New abstract class.  This is now a base
13842         class for Property, Indexer and Event to avoid some code duplication
13843         in their Define() and DefineMethods() methods.
13844         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13845         generic methods for Define() and DefineMethods().
13846         (FieldBase): Derive from MemberBase, not MemberCore.
13847         (Property): Derive from MemberBase, not MemberCore.
13848         (Property.DefineMethod): Moved all the code from this method to the
13849         new MethodBase.DefineAccessor(), just call it with appropriate
13850         argumetnts.
13851         (Property.Define): Call the new Property.DoDefine(), this does some
13852         sanity checks and we don't need to duplicate the code everywhere.
13853         (Event): Derive from MemberBase, not MemberCore.
13854         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13855         accessors, this will also make them work with interface events.
13856         (Indexer): Derive from MemberBase, not MemberCore.
13857         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13858         (Indexer.Define): Use the new MethodBase functions.
13859
13860         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13861         argument to the constructor.
13862         (Interface.FindMembers): Added support for interface events.
13863         (Interface.PopluateEvent): Implemented.
13864
13865         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13866
13867 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13868
13869         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13870         but this is required to check for a method name being the same as
13871         the containing class.  
13872
13873         Handle this now.
13874
13875 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13876
13877         * interface.cs: initialize variable.
13878
13879 2002-07-23  Martin Baulig  <martin@gnome.org>
13880
13881         Implemented the IndexerName attribute in interfaces.
13882
13883         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13884         name if this is an explicit interface implementation.
13885         (Indexer.InterfaceIndexerName): New public variable.  If we're
13886         implementing an interface indexer, this is the IndexerName in that
13887         interface.  Otherwise, it's the IndexerName.
13888         (Indexer.DefineMethod): If we're implementing interface indexer,
13889         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13890         and Pending.ImplementIndexer methods.
13891         (Indexer.Define): Also define the PropertyBuilder if we're
13892         implementing an interface indexer and this is neither an explicit
13893         interface implementation nor do the IndexerName match the one in
13894         the interface.
13895
13896         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13897         If a method is defined here, then we always need to create a proxy
13898         for it.  This is used when implementing interface indexers.
13899         (Pending.IsInterfaceIndexer): New public method.
13900         (Pending.ImplementIndexer): New public method.
13901         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13902         This is used when implementing interface indexers to define a proxy
13903         if necessary.
13904         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13905         define a proxy if necessary.
13906
13907         * interface.cs (Interface.IndexerName): New public variable.
13908         (Interface.PopulateIndexer): Set the IndexerName.
13909         (Interface.DefineIndexers): New private method.  Populate all the
13910         indexers and make sure their IndexerNames match.
13911
13912         * typemanager.cs (IndexerPropertyName): Added support for interface
13913         indexers.
13914
13915 2002-07-22  Martin Baulig  <martin@gnome.org>
13916
13917         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13918         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13919         ret if HasReturnLabel.
13920         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13921         variables.
13922
13923         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13924         and set the ec.LoopBeginTryCatchLevel.
13925         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13926         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13927         the current ec.TryCatchLevel, the branch goes out of an exception
13928         block.  In this case, we need to use Leave and not Br.
13929
13930 2002-07-22  Martin Baulig  <martin@gnome.org>
13931
13932         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13933         block unless the block does not always return or it is contained in
13934         another try { ... } catch { ... } block.  Fixes bug #26506.
13935         Added verify-1.cs to the test suite.
13936
13937 2002-07-22  Martin Baulig  <martin@gnome.org>
13938
13939         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13940         then we do not always return.  Fixes bug #24985.
13941
13942 2002-07-22  Martin Baulig  <martin@gnome.org>
13943
13944         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13945         lookup on a per-class level; ie. walk up the class hierarchy until we
13946         found at least one applicable method, then choose the best among them.
13947         Fixes bug #24463 and test-29.cs.
13948
13949 2002-07-22  Martin Baulig  <martin@gnome.org>
13950
13951         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13952         return types of the methods.  The return type is not part of the
13953         signature and we must not check it to make the `new' modifier work.
13954         Fixes bug #27999, also added test-147.cs.
13955         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13956
13957         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13958         on the method's return type.
13959
13960 2002-07-21  Martin Baulig  <martin@gnome.org>
13961
13962         * assign.cs: Make this work if the rightmost source is a constant and
13963         we need to do an implicit type conversion.  Also adding a few more tests
13964         to test-38.cs which should have caught this.
13965
13966         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13967         target in the makefile for this.  The makefile.gnu is primarily intended
13968         for end-users who don't want to debug the compiler.
13969
13970 2002-07-21  Martin Baulig  <martin@gnome.org>
13971
13972         * assign.cs: Improved the Assign class so it can now handle embedded
13973         assignments (X = Y = Z = something).  As a side-effect this'll now also
13974         consume less local variables.  test-38.cs now passes with MCS, added
13975         a few new test cases to that test.
13976
13977 2002-07-20  Martin Baulig  <martin@gnome.org>
13978
13979         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13980         instructions.  Fixes bug #27977, also added test-146.cs.
13981
13982 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13983
13984         * cs-tokenizer.cs: fixed getHex ().
13985
13986 2002-07-19  Martin Baulig  <martin@gnome.org>
13987
13988         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13989         not Type.GetType() to lookup the array type.  This is needed when
13990         we're constructing an array of a user-defined type.
13991         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13992         single-dimensional arrays, but also for single-dimensial arrays of
13993         type decimal.
13994
13995 2002-07-19  Martin Baulig  <martin@gnome.org>
13996
13997         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13998         this function is called, it's not allowed to share LocalBuilders
13999         among ILGenerators.
14000
14001 2002-07-19  Martin Baulig  <martin@gnome.org>
14002
14003         * expression.cs (Argument.Resolve): Report an error 118 when trying
14004         to pass a type as argument.
14005
14006 2002-07-18  Martin Baulig  <martin@gnome.org>
14007
14008         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14009         Conv_R_Un for the signed `long' type.
14010
14011 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14012
14013         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14014         `expr' for the temporary result, as that will fail if we do
14015         multiple resolves on the same expression.
14016
14017 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14018
14019         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14020         ec.TypeContainer for looking up aliases. 
14021
14022         * class.cs (TypeContainer): Remove LookupAlias from here.
14023
14024         * decl.cs (DeclSpace); Move here.
14025
14026 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14027
14028         * class.cs (FindMembers): Only call filter if the constructor
14029         bulider is not null.
14030
14031         Also handle delegates in `NestedTypes' now.  Now we will perform
14032         type lookups using the standard resolution process.  This also
14033         fixes a bug.
14034
14035         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14036         This uses Expressions (the limited kind that can be parsed by the
14037         tree) instead of strings.
14038
14039         * expression.cs (ComposedCast.ToString): Implement, used to flag
14040         errors since now we have to render expressions.
14041
14042         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14043         FormArrayType. 
14044
14045         * ecore.cs (SimpleName.ToString): ditto.
14046
14047         * cs-parser.jay: Instead of using strings to assemble types, use
14048         Expressions to assemble the type (using SimpleName, ComposedCast,
14049         MemberAccess).  This should fix the type lookups in declarations,
14050         because we were using a different code path for this.
14051
14052         * statement.cs (Block.Resolve): Continue processing statements
14053         even when there is an error.
14054
14055 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14056
14057         * class.cs (Event.Define): Also remove the `remove' method from
14058         the list of pending items.
14059
14060         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14061         generate more compact code. 
14062
14063 2002-07-17  Martin Baulig  <martin@gnome.org>
14064
14065         * const.cs (Const.LookupConstantValue): Add support for constant
14066         `unchecked' and `checked' expressions.
14067         Also adding test case test-140.cs for this.
14068
14069 2002-07-17  Martin Baulig  <martin@gnome.org>
14070
14071         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14072         check whether mi.ReturnType implements the IEnumerator interface; the
14073         `==' and the IsAssignableFrom() will fail in this situation.
14074
14075 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14076
14077         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14078         here too.
14079
14080 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14081
14082         * expression.cs: fixed bug #27811.
14083
14084 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14085
14086         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14087         Molaro: when we are a ref, the value already contains a pointer
14088         value, do not take the address of it.
14089
14090 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14091         * removed mb-parser.jay and mb-tokenizer.cs
14092
14093 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14094
14095         * expression.cs: check against the building corlib void type.
14096
14097 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14098
14099         * ecore.cs: fix for valuetype static readonly fields: when 
14100         initializing them, we need their address, not the address of a copy.
14101
14102 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14103
14104         * typemanager.cs: register also enum_type in corlib.
14105
14106 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14107
14108         * class.cs: allow calling this (but not base) initializers in structs.
14109
14110 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14111
14112         * ecore.cs: make sure we compare against the building base types
14113         in GetTypeSize ().
14114
14115 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14116
14117         * typemanager.cs: fix TypeToCoreType() to handle void and object
14118         (corlib gets no more typerefs after this change).
14119
14120 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * expression.cs (ArrayCreation.EmitArrayArguments): use
14123         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14124
14125         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14126         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14127         array indexes, the runtime actually forbids them.
14128
14129         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14130         for array arguments here.
14131
14132         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14133         instead of the default for ValueTypes.
14134
14135         (New.DoEmit): Use IsValueType instead of
14136         IsSubclassOf (value_type)
14137         (New.DoResolve): ditto.
14138         (Invocation.EmitCall): ditto.
14139
14140         * assign.cs (Assign): ditto.
14141
14142         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14143         Statements *are* currently doing part of their resolution during
14144         Emit.  
14145
14146         Expressions do always resolve during resolve, but statements are
14147         only required to propagate resolution to their children.
14148
14149 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14150
14151         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14152
14153         (LoadAssembly): Do not add the dll if it is already specified
14154
14155         (MainDriver): Add the System directory to the link path at the end,
14156         after all the other -L arguments. 
14157
14158         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14159         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14160         ldelem.u1) and using the opposite for sbytes.
14161
14162         This fixes Digger, and we can finally run it.
14163
14164         * driver.cs (UnixParseOption): Move the option parsing here.  
14165         (CSCParseOption): Implement CSC-like parsing of options.
14166
14167         We now support both modes of operation, the old Unix way, and the
14168         new CSC-like way.  This should help those who wanted to make cross
14169         platform makefiles.
14170
14171         The only thing broken is that /r:, /reference: and /lib: are not
14172         implemented, because I want to make those have the same semantics
14173         as the CSC compiler has, and kill once and for all the confussion
14174         around this.   Will be doing this tomorrow.
14175
14176         * statement.cs (Unsafe.Resolve): The state is checked during
14177         resolve, not emit, so we have to set the flags for IsUnsfe here.
14178
14179 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14180
14181         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14182         not catch the Error_ObjectRefRequired in SimpleName (as it is
14183         possible to have a class/instance variable name that later gets
14184         deambiguated), we have to check this here.      
14185
14186 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14187
14188         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14189         make static and put into Expression.
14190
14191         (Event.Define): Register the private field of the event with the 
14192         TypeManager so that GetFieldFromEvent can get at it.
14193
14194         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14195         keep track of the private field associated with an event which
14196         has no accessors.
14197
14198         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14199         private field.
14200
14201         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14202
14203 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14204
14205         * expression.cs (Binary.EmitBranchable): this routine emits the
14206         Binary expression in a branchable context.  This basically means:
14207         we need to branch somewhere, not just get the value on the stack.
14208
14209         This works together with Statement.EmitBoolExpression.
14210
14211         * statement.cs (Statement.EmitBoolExpression): Use
14212         EmitBranchable. 
14213
14214 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14215
14216         * statement.cs (For): Reduce the number of jumps in loops.
14217
14218         (For): Implement loop inversion for the For statement.
14219
14220         (Break): We can be breaking out of a Try/Catch controlled section
14221         (foreach might have an implicit try/catch clause), so we need to
14222         use Leave instead of Br.
14223
14224         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14225         now).  If the instace expression supports IMemoryLocation, we use
14226         the AddressOf method from the IMemoryLocation to extract the
14227         address instead of emitting the instance.
14228
14229         This showed up with `This', as we were emitting the instance
14230         always (Emit) instead of the Address of This.  Particularly
14231         interesting when This is a value type, as we dont want the Emit
14232         effect (which was to load the object).
14233
14234 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14235
14236         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14237
14238         * statement.cs (Checked): Set the CheckedState during the resolve
14239         process too, as the ConvCast operations track the checked state on
14240         the resolve process, and not emit.
14241
14242         * cs-parser.jay (namespace_member_declaration): Flag that we have
14243         found a declaration when we do.  This is used to flag error 1529
14244
14245         * driver.cs: Report ok when we display the help only.
14246
14247 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14248
14249         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14250
14251 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14252
14253         * cs-tokenizer.cs (define): We also have to track locally the
14254         defines.  AllDefines is just used for the Conditional Attribute,
14255         but we also need the local defines for the current source code. 
14256
14257 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * statement.cs (While, For, Do): These loops can exit through a
14260         Break statement, use this information to tell whether the
14261         statement is the last piece of code.
14262
14263         (Break): Flag that we break.
14264
14265         * codegen.cs (EmitContexts): New `Breaks' state variable.
14266
14267 2002-07-03  Martin Baulig  <martin@gnome.org>
14268
14269         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14270         modifiers in method declarations in structs.  Otherwise, you won't
14271         be able to override things like Object.Equals().
14272
14273 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14274
14275         * class.cs (Method, Property, Indexer): Do not allow the public
14276         modifier to be used in explicit interface implementations.
14277
14278         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14279         override modifiers in method declarations in structs
14280
14281 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14282
14283         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14284         integer or real overflow, report an error
14285
14286 2002-07-02  Martin Baulig  <martin@gnome.org>
14287
14288         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14289         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14290         to tell the runtime about our newly created System.Object and
14291         System.ValueType types.
14292
14293 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14294
14295         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14296         struct instead of Ldarg/Starg.
14297
14298 2002-07-02  Martin Baulig  <martin@gnome.org>
14299
14300         * expression.cs (Indirection.Indirection): Call
14301         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14302
14303 2002-07-02  Martin Baulig  <martin@gnome.org>
14304
14305         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14306         ValueType, call TypeManager.TypeToCoreType() on it.
14307         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14308         the OpCodes.Newarr argument.
14309
14310 2002-07-02  Martin Baulig  <martin@gnome.org>
14311
14312         * expression.cs (Invocation.EmitCall): When compiling corlib,
14313         replace all calls to the system's System.Array type to calls to
14314         the newly created one.
14315
14316         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14317         System.Array methods.
14318         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14319         from the system's System.Array type which must be replaced.
14320
14321 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14322
14323         * typemanager.cs: load unverifiable_code_ctor so we can build
14324         corlib using the correct type. Avoid using GetTypeCode() with
14325         TypeBuilders.
14326         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14327         TypeManager.object_type to allow building corlib.
14328
14329 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14330
14331         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14332
14333 2002-07-01  Martin Baulig  <martin@gnome.org>
14334
14335         * class.cs: Make the last change actually work, we need to check
14336         whether `ifaces != null' to avoid a crash.
14337
14338 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14339
14340         * class.cs: when we build structs without fields that implement
14341         interfaces, we need to add the interfaces separately, since there is
14342         no API to both set the size and add the interfaces at type creation
14343         time.
14344
14345 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14346
14347         * expression.cs: the dimension arguments to the array constructors
14348         need to be converted if they are a long.
14349
14350 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14351
14352         * class.cs: don't emit ldarg.0 if there is no parent constructor
14353         (fixes showstopper for corlib).
14354
14355 2002-06-29  Martin Baulig  <martin@gnome.org>
14356
14357         MCS now compiles corlib on GNU/Linux :-)
14358
14359         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14360         ie. check for MethodImplOptions.InternalCall.
14361
14362         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14363         and TypeManager.attribute_type are null, so we must explicitly check
14364         whether parent is not null to find out whether it's an attribute type.
14365         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14366         and SetBuilder, not only if the property is neither abstract nor external.
14367         This is necessary to set the MethodImplOptions on the accessor methods.
14368         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14369         SetBuilder, see Property.Emit().
14370
14371         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14372         populate "System.Object", "System.ValueType" and "System.Attribute" since
14373         they've already been populated from BootCorlib_PopulateCoreTypes().
14374
14375 2002-06-29  Martin Baulig  <martin@gnome.org>
14376
14377         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14378         is the NullLiteral, we also need to make sure that target_type is not
14379         an enum type.   
14380
14381 2002-06-29  Martin Baulig  <martin@gnome.org>
14382
14383         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14384         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14385         before calling BootstrapCorlib_ResolveDelegate ().
14386
14387 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14388
14389         * statement.cs: fixed build-breaker. All tests passed ok.
14390
14391 2002-06-27  Martin Baulig  <martin@gnome.org>
14392
14393         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14394         for System.Decimal when compiling corlib.
14395
14396 2002-06-27  Martin Baulig  <martin@gnome.org>
14397
14398         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14399         switch blocks which contain nothing but a default clause.
14400
14401 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14402
14403        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14404
14405 2002-06-27  Martin Baulig  <martin@gnome.org>
14406
14407         * ecore.cs (PropertyExpr.PropertyExpr): Call
14408         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14409
14410         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14411         is already a TypeBuilder.
14412
14413 2002-06-27  Martin Baulig  <martin@gnome.org>
14414
14415         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14416         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14417         the "from an array-type to System.Array" case.  This makes it work
14418         when compiling corlib.
14419
14420 2002-06-27  Martin Baulig  <martin@gnome.org>
14421
14422         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14423         non-static PropertyExpr, set its InstanceExpression.  This makes
14424         the `ICollection.Count' property work in System/Array.cs.
14425
14426 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14427
14428         * driver.cs: Made error handling more consistent.  Errors now
14429         tracked by Report class, so many methods which used to return int
14430         now return void.  Main() now prints success/failure and 
14431         errors/warnings message.
14432
14433         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14434         the magic number return values (123 and 124).  Now, if the
14435         expected error occurs, the compiler exits with success (exit value
14436         0).  If the compilation completes without seeing that particular
14437         error, the compiler exits with failure (exit value 1).  The
14438         makefile in mcs/errors has been changed to handle the new behaviour.
14439
14440         * report.cs: Made 'expected error' number a property and renamed
14441         it from 'Probe' to 'ExpectedError'.
14442
14443         * genericparser.cs: Removed error handling support, since it is
14444         now all done by Report class.
14445
14446         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14447         class, so parse() no longer returns an int.
14448
14449         * namespace.cs: Use Report.Error instead of GenericParser.error
14450
14451 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14452
14453         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14454         TypeContainer.AddOperator): At the front of the list put the
14455         explicit implementations, so they get resolved/defined first. 
14456
14457 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14460         interface type is implemented by this TypeContainer.  Used during
14461         explicit interface implementation.
14462
14463         (Property.Define, Indexer.Define, Method.Define): Validate that
14464         the given interface in the explicit implementation is one of the
14465         base classes for the containing type.
14466
14467         Also if we are explicitly implementing an interface, but there is
14468         no match in the pending implementation table, report an error.
14469
14470         (Property.Define): Only define the property if we are
14471         not explicitly implementing a property from an interface.  Use the
14472         correct name also for those properties (the same CSC uses,
14473         although that is really not needed).
14474
14475         (Property.Emit): Do not emit attributes for explicitly implemented
14476         properties, as there is no TypeBuilder.
14477
14478         (Indexer.Emit): ditto.
14479
14480         Hiding then means that we do not really *implement* a pending
14481         implementation, which makes code fail.
14482
14483 2002-06-22  Martin Baulig  <martin@gnome.org>
14484
14485         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14486         the return value of Object.GetType().  [FIXME: we need to do this whenever
14487         we get a type back from the reflection library].
14488
14489 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14490
14491         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14492
14493 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14494
14495         * attribute.cs: Return null if we can not look up the type.
14496
14497         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14498         the interface types found.
14499
14500         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14501         interface types found.
14502
14503         * typemanager.cs (GetInterfaces): Make this routine returns alll
14504         the interfaces and work around the lame differences between
14505         System.Type and System.Reflection.Emit.TypeBuilder in the results
14506         result for GetInterfaces.
14507
14508         (ExpandInterfaces): Given an array of interface types, expand and
14509         eliminate repeated ocurrences of an interface.  This expands in
14510         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14511         be IA, IB, IC.
14512
14513 2002-06-21  Martin Baulig  <martin@gnome.org>
14514
14515         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14516         on System.Enum.
14517
14518 2002-06-21  Martin Baulig  <martin@gnome.org>
14519
14520         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14521         and called with one of the core types, return the corresponding typebuilder for
14522         that type.
14523
14524         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14525         element type.
14526
14527 2002-06-21  Martin Baulig  <martin@gnome.org>
14528
14529         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14530         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14531         (Expression.ConvertReferenceExplicit): Likewise.
14532
14533         * expression.cs (ElementAccess.DoResolve): Likewise.
14534         (ElementAccess.DoResolveLValue): Likewise.
14535
14536 2002-06-10  Martin Baulig  <martin@gnome.org>
14537
14538         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14539         add the "value" parameter to the parameter list.
14540
14541         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14542         to our caller.
14543
14544 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14545
14546         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14547         the argument to an int, uint, long or ulong, per the spec.  Also
14548         catch negative constants in array creation.
14549
14550 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14551
14552         * class.cs: do not allow the same interface to appear twice in
14553         the definition list.
14554
14555 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14556
14557         * ecore.cs: don't use ldlen with System.Array.
14558
14559 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14560
14561         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14562
14563 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14564
14565         * modifiers.cs: produce correct field attributes for protected
14566         internal. Easy fix so miguel can work on ther harder stuff:-)
14567
14568 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * pending.cs: New file.  Move the code from class.cs here.
14571         Support clearning the pending flag for all methods (when not doing
14572         explicit interface implementation).
14573
14574 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14575
14576         * rootcontext.cs: added a couple more types needed to bootstrap.
14577
14578 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14579
14580         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14581         constructor in the type, instead of any constructor in the type
14582         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14583         a bug in the Mono runtime when applying the params attribute). 
14584
14585 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14586         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14587
14588 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14589
14590         * expression.cs (Unary.ResolveOperator): Use TypeManager
14591         to resolve the type.
14592
14593 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14594
14595         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14596         attached.
14597
14598         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14599         with each member too.
14600
14601         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14602         field builders too - this takes care of the enum member case.
14603
14604 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14605
14606         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14607         address-of operator on both value types and pointers.
14608
14609 2002-06-10  Martin Baulig  <martin@gnome.org>
14610
14611         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14612         PropertyBuilder to the `property_builders' list.
14613
14614         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14615         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14616         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14617         find any indexers which are inherited from an interface.
14618
14619 2002-06-09  Martin Baulig  <martin@gnome.org>
14620
14621         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14622         the same type as the constant if necessary.  There's also a test-130.cs
14623         for this.
14624
14625         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14626
14627         * typemanager.cs (TypeManager.ChangeType): Previously known as
14628         Enum.ChangeEnumType().
14629
14630 2002-06-09  Martin Baulig  <martin@gnome.org>
14631
14632         * expression.cs (Cast.TryReduce): Added support for consts.
14633
14634 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14635
14636         * class.cs (Accessor): Hold attributes information so we can pass
14637         it along.
14638
14639         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14640         Modify to pass in attributes attached to the methods.
14641
14642         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14643
14644         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14645         to handle the Accessor kind :-)
14646
14647         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14648
14649 2002-06-08  Martin Baulig  <martin@gnome.org>
14650
14651         * expression.cs (Unary.TryReduceNegative): Added support for
14652         ULongConstants.
14653
14654 2002-06-08  Martin Baulig  <martin@gnome.org>
14655
14656         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14657         name can't be found in the `defined_names' - the caller will do a
14658         MemberLookup in this case and thus find methods in System.Enum
14659         such as Enum.IsDefined().
14660
14661 2002-06-08  Martin Baulig  <martin@gnome.org>
14662
14663         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14664         Convert.ChangeType() which works with TypeBuilder created types.
14665         (Enum.LookupEnumValue, Enum.Define): Use it here.
14666
14667         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14668         `TypeBuilder.BaseType != null' check.
14669         (TypeContainer.FindMembers): Only lookup parent members if we
14670         actually have a parent.
14671         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14672         (ConstructorInitializer.Resolve): Likewise.
14673
14674         * interface.cs (Interface.FindMembers): Added
14675         `TypeBuilder.BaseType != null' check.
14676
14677         * rootcontext.cs (RootContext.ResolveCore): Added
14678         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14679         classes_second_stage.
14680
14681         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14682         debug_type and trace_type when compiling with --nostdlib.       
14683
14684 2002-06-07  Martin Baulig  <martin@gnome.org>
14685
14686         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14687         (AddField): Set it to true when adding a non-static field.
14688         (DefineType): Use `have_nonstatic_fields' to find out whether we
14689         have non-static fields, not `Fields != null'.
14690
14691 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14692
14693         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14694         dereferencing a null on the static-field code path)
14695
14696 2002-05-30  Martin Baulig  <martin@gnome.org>
14697
14698         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14699         to take command line arguments.  Use reflection to call the new
14700         custom `Initialize' function on the symbol writer and pass it the
14701         command line arguments.
14702
14703         * driver.cs (--debug-args): New command line argument to pass command
14704         line arguments to the symbol writer.
14705
14706 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14707
14708         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14709         the target type for indexers and properties.  Thanks to Joe for
14710         catching this.
14711
14712 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14713
14714         * typemanager.cs (MethodFlags): returns the method flags
14715         (Obsolete/ShouldIgnore) that control warning emission and whether
14716         the invocation should be made, or ignored. 
14717
14718         * expression.cs (Invocation.Emit): Remove previous hack, we should
14719         not do this on matching a base type, we should do this based on an attribute
14720
14721         Only emit calls to System.Diagnostics.Debug and
14722         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14723         on the command line.
14724
14725         * rootcontext.cs: Global settings for tracing and debugging.
14726
14727         * cs-tokenizer.cs (define): New utility function to track
14728         defines.   Set the global settings for TRACE and DEBUG if found.
14729
14730 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14731
14732         * interface.cs (Populate*): Pass in the TypeContainer as well as
14733         the DeclSpace as parameters so that we can create EmitContexts and
14734         then use that to apply attributes etc.
14735
14736         (PopulateMethod, PopulateEvent, PopulateProperty)
14737         (PopulateIndexer): Apply attributes everywhere.
14738
14739         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14740         etc.
14741
14742         (ApplyAttributes): Update accordingly.
14743
14744         We now apply interface attributes for all members too.
14745
14746 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14747
14748         * class.cs (Indexer.Define); Correctly check if we are explicit
14749         implementation (instead of checking the Name for a ".", we
14750         directly look up if the InterfaceType was specified).
14751
14752         Delay the creation of the PropertyBuilder.
14753
14754         Only create the PropertyBuilder if we are not an explicit
14755         interface implementation.   This means that explicit interface
14756         implementation members do not participate in regular function
14757         lookups, and hence fixes another major ambiguity problem in
14758         overload resolution (that was the visible effect).
14759
14760         (DefineMethod): Return whether we are doing an interface
14761         implementation. 
14762
14763         * typemanager.cs: Temporary hack until we get attributes in
14764         interfaces (Ravi is working on that) and we get IndexerName
14765         support in interfaces.
14766
14767         * interface.cs: Register the indexers as properties.
14768
14769         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14770         warning, I have verified that this is a bug in the .NET runtime
14771         (JavaScript suffers of the same problem).
14772
14773         * typemanager.cs (MemberLookup): When looking up members for
14774         interfaces, the parent of an interface is the implicit
14775         System.Object (so we succeed in searches of Object methods in an
14776         interface method invocation.  Example:  IEnumerable x;  x.ToString
14777         ()) 
14778
14779 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * class.cs (Event): Events should also register if they do
14782         implement the methods that an interface requires.
14783
14784         * typemanager.cs (MemberLookup); use the new GetInterfaces
14785         method. 
14786
14787         (GetInterfaces): The code used to lookup interfaces for a type is
14788         used in more than one place, factor it here. 
14789
14790         * driver.cs: Track the errors at the bottom of the file, we kept
14791         on going.
14792
14793         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14794         instance if the method we are calling is static!
14795
14796 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14797
14798         * attribute.cs (ApplyAttributes): Make this function filter out
14799         the IndexerName attribute (as that attribute in reality is never
14800         applied) and return the string constant for the IndexerName
14801         attribute. 
14802
14803         * class.cs (TypeContainer.Emit): Validate that all the indexers
14804         have the same IndexerName attribute, and if so, set the
14805         DefaultName attribute on the class. 
14806
14807         * typemanager.cs: The return value might contain other stuff (not
14808         only methods).  For instance, consider a method with an "Item"
14809         property and an Item method.
14810
14811         * class.cs: If there is a problem with the parameter types,
14812         return. 
14813
14814 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14815
14816         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14817         looks at user defined conversion after making a call to 
14818         StandardConversionExists - we need this for overload resolution.
14819
14820         * expression.cs : Update accordingly the various method calls.
14821
14822         This fixes 2 bugs filed against implicit user defined conversions 
14823
14824 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14825
14826         * statement.cs: Track the result of the assignment.
14827
14828 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14829
14830         * expression.cs (MemberAccess): Improved error reporting for
14831         inaccessible members.
14832
14833 2002-05-22  Martin Baulig  <martin@gnome.org>
14834
14835         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14836         itself with debugging support.
14837
14838 2002-05-22  Martin Baulig  <martin@gnome.org>
14839
14840         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14841         Removed, this isn't needed anymore.
14842
14843 2002-05-20  Martin Baulig  <martin@gnome.org>
14844
14845         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14846         be underlying type for an enum.
14847
14848 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14851         that splits out the loading of just the core types.
14852
14853         * rootcontext.cs (ResolveCore): Split the struct resolution in
14854         two, so we can load the enumeration underlying types before any
14855         enums are used.
14856
14857         * expression.cs (Is): Bandaid until we fix properly Switch (see
14858         bug #24985 for details).
14859
14860         * typemanager.cs (ImplementsInterface): The hashtable will contain
14861         a null if there are no interfaces implemented.
14862
14863 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14864
14865         * cs-parser.jay (indexer_declarator): It is fine to have array
14866         parameters
14867
14868 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * typemanager.cs: (RegisterBuilder): New function used to register
14871         TypeBuilders that implement interfaces.  Since
14872         TypeBuilder.GetInterfaces (as usual) does not work with lame
14873         Reflection.Emit. 
14874         (AddUserType): register interfaces.
14875
14876         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14877         dealing with TypeBuilder.  Also, arrays are showing up as
14878         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14879         methods can not be invoked on them!
14880
14881         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14882         (ImplicitReferenceConversionExists): Split out from
14883         StandardConversionExists. 
14884
14885         * expression.cs (As): We were only implementing one of the three
14886         cases for the as operator.  We now implement them all.
14887         (Is): Implement the various other cases for Is as well.
14888
14889         * typemanager.cs (CACHE): New define used to control if we want or
14890         not the FindMembers cache.  Seems to have a negative impact on
14891         performance currently
14892
14893         (MemberLookup): Nested types have full acess to
14894         enclosing type members
14895
14896         Remove code that coped with instance/static returns for events, we
14897         now catch this in RealFindMembers.
14898
14899         (RealFindMembers): only perform static lookup if the instance
14900         lookup did not return a type or an event.  
14901
14902 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14903
14904         * assign.cs (CompoundAssign): We pass more semantic information
14905         now to Compound Assignments than we did before: now we have all
14906         the information at hand, and now we resolve the target *before* we
14907         do the expression expansion, which allows the "CacheValue" method
14908         to have the effect we intended (before, a [x] += 1 would generate
14909         two differen ArrayAccess expressions from the ElementAccess,
14910         during the resolution process).
14911
14912         (CompoundAssign.DoResolve): Resolve target and original_source here.
14913
14914 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14915
14916         * expression.cs (ArrayAccess): dropped debugging information. 
14917
14918         * typemanager.cs: Small bug fix: I was always returning i_members,
14919         instead of one of i_members or s_members (depending on which had
14920         the content).
14921
14922         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14923         method is invoked before any code generation takes place, and it
14924         is a mechanism to inform that the expression will be invoked more
14925         than once, and that the method should use temporary values to
14926         avoid having side effects
14927
14928         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14929
14930         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14931         implementation.
14932
14933         * expression.cs (Indirection, ArrayAccess): Add support for
14934         CacheTemporaries in these two bad boys. 
14935
14936         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14937         ldobj or ldind_ref.  
14938         (StoreFromPtr): Handle stobj as well.
14939
14940         * expression.cs (UnaryMutator): Share more code.
14941
14942         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14943         down: I was not tracking the Filter function as well, which
14944         was affecting the results of the cache.
14945
14946 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * attribute.cs: Remove the hack to handle the CharSet property on
14949         StructLayouts. 
14950
14951 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14952
14953         * attribute.cs (DoResolve): More uglyness, we now only try to
14954         resolve the attribute partially, to extract the CharSet
14955         information (only if we are a StructLayout attribute).  Otherwise 
14956
14957         (GetExtraTypeInfo): Add some code to conditionally kill in the
14958         future this.   I am more and more convinced that the .NET
14959         framework has special code to handle the attribute setting on
14960         certain elements.
14961
14962         * expression.cs (IsParamsMethodApplicable): Revert my previous
14963         foreach change here, it was wrong.
14964
14965 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14966
14967         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14968         (pp_expr): do not abort on unknown input, just return.
14969         (eval): abort if there are pending chars.
14970
14971         * attribute.cs (Attribute.Resolve): Positional parameters are
14972         optional.  Deal with that case.
14973
14974         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14975         the Ansi/Unicode/Auto information for the type.
14976
14977         (TypeContainer.DefineType): instantiate the EmitContext here, as
14978         we will be using it during the type definition (to resolve
14979         attributes) and during the emit phase.
14980
14981         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14982         to pull type information out of the attributes
14983
14984         (Attribute.Resolve): track the constructor builder, and allow for
14985         multiple invocations (structs and classes will use this).
14986
14987         * ecore.cs (MemberLookupFinal): new version with all the
14988         parameters customizable.
14989
14990         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14991         constructors.  Return if the result value is null (as the error
14992         would have been flagged already by MemberLookupFinal)
14993
14994         Do not allow instances of abstract classes or interfaces to be
14995         created.
14996
14997         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14998         We have to compare the assembly property here when dealing with
14999         FamANDAssem and Assembly access modifiers, because we might be
15000         creating an assembly from *modules* (that means that we are not
15001         getting TypeBuilders for types defined in other modules that are
15002         part of this assembly).
15003
15004         (Method.Emit): If the method is marked abstract and has a body,
15005         emit an error. 
15006
15007         (TypeContainer.DefineMembers): If both the defined member and the
15008         parent name match are methods, then do not emit any warnings: let
15009         the Method.Define routine take care of flagging warnings.  But if
15010         there is a mismatch (method overrides something else, or method is
15011         overriwritten by something, then emit warning).
15012
15013         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15014         set to null, this means `do not check for the return type on the
15015         signature'. 
15016
15017         (Method.Define): set the return type for the method signature to
15018         null, so that we get methods with the same name and parameters and
15019         different return types.  This is used to flag warning 114 (you are
15020         hiding a method, and you probably want to use the new/override
15021         keywords instead).
15022
15023         * typemanager.cs (MemberLookup): Implemented proper access
15024         control, closing a long standing set of bug reports.  The problem
15025         was that the Framework only has two bits: Public and NonPublic,
15026         and NonPublic includes private and protected methods, but we need
15027         to enforce the FamANDAssem, FamOrAssem and Family. 
15028
15029 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15030
15031         * statement.cs (GotoCase): Return true: Ammounts to giving up
15032         knowledge on whether we return or not, and letting the other case
15033         be responsible for it.
15034
15035 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15036
15037         * driver.cs: Do not load directories for each file processed, only
15038         do it if there is a pattern.
15039
15040         * ecore.cs: Report readonly assigns here as well, as we might have
15041         been resolved only by MemberAccess.
15042
15043         (SimpleName.SimpleNameResolve): Also be useful for LValue
15044         resolution.   We need this to propagate assign to local readonly variables
15045
15046         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15047         do not want to reuse potential criteria memory.
15048
15049         * class.cs (MyEventBuilder): Set reflected_type;
15050
15051         * ecore.cs (Constantify): Added support for constifying bools.
15052
15053         (RootContext.LookupType): Added a cache for values looked up in
15054         the declaration space.
15055
15056         * typemanager.cs (FindMembers): Now is a front-end to
15057         RealFindMembers, and provides a two-level hashtable-based cache to
15058         the request.  
15059
15060         15% performance improvement: from 22.5 to 19.2 seconds.
15061
15062         * expression.cs (IsParamsMethodApplicable): use foreach.
15063         (Invocation.DoResolve): ditto.
15064         (New.DoResolve): ditto.
15065         (ArrayCreation.DoResolve): ditto.
15066
15067         * ecore.cs (FindMostEncompassingType): use foreach.
15068
15069         * delegate.cs (NewDelegate.DoResolve): Use foreach
15070
15071         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15072         (RemoveMethods): use foreach.
15073
15074         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15075         nested foreach statements instead of for, and also break out of
15076         the inner loop once a match is found.
15077
15078         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15079
15080 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15081
15082         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15083         we actually unwrap the expression to allow for extra information
15084         to be extracted. 
15085
15086         * expression.cs: Use Shr_Un on unsigned operations. 
15087
15088 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15089
15090         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15091         applicable operators was not being considered correctly. This closes
15092         the bug Miguel reported.
15093
15094 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15095
15096         * attribute.cs: check that the type derives from System.Attribute
15097         and report the correct error in that case (moved the duplicate code to
15098         its own method, too).
15099
15100 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15101
15102         * attribute.cs: lookup attribute type name as the spec says: first the
15103         bare attribute name and then name + "Attribute" (nant compiles with
15104         mcs after this fix).
15105
15106 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15107
15108         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15109         Because of the way we parse things, we should try to see if a
15110         UIntConstant can fit in an integer.
15111
15112 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15113
15114         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15115         when we are in an explicit context.
15116
15117         (ConvertReferenceExplicit): When converting from Iface type S to Class
15118         T make sure the rules are implemented as an OR.
15119
15120         * parameter.cs (ParameterType): Make it a property for now although the
15121         purpose really isn't anything immediate.
15122
15123         * expression.cs (Is*Applicable): Do better checking on the parameter type
15124         of a ref/out parameter. The ones from the system assemblies are already 
15125         marked with the correct type so we don't need to do any correction.
15126
15127         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15128         the object type is standard too so include that.
15129
15130 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15131
15132         * ecore.cs (StandardConversionExists): Augment with missing code:
15133         deal with IntConstant, LongConstants and Enumerations.
15134
15135         * assign.cs: Report the error, instead of failing silently
15136
15137         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15138         typecontainer that they are declared, because the
15139         typecontainer/namespace will have the list of using clauses that
15140         need to be applied.
15141
15142         Assembly Attributes were escaping the normal registration
15143         mechanism. 
15144
15145         (EmitCode): Apply attributes within an EmitContext that represents
15146         the container they were declared on.
15147
15148         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15149
15150 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15151
15152         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15153         Revamp completely - make much cleaner as we now operate only
15154         on a set of Types.
15155
15156         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15157         to implement the logic detailed in the spec more correctly.
15158
15159         (UserDefinedConversion): Update accordingly.
15160
15161 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15162
15163         * statement.cs: Return flow analysis information up.
15164
15165         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15166         and the default.
15167
15168         (token): Do not consume an extra character before calling
15169         decimal_digits.
15170
15171 2002-05-06  Piers Haken <piersh@friskit.com>
15172
15173         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15174
15175 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15176
15177         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15178         EmitContext during the instance constructor initializer
15179         resolution, to stop access to instance variables.
15180
15181         This is mandated by the spec, last paragraph of the `constructor
15182         initializers' section. 
15183
15184 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15185
15186         * cs-parser.jay, class.cs (Accessor): new class used to represent
15187         an accessor (get or set).  In the past we used `null' to represent
15188         a missing accessor.  But this is ambiguous because there was no
15189         way to tell in abstract indexers/properties if one of them was
15190         specified.
15191
15192         Now there is a way of addressing that.
15193
15194         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15195         instead of FindMembers.
15196
15197         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15198         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15199
15200         * attribute.cs: Treat indexers and properties as the same in terms
15201         of applying attributes
15202
15203         * ecore.cs (FindMostEncompassedType): Use statically initialized
15204         EmptyExpressions()s like we do elsewhere to avoid creating useless
15205         objects (and we take this out of the tight loop).
15206
15207         (GetConversionOperators): Move the code to extract the actual
15208         operators to a separate routine to clean things up.
15209
15210 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15211
15212         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15213         events are always registered FieldBuilders.
15214
15215         * class.cs (FieldBase): New class shared by Fields 
15216
15217         * delegate.cs: If we are a toplevel delegate, use our full name.
15218         If we are a nested delegate, then only use our tail name.
15219
15220 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15221
15222         * expression.cs (IsApplicable): Ensure that we add the "&" to
15223         ref/out types before comparing it with the type of the argument.
15224
15225         (IsParamsMethodApplicable): Ditto.
15226
15227         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15228         silly me ;-)
15229
15230         * delegate.cs : Handle the case when we have more than one applicable
15231         method. Flag an error only when we finish checking all.
15232
15233 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15234
15235         * expression.cs: Add support for boolean static initializers.
15236
15237 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15238
15239         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15240
15241         * parameter.cs (ComputeParameterTypes,
15242         ComputeAndDefineParameterTypes): Better error handling: now we
15243         clear the `types' cache if we fail during any of the type lookups.
15244         We also return the status code correctly to our caller
15245
15246         * delegate.cs: If we fail to define a delegate, abort the extra
15247         steps. 
15248
15249         * expression.cs (Binary.ResolveOperator): for
15250         operator==(object,object) and operator !=(object, object) we also
15251         have to verify that there is an implicit conversion from one to
15252         the other.
15253
15254         (ArrayAccess.DoResolve): Array Access can operate on
15255         non-variables. 
15256
15257 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15258
15259         * assign.cs (CompoundAssign): A new class used as a "flag" that
15260         the assignment actually is happening as part of a compound
15261         assignment operator.
15262
15263         During compound assignment, a few new rules exist to enable things
15264         like:
15265
15266         byte b |= 1 + 2
15267
15268         From the spec:
15269
15270         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15271         to the type of x) if y is implicitly convertible to the type of x,
15272         and the operator is a builtin operator and the return type of the
15273         operator is explicitly convertible to the type of x. 
15274
15275         * rootcontext.cs: Reset warning level to 2.  4 catches various
15276         "interesting" features in mcs, we must clean this up at some
15277         point, but currently am trying to kill other bugs ;-)
15278
15279         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15280         in container classes as well.  
15281
15282         * expression.cs (Binary.ResolveOperator): Handle string case
15283         before anything else (as operator overloading does emit an error
15284         before doing anything else).
15285
15286         This code could go away when we move to a table driven model, but
15287         i could not come up with a good plan last night.
15288
15289 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15290
15291         * typemanager.cs (CSharpName): reimplementation using regex.
15292         * class.cs: added null check for fields in Emit
15293         * rootcontext.cs: set warninglevel to 4
15294
15295 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * typemanager.cs (CSharpName): reimplemented with Lupus
15298         suggestion.
15299
15300 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15301
15302         * statement.cs (If): correclty implement Resolve, because we were
15303         not catching sem errors in there.  The same process is needed
15304         everywhere else. 
15305         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15306
15307
15308         (Statement.Warning_DeadCodeFound): Factorize code.
15309         (While): Report dead code here too.
15310
15311         (Statement): Added Resolve virtual method to allow
15312         for resolution split from the emit code.
15313
15314 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15315
15316         * statement.cs (EmitBoolExpression): No longer try to resolve the
15317         expression here.    
15318         (MakeBoolean): New utility function that resolve, implicitly
15319         converts to boolean and tags the expression. 
15320
15321
15322         (If, Do): Implement dead code elimination.
15323         (While): Implement loop inversion
15324
15325         (Do, While, For, If): Resolve the expression prior to calling our
15326         code generation.
15327
15328 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15329
15330         * class.cs:
15331           - added method Report28 (warning: program has more than one entry point)
15332           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15333           - modified method Method.Define, the part at the end of the method
15334
15335         * rootcontext.cs: added static public Location EntryPointLocation;
15336           
15337         * ../errors/cs0028.cs : Add test case for the above warning.              
15338
15339         * typemanager.cs:
15340           - modified method CSharpName to allow arrays of primitive type to
15341             be printed nicely (e.g. instead of System.Int32[][] it now prints
15342             int[][])
15343           - added method CSharpSignature: returns the signature of a method
15344             in string format to be used in reporting errors, warnings, etc.
15345
15346         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15347         with String.Empty.
15348
15349 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15350
15351         * delegate.cs (Define): Fix extremely silly bug where I was
15352         setting the type of the 'object' parameter of the BeginInvoke
15353         method to System.IAsyncResult instead of System.Object ;-)
15354
15355 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15356
15357         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15358         here. 
15359
15360         (Constructor.Emit): return if we fail to initialize the
15361         constructor.  Another door closed!  
15362
15363         * expression.cs (New.DoResolve): Improve error message (from -6 to
15364         1501).  Use DeclaredOnly lookup to find the exact constructor.
15365
15366         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15367         loop.  This is useful.
15368
15369         * cs-parser.jay: Adjust the default parameters so that destructors
15370         have the proper signature.
15371
15372 2002-04-26  Martin Baulig  <martin@gnome.org>
15373
15374         * driver.cs (LoadAssembly): If `assembly' contains any characters
15375         which are only valid in path names and not in assembly names
15376         (currently slash, backslash and point), use Assembly.LoadFrom ()
15377         instead of Assembly.Load () on the `assembly' (before iteration
15378         over the link_paths).
15379
15380 2002-04-26  Martin Baulig  <martin@gnome.org>
15381
15382         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15383
15384 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15385
15386         * class.cs (Property): use the new typemanager.MemberLookup
15387
15388         (TypeContainer.MemberLookup): Implement using the
15389         TypeManager.MemberLookup now. 
15390
15391         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15392         and return MemberInfos, so that these can be used without an
15393         EmitContext (what we had before).
15394
15395 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15396
15397         * expression.cs: Fix the case where the argument to params if the
15398         type of the params.  I omitted handling this before.   Fixed
15399
15400 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15401
15402         * driver.cs: Call BootCorlib_PopulateCoreType
15403
15404         * class.cs (Property.CheckBase): Check for properties only, not
15405         for all members. 
15406
15407         * interface.cs: Temporary hack: try/catch around the
15408         CustomAttributeBuilder, because I am getting an exception that I
15409         do not understand.
15410
15411         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15412         types whose definitions are required to be there (attributes are
15413         defined before standard types).
15414
15415         Compute definitions as we boot the various types, as they are used
15416         immediately (value_type class will need object_type, but if we do
15417         not initialize object_type, we will pass a null, which will let
15418         the runtime pick the System.Object from the existing corlib, which
15419         is not what we want).
15420
15421 2002-04-22  Patrik Torstensson <totte@labs2.com>
15422
15423         * cs-tokenizer.cs: fixed a number of trim() issues.
15424
15425 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15426
15427         * expression.cs (Argument.Type): Ensure that we return the correct
15428         type when we have out or ref parameters [in which case we 
15429         append a "&"].
15430
15431 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15432
15433         * class.cs (Property, Indexer): Allow extern modifier in there. 
15434
15435         * typemanager.cs (InitBaseTypes): Initializes object_type and
15436         value_type, since those will be used early on during the bootstrap
15437         process to compile corlib.
15438
15439         (InitCoreTypes): Move code from here to InitBaseTypes.
15440
15441 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15442
15443         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15444         single-dimension arrays as using the ldlen opcode.  
15445
15446         Daniel Lewis discovered this optimization.  
15447
15448         * typemanager.cs: Add signature for System.Array::get_Length
15449
15450 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15451
15452         * statement.cs: report the error when the foreach does not apply to an
15453         array nor a collection.
15454
15455 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15456
15457         * expression.cs: Add implicit conversions to the operator ~.
15458
15459         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15460
15461         * typemanager.cs: Locate the decimal constructor.
15462
15463 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15464
15465         * attribute.cs: use the new property of TypeOf.
15466         * expression.cs: added 'get' property around typearg.
15467
15468         These changes fix a build breaker reported by NickD. Is this the
15469         correct way to fix?  If not, please, revert my changes and make it
15470         work :-).
15471
15472 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15473
15474         * attribute.cs: Add support for typeof in attribute invocations.
15475         I am not sure that this is right though.
15476
15477 2002-04-14  Duncan Mak  <duncan@ximian.com>
15478
15479         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15480         Binary.Operator.Division case.
15481
15482 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15483
15484         * class.cs (DefineType): Ensure that we do a proper check on
15485         attribute types and also register it with the TypeManager.
15486
15487         (TypeContainer.Targets): The default for attribute types is
15488         AttributeTargets.All.
15489
15490         * attribute.cs (ApplyAttributes): Registering the attribute type
15491         is done elsewhere, not when we discover we have a Usage attribute.
15492
15493 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15494
15495         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15496         and get rid of is_delegate parameter.
15497
15498         * everywhere : update.
15499
15500 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15501
15502         * cs-parser.jay (compilation_unit): Revamp completely to use
15503         some new ideas that I got from Rhys' grammar to solve the problems
15504         with assembly level attributes.
15505
15506         (outer_declaration): New grammar production.
15507
15508         (attribute_sections): Add.
15509
15510         (opt_attributes): Base on attribute_sections
15511
15512         (namespace_declaration): Allow opt_attributes to tackle the case
15513         when we have assembly level attributes - we are clever in this
15514         regard now ;-)
15515
15516         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15517         attributes in the non-global context.
15518
15519         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15520         instead of SetGlobalAttributes.
15521
15522         * class.cs, rootcontext.cs : Ensure we define and generate 
15523         attribute types before anything else.
15524
15525         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15526         and flag the new error -20 for the case when the attribute type
15527         does not have valid targets specified. csc does not catch this.
15528
15529         * ../errors/errors.txt : update for error # -20
15530
15531 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15532
15533         * support.cs (InternalParameters.ParameterModifier): Do some null
15534         checking and return sane values.
15535
15536         * class.cs (Method.Define): If we are a PInvoke method, ensure
15537         that we are static and extern. Report error # 601
15538
15539         * ../errors/cs0601.cs : Add test case for the above error.
15540
15541 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15542
15543         * rootcontext.cs (attribute_types): We need to keep type of
15544         all attribute types separately and emit code for them first.
15545
15546         (RegisterAttribute) : Implement.
15547
15548         * class.cs (DefineType): Check if the current Type is a custom
15549         attribute type and register it accordingly.
15550
15551         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15552         adding the first attribute twice and rename to
15553
15554         (SetGlobalAttributes): this.
15555
15556         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15557         lookups.
15558
15559         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15560         if we are processing global arguments. Hmm, I am unsure of this.
15561
15562 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15563
15564         * expression.cs: added static array of strings to avoid calling
15565         Enum.ToString () for Operator in Binary. Significant recover of
15566         performance.
15567
15568 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15569
15570         * class.cs (FindMembers): Allow the Builders of the various
15571         members to be null.  If they are skip them.  This only happens
15572         during the PInvoke declaration.
15573
15574 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15575
15576         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15577         failure, so we do not keep going afterwards.
15578
15579         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15580         wanted to pass `false' as the `is_delegate' argument.  If this is
15581         the case, why not use delegate_type == null to mean `is_delegate =
15582         false' and anything else as is_delegate = true.
15583
15584 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15585
15586         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15587         code for the section, not the beginning of the tests.
15588
15589 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15590
15591         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15592
15593         * expression.cs (Binary): same.  Warn about errors where we have
15594         Enum/Enum in operator + as well.
15595
15596 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15597
15598         * statement.cs:
15599                 - added support for switch(bool)
15600                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15601                 - add TableSwitchEmit() to handle table-based switch statements
15602
15603 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15604
15605         * expression.cs (Invocation.OverloadResolve): Factor out code which
15606         does parameter compatibility checking with arguments so that we can 
15607         re-use the code even from Delegate.VerifyApplicability
15608
15609         (VerifyArgumentsCompat): Move above code here.
15610
15611         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15612         and instead make a call to the above method.
15613
15614 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15615
15616         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15617         We use it to keep track of classes which are attribute types.
15618
15619 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15620
15621         * delegate.cs (Delegate.Define): Correctly define the types in the
15622         presence of fixed and array parameters.
15623
15624         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15625         doing FindMembers.
15626
15627         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15628         include NonPublic after the first iteration.
15629
15630         * class.cs (Indexer.CheckBase): Only check if both parents are
15631         non-null. 
15632
15633         * cs-parser.jay (accessor_body): If empty, set to null.
15634
15635         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15636         same code path here to resolve constants names that we did have in
15637         MemberAccess.DoResolve.  There is too much code duplicated here.
15638
15639 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15640
15641         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15642
15643         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15644         to MakeUnionSet.
15645
15646         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15647         tokens, numbers and strings.
15648
15649         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15650         parenthesis.
15651
15652         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15653         asyncronous parameters and the regular parameters.  
15654
15655         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15656         specify the target directory.
15657
15658         * expression.cs: (This.DoResolve): Simplify
15659         (As.Emit): Optimize, do not generate IsInst if the expression is
15660         always of the given type.
15661
15662         (Is.DoResolve): Bug fix, we were reporting both always/never for
15663         the is expression.
15664
15665         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15666         creating too many unnecessary arrays.
15667
15668 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15669
15670         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15671         fields instead of rolling our own initializer.   Takes care of all
15672         implicit conversions, and drops unnecessary static checks/argument.
15673
15674 2002-03-31  Dick Porter  <dick@ximian.com>
15675
15676         * driver.cs: use the GetDirectories() return values properly, and
15677         use "/" as path separator.
15678
15679 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15680
15681         * expression.cs (Unary): Optimize - - expr into expr.
15682         (Binary): Optimize a + (-b) into a -b.
15683
15684         * codegen.cs (CodeGen): Made all methods static.
15685
15686 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15687
15688         * rootcontext.cs: 
15689
15690         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15691         TypeBuilder property.
15692
15693         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15694         instead. 
15695
15696         * tree.cs: Removed the various RecordXXXX, and replaced with a
15697         single RecordDecl.  Removed all the accessor methods, and just
15698         left a single access point Type 
15699
15700         * enum.cs: Rename DefineEnum to DefineType.
15701
15702         * decl.cs: New abstract method `DefineType' used to unify the
15703         Defines for Enumerations, Interfaces, TypeContainers and
15704         Delegates.
15705
15706         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15707         LookupBaseClasses method that used to live in class.cs and
15708         interface.cs here, and renamed to FindType.
15709
15710         * delegate.cs: Implement DefineType.  Take advantage of the
15711         refactored pattern for locating the parent builder without taking
15712         the parent_builder argument (which we know does not work if we are
15713         nested, and triggering a toplevel definition).
15714
15715 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15716
15717         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15718         accessibility of a member has changed during override and report
15719         an error if so.
15720
15721         * class.cs (Method.Define, Property.Define): Only complain on
15722         overrides if the method is private, any other accessibility is
15723         fine (and since we just checked the permission is the same, we are
15724         good to go).
15725
15726         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15727         and elif are processed always.  The other pre-processing
15728         directives are only processed if we are "taking" the path
15729
15730 2002-03-29  Martin Baulig  <martin@gnome.org>
15731
15732         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15733         current location is not Null.
15734
15735         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15736         a separate method so we can profile it.
15737
15738         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15739         `span.Seconds' are just seconds, but no minutes or hours.
15740         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15741
15742 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15743
15744         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15745         Remove the gratuitous set of Final:
15746
15747                                 // If an interface implementation, then we can set Final.
15748                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15749                                     implementing.DeclaringType.IsInterface)
15750                                         flags |= MethodAttributes.Final;
15751
15752         I do not know what I was smoking when I used that.
15753
15754
15755         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15756         step into fixing the name resolution issues for delegates and
15757         unifying the toplevel name resolution.
15758
15759 2002-03-28  Martin Baulig  <martin@gnome.org>
15760
15761         * class.cs (Method.Emit): If we have a symbol writer, call its
15762         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15763         tell it about the current method.
15764
15765         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15766         writer that we're going to emit the first byte of IL code for a new
15767         statement (a new source line).
15768         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15769         EmitContext.Mark() before emitting any code.
15770
15771         * location.cs (SymbolDocument): Return null when we're Null.
15772
15773         * statement.cs (Statement): Moved the `Location loc' variable here.
15774         (Statement.EmitBoolExpression): If we have a symbol writer, call
15775         ec.Mark() before emitting any code to tell it that we're at the
15776         beginning of a new statement.
15777         (StatementExpression): Added `Location' argument to the constructor.
15778         (Block): Added public readonly variable `StartLocation' and public
15779         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15780         (Block): Added constructor which takes a start and end location.
15781         (Block.SetEndLocation): New method. This sets the end location.
15782         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15783         local variables we create.
15784         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15785         each statement and do also mark the begin and end of the block.
15786
15787         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15788         tell it the current lexer.Location, use Location.Null for the end of the
15789         block.
15790         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15791         current block, set its end location using SetEndLocation().
15792         (statement_expression): StatementExpression constructor now takes the
15793         lexer.Location as additional argument.
15794         (for_statement, declare_local_variables): Likewise.
15795         (declare_local_variables): When creating a new implicit block, use the
15796         new Block constructor and pass it the lexer.Location.
15797
15798 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15799
15800         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15801         members also on the parent interfaces recursively.
15802
15803 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15804
15805         * report.cs: Use new formats, since Gonzalo finished the missing
15806         bits. 
15807
15808         * expression.cs (Binary.ResolveOperator): added missing operator|
15809         operator& and operator^ for bool/bool.
15810
15811         * cs-parser.jay: CheckDef now takes a Location argument that is
15812         used to report errors more precisly (instead of reporting the end
15813         of a definition, we try to track something which is a lot closer
15814         to the source of the problem).
15815
15816         * cs-tokenizer.cs: Track global token use, so we can properly flag
15817         the use of #define/#undef after the first token has been seen.
15818
15819         Also, rename the reportXXXX to Error_DescriptiveName
15820
15821         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15822         TypeContainer, so that Enum and Interface can use this too.
15823
15824         * class.cs (TypeContainer.LookupInterfaceOrClass,
15825         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15826         `builder' argument.  Typically this was used to pass the parent
15827         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15828         the definition).  
15829
15830         The problem is that a nested class could trigger the definition of
15831         a toplevel class, and the builder would be obviously wrong in that
15832         case. 
15833
15834         So we drop this argument, and we compute dynamically the
15835         TypeBuilder/ModuleBuilder (the correct information was available
15836         to us anyways from DeclSpace.Parent)
15837
15838         * interface.cs (Interface.DefineInterface): Drop builder
15839         parameter cleanup like class.cs
15840
15841         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15842         like class.cs
15843
15844         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15845         values. 
15846
15847         (Try.Emit): Propagate the returns value from the statement.
15848
15849         (Return.Emit): Even if we are leavning 
15850
15851         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15852
15853         * modifiers.cs: Fix the computation of MethodAttributes flags.
15854
15855 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15856
15857         * driver.cs: allow compilation of files that start with '/'.
15858         Add a default case when checking the argument of --target.
15859
15860 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15861
15862         * interface.cs: Implement the same search algorithm for types in
15863         the interface code.
15864
15865         * delegate.cs: Do not allow multiple definition.
15866
15867         * Recovered ChangeLog that got accidentally amputated
15868
15869         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15870
15871         * rootcontext.cs: Load manually enum to allow core classes to
15872         contain enumerations.
15873
15874         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15875         Update to new static methods in TypeManager.
15876
15877         * typemanager.cs (GetMethod, GetConstructor): Use our
15878         implementation of FindMembers to find the members, since during
15879         corlib compilation, the types are TypeBuilders and GetMethod and
15880         GetConstructor do not work.
15881
15882         Make all methods in TypeManager static.
15883
15884         (InitCodeHelpers): Split the functionality from
15885         the InitCodeTypes function.
15886
15887         * driver.cs: Call InitCodeHelpers after we have populated the
15888         types. 
15889
15890         * cs-parser.jay (delegate_declaration): we did not used to compute
15891         the delegate name correctly for void delegates.
15892
15893 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * rootcontext.cs (RootContext): Init the interface_resolve_order
15896         and type_container_resolve_order always.
15897
15898         (ResolveCore, BootstrapCorlib_ResolveClass,
15899         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15900         compiler when compiling with --nostdlib
15901
15902         * class.cs (TypeContainer.DefineType): Check that our parent is
15903         not null.  This test is most important when we are bootstraping
15904         the core types.
15905
15906         * codegen.cs: Split out the symbol writing code.
15907
15908 2002-03-25  Martin Baulig  <martin@gnome.org>
15909
15910         * driver.cs (-g): Made -g an alias for --debug.
15911
15912 2002-03-24  Martin Baulig  <martin@gnome.org>
15913
15914         * codegen.cs (SymbolWriter): New public variable. Returns the
15915         current symbol writer.
15916         (CodeGen): Added `bool want_debugging_support' argument to the
15917          constructor. If true, tell the ModuleBuild that we want debugging
15918         support and ask it for the ISymbolWriter.
15919         (Save): If we have a symbol writer, call it's Close() method after
15920         saving the assembly.
15921
15922         * driver.c (--debug): New command line argument to create a
15923         debugger information file.
15924
15925         * location.cs (SymbolDocument): New public property. Returns an
15926         ISymbolDocumentWriter object for the current source file or null
15927         if we don't have a symbol writer.
15928
15929 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15930
15931         * driver.cs (LoadAssembly): Correctly return when all the paths
15932         have been tried and not before.
15933
15934         * statement.cs (Switch.Emit): return the actual coverage for this
15935         statement (returns/not-returns)
15936
15937         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15938         switch of the statement if we are the last switch section.  That
15939         kills two problems: try/catch problems (we used to emit an empty
15940         nop at the end) and switch statements where all branches would
15941         return. 
15942
15943 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15944
15945         * driver.cs: Add default assemblies (the equivalent to the
15946         Microsoft CSC.RSP file)
15947
15948         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15949         also update tokens_seen and set it to false.
15950
15951         * driver.cs: Implement --recurse for Mike.
15952
15953         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15954         correctly splitting out the paths.
15955
15956 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15957
15958         * interface.cs (Interface.PopulateProperty): Instead of using
15959         `parent' as the declaration space for the set parameters, use
15960         `this' 
15961
15962         * support.cs (InternalParameters): InternalParameters constructor
15963         takes a DeclSpace instead of a TypeContainer.
15964
15965         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15966         types are being initialized, load the address of it before calling
15967         the function.  
15968
15969         (New): Provide a mechanism to disable the generation of local
15970         value type temporaries when the caller will be providing us with
15971         an address to store it.
15972
15973         (ArrayCreation.EmitDynamicInitializers): Use it.
15974
15975 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15976
15977         * expression.cs (Invocation.EmitArguments): Only probe for array
15978         property if there is more than one argument.  Sorry about that.
15979
15980         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15981         empty param arrays.
15982
15983         * class.cs (Method.LabelParameters): Fix incorrect code path that
15984         prevented the `ParamArrayAttribute' from being applied to the
15985         params attribute.
15986
15987 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15988
15989         * support.cs (ReflectionParameters): Correctly compute whether the
15990         last argument is a params array.  Fixes the problem with
15991         string.Split ('a')
15992
15993         * typemanager.cs: Make the assemblies array always be non-null
15994         (empty, but non-null)
15995
15996         * tree.cs (RecordDecl): New function that abstracts the recording
15997         of names.  This reports error 101, and provides a pointer to the
15998         previous declaration.  Fixes a crash in the compiler.
15999
16000         * cs-parser.jay (constructor_declaration): Update to new grammar,
16001         and provide a constructor_body that can be empty.
16002
16003 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16004
16005         * driver.cs: Add support for --resources.
16006
16007         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16008         Make all types for the various array helper methods be integer.
16009
16010         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16011         CheckState to ConvCast.
16012
16013         (ConvCast): Now it takes a `checked' state argument, to avoid
16014         depending on the emit context for the conversion, and just using
16015         the resolve time setting.
16016
16017         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16018         instead of Invocation.EmitArguments.  We do not emit the original
16019         arguments, instead we emit those which have been converted to
16020         unsigned int expressions.
16021
16022         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16023
16024         * codegen.cs: ditto.
16025
16026         * expression.cs (LocalVariableReference): Drop the use of the
16027         Store function that depended on the variable index.
16028
16029         * statement.cs (VariableInfo): Drop the `Idx' property from this
16030         class, as this is not taking into account the indexes for
16031         temporaries tat we generate during the execution, getting the
16032         indexes wrong.
16033
16034         * class.cs: First emit class initializers, then call the parent
16035         constructor. 
16036
16037         * expression.cs (Binary): Fix opcode emision.
16038         (UnaryMutator.EmitCode): Support checked code generation
16039
16040         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16041         matches for events for both the Static and Instance scans,
16042         pointing to the same element.   Fix that.
16043
16044 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16045
16046         * rootcontext.cs (ResolveTree): Always set the
16047         interface_resolve_order, because nested interfaces will be calling
16048         into us.
16049
16050         * class.cs (GetInterfaceOrClass): Track the same resolution
16051         process used by TypeManager.LookupType.  This fixes the nested
16052         type lookups in class declarations (separate path from
16053         LookupType). 
16054
16055         (TypeContainer.DefineType): Also define nested interfaces.
16056         (TypeContainer.RegisterOrder): New public function used to
16057         register the order in which child interfaces need to be closed.
16058
16059         Nested interfaces need to be closed after their parents have been
16060         created. 
16061
16062         * interface.cs (InterfaceAttr): Put all the logic for computing
16063         the interface attribute here. 
16064
16065         (DefineInterface): Register our interface order with the
16066         RootContext or with the TypeContainer depending on the case.
16067
16068 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * cs-parser.jay: rework foreach statement to work with the new
16071         changes to the policy on SimpleNames.
16072
16073         * report.cs: support Stacktrace on warnings as well.
16074
16075         * makefile: drop --unsafe and /unsafe from the compile.
16076
16077 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16078
16079         * ecore.cs (StandardConversionExists): Modify to take an Expression
16080         as the first parameter. Ensure we do null -> reference type conversion
16081         checking.
16082
16083         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16084         temporary Expression objects.
16085
16086 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16087
16088         * interface.cs: workaround bug in method overloading resolution
16089         (there is already a bugzilla bug for it).
16090
16091 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16092
16093         We could also solve this problem by having a separate path for
16094         performing type lookups, instead of DoResolve, we could have a
16095         ResolveType entry point, and only participating pieces of the
16096         production (simplename, deref, array) would implement this. 
16097
16098         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16099         signal SimpleName to only resolve type names and not attempt to
16100         resolve anything else.
16101
16102         * expression.cs (Cast): Set the flag.
16103
16104         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16105
16106         * class.cs: Only report 108 if there is no `new' modifier.
16107
16108         * cs-parser.jay: rework foreach statement to work with the new
16109         changes to the policy on SimpleNames.
16110
16111         * report.cs: support Stacktrace on warnings as well.
16112
16113         * makefile: drop --unsafe and /unsafe from the compile.
16114
16115 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16116
16117         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16118         lookups here, instead of doing that at parse time.  This means
16119         that our grammar will not introduce `LocalVariableReferences' as
16120         expressions at this point.  That solves the problem of code like
16121         this:
16122
16123         class X {
16124            static void Main ()
16125            { int X = 1;
16126             { X x = null }}}
16127
16128         This is only half the fix.  The full fix requires parameters to
16129         also be handled in this way.
16130
16131         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16132         makes the use more obvious of the DeclSpace.  The
16133         ec.TypeContainer.TypeBuilder is now only used to pull the
16134         TypeBuilder for it.
16135
16136         My theory is that I can get rid of the TypeBuilder completely from
16137         the EmitContext, and have typecasts where it is used (from
16138         DeclSpace to where it matters).  
16139
16140         The only pending problem is that the code that implements Aliases
16141         is on TypeContainer, and probably should go in DeclSpace.
16142
16143         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16144         lookups here, instead of doing that at parse time.  This means
16145         that our grammar will not introduce `LocalVariableReferences' as
16146         expressions at this point.  That solves the problem of code like
16147         this:
16148
16149         class X {
16150            static void Main ()
16151            { int X = 1;
16152             { X x = null }}}
16153
16154         This is only half the fix.  The full fix requires parameters to
16155         also be handled in this way.
16156
16157         * class.cs (Property.DefineMethod): When implementing an interface
16158         method, set newslot, when implementing an abstract method, do not
16159         set the flag (before we tried never setting it, or always setting
16160         it, which is the difference).
16161         (Indexer.DefineMethod): same.
16162         (Method.DefineMethod): same.
16163
16164         * ecore.cs: Only set the status used flag if we get back a Field.
16165
16166         * attribute.cs: Temporary hack, so Paolo can keep working.
16167
16168 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16169
16170         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16171         the unmanaged type in the case we have a MarshalAs attribute.
16172
16173         (Resolve): Handle the case when we are parsing the special MarshalAs
16174         attribute [we need to store the unmanaged type to use later]
16175
16176         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16177         MarshalAs Attribute.
16178
16179         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16180         on parameters and accordingly set the marshalling info.
16181
16182 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16183
16184         * class.cs: Optimizing slightly by removing redundant code after
16185         we switched to the `NoTypes' return value.
16186         (Property.DefineMethod): use NoTypes here too.
16187
16188         This fixes the bug I introduced in my last batch of changes.
16189
16190 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16191
16192         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16193
16194         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16195         Enums since those are types too. 
16196
16197         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16198
16199         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16200         thanks to a call during the lookup process.
16201
16202 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16203
16204         * statement.cs (Foreach): Lots of work to accomodate a particular
16205         kind of foreach statement that I had not kept in mind.  It is
16206         possible to have foreachs on classes that provide a GetEnumerator
16207         method that return objects that implement the "pattern" for using
16208         a foreach, there is no need to support GetEnumerator
16209         specifically. 
16210
16211         This is needed to compile nant.
16212
16213         * decl.cs: Only report 114 if the member is not `Finalize' and if
16214         the warning level is at least 2.
16215
16216         * class.cs: Moved the compare function from Method to
16217         MethodSignature. 
16218
16219         (MethodSignature.InheritableMemberSignatureCompare): Add new
16220         filter function that is used to extract inheritable methods from a
16221         class. 
16222
16223         (Method.Define): Use the new `inheritable_method_signature_filter'
16224         delegate
16225
16226         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16227         command. 
16228
16229 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16230
16231         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16232
16233         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16234
16235         * expression.cs: Pass location information to
16236         ConvertImplicitStandard. 
16237
16238         * class.cs: Added debugging code to track return values from
16239         interfaces. 
16240
16241 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16242
16243         * expression.cs (Is.DoResolve): If either side of the `is' is an
16244         interface, do not flag the warning.
16245
16246         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16247         for interfaces
16248
16249         * report.cs: Allow for --fatal to be used with --probe.
16250
16251         * typemanager.cs (NoTypes): Move the definition for the empty Type
16252         array here. 
16253
16254         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16255         properties. 
16256         (TypeContainer.DefineProxy): New function used to proxy to parent
16257         implementations when implementing interfaces.
16258         (TypeContainer.ParentImplements): used to lookup if our parent
16259         implements a public function that is required by an interface.
16260         (TypeContainer.VerifyPendingMethods): Hook this up.
16261
16262         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16263         `modules' and `assemblies' arraylists into arrays.  We only grow
16264         these are the very early start up of the program, so this improves
16265         the speedof LookupType (nicely measured).
16266
16267         * expression.cs (MakeByteBlob): Replaced unsafe code with
16268         BitConverter, as suggested by Paolo.
16269
16270         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16271         folding of string concatenation, but if either side is a string,
16272         and the other is not, then return null, and let the runtime use
16273         the concatenation on the string plus the object (using
16274         `Object.ToString'). 
16275
16276 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16277
16278         Constant Folding has been implemented now.
16279
16280         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16281         the error instead on types that are not supported in one's
16282         complement. 
16283
16284         * constant.cs (Constant and all children): New set of functions to
16285         perform implict and explicit conversions.
16286
16287         * ecore.cs (EnumConstant): Implement the new functions to perform
16288         conversion by proxying to the child expression.
16289
16290         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16291         own separate setting that can not be turned off from the command
16292         line using --unchecked or --checked and is only controlled using
16293         the checked/unchecked statements and expressions.  This setting is
16294         used by the constant folder to flag errors.
16295
16296         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16297         ConstantCheckState as well.   
16298
16299         During Resolve, they also have to flag the state, because the
16300         constant folder runs completely in the Resolve phase.
16301
16302         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16303         well.
16304
16305 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16306
16307         * cfold.cs: New file, this file contains the constant folder.
16308
16309         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16310         argument to track whether we are using the resulting address to
16311         load or store a value and provide better error messages. 
16312
16313         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16314         new AddressOf arguments.
16315
16316         * statement.cs (Foreach.EmitCollectionForeach): Update
16317
16318         * expression.cs (Argument.Emit): Call AddressOf with proper
16319         arguments to track usage.
16320
16321         (New.DoEmit): Call AddressOf with new arguments.
16322
16323         (Unary.Emit): Adjust AddressOf call.
16324
16325 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16326
16327         * cs-parser.jay (member_access): Change the case for pre-defined types
16328         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16329         this suggestion.
16330
16331         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16332         a method body.
16333
16334         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16335         essentially like methods and apply attributes like MethodImplOptions to them too.
16336
16337         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16338         not being null.
16339
16340         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16341         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16342         is the DeclSpace.
16343
16344         * Update code everywhere accordingly.
16345
16346         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16347
16348         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16349
16350 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16351
16352         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16353         try performing lookups against those instead of jumping straight into using
16354         the 'using' clauses.
16355
16356         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16357
16358         (LookupType): Perform lookups in implicit parents too.
16359
16360         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16361         sequence as RootContext.LookupType. 
16362
16363         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16364         the various cases of namespace lookups into this method.
16365
16366 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16367
16368         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16369         in positional arguments)
16370
16371         * class.cs (Operator): Update the AllowedModifiers to contain
16372         extern. 
16373
16374         * cs-parser.jay: Update operator declaration to allow for the
16375         operator body to be empty.
16376
16377         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16378         values. 
16379
16380 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16381
16382         * class.cs (Method.Emit): Label parameters.
16383
16384         * driver.cs: Return 1 or 0 as the program exit code.
16385
16386 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16387
16388         * expression.cs: Special case the `null' object when trying to
16389         auto-compute the type, as anything can be explicitly converted to
16390         that. 
16391
16392         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16393         spotting this Paolo.
16394
16395         (Expression.ImplicitNumericConversion): Perform comparissions of
16396         the type using the underlying type in the case of an enumeration
16397         rather than using the enumeration type for the compare.
16398
16399         Cope with the underlying == type case, which is not possible to
16400         catch before. 
16401
16402         (Expression.ConvertNumericExplicit): Perform comparissions of
16403         the type using the underlying type in the case of an enumeration
16404         rather than using the enumeration type for the compare.
16405
16406         * driver.cs: If the user does not supply an extension, assume .exe
16407
16408         * cs-parser.jay (if_statement): Rewrote so that we can track the
16409         location for the if statement.
16410
16411         * expression.cs (Binary.ConstantFold): Only concat strings when
16412         the operation is "+", not everything ;-)
16413
16414         * statement.cs (Statement.EmitBoolExpression): Take a location
16415         argument. 
16416         (If, While, Do): Track location.
16417
16418         * expression.cs (Binary.ResolveOperator): In the object + string
16419         case, I was missing a call to ConvertImplicit
16420
16421 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16422
16423         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16424         Location arguments. Ensure we use RootContext.LookupType to do our work
16425         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16426
16427         * interface.cs (PopulateMethod): Handle the type of the parameter being
16428         null gracefully.
16429
16430         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16431         have a params method with no fixed arguments and a call is made with no
16432         arguments.
16433
16434 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16437         the verbatim-string-literal
16438
16439         * support.cs (InternalParameters.ParameterModifier): handle null
16440         fixed parameters.
16441         (InternalParameters.ParameterType): ditto.
16442
16443         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16444         duplicating the name of the variable parameter.
16445         (GetParameterByName): Fix bug where we were not looking up array
16446         paramters if they were the only present (thanks Paolo!).
16447         (GetParameterInfo): We only have an empty set of types if both
16448         fixed and array are set to null.
16449         (GetParameterInfo-idx): Handle FixedParameter == null
16450
16451         * cs-parser.jay: Handle the case where there is no catch
16452         statements (missing null test).
16453
16454 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16455
16456         * driver.cs (MainDriver): Be conservative on our command line
16457         handling.
16458
16459         Catch DirectoryNotFoundException when calling GetFiles.
16460
16461         (SplitPathAndPattern): Used to split the input specification into
16462         a path and a pattern that we can feed to Directory.GetFiles.
16463
16464 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16465
16466         * statement.cs (Fixed): Implement the last case of the Fixed
16467         statement (string handling).
16468
16469         * expression.cs (StringPtr): New class used to return a char * to
16470         a string;  Used by the Fixed statement.
16471
16472         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16473
16474         * expression.cs (Binary.ResolveOperator): Remove redundant
16475         MemberLookup pn parent type.
16476         Optimize union call, we do not need a union if the types are the same.
16477         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16478         type.
16479
16480         Specialize the use of MemberLookup everywhere, instead of using
16481         the default settings. 
16482
16483         (StackAlloc): Implement stackalloc keyword.
16484
16485         * cs-parser.jay: Add rule to parse stackalloc.
16486
16487         * driver.cs: Handle /h, /help, /?
16488
16489         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16490         before we supported unsafe code.
16491
16492         * makefile: add --unsafe to the self compilation of mcs.
16493
16494 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16495
16496         * expression.cs (PointerArithmetic): New class that is used to
16497         perform pointer arithmetic.
16498         (Binary.Resolve): Handle pointer arithmetic
16499         Handle pointer comparission.
16500         (ArrayPtr): Utility expression class that is used to take the
16501         address of an array.
16502
16503         (ElementAccess): Implement array access for pointers
16504
16505         * statement.cs (Fixed): Implement fixed statement for arrays, we
16506         are missing one more case before we are done.
16507
16508         * expression.cs (Indirection): Implement EmitAssign and set the
16509         ExprClass to Variable.  This allows pointer dereferences to be
16510         treated as variables, and to have values assigned to them.
16511
16512         * ecore.cs (Expression.StoreFromPtr): New utility function to
16513         store values dereferencing.
16514
16515 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16516
16517         * expression.cs (Binary.ResolveOperator): Ensure that we are
16518         not trying to operate on a void type - this fixes the reported
16519         bug.
16520
16521         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16522         the parent implementation is sealed.
16523
16524         * ../errors/cs0239.cs : Add.
16525
16526         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16527
16528         * typemanager.cs (unverifiable_code_type): Corresponds to 
16529         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16530         which have unsafe code in them.
16531
16532         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16533         unsafe context.
16534
16535 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16536
16537         * cs-tokenizer.cs: Add support for @"litreal strings"
16538
16539         Make tokenizer accept pre-processor directives
16540         on any column (remove the old C-like limitation). 
16541
16542         * rootcontext.cs (EmitCode): Emit any global attributes.
16543         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16544
16545         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16546
16547         * cs-parser.jay: Add support for global attributes.  
16548
16549 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16550
16551         * expression.cs (Indirection): New helper class.  Unary will
16552         create Indirection classes to be able to implement the
16553         IMemoryLocation interface on it.
16554
16555 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16556
16557         * cs-parser.jay (fixed_statement): reference the right statement.
16558
16559         * statement.cs (Fixed.Emit): Finish implementing the fixed
16560         statement for the &x case.
16561
16562 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16563
16564         * class.cs (Property.Define, Method.Define): Remove newslot when
16565         `implementing'.  
16566
16567         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16568         wrong.  NewSlot should only be used if the `new' keyword is present.
16569
16570         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16571         locating our system dir.  Sorry about this.
16572
16573 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16574
16575         * driver.cs (GetSystemDir): Compute correctly the location of our
16576         system assemblies.  I was using the compiler directory instead of
16577         the library directory.
16578
16579 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16580
16581         * expression.cs (BetterFunction): Put back in what Miguel commented out
16582         since it is the correct fix. The problem is elsewhere ;-)
16583
16584         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16585         parameters of the parms method are themselves compatible or not !
16586
16587         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16588         to check that a class implements an interface before saying that an implicit
16589         conversion was allowed. Use ImplementsInterface to do the checking.
16590
16591 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16592
16593         * class.cs (Method.Define): Track whether we are an explicit
16594         implementation or not.  And only call DefineMethodOverride if we
16595         are an explicit implementation.
16596
16597         (Property.DefineMethod): Ditto.
16598
16599 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16600
16601         * expression.cs (BetterFunction): Catch hideous bug which was
16602          preventing us from detecting ambiguous calls due to implicit casts i.e
16603         cs0121.
16604
16605 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16606
16607         * support.cs (Pair): Remove un-needed method.  I figured why I was
16608         getting the error in cs-parser.jay, the variable in a foreach loop
16609         is readonly, and the compiler does not really treat this as a variable.
16610
16611         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16612         instead of EQUALS in grammar.  
16613
16614         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16615
16616         * expression.cs (Unary.DoResolve): Check whether the argument is
16617         managed or not.
16618
16619 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16620
16621         * support.cs: Api for Pair to set a value.  Despite the fact that
16622         the variables are public the MS C# compiler refuses to compile
16623         code that accesses the field if the variable is part of a foreach
16624         statement. 
16625
16626         * statement.cs (Fixed): Begin implementation of the fixed
16627         statement.
16628
16629         (Block.AddVariable): Return the VariableInfo on success and null
16630         on failure instead of true/false. 
16631
16632         * cs-parser.jay (foreach): Catch errors on variables already
16633         defined (we were ignoring this value before) and properly unwind
16634         the block hierarchy
16635
16636         (fixed_statement): grammar for the fixed statement.
16637
16638 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16639
16640         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16641         pointer types to be incretemented.
16642
16643         (SizeOf): Implement.
16644
16645         * cs-parser.jay (pointer_member_access): Implement
16646         expr->IDENTIFIER production.
16647
16648         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16649         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16650         on safe contexts.
16651
16652         (Unary): Implement indirection.
16653
16654         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16655         use in non-unsafe context).
16656
16657         (SimpleName.DoResolve): Check for pointers in field access on safe
16658         contexts. 
16659
16660         (Expression.LoadFromPtr): Factor the load-indirect code in this
16661         function.  This was duplicated in UnboxCast and ParameterReference
16662
16663 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16664
16665         * expression.cs (ComposedCast): report an error if a pointer cast
16666         is used in a safe region.
16667
16668         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16669         pointer type casts in unsafe context.
16670
16671         * codegen.cs (EmitContext): Set up IsUnsafe.
16672
16673         * cs-parser.jay (non_expression_type): Add productions for pointer
16674         casts. 
16675
16676         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16677         code.  We should not use force into static mode if the method is
16678         not virtual.  Fixes bug in MIS
16679
16680         * statement.cs (Do.Emit, While.Emit, For.Emit,
16681         Statement.EmitBoolExpression): Add support to Do and While to
16682         propagate infinite loop as `I do return' semantics.
16683
16684         Improve the For case to also test for boolean constants.
16685
16686         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16687         to the list of attributes we can add.
16688
16689         Remove `EmitContext' argument.
16690
16691         * class.cs (Method.Define): Apply parameter attributes.
16692         (Constructor.Define): Apply parameter attributes.
16693         (MethodCore.LabelParameters): Move here the core of labeling
16694         parameters. 
16695
16696         * support.cs (ReflectionParameters.ParameterModifier,
16697         InternalParameters.ParameterModifier): Use IsByRef on the type and
16698         only return the OUT bit for these parameters instead of in/out/ref
16699         flags.
16700
16701         This is because I miss-understood things.  The ParameterInfo.IsIn
16702         and IsOut represent whether the parameter has the [In] and [Out]
16703         attributes set.  
16704
16705 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16706
16707         * ecore.cs (FieldExpr.Emit): Release temporaries.
16708
16709         * assign.cs (LocalTemporary.Release): new function.
16710
16711         * codegen.cs (EmitContext.GetTemporaryStorage,
16712         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16713         temporary storage.  Now we can "put back" localbuilders when we
16714         are done with them
16715
16716 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16717
16718         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16719         need to make a copy of the variable to generate verifiable code.
16720
16721 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16722
16723         * driver.cs: Compute dynamically the system directory.
16724
16725         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16726         Slower, but more generally useful.  Used by the abstract
16727         registering implementation. 
16728
16729         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16730         the rules for the special rule on Type/instances.  First check if
16731         we have the same name, and if so, try that special static path
16732         rather than the instance path.
16733
16734 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16735
16736         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16737         for, while and if.
16738
16739         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16740         Enum, ValueType, Delegate or Array for non-corlib compiles.
16741
16742         * cs-tokenizer.cs: Catch long identifiers (645)
16743
16744         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16745         piece of code.
16746
16747         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16748         fix, we were returning too early, so we were not registering
16749         pending methods from abstract classes.
16750
16751         Do not register pending methods if the class is abstract.
16752
16753         * expression.cs (Conditional.DoResolve): Report circular implicit
16754         conversions when we neecd to compute it for conditional
16755         expressions. 
16756
16757         (Is.DoResolve): If the expression is always of the provided type,
16758         flag warning 183.  If the expression can not ever be of the
16759         provided type flag warning 184.
16760
16761         * class.cs: Catch 169 as well.
16762
16763         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16764         read. 
16765
16766 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16767
16768         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16769
16770 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16771
16772         * interface.cs: (PopulateMethod): Check for pointers being defined
16773         only if the unsafe context is active.
16774         (PopulateProperty): ditto.
16775         (PopulateIndexer): ditto.
16776
16777         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16778         specified.  If pointers are present, make sure that they are
16779         present in an unsafe context.
16780         (Constructor, Constructor.Define): ditto.
16781         (Field, Field.Define): ditto.
16782         (Property, Property.Define): ditto.
16783         (Event, Event.Define): ditto.
16784
16785         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16786         hashtable if there are classes or structs defined.
16787
16788         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16789         code, as the constant resolution moved.
16790
16791         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16792         the metadata, so we can flag error 133. 
16793
16794         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16795         pointer is being declared in an unsafe context.
16796
16797 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16798
16799         * modifiers.cs (Modifiers.Check): Require a Location argument.
16800         Report error 227 for Unsafe use.
16801
16802         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16803
16804         * statement.cs (For.Emit): If the test is null, then report that
16805         we do `return', as we wont reach anything afterwards.
16806
16807         (Switch.SwitchGoverningType): Track the expression that matched
16808         the conversion.
16809
16810         * driver.cs: Allow negative numbers as an error code to flag.
16811
16812         * cs-parser.jay: Handle 1551.
16813
16814         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16815
16816 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16817
16818         * cs-parser.jay: Report 1518 (type declaration can only contain
16819         class, struct, interface, enum or delegate)
16820
16821         (switch_label): Report 1523 (keywords `case' or `default' must
16822         preced code)
16823
16824         (opt_switch_sections): Report 1522 (empty switch)
16825
16826         * driver.cs: Report 1515 (response file specified multiple times)
16827         Report 1516 (Source file specified multiple times).
16828
16829         * expression.cs (Argument.Resolve): Signal 1510
16830
16831         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16832         access not allowed in static code)
16833
16834 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16835
16836         * typemanager.cs (IsPointerType): Utility method which we are going
16837         to need a lot.
16838
16839         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16840         the object type, so we take care of that.
16841
16842         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16843
16844         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16845         added to non-params parameters :-)
16846
16847         * typemanager.cs (CSharpName): Include 'void' type too. 
16848
16849         (void_ptr_type): Include in the set of core types.
16850
16851         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16852         duplicating code.
16853
16854         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16855         an unsafe context.
16856
16857         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16858         completely forgotten about it.
16859
16860 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16861
16862         * cs-parser.jay (pointer_type): Add. This begins our implementation
16863         of parsing rules for unsafe code.
16864
16865         (unsafe_statement): Implement.
16866
16867         (embedded_statement): Modify to include the above.
16868
16869         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16870
16871         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16872         if the current context is an unsafe one.
16873
16874         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16875         are handled differently, we need separate rules for them.
16876
16877         (local_variable_declaration): Update to use local_variable_pointer_type
16878         to allow variable declarations of unmanaged pointer types.
16879
16880         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16881         in unsafe contexts.
16882
16883         * ../errors/cs0214.cs : Add.
16884
16885 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16886
16887         * makefile: remove 'response' file when cleaning.
16888
16889 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16890
16891         * cs-parser.jay: Report 1524.
16892
16893 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16894
16895         * typemanager.cs (RegisterMethod): drop checking if we have
16896         registered this from here
16897
16898 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16899
16900         * class.cs (Method.EmitDestructor): Implement calling our base
16901         destructor. 
16902
16903         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16904         value of InFinally.
16905
16906         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16907         this routine and will wrap the call in a try/catch block.  Deal
16908         with the case.
16909
16910 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16911
16912         * ecore.cs (Expression.MemberLookup): instead of taking a
16913         parameter `same_type' that was used to tell whether we could
16914         access private members we compute our containing type from the
16915         EmitContext.
16916
16917         (FieldExpr): Added partial support for volatile fields.  This does
16918         not work for volatile fields exposed from assemblies, as I can not
16919         figure out how to extract the modreq from it.
16920
16921         Updated all the source files to use this.
16922
16923         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16924         because it is referenced by MemberLookup very often. 
16925
16926 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16927
16928         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16929         TypeBuilder.GetCustomAttributes to retrieve what we need.
16930
16931         Get rid of redundant default_member_attr_type as this is the same as
16932         default_member_type which already exists.
16933
16934         * interface.cs, attribute.cs : Update accordingly.
16935
16936 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16937
16938         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16939         work for TYpeBuilders though.  Ravi, can you please fix this?
16940
16941         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16942
16943         * expression.cs (Argument.Emit): Handle the case of ref objects
16944         being passed to ref functions;  
16945
16946         (ParameterReference.EmitLoad): Loads the content of the pointer
16947         without dereferencing.
16948
16949 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16950
16951         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16952
16953 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16954
16955         * class.cs (Indexer.DefineMethod): Incorporate the interface
16956         type in the name of the method if we are doing explicit interface
16957         implementation.
16958
16959         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16960
16961         (BetterConversion): Fix extremely trivial bug where we were referring to
16962         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16963         again !
16964
16965         * ../errors/bug16.cs : Add although we have fixed it.
16966
16967 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16968
16969         * expression.cs (BaseIndexer): Begin implementation.
16970
16971         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16972
16973         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16974         production directly to remove a shift/reduce, and implement
16975         explicit interface implementation.
16976
16977         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16978         after a floating point suffix.
16979
16980         * expression.cs (DoNumericPromotions): Improved the conversion for
16981         uint/uint.  If we have a constant, we avoid doing a typecast to a
16982         larger type.
16983
16984         * class.cs (Indexer): Implement explicit interface implementation
16985         for indexers.
16986
16987 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16988
16989         * class.cs: make the default instance constructor public and hidebysig.
16990
16991 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16992
16993         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16994         so we can call it from elsewhere.
16995
16996         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16997         we emit it internally if the class has a defined indexer; otherwise the user
16998         emits it by decorating the class definition with the DefaultMemberAttribute.
16999
17000         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17001         attribute is not used on a type which defines an indexer.
17002
17003         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17004         character when we skip whitespace.
17005
17006         * ../errors/cs0646.cs : Add.
17007
17008 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17011         again. 
17012
17013         * makefile: Add practical target `mcs3.exe' which builds the third
17014         generation compiler. 
17015
17016         * expression.cs (New): Fix structures constructor calling.
17017
17018         * class.cs (Property, Method, Indexer): Emit Final flag on the
17019         method if we are an interface implementation and we are not
17020         abstract. 
17021
17022         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17023         whether this property is referencing a `base' method.
17024
17025         * expression.cs (Invocation.EmitCall): take an extra argument:
17026         is_base, this is used to determine whether the `call' or
17027         `callvirt' opcode should be used.
17028
17029
17030         * delegate.cs: update EmitCall.
17031
17032         * class.cs (Method.Define): Set NewSlot for the cases where we are
17033         not implementing an interface method.
17034
17035         (Property.Define): ditto.
17036
17037 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17040         'r'.  Allows mcs to parse itself fully.
17041
17042 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17043
17044         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17045         of the number of initializers that require the InitializeArray method.
17046
17047         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17048         update the above field where necessary.
17049
17050         (MakeByteBlob): Update accordingly.
17051
17052         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17053         greater than 2.
17054
17055         (EmitDynamicInitializers): Update in accordance with the new optimization.
17056
17057         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17058         same OpCode applies.
17059
17060         * cs-parser.jay : Fix some glaring errors I introduced.
17061
17062 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17063
17064         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17065         so that we can check for name clashes there too.
17066
17067         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17068         for interface indexers.
17069
17070         * interfaces.cs (Define): Emit the default member attribute.
17071
17072         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17073         variable was being referred to while setting the value ;-)
17074
17075 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17076
17077         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17078         byte-by-byte information when we know the data is zero.
17079
17080         Make the block always a multiple of 4, because
17081         DefineInitializedData has a bug.
17082
17083         * assign.cs: Fix, we should assign from the temporary, not from
17084         the source. 
17085
17086         * expression.cs (MakeByteBlob): Fix my incorrect code.
17087
17088 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17089
17090         * typemanager.cs (EnumToUnderlying): This function is used to get
17091         the underlying type from an enumeration, because it does not
17092         always work. 
17093
17094         * constant.cs: Use the I4_S form for values between -128 and 127.
17095
17096         * statement.cs (Block.LookupLabel): Looks up a label.
17097         (Block): Drop support for labeled blocks.
17098
17099         (LabeledStatement): New kind of statement that represents a label
17100         only.
17101
17102         (Goto): Finally implement this bad boy.
17103
17104         * cs-parser.jay: Update to reflect new mechanism to implement
17105         labels.
17106
17107 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17108
17109         * codegen.cs (EmitContext.This): a codegen property that keeps the
17110         a single instance of this instead of creating many different this
17111         instances. 
17112
17113         * delegate.cs (Delegate.DoResolve): Update to use the property;
17114
17115         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17116
17117         * expression.cs (BaseAccess.DoResolve): Ditto.
17118
17119 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17120
17121         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17122         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17123
17124         (InitCoreTypes): Update accordingly.
17125
17126         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17127         so we can quickly store the state.
17128
17129         (ApplyAttributes): Set the correct implementation flags
17130         for InternalCall methods.
17131
17132 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17133
17134         * expression.cs (EmitCall): if a method is not virtual, then do
17135         not use callvirt on it.
17136
17137         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17138         user defined stuff) requires the use of stobj, which takes an
17139         address on the stack instead of an array and an index.  So emit
17140         the Ldelema operation for it.
17141
17142         (EmitStoreOpcode): Use stobj for valuetypes.
17143
17144         (UnaryMutator.EmitCode): Use the right 1 value depending on
17145         whether we are dealing with int64/uint64, float or doubles.
17146
17147         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17148         constructors that I implemented last night.
17149
17150         (Constructor.IsDefault): Fix to work properly for static
17151         constructors.
17152
17153         * cs-parser.jay (CheckDef): report method signature errors.
17154         Update error number 103 to be 132.
17155
17156         * decl.cs: New AdditionResult enumeration value: MethodExists.
17157         Although we do this check for methods later on in the semantic
17158         analysis, catching repeated default constructors is so easy that
17159         we catch these here. 
17160
17161         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17162         promotions code.
17163
17164         (ParameterReference.EmitAssign, Emit): handle
17165         bools as bytes.
17166
17167         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17168         (ArrayAccess.EmitStoreOpcode): ditto.
17169
17170         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17171
17172         * expression.cs (MakeByteBlob): Complete all the missing types
17173         (uint, short, ushort, byte, sbyte)
17174
17175         * class.cs: Only init instance field initializers on instance
17176         constructors. 
17177
17178         Rename `constructors' to instance_constructors. 
17179
17180         (TypeContainer.AddConstructor): Only add constructors to the list
17181         if it is not static.
17182
17183         Make sure that we handle default_static_constructor independently
17184         everywhere where we handle instance_constructors
17185
17186 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17187
17188         * class.cs: Do not lookup or create a base initializer for a
17189         static constructor.
17190
17191         (ConstructorInitializer.Resolve): use the proper type to lookup
17192         for constructors.
17193
17194         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17195
17196         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17197         in DeclSpace. 
17198
17199         * decl.cs: CloseType is now an virtual method, the default
17200         implementation just closes this type.
17201
17202 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17203
17204         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17205         to PreserveSig by default. Also emit HideBySig on such methods.
17206
17207         Basically, set the defaults to standard values.
17208
17209         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17210         argument, if candidate is better, it can't be worse than the best !
17211
17212         (Invocation): Re-write bits to differentiate between methods being
17213         applicable in their expanded form and their normal form - for params
17214         methods of course.
17215
17216         Get rid of use_standard everywhere as only standard conversions are allowed
17217         in overload resolution. 
17218
17219         More spec conformance.
17220
17221 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * driver.cs: Add --timestamp, to see where the compiler spends
17224         most of its time.
17225
17226         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17227         `this' in static code.
17228
17229         (SimpleName.DoResolve): Implement in terms of a helper function
17230         that allows static-references to be passed upstream to
17231         MemberAccess.
17232
17233         (Expression.ResolveWithSimpleName): Resolve specially simple
17234         names when called by MemberAccess to implement the special
17235         semantics. 
17236
17237         (Expression.ImplicitReferenceConversion): Handle conversions from
17238         Null to reference types before others, as Null's type is
17239         System.Object. 
17240
17241         * expression.cs (Invocation.EmitCall): Handle the special case of
17242         calling methods declared on a reference type from a ValueType
17243         (Base classes System.Object and System.Enum)
17244
17245         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17246         the left hand side is a TypeExpr, not on every enumeration. 
17247
17248         (Binary.Resolve): If types are reference types, then do a cast to
17249         object on operators != and == of both arguments.
17250
17251         * typemanager.cs (FindMembers): Extract instance and static
17252         members if requested.
17253
17254         * interface.cs (PopulateProperty): Use void_type instead of null
17255         as the return type for the setter method.
17256
17257         (PopulateIndexer): ditto.
17258
17259 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17260
17261         * support.cs (ReflectionParameters): Fix minor bug where we
17262         were examining the wrong parameter for the ParamArray attribute.
17263
17264         Cope with requests for the type of the parameter at position
17265         greater than the params parameter's. We now return the element
17266         type of the params array as that makes more sense.
17267
17268         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17269         accordingly as we no longer have to extract the element type
17270         ourselves.
17271
17272         (Invocation.OverloadResolve): Update.
17273
17274 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17275
17276         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17277         against IEnumerator, test whether the return value is a descendant
17278         of the IEnumerator interface.
17279
17280         * class.cs (Indexer.Define): Use an auxiliary method to implement
17281         the other bits of the method definition.  Begin support for
17282         explicit interface implementation.
17283
17284         (Property.DefineMethod): Use TypeManager.void_type instead of null
17285         for an empty return value.
17286
17287 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17288
17289         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17290         dealing with a FieldExpr which is composed of a FieldBuilder, in
17291         the code path we did extract the constant, but we should have
17292         obtained the underlying value to be able to cast it (otherwise we
17293         end up in an infinite loop, this is what Ravi was running into).
17294
17295         (ArrayCreation.UpdateIndices): Arrays might be empty.
17296
17297         (MemberAccess.ResolveMemberAccess): Add support for section
17298         14.5.4.1 that deals with the special case of E.I when E is a type
17299         and something else, that I can be a reference to a static member.
17300
17301         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17302         handle a particular array type to create byte blobs, it is just
17303         something we dont generate byteblobs for.
17304
17305         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17306         arguments. 
17307
17308         * location.cs (Push): remove the key from the hashtable that we
17309         are about to add.   This happens for empty files.
17310
17311         * driver.cs: Dispose files after we have parsed them.
17312
17313         (tokenize): new function that only runs the tokenizer on its
17314         input, for speed testing.
17315
17316 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17317
17318         * class.cs (Event.Define): Define the private field only if there
17319         are no accessors defined.
17320
17321         * expression.cs (ResolveMemberAccess): If there is no associated
17322         field with the event, that means we have an event defined with its
17323         own accessors and we should flag error cs0070 since transforming
17324         ourselves into a field is not valid in that case.
17325
17326         * ecore.cs (SimpleName.DoResolve): Same as above.
17327
17328         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17329         and charset to sane values.
17330
17331 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17332
17333         * assign.cs (DoResolve): Perform check on events only if they 
17334         are being accessed outside the declaring type.
17335
17336         * cs-parser.jay (event_declarations): Update rules to correctly
17337         set the type of the implicit parameter etc.
17338
17339         (add_accessor, remove_accessor): Set current local parameters.
17340
17341         * expression.cs (Binary): For delegate addition and subtraction,
17342         cast the return value from the method into the appropriate delegate
17343         type.
17344
17345 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17346
17347         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17348         of these as the workaround is unnecessary.
17349
17350         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17351         delegate data - none of that is needed at all.
17352
17353         Re-write bits to extract the instance expression and the delegate method
17354         correctly.
17355
17356         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17357         on delegates too.
17358
17359         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17360         of attaching attributes instead of duplicating code everywhere.
17361
17362         * everywhere : Update code to do attribute emission using the above method.
17363
17364 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17365
17366         * expression.cs (IsParamsMethodApplicable): if there are not
17367         parameters, return immediately.
17368
17369         * ecore.cs: The 0 literal can be implicity converted to an enum
17370         type. 
17371
17372         (SimpleName.DoResolve): First lookup the type, then lookup the
17373         members. 
17374
17375         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17376         want to get its address.  If the InstanceExpression is not
17377         addressable, store the result in a temporary variable, then get
17378         the address of it.
17379
17380         * codegen.cs: Only display 219 errors on warning level or above. 
17381
17382         * expression.cs (ArrayAccess): Make it implement the
17383         IMemoryLocation interface.
17384
17385         (Binary.DoResolve): handle the operator == (object a, object b)
17386         and operator != (object a, object b) without incurring into a
17387         BoxedCast (because 5 != o should never be performed).
17388
17389         Handle binary enumerator operators.
17390
17391         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17392         value type, otherwise use Ldelem_ref.
17393
17394         Use precomputed names;
17395
17396         (AddressOf): Implement address of
17397
17398         * cs-parser.jay (labeled_statement): Fix recursive block
17399         addition by reworking the production.
17400
17401         * expression.cs (New.DoEmit): New has a special case:
17402                 
17403                  If we are dealing with a ValueType, we have a few
17404                  situations to deal with:
17405                 
17406                     * The target of New is a ValueType variable, that is
17407                       easy, we just pass this as the variable reference
17408                 
17409                     * The target of New is being passed as an argument,
17410                       to a boxing operation or a function that takes a
17411                       ValueType.
17412                 
17413                       In this case, we need to create a temporary variable
17414                       that is the argument of New.
17415
17416
17417 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17418
17419         * rootcontext.cs (LookupType): Check that current_type is not null before
17420         going about looking at nested types.
17421
17422         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17423         not implement the IAssignMethod interface any more.
17424
17425         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17426         where we tranform them into FieldExprs if they are being resolved from within
17427         the declaring type.
17428
17429         * ecore.cs (SimpleName.DoResolve): Do the same here.
17430
17431         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17432
17433         * ../errors/bug10.cs : Add.
17434
17435         * ../errors/cs0070.cs : Add.
17436
17437         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17438
17439         * assign.cs : Get rid of EventIsLocal everywhere.
17440
17441 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17442
17443         * ecore.cs (ConvertIntLiteral): finished the implementation.
17444
17445         * statement.cs (SwitchLabel): Convert the value we are using as a
17446         key before looking up the table.
17447
17448 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17449
17450         * codegen.cs (EmitTopBlock): Require a Location argument now.
17451
17452         * cs-parser.jay (constructor_declarator): We need to setup
17453         current_local_parameters before we parse the
17454         opt_constructor_initializer, to allow the variables to be bound
17455         to the constructor arguments.
17456
17457         * rootcontext.cs (LookupType): First lookup nested classes in our
17458         class and our parents before we go looking outside our class.
17459
17460         * expression.cs (ConstantFold): Extract/debox the values at the
17461         beginnning. 
17462
17463         * rootcontext.cs (EmitCode): Resolve the constants first before we
17464         resolve the types.  This is not really needed, but it helps debugging.
17465
17466         * statement.cs: report location.
17467
17468         * cs-parser.jay: pass location to throw statement.
17469
17470         * driver.cs: Small bug fix.
17471
17472         * report.cs: Updated format to be 4-zero filled digits.
17473
17474 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17475
17476         * expression.cs (CheckIndices): Fix minor bug where the wrong
17477         variable was being referred to ;-)
17478
17479         (DoEmit): Do not call EmitStaticInitializers when the 
17480         underlying type is System.Object.
17481
17482 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17483
17484         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17485         and do the usual workaround for SRE.
17486
17487         * class.cs (MyEventBuilder.EventType): New member to get at the type
17488         of the event, quickly.
17489
17490         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17491
17492         * assign.cs (Assign.DoResolve): Handle the case when the target
17493         is an EventExpr and perform the necessary checks.
17494
17495         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17496         interface.
17497
17498         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17499
17500         (EventExpr): Set the type in the constructor itself since we 
17501         are meant to be born fully resolved.
17502
17503         (EventExpr.Define): Revert code I wrote earlier.
17504                 
17505         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17506         instance expression is null. The instance expression is a This in that case
17507         or a null, depending on whether it is a static method or not.
17508
17509         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17510         refers to more than one method.
17511
17512         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17513         and accordingly flag errors.
17514
17515 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17516
17517         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17518
17519 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17520
17521         * location.cs (ToString): Provide useful rutine.
17522
17523 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17524
17525         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17526         objects, return the actual integral boxed.
17527
17528         * statement.cs (SwitchLabel): define an ILLabel for each
17529         SwitchLabel. 
17530
17531         (Switch.CheckSwitch): If the value is a Literal, extract
17532         the underlying literal.
17533
17534         Also in the unused hashtable we had, add the SwitchLabel so we can
17535         quickly look this value up.
17536
17537         * constant.cs: Implement a bunch of new constants.  Rewrite
17538         Literal based on this.  Made changes everywhere to adapt to this.
17539
17540         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17541         dereferencing array only once, and also copes with enumrations.
17542
17543         bytes are two bytes wide, not one.
17544
17545         (Cast): Perform constant conversions.
17546
17547         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17548         wrappers to the literals here.
17549
17550         * expression.cs (DoNumericPromotions): long literals can converted
17551         to ulong implicity (this is taken care of elsewhere, but I was
17552         missing this spot).
17553
17554         * ecore.cs (Expression.Literalize): Make the return type Literal,
17555         to improve type checking.
17556
17557         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17558
17559 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17560
17561         * literal.cs: Revert code from ravi that checked the bounds.  The
17562         bounds are sane by the definition of the type itself. 
17563
17564         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17565         need to actually look up in our parent hierarchy for interfaces
17566         implemented. 
17567
17568         * const.cs: Use the underlying type for enumerations
17569
17570         * delegate.cs: Compute the basename for the delegate creation,
17571         that should fix the delegate test case, and restore the correct
17572         Type Lookup semantics in rootcontext
17573
17574         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17575         referencing a nested type with the Reflection API is using the "+"
17576         sign. 
17577
17578         * cs-parser.jay: Do not require EOF token at the end.
17579
17580 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17581
17582         * rootcontext.cs (LookupType): Concatenate type names with
17583         a '.' instead of a '+' The test suite passes again.
17584
17585         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17586         field of the enumeration.
17587
17588         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17589         the case when the member is an EventExpr.
17590
17591         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17592         static has an associated instance expression.
17593
17594         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17595
17596         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17597
17598         * class.cs (Event.Define): Register event and perform appropriate checks
17599         for error #111.
17600
17601         We define the Add and Remove methods even if the use provides none because
17602         in that case, we provide default implementations ourselves.
17603
17604         Define a private field of the type of the event. This is done by the CSC compiler
17605         and we should be doing it too ;-)
17606
17607         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17608         More methods we use in code we generate.
17609
17610         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17611         is important.
17612
17613         (InitCoreTypes): Update accordingly for the above.
17614
17615         * class.cs (Event.Emit): Generate code for default accessors that we provide
17616
17617         (EmitDefaultMethod): Do the job in the above.
17618
17619         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17620         appropriate place.
17621
17622 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17625         builders even if we were missing one.
17626
17627         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17628         pass the Basename as our class name instead of the Name.  The
17629         basename will be correctly composed for us.
17630
17631         * parameter.cs (Paramters): Now takes a Location argument.
17632
17633         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17634         make all the code call directly LookupType in RootContext and take
17635         this chance to pass the Location information everywhere.
17636
17637         * Everywhere: pass Location information.
17638
17639 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17640
17641         * class.cs (Constructor.Define): Updated way of detecting the
17642         length of the parameters.
17643
17644         (TypeContainer.DefineType): Use basename as the type name for
17645         nested types.
17646
17647         (TypeContainer.Define): Do not recursively define types here, as
17648         definition is taken care in order by the RootContext.
17649
17650         * tree.cs: Keep track of namespaces in a per-file basis.
17651
17652         * parameter.cs (Parameter.ComputeSignature): Update to use
17653         DeclSpace. 
17654
17655         (Parameters.GetSignature): ditto.
17656
17657         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17658         instead of a TypeContainer.
17659
17660         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17661         resolve names.  Because we need to be resolve in our context, not
17662         our parents.
17663
17664         * driver.cs: Implement response files.
17665
17666         * class.cs (TypeContainer.DefineType): If we are defined, do not
17667         redefine ourselves.
17668
17669         (Event.Emit): Emit the code for add/remove handlers.
17670         (Event.Define): Save the MethodBuilders for add/remove.
17671
17672         * typemanager.cs: Use pair here too.
17673
17674         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17675         DictionaryEntry requires the first argument to be non-null.  
17676
17677         (enum_declaration): Compute full name for registering the
17678         enumeration.
17679
17680         (delegate_declaration): Instead of using
17681         formal_parameter_list, use opt_formal_parameter_list as the list
17682         can be empty.
17683
17684         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17685         (EventParsing): New property that controls whether `add' and
17686         `remove' are returned as tokens or identifiers (for events);
17687
17688 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17689
17690         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17691         use MyEventBuilder only and let it wrap the real builder for us.
17692
17693         (MyEventBuilder): Revamp constructor etc.
17694
17695         Implement all operations that we perform on EventBuilder in precisely the same
17696         way here too.
17697
17698         (FindMembers): Update to use the EventBuilder member.
17699
17700         (Event.Emit): Update accordingly.
17701
17702 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17703
17704         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17705         by calling the appropriate methods.
17706
17707         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17708         useful.
17709
17710         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17711
17712 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17713
17714         * delegate.cs (Delegate.Populate): Check that the return type
17715         and various parameters types are indeed accessible.
17716
17717         * class.cs (Constructor.Define): Same here.
17718
17719         (Field.Define): Ditto.
17720
17721         (Event.Define): Ditto.
17722
17723         (Operator.Define): Check that the underlying Method defined itself
17724         correctly - so it's MethodBuilder should not be null.
17725
17726         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17727         expression happens to be null.
17728
17729         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17730         members but as of now we don't seem to be able to do anything really useful with it.
17731
17732         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17733         not the EventBuilder.
17734
17735 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17736
17737         * cs-tokenizer.cs: Add support for defines.
17738         Add support for #if, #elif, #else, #endif
17739
17740         (eval_var): evaluates a variable.
17741         (eval): stubbed for evaluating functions.
17742
17743         * cs-parser.jay: Pass the defines information
17744
17745         * driver.cs: Add --define command line option.
17746
17747         * decl.cs: Move MemberCore here.
17748
17749         Make it the base class for DeclSpace.  This allows us to catch and
17750         report 108 and 109 for everything now.
17751
17752         * class.cs (TypeContainer.Define): Extract all the members
17753         before populating and emit the warning 108 (new keyword required
17754         to override) instead of having each member implement this.
17755
17756         (MemberCore.Define): New abstract method, we will be using this in
17757         the warning reporting engine in Populate.
17758
17759         (Operator.Define): Adjust to new MemberCore protocol. 
17760
17761         * const.cs (Const): This does not derive from Expression, it is a
17762         temporary object we use to create fields, it is a MemberCore. 
17763
17764         * class.cs (Method.Define): Allow the entry point to be in a
17765         specific class.
17766
17767         * driver.cs: Rewrite the argument handler to clean it up a bit.
17768
17769         * rootcontext.cs: Made it just an auxiliary namespace feature by
17770         making everything static.
17771
17772         * driver.cs: Adapt code to use RootContext type name instead of
17773         instance variable.
17774
17775         * delegate.cs: Remove RootContext argument.
17776
17777         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17778         argument. 
17779
17780         * class.cs (Event.Define): The lookup can fail.
17781
17782         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17783
17784         * expression.cs: Resolve the this instance before invoking the code.
17785
17786 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17787
17788         * cs-parser.jay: Add a production in element_access that allows
17789         the thing to become a "type" reference.  This way we can parse
17790         things like "(string [])" as a type.
17791
17792         Note that this still does not handle the more complex rules of
17793         casts. 
17794
17795
17796         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17797
17798         * ecore.cs: (CopyNewMethods): new utility function used to
17799         assemble the list of methods from running FindMembers.
17800
17801         (MemberLookup): Rework FindMembers so that 
17802
17803 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17804
17805         * class.cs (TypeContainer): Remove Delegates who fail to be
17806         defined.
17807
17808         * delegate.cs (Populate): Verify that we dont get null return
17809         values.   TODO: Check for AsAccessible.
17810
17811         * cs-parser.jay: Use basename to emit error 574 (destructor should
17812         have the same name as container class), not the full name.
17813
17814         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17815         possible representation.  
17816
17817         Also implements integer type suffixes U and L.
17818
17819 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * expression.cs (ArrayCreation.DoResolve): We need to do the
17822         argument resolution *always*.
17823
17824         * decl.cs: Make this hold the namespace.  Hold the root context as
17825         well.
17826         (LookupType): Move here.
17827
17828         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17829
17830         * location.cs (Row, Name): Fixed the code, it was always returning
17831         references to the first file.
17832
17833         * interface.cs: Register properties defined through interfaces.
17834
17835         * driver.cs: Add support for globbing on the command line
17836
17837         * class.cs (Field): Make it derive from MemberCore as well.
17838         (Event): ditto.
17839
17840 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17841
17842         * class.cs (Event::Define): Check that the type of the event is a delegate
17843         type else flag error #66.
17844
17845         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17846         same.
17847
17848         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17849         values of EntryPoint, CharSet etc etc.
17850
17851         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17852
17853         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17854         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17855         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17856         which needs this to do its work.
17857
17858         * ../errors/cs0066.cs : Add.
17859
17860 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17861
17862         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17863         helper functions.
17864
17865         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17866         clears out the parameters field.
17867         (MemberSignatureCompare): Cleanup
17868
17869         (MemberCore): New base class used to share code between MethodCore
17870         and Property.
17871
17872         (RegisterRequiredImplementations) BindingFlags.Public requires
17873         either BindingFlags.Instace or Static.  Use instance here.
17874
17875         (Property): Refactored code to cope better with the full spec.
17876
17877         * parameter.cs (GetParameterInfo): Return an empty array instead
17878         of null on error.
17879
17880         * class.cs (Property): Abstract or extern properties have no bodies.
17881
17882         * parameter.cs (GetParameterInfo): return a zero-sized array.
17883
17884         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17885         method modifier validation to the typecontainer so we can reuse
17886         this on properties.
17887
17888         (MethodCore.ParameterTypes): return an empty sized array of types.
17889
17890         (Property.Define): Test property modifier validity.
17891
17892         Add tests for sealed/override too.
17893
17894         (Method.Emit): abstract or extern methods have no bodies.
17895
17896 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17897
17898         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17899         thing.
17900
17901         (Method::Define, ::Emit): Modify accordingly.
17902
17903         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17904
17905         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17906
17907         * makefile: Pass in /unsafe.
17908
17909 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17910
17911         * class.cs (MakeKey): Kill routine.
17912
17913         * class.cs (TypeContainer.Define): Correctly define explicit
17914         method implementations (they require the full interface name plus
17915         the method name).
17916
17917         * typemanager.cs: Deply the PtrHashtable here and stop using the
17918         lame keys.  Things work so much better.
17919
17920         This of course broke everyone who depended on `RegisterMethod' to
17921         do the `test for existance' test.  This has to be done elsewhere.
17922
17923         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17924         the object stupid Equals method (because, that like fails all over
17925         the place).  We still do not use it.
17926
17927         * class.cs (TypeContainer.SetRequiredInterface,
17928         TypeContainer.RequireMethods): Killed these two routines and moved
17929         all the functionality to RegisterRequiredImplementations.
17930
17931         (TypeContainer.RegisterRequiredImplementations): This routine now
17932         registers all the implementations required in an array for the
17933         interfaces and abstract methods.  We use an array of structures
17934         which can be computed ahead of time to reduce memory usage and we
17935         also assume that lookups are cheap as most classes will not
17936         implement too many interfaces.
17937
17938         We also avoid creating too many MethodSignatures.
17939
17940         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17941         clear the "pending" bit if we find that there are problems with
17942         the declaration.
17943
17944         (TypeContainer.VerifyPendingMethods): Update to report errors of
17945         methods that look like implementations but are not.
17946
17947         (TypeContainer.Define): Add support for explicit interface method
17948         implementation. 
17949
17950 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17951
17952         * typemanager.cs: Keep track of the parameters here instead of
17953         being a feature of the TypeContainer.
17954
17955         * class.cs: Drop the registration of parameters here, as
17956         InterfaceMethods are also interface declarations.
17957
17958         * delegate.cs: Register methods with the TypeManager not only with
17959         the TypeContainer.  This code was buggy.
17960
17961         * interface.cs: Full registation here.
17962
17963 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * expression.cs: Remove reducer for binary expressions, it can not
17966         be done this way.
17967
17968         * const.cs: Put here the code that used to go into constant.cs
17969
17970         * constant.cs: Put here the code for constants, this is a new base
17971         class for Literals.
17972
17973         * literal.cs: Make Literal derive from Constant.
17974
17975 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17976
17977         * statement.cs (Return.Emit): Report error 157 if the user
17978         attempts to return from a finally block.
17979
17980         (Return.Emit): Instead of emitting a return, jump to the end of
17981         the function.
17982
17983         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17984         LocalBuilder to store the result of the function.  ReturnLabel is
17985         the target where we jump.
17986
17987
17988 2001-12-09  Radek Doulik  <rodo@ximian.com>
17989
17990         * cs-parser.jay: remember alias in current namespace
17991
17992         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17993         namespaces
17994
17995         * class.cs (LookupAlias): lookup alias in my_namespace
17996
17997         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17998         aliases hashtable
17999         (LookupAlias): lookup alias in this and if needed in parent
18000         namespaces
18001
18002 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18003
18004         * support.cs: 
18005
18006         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18007         making things static.  I need this to avoid passing the
18008         TypeContainer when calling ParameterType.
18009
18010         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18011         that did string manipulation to compute the type and then call
18012         GetType.  Use Parameter.ParameterType instead.
18013
18014         * cs-tokenizer.cs: Consume the suffix for floating values.
18015
18016         * expression.cs (ParameterReference): figure out whether this is a
18017         reference parameter or not.  Kill an extra variable by computing
18018         the arg_idx during emission.
18019
18020         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18021         function that returns whether a parameter is an out/ref value or not.
18022
18023         (Parameter.ParameterType): The type of the parameter (base,
18024         without ref/out applied).
18025
18026         (Parameter.Resolve): Perform resolution here.
18027         (Parameter.ExternalType): The full type (with ref/out applied).
18028
18029         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18030         support for expressions on the using statement.
18031
18032 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18033
18034         * statement.cs (Using.EmitLocalVariableDecls): Split the
18035         localvariable handling of the using statement.
18036
18037         (Block.EmitMeta): Keep track of variable count across blocks.  We
18038         were reusing slots on separate branches of blocks.
18039
18040         (Try.Emit): Emit the general code block, we were not emitting it. 
18041
18042         Check the type of the declaration to be an IDisposable or
18043         something that can be implicity converted to it. 
18044
18045         Emit conversions if required.
18046
18047         * ecore.cs (EmptyExpression): New utility class.
18048         (Expression.ImplicitConversionExists): New utility function.
18049
18050 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18051
18052         * statement.cs (Using): Implement.
18053
18054         * expression.cs (LocalVariableReference): Support read only variables.
18055
18056         * statement.cs: Remove the explicit emit for the Leave opcode.
18057         (VariableInfo): Add a readonly field.
18058
18059 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18060
18061         * ecore.cs (ConvCast): new class used to encapsulate the various
18062         explicit integer conversions that works in both checked and
18063         unchecked contexts.
18064
18065         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18066         properly generate the overflow opcodes.
18067
18068 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18069
18070         * statement.cs: The correct type for the EmptyExpression is the
18071         element_type, not the variable type.  Ravi pointed this out.
18072
18073 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18074
18075         * class.cs (Method::Define): Handle PInvoke methods specially
18076         by using DefinePInvokeMethod instead of the usual one.
18077
18078         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18079         above to do the task of extracting information and defining the method.
18080
18081 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18082
18083         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18084         of the condition for string type.
18085
18086         (Emit): Move that here. 
18087
18088         (ArrayCreation::CheckIndices): Keep string literals in their expression
18089         form.
18090
18091         (EmitDynamicInitializers): Handle strings appropriately.
18092
18093 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18094
18095         * codegen.cs (EmitContext): Replace multiple variables with a
18096         single pointer to the current Switch statement.
18097
18098         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18099         EmitContext.
18100
18101 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * statement.cs 
18104
18105         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18106         default'.
18107
18108         (Foreach.Emit): Foreach on arrays was not setting
18109         up the loop variables (for break/continue).
18110
18111         (GotoCase): Semi-implented.
18112
18113 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18114
18115         * attribute.cs (CheckAttribute): Handle system attributes by using
18116         Attribute.GetAttributes to examine information we need.
18117
18118         (GetValidPlaces): Same here.
18119
18120         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18121
18122         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18123
18124         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18125
18126         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18127
18128         (Method::Emit): Handle the case when we are a PInvoke method.
18129
18130 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18131
18132         * expression.cs: Use ResolveWithSimpleName on compound names.
18133
18134 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18135
18136         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18137         before trying to reduce it.
18138
18139         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18140
18141         * constant.cs (LookupConstantValue): Implement.
18142
18143         (EmitConstant): Use the above in emitting the constant.
18144
18145         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18146         that are user-defined by doing a LookupConstantValue on them.
18147
18148         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18149         too, like above.
18150
18151 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18152
18153         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18154
18155         (BaseAccess.DoResolve): Implement.
18156
18157         (MemberAccess.DoResolve): Split this routine into a
18158         ResolveMemberAccess routine that can be used independently
18159
18160 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18161
18162         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18163         As that share bits of the implementation.  Is returns a boolean,
18164         while As returns the Type that is being probed.
18165
18166 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18167
18168         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18169         instead of a Literal - much easier.
18170
18171         (EnumInTransit): Remove - utterly useless :-)
18172
18173         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18174
18175         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18176
18177         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18178         chain when we have no associated expression.
18179
18180 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18181
18182         * constant.cs (Define): Use Location while reporting the errror.
18183
18184         Also emit a warning when 'new' is used and there is no inherited
18185         member to hide.
18186
18187         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18188         populated.
18189
18190         (LookupEnumValue): Implement to lookup an enum member's value and define it
18191         if necessary.
18192
18193         (Populate): Re-write accordingly to use the above routine.
18194
18195 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18196
18197         * expression.cs (This): Fix prototype for DoResolveLValue to
18198         override the base class DoResolveLValue.
18199
18200         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18201         declarations) 
18202
18203         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18204         (we need to load the address of the field here).  This fixes
18205         test-22. 
18206
18207         (FieldExpr.DoResolveLValue): Call the DoResolve
18208         function to initialize the Instance expression.
18209
18210         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18211         correctly the GetEnumerator operation on a value type.
18212
18213         * cs-parser.jay: Add more simple parsing error catches.
18214
18215         * statement.cs (Switch): Add support for string switches.
18216         Handle null specially.
18217
18218         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18219
18220 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18221
18222         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18223
18224         (declare_local_constant): New helper function.
18225
18226         * statement.cs (AddConstant): Keep a separate record of constants
18227
18228         (IsConstant): Implement to determine if a variable is a constant.
18229
18230         (GetConstantExpression): Implement.
18231
18232         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18233
18234         * statement.cs (IsVariableDefined): Re-write.
18235
18236 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18237
18238         * class.cs (TypeContainer::FindMembers): Look for constants
18239         in the case when we are looking for MemberTypes.Field
18240
18241         * expression.cs (MemberAccess::DoResolve): Check that in the
18242         case we are a FieldExpr and a Literal, we are not being accessed
18243         by an instance reference.
18244
18245         * cs-parser.jay (local_constant_declaration): Implement.
18246
18247         (declaration_statement): Implement for constant declarations.
18248
18249 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18250
18251         * statement.cs (Switch): Catch double defaults.
18252
18253         (Switch): More work on the switch() statement
18254         implementation.  It works for integral values now, need to finish
18255         string support.
18256
18257
18258 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18259
18260         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18261         integer literals into other integer literals.  To be used by
18262         switch. 
18263
18264 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18265
18266         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18267         some memory.
18268
18269         (EmitDynamicInitializers): Cope with the above since we extract data
18270         directly from ArrayData now.
18271
18272         (ExpectInitializers): Keep track of whether initializers are mandatory
18273         or not.
18274
18275         (Bounds): Make it a hashtable to prevent the same dimension being 
18276         recorded for every element in that dimension.
18277
18278         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18279         from being found.
18280
18281         Also fix bug which was causing the indices to be emitted in the reverse
18282         order.
18283
18284 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18285
18286         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18287         unfinished.  They do not work, because the underlying code is
18288         sloppy.
18289
18290 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18291
18292         * cs-parser.jay: Remove bogus fixme.
18293
18294         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18295         on Switch statement.
18296
18297 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18298
18299         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18300         the same. 
18301
18302         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18303         parameter. Apparently, any expression is allowed. 
18304
18305         (ValidateInitializers): Update accordingly.
18306
18307         (CheckIndices): Fix some tricky bugs thanks to recursion.
18308
18309         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18310         I was being completely brain-dead.
18311
18312         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18313         and re-write acordingly.
18314
18315         (DelegateInvocation): Re-write accordingly.
18316
18317         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18318
18319         (MakeByteBlob): Handle types more correctly.
18320
18321         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18322         initialization from expressions but it is incomplete because I am a complete
18323         Dodo :-|
18324
18325 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18326
18327         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18328         on If.  Basically, we have to return `true' (ie, we do return to
18329         our caller) only if both branches of the if return.
18330
18331         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18332         short-circuit operators, handle them as short circuit operators. 
18333
18334         (Cast.DoResolve): Resolve type.
18335         (Cast.Cast): Take an expression as the target type.
18336
18337         * cs-parser.jay (cast_expression): Remove old hack that only
18338         allowed a limited set of types to be handled.  Now we take a
18339         unary_expression and we resolve to a type during semantic
18340         analysis.
18341
18342         Use the grammar productions from Rhys to handle casts (this is
18343         not complete like Rhys syntax yet, we fail to handle that corner
18344         case that C# has regarding (-x), but we will get there.
18345
18346 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18347
18348         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18349         field which is an array type.
18350
18351         * cs-parser.jay (declare_local_variables): Support array initialization too.
18352
18353         * typemanager.cs (MakeKey): Implement.
18354
18355         (everywhere): Use the above appropriately.
18356
18357         * cs-parser.jay (for_statement): Update for array initialization while
18358         declaring variables.
18359
18360         * ecore.cs : The error message was correct, it's the variable's names that
18361         were misleading ;-) Make the code more readable.
18362
18363         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18364         the correct type etc.
18365
18366         (ConvertExplicit): Handle Enum types by examining the underlying type.
18367
18368 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18369
18370         * parameter.cs (GetCallingConvention): Always return
18371         CallingConventions.Standard for now.
18372
18373 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18376         and `r' after calling DoNumericPromotions.
18377
18378         * ecore.cs: Fix error message (the types were in the wrong order).
18379
18380         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18381         BindingFlags.Instance as well 
18382
18383         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18384         implicit int literal conversion in an empty cast so that we
18385         propagate the right type upstream.
18386
18387         (UnboxCast): new class used to unbox value types.
18388         (Expression.ConvertExplicit): Add explicit type conversions done
18389         by unboxing.
18390
18391         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18392         the target type before applying the implicit LongLiterals to ULong
18393         literal cast.
18394
18395 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18396
18397         * cs-parser.jay (for_statement): Reworked the way For works: now
18398         we declare manually any variables that are introduced in
18399         for_initializer to solve the problem of having out-of-band code
18400         emition (that is what got for broken).
18401
18402         (declaration_statement): Perform the actual variable declaration
18403         that used to be done in local_variable_declaration here.
18404
18405         (local_variable_declaration): Do not declare anything, just pass
18406         the information on a DictionaryEntry
18407
18408 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18409
18410         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18411         re-write of the logic to now make it recursive.
18412
18413         (UpdateIndices): Re-write accordingly.
18414
18415         Store element data in a separate ArrayData list in the above methods.
18416
18417         (MakeByteBlob): Implement to dump the array data into a byte array.
18418
18419 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18420
18421         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18422         into CheckIndices.
18423
18424         * constant.cs (Define): Implement.
18425
18426         (EmitConstant): Re-write fully.
18427
18428         Pass in location info.
18429
18430         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18431         respectively.
18432
18433         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18434         DictionaryEntry since we need location info too.
18435
18436         (constant_declaration): Update accordingly.
18437
18438         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18439         code into another method : UpdateIndices.
18440
18441 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18442
18443         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18444         some type checking etc.
18445
18446 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18447
18448         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18449         bits to provide dimension info if the user skips doing that.
18450
18451         Update second constructor to store the rank correctly.
18452
18453 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18454
18455         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18456         and try to implement.
18457
18458         * ../errors/cs0150.cs : Add.
18459
18460         * ../errors/cs0178.cs : Add.
18461
18462 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * statement.cs: Implement foreach on multi-dimensional arrays. 
18465
18466         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18467         name of the params argument.
18468
18469         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18470         initializing the array.
18471
18472         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18473         we can use this elsewhere.
18474
18475         * statement.cs: Finish implementation of foreach for single
18476         dimension arrays.
18477
18478         * cs-parser.jay: Use an out-of-band stack to pass information
18479         around, I wonder why I need this.
18480
18481         foreach_block: Make the new foreach_block the current_block.
18482
18483         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18484         function used to return a static Parameters structure.  Used for
18485         empty parameters, as those are created very frequently.
18486
18487         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18488
18489 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18490
18491         * interface.cs : Default modifier is private, not public. The
18492         make verify test passes again.
18493
18494 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18495
18496         * support.cs (ReflectionParameters): Fix logic to determine
18497         whether the last parameter is a params one. Test 9 passes again.
18498
18499         * delegate.cs (Populate): Register the builders we define with
18500         RegisterParameterForBuilder. Test 19 passes again.
18501
18502         * cs-parser.jay (property_declaration): Reference $6 instead
18503         of $$ to get at the location.
18504
18505         (indexer_declaration): Similar stuff.
18506
18507         (attribute): Ditto.
18508
18509         * class.cs (Property): Register parameters for the Get and Set methods
18510         if they exist. Test 23 passes again.
18511
18512         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18513         call to EmitArguments as we are sure there aren't any params arguments. 
18514         Test 32 passes again.
18515
18516         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18517         IndexOutOfRangeException. 
18518
18519         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18520         Test 33 now passes again.
18521
18522 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18523
18524         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18525         broke a bunch of things.  Will have to come up with a better way
18526         of tracking locations.
18527
18528         * statement.cs: Implemented foreach for single dimension arrays.
18529
18530 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18531
18532         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18533         an error.  This removes the lookup from the critical path.
18534
18535         * cs-parser.jay: Removed use of temporary_loc, which is completely
18536         broken. 
18537
18538 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * support.cs (ReflectionParameters.ParameterModifier): Report
18541         whether the argument is a PARAMS argument or not.
18542
18543         * class.cs: Set the attribute `ParamArrayAttribute' on the
18544         parameter argument.
18545
18546         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18547         and cons_param_array_attribute (ConstructorInfo for
18548         ParamArrayAttribute)., 
18549
18550         * codegen.cs: Emit the return using the `Return' statement, that
18551         way we can report the error correctly for missing return values. 
18552
18553         * class.cs (Method.Emit): Clean up.
18554
18555         * expression.cs (Argument.Resolve): Take another argument: the
18556         location where this argument is used.  Notice that this is not
18557         part of the "Argument" class as to reduce the size of the
18558         structure (we know the approximate location anyways).
18559
18560         Test if the argument is a variable-reference, if not, then
18561         complain with a 206.
18562
18563         (Argument.Emit): Emit addresses of variables.
18564
18565         (Argument.FullDesc): Simplify.
18566
18567         (Invocation.DoResolve): Update for Argument.Resolve.
18568
18569         (ElementAccess.DoResolve): ditto.
18570
18571         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18572         method should be virtual, as this method is always virtual.
18573
18574         (NewDelegate.DoResolve): Update for Argument.Resolve.
18575
18576         * class.cs (ConstructorInitializer.DoResolve): ditto.
18577
18578         * attribute.cs (Attribute.Resolve): ditto.
18579
18580 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18581
18582         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18583
18584         * expression.cs (ParameterReference): Drop IStackStorage and implement
18585         IAssignMethod instead. 
18586
18587         (LocalVariableReference): ditto.
18588
18589         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18590         IAssignMethod instead. 
18591
18592 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18593
18594         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18595         enumerations that are used in heavily used structures derive from
18596         byte in a laughable and pathetic attempt to reduce memory usage.
18597         This is the kind of pre-optimzations that you should not do at
18598         home without adult supervision.
18599
18600         * expression.cs (UnaryMutator): New class, used to handle ++ and
18601         -- separatedly from the other unary operators.  Cleans up the
18602         code, and kills the ExpressionStatement dependency in Unary.
18603
18604         (Unary): Removed `method' and `Arguments' from this class, making
18605         it smaller, and moving it all to SimpleCall, so I can reuse this
18606         code in other locations and avoid creating a lot of transient data
18607         strucutres when not required.
18608
18609         * cs-parser.jay: Adjust for new changes.
18610
18611 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18612
18613         * enum.cs (Enum.Populate): If there is a failure during
18614         definition, return
18615
18616         * cs-parser.jay (opt_enum_base): we used to catch type errors
18617         here, but this is really incorrect.  The type error should be
18618         catched during semantic analysis.
18619
18620 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18621
18622         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18623         current_local_parameters as expected since I, in my stupidity, had forgotten
18624         to do this :-)
18625
18626         * attribute.cs (GetValidPlaces): Fix stupid bug.
18627
18628         * class.cs (Method::Emit): Perform check on applicability of attributes.
18629
18630         (Constructor::Emit): Ditto.
18631
18632         (Field::Emit): Ditto.
18633
18634         (Field.Location): Store location information.
18635
18636         (Property, Event, Indexer, Operator): Ditto.
18637
18638         * cs-parser.jay (field_declaration): Pass in location for each field.
18639
18640         * ../errors/cs0592.cs : Add.
18641
18642 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18643
18644         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18645
18646         (InitCoreTypes): Update accordingly.
18647
18648         (RegisterAttrType, LookupAttr): Implement.
18649
18650         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18651         info about the same.
18652
18653         (Resolve): Update to populate the above as necessary.
18654
18655         (Error592): Helper.
18656
18657         (GetValidPlaces): Helper to the above.
18658
18659         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18660
18661         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18662
18663 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18664
18665         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18666
18667         * ../errors/cs0617.cs : Add.
18668
18669 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18670
18671         * enum.cs (Emit): Rename to Populate to be more consistent with what
18672         we expect it to do and when exactly it is called.
18673
18674         * class.cs, rootcontext.cs : Update accordingly.
18675
18676         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18677         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18678
18679         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18680
18681         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18682         of a fieldinfo using the above, when dealing with a FieldBuilder.
18683
18684 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18685
18686         * ../errors/cs0031.cs : Add.
18687
18688         * ../errors/cs1008.cs : Add.
18689
18690         * ../errrors/cs0543.cs : Add.
18691
18692         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18693         enum type.
18694
18695         (FindMembers): Implement.
18696
18697         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18698         enums and delegates too.
18699
18700         (enum_types): Rename to builder_to_enum.
18701
18702         (delegate_types): Rename to builder_to_delegate.
18703
18704         * delegate.cs (FindMembers): Implement.
18705
18706 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18707
18708         * typemanager.cs (IsEnumType): Implement.
18709
18710         * enum.cs (Emit): Re-write parts to account for the underlying type
18711         better and perform checking etc.
18712
18713         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18714         of the underlying type.
18715
18716         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18717         value
18718
18719         * enum.cs (error31): Helper to report error #31.
18720
18721         * cs-parser.jay (enum_declaration): Store location of each member too.
18722
18723         * enum.cs (member_to_location): New hashtable. 
18724
18725         (AddEnumMember): Update location hashtable.
18726
18727         (Emit): Use the location of each member while reporting errors.
18728
18729 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18730
18731         * cs-parser.jay: A for_initializer if is a
18732         local_variable_declaration really ammount to have an implicit
18733         block with the variable declaration and no initializer for for.
18734
18735         * statement.cs (For.Emit): Cope with null initializers.
18736
18737         This fixes the infinite loop on for initializers.
18738
18739 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18740
18741         * enum.cs: More cleanup.
18742
18743         * ecore.cs: Remove dead code.
18744
18745         * class.cs (Property.Emit): More simplification.
18746         (Event.Emit): ditto.
18747
18748         Reworked to have less levels of indentation.
18749
18750 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18751
18752         * class.cs (Property): Emit attributes.
18753
18754         (Field): Ditto.
18755
18756         (Event): Ditto.
18757
18758         (Indexer): Ditto.
18759
18760         (Operator): Ditto.
18761
18762         * enum.cs (Emit): Ditto.
18763
18764         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18765         Enums too.
18766
18767         * class.cs (Field, Event, etc.): Move attribute generation into the
18768         Emit method everywhere.
18769
18770         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18771         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18772         as we had no way of defining nested enums !
18773
18774         * rootcontext.cs : Adjust code accordingly.
18775
18776         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18777
18778 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18779
18780         * expression.cs (EvalConstantExpression): Move into ecore.cs
18781
18782         * enum.cs (Enum): Rename some members and make them public and readonly
18783         according to our convention.
18784
18785         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18786         nothing else.
18787
18788         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18789
18790         (Enum::Emit): Write a simple version for now which doesn't try to compute
18791         expressions. I shall modify this to be more robust in just a while.
18792
18793         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18794
18795         (TypeContainer::CloseType): Create the Enum types too.
18796
18797         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18798
18799         * expression.cs (EvalConstantExpression): Get rid of completely.
18800
18801         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18802         user-defined values and other cases.
18803
18804         (IsValidEnumLiteral): Helper function.
18805
18806         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18807         out there in the case we had a literal FieldExpr.
18808
18809         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18810
18811         (Literalize): Revamp a bit to take two arguments.
18812
18813         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18814
18815 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18816
18817         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18818
18819         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18820
18821         (Resolve): Use the above to ensure we have proper initializers.
18822
18823 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18824
18825         * expression.cs (Expression::EvalConstantExpression): New method to 
18826         evaluate constant expressions.
18827
18828         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18829
18830 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18831
18832         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18833         in an array.
18834
18835         (Binary.ResolveOperator): Handle operator != (object a, object b)
18836         and operator == (object a, object b);
18837
18838         (Binary.DoNumericPromotions): Indicate whether the numeric
18839         promotion was possible.
18840
18841         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18842         Implement.  
18843
18844         Made the ArrayAccess implement interface IAssignMethod instead of
18845         IStackStore as the order in which arguments are passed reflects
18846         this.
18847
18848         * assign.cs: Instead of using expr.ExprClass to select the way of
18849         assinging, probe for the IStackStore/IAssignMethod interfaces.
18850
18851         * typemanager.cs: Load InitializeArray definition.
18852
18853         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18854         static data that can be used to initialize arrays. 
18855
18856 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * expression.cs: Handle operator== and operator!= for booleans.
18859
18860         (Conditioal.Reduce): Implement reducer for the ?: operator.
18861
18862         (Conditional.Resolve): Implement dead code elimination.
18863
18864         (Binary.Resolve): Catch string literals and return a new
18865         concatenated string.
18866
18867         (Unary.Reduce): Implement reduction of unary expressions.
18868
18869         * ecore.cs: Split out the expression core handling here.
18870
18871         (Expression.Reduce): New method used to perform constant folding
18872         and CSE.  This is needed to support constant-expressions. 
18873
18874         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18875         targets, and optimize for !x.
18876
18877 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18878
18879         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18880         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18881         set custom atttributes.
18882
18883         * literal.cs (Literal::GetValue): New abstract method to return the actual
18884         value of the literal, cast as an object.
18885
18886         (*Literal): Implement GetValue method.
18887
18888         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18889         expressions to the arraylist but objects of type Argument.
18890
18891         * class.cs (TypeContainer::Emit): Emit our attributes too.
18892
18893         (Method::Emit, Constructor::Emit): Ditto.
18894
18895         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18896         to be ignoring earlier.
18897
18898 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18899
18900         * attribute.cs (AttributeSection::Define): Implement to do the business
18901         of constructing a CustomAttributeBuilder.
18902
18903         (Attribute): New trivial class. Increases readability of code.  
18904
18905         * cs-parser.jay : Update accordingly.
18906
18907         (positional_argument_list, named_argument_list, named_argument): New rules
18908
18909         (attribute_arguments): Use the above so that we are more correct.
18910
18911 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18912
18913         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18914         to perform all checks for a method with a params parameter.
18915
18916         (Invocation::OverloadResolve): Update to use the above method and therefore
18917         cope correctly with params method invocations.
18918
18919         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18920         params too.
18921
18922         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18923         constructors in our parent too because we can't afford to miss out on 
18924         protected ones ;-)
18925
18926         * attribute.cs (AttributeSection): New name for the class Attribute
18927
18928         Other trivial changes to improve readability.
18929
18930         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18931         use the new class names.
18932
18933 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18934
18935         * class.cs (Method::Define): Complete definition for params types too
18936
18937         (Indexer::Define): Ditto.
18938
18939         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18940         Cope everywhere with a request for info about the array parameter.
18941
18942 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18943
18944         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18945
18946         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18947         local_variable_type to extract the string corresponding to the type.
18948
18949         (local_variable_type): Fixup the action to use the new helper method.
18950
18951         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18952         go.
18953
18954         * expression.cs : Clean out code which uses the above.
18955
18956 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18957
18958         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18959         and bale out if necessary by returning a false.
18960
18961         (RegisterProperty): Ditto.
18962
18963         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18964         and print out appropriate error messages.
18965
18966         * interface.cs (everywhere): Ditto.
18967
18968         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18969         location to constructor.
18970
18971         * class.cs (Property, Event, Indexer): Update accordingly.
18972
18973         * ../errors/cs111.cs : Added.
18974
18975         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18976         of a method, as laid down by the spec.
18977
18978         (Invocation::OverloadResolve): Use the above method.
18979
18980 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18981
18982         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18983         now take a TypeContainer and a Parameters object.
18984
18985         (ParameterData): Modify return type of ParameterModifier method to be 
18986         Parameter.Modifier and not a string.
18987
18988         (ReflectionParameters, InternalParameters): Update accordingly.
18989
18990         * expression.cs (Argument::GetParameterModifier): Same here.
18991
18992         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18993         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18994         symbol in it at all so maybe this is only for now.
18995
18996 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18997
18998         * support.cs (InternalParameters): Constructor now takes an extra argument 
18999         which is the actual Parameters class.
19000
19001         (ParameterDesc): Update to provide info on ref/out modifiers.
19002
19003         * class.cs (everywhere): Update call to InternalParameters to pass in
19004         the second argument too.
19005
19006         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19007         to return the modifier info [ref/out etc]
19008
19009         (InternalParameters, ReflectionParameters): Implement the above.
19010
19011         * expression.cs (Argument::ParameterModifier): Similar function to return
19012         info about the argument's modifiers.
19013
19014         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19015         too.
19016
19017         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19018         a new SetFormalParameters object which we pass to InternalParameters.
19019
19020 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19021
19022         * expression.cs (NewArray): Merge into the ArrayCreation class.
19023
19024 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19025
19026         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19027         NewUserdefinedArray into one as there wasn't much of a use in having
19028         two separate ones.
19029
19030         * expression.cs (Argument): Change field's name to ArgType from Type.
19031
19032         (Type): New readonly property which returns the proper type, taking into 
19033         account ref/out modifiers.
19034
19035         (everywhere): Adjust code accordingly for the above.
19036
19037         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19038         whether we are emitting for a ref or out parameter.
19039
19040         * expression.cs (Argument::Emit): Use the above field to set the state.
19041
19042         (LocalVariableReference::Emit): Update to honour the flag and emit the
19043         right stuff.
19044
19045         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19046
19047         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19048
19049         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19050
19051         (ReflectionParameters, InternalParameters): Implement the above method.
19052
19053         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19054         reporting errors.
19055
19056         (Invocation::FullMethodDesc): Ditto. 
19057
19058 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19059
19060         * cs-parser.jay: Add extra production for the second form of array
19061         creation. 
19062
19063         * expression.cs (ArrayCreation): Update to reflect the above
19064         change. 
19065
19066         * Small changes to prepare for Array initialization.
19067
19068 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19069
19070         * typemanager.cs (ImplementsInterface): interface might be null;
19071         Deal with this problem;
19072
19073         Also, we do store negative hits on the cache (null values), so use
19074         this instead of calling t.GetInterfaces on the type everytime.
19075
19076 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19077
19078         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19079
19080         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19081         split functionality out into different classes.
19082
19083         (New::FormArrayType): Move into NewBuiltinArray.
19084
19085         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19086         quite useless.
19087
19088         (NewBuiltinArray): New class to handle creation of built-in arrays.
19089
19090         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19091         account creation of one-dimensional arrays.
19092
19093         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19094
19095         (NewUserdefinedArray::DoResolve): Implement.
19096
19097         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19098
19099         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19100         we maintain inside the TypeManager. This is necessary to perform lookups on the
19101         module builder.
19102
19103         (LookupType): Update to perform GetType on the module builders too.     
19104
19105         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19106
19107         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19108
19109 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19110
19111         * expression.cs (New::DoResolve): Implement guts of array creation.
19112
19113         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19114
19115 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19116
19117         * expression.cs: Fix bug I introduced lsat night that broke
19118         Delegates. 
19119
19120         (Expression.Resolve): Report a 246 error (can not resolve name)
19121         if we find a SimpleName in the stream.
19122
19123         (Expression.ResolveLValue): Ditto.
19124
19125         (Expression.ResolveWithSimpleName): This function is a variant of
19126         ResolveName, this one allows SimpleNames to be returned without a
19127         warning.  The only consumer of SimpleNames is MemberAccess
19128
19129 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19130
19131         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19132         might arrive here.  I have my doubts that this is correct.
19133
19134         * statement.cs (Lock): Implement lock statement.
19135
19136         * cs-parser.jay: Small fixes to support `lock' and `using'
19137
19138         * cs-tokenizer.cs: Remove extra space
19139
19140         * driver.cs: New flag --checked, allows to turn on integer math
19141         checking. 
19142
19143         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19144         Threading.Monitor.Exit 
19145
19146 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19147
19148         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19149         Expression Class to be IndexerAccess.
19150
19151         Notice that Indexer::DoResolve sets the eclass to Value.
19152
19153 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19154
19155         * class.cs (TypeContainer::Emit): Emit code for indexers.
19156
19157         * assign.cs (IAssignMethod): New interface implemented by Indexers
19158         and Properties for handling assignment.
19159
19160         (Assign::Emit): Simplify and reuse code. 
19161
19162         * expression.cs (IndexerAccess, PropertyExpr): Implement
19163         IAssignMethod, clean up old code. 
19164
19165 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19166
19167         * typemanager.cs (ImplementsInterface): New method to determine if a type
19168         implements a given interface. Provides a nice cache too.
19169
19170         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19171         method.
19172
19173         (ConvertReferenceExplicit): Ditto.
19174
19175         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19176         various methods, with correct names etc.
19177
19178         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19179         Operator.UnaryNegation.
19180
19181         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19182         we have a unary plus or minus operator.
19183
19184         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19185         UnaryMinus.
19186
19187         * everywhere : update accordingly.
19188
19189         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19190         respectively.
19191
19192         * class.cs (Method::Define): For the case where we are implementing a method
19193         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19194         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19195
19196 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19197
19198         * interface.cs (FindMembers): Implement to work around S.R.E
19199         lameness.
19200
19201         * typemanager.cs (IsInterfaceType): Implement.
19202
19203         (FindMembers): Update to handle interface types too.
19204
19205         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19206         use IsAssignableFrom as that is not correct - it doesn't work.
19207
19208         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19209         and accordingly override EmitStatement.
19210
19211         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19212         using the correct logic :-)
19213
19214 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19215
19216         * ../errors/cs-11.cs : Add to demonstrate error -11 
19217
19218 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19221         then pass this as a hint to ResolveLValue.
19222
19223         * expression.cs (FieldExpr): Add Location information
19224
19225         (FieldExpr::LValueResolve): Report assignment to readonly
19226         variable. 
19227
19228         (Expression::ExprClassFromMemberInfo): Pass location information.
19229
19230         (Expression::ResolveLValue): Add new method that resolves an
19231         LValue. 
19232
19233         (Expression::DoResolveLValue): Default invocation calls
19234         DoResolve. 
19235
19236         (Indexers): New class used to keep track of indexers in a given
19237         Type. 
19238
19239         (IStackStore): Renamed from LValue, as it did not really describe
19240         what this did.  Also ResolveLValue is gone from this interface and
19241         now is part of Expression.
19242
19243         (ElementAccess): Depending on the element access type
19244
19245         * typemanager.cs: Add `indexer_name_type' as a Core type
19246         (System.Runtime.CompilerServices.IndexerNameAttribute)
19247
19248         * statement.cs (Goto): Take a location.
19249
19250 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19251
19252         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19253         if two delegates are compatible.
19254
19255         (NewDelegate::DoResolve): Update to take care of the case when
19256         we instantiate a delegate from another delegate.
19257
19258         * typemanager.cs (FindMembers): Don't even try to look up members
19259         of Delegate types for now.
19260
19261 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19262
19263         * delegate.cs (NewDelegate): New class to take care of delegate
19264         instantiation.
19265
19266         * expression.cs (New): Split the delegate related code out into 
19267         the NewDelegate class.
19268
19269         * delegate.cs (DelegateInvocation): New class to handle delegate 
19270         invocation.
19271
19272         * expression.cs (Invocation): Split out delegate related code into
19273         the DelegateInvocation class.
19274
19275 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19276
19277         * expression.cs (New::DoResolve): Implement delegate creation fully
19278         and according to the spec.
19279
19280         (New::DoEmit): Update to handle delegates differently.
19281
19282         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19283         because of which we were printing out arguments in reverse order !
19284
19285         * delegate.cs (VerifyMethod): Implement to check if the given method
19286         matches the delegate.
19287
19288         (FullDelegateDesc): Implement.
19289
19290         (VerifyApplicability): Implement.
19291
19292         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19293         delegate invocations too.
19294
19295         (Invocation::Emit): Ditto.
19296
19297         * ../errors/cs1593.cs : Added.
19298
19299         * ../errors/cs1594.cs : Added.
19300
19301         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19302
19303 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19304
19305         * typemanager.cs (intptr_type): Core type for System.IntPtr
19306
19307         (InitCoreTypes): Update for the same.
19308
19309         (iasyncresult_type, asynccallback_type): Ditto.
19310
19311         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19312         correct.
19313
19314         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19315         too.
19316
19317         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19318         the builders for the 4 members of a delegate type :-)
19319
19320         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19321         type.
19322
19323         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19324
19325         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19326
19327 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19328
19329         * statement.cs (Break::Emit): Implement.   
19330         (Continue::Emit): Implement.
19331
19332         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19333         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19334         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19335         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19336         end loop
19337
19338         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19339         properties that track the label for the current loop (begin of the
19340         loop and end of the loop).
19341
19342 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19343
19344         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19345         use of emitting anything at all.
19346
19347         * class.cs, rootcontext.cs : Get rid of calls to the same.
19348
19349         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19350
19351         (Populate): Define the constructor correctly and set the implementation
19352         attributes.
19353
19354         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19355         have been defined.
19356
19357         (AddDelegateType): Implement.
19358
19359         (IsDelegateType): Implement helper method.
19360
19361         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19362
19363         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19364         and accordingly handle it.
19365
19366         * delegate.cs (Populate): Take TypeContainer argument.
19367         Implement bits to define the Invoke method. However, I still haven't figured out
19368         how to take care of the native int bit :-(
19369
19370         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19371         Qualify the name of the delegate, not its return type !
19372
19373         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19374         conversion.
19375
19376         (StandardConversionExists): Checking for array types turns out to be recursive.
19377
19378         (ConvertReferenceExplicit): Implement array conversion.
19379
19380         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19381
19382 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19383
19384         * cs-parser.jay (delegate_declaration): Store the fully qualified
19385         name as it is a type declaration.
19386
19387         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19388         readonly.
19389
19390         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19391         as TypeContainer::DefineType.
19392
19393         (Populate): Method in which all the definition of the various methods (Invoke)
19394         etc is done.
19395
19396         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19397         see.
19398
19399         (CloseDelegate): Finally creates the delegate.
19400
19401         * class.cs (TypeContainer::DefineType): Update to define delegates.
19402         (Populate, Emit and CloseType): Do the same thing here too.
19403
19404         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19405         delegates in all these operations.
19406
19407 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19408
19409         * expression.cs: LocalTemporary: a new expression used to
19410         reference a temporary that has been created.
19411
19412         * assign.cs: Handle PropertyAccess back here, so that we can
19413         provide the proper semantic access to properties.
19414
19415         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19416         a few more explicit conversions. 
19417
19418         * modifiers.cs: `NEW' modifier maps to HideBySig.
19419
19420         * expression.cs (PropertyExpr): Make this into an
19421         ExpressionStatement, and support the EmitStatement code path. 
19422
19423         Perform get/set error checking, clean up the interface.
19424
19425         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19426         them into toplevel access objects.
19427
19428 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19429
19430         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19431         SRE.
19432
19433         * typemanager.cs: Keep track here of our PropertyBuilders again to
19434         work around lameness in SRE.
19435
19436 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19437
19438         * expression.cs (LValue::LValueResolve): New method in the
19439         interface, used to perform a second resolution pass for LValues. 
19440
19441         (This::DoResolve): Catch the use of this in static methods.
19442
19443         (This::LValueResolve): Implement.
19444
19445         (This::Store): Remove warning, assigning to `this' in structures
19446         is 
19447
19448         (Invocation::Emit): Deal with invocation of
19449         methods on value types.  We need to pass the address to structure
19450         methods rather than the object itself.  (The equivalent code to
19451         emit "this" for structures leaves the entire structure on the
19452         stack instead of a pointer to it). 
19453
19454         (ParameterReference::DoResolve): Compute the real index for the
19455         argument based on whether the method takes or not a `this' pointer
19456         (ie, the method is static).
19457
19458         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19459         value types returned from functions when we need to invoke a
19460         method on the sturcture.
19461
19462
19463 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19464
19465         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19466         defining the type in the Modulebuilder or Typebuilder. This is to take
19467         care of nested types which need to be defined on the TypeBuilder using
19468         DefineNestedMethod.
19469
19470         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19471         methods in RootContext, only ported to be part of TypeContainer.
19472
19473         (TypeContainer::GetInterfaceOrClass): Ditto.
19474
19475         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19476
19477         * interface.cs (Interface::DefineInterface): New method. Does exactly
19478         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19479         too.
19480
19481         (Interface::GetInterfaces): Move from RootContext here and port.
19482
19483         (Interface::GetInterfaceByName): Same here.
19484
19485         * rootcontext.cs (ResolveTree): Re-write.
19486
19487         (PopulateTypes): Re-write.
19488
19489         * class.cs (TypeContainer::Populate): Populate nested types too.
19490         (TypeContainer::Emit): Emit nested members too.
19491
19492         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19493         instead just use the name argument passed in as it is already fully
19494         qualified.
19495
19496         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19497         to TypeContainer mapping to see if a type is user-defined.
19498
19499         * class.cs (TypeContainer::CloseType): Implement. 
19500
19501         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19502         the default constructor.
19503
19504         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19505         twice.
19506
19507         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19508
19509         * interface.cs (CloseType): Create the type here.
19510
19511         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19512         the hierarchy.
19513
19514         Remove all the methods which are now in TypeContainer.
19515
19516 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19517
19518         * delegate.cs (Define): Re-write bits to define the delegate
19519         correctly.
19520
19521 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19522
19523         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19524
19525         * expression.cs (ImplicitReferenceConversion): handle null as well
19526         as a source to convert to any reference type.
19527
19528         * statement.cs (Return): Perform any implicit conversions to
19529         expected return type.  
19530
19531         Validate use of return statement.  
19532
19533         * codegen.cs (EmitContext): Pass the expected return type here.
19534
19535         * class.cs (Method, Constructor, Property): Pass expected return
19536         type to EmitContext.
19537
19538 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19539
19540         * expression.cs: Make DoResolve take an EmitContext instead of a
19541         TypeContainer.
19542
19543         Replaced `l' and `location' for `loc', for consistency.
19544
19545         (Error, Warning): Remove unneeded Tc argument.
19546
19547         * assign.cs, literal.cs, constant.cs: Update to new calling
19548         convention. 
19549
19550         * codegen.cs: EmitContext now contains a flag indicating whether
19551         code is being generated in a static method or not.
19552
19553         * cs-parser.jay: DecomposeQI, new function that replaces the old
19554         QualifiedIdentifier.  Now we always decompose the assembled
19555         strings from qualified_identifier productions into a group of
19556         memberaccesses.
19557
19558 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19559
19560         * rootcontext.cs: Deal with field-less struct types correctly now
19561         by passing the size option to Define Type.
19562
19563         * class.cs: Removed hack that created one static field. 
19564
19565 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19566
19567         * statement.cs: Moved most of the code generation here. 
19568
19569 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19570
19571         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19572         seem very right.
19573
19574         (ElementAccess): Remove useless bits for now - keep checks as the spec
19575         says.
19576
19577 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19578
19579         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19580         and start performing checks according to the spec.
19581
19582 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19583
19584         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19585         rank_specifiers instead.
19586
19587         (rank_specifiers): Change the order in which the rank specifiers are stored
19588
19589         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19590
19591         * expression.cs (ElementAccess): Implement the LValue interface too.
19592
19593 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19594
19595         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19596         except that user defined conversions are not included.
19597
19598         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19599         perform the conversion of the return type, if necessary.
19600
19601         (New::DoResolve): Check whether we are creating an array or an object
19602         and accordingly do the needful.
19603
19604         (New::Emit): Same here.
19605
19606         (New::DoResolve): Implement guts of array creation.
19607
19608         (New::FormLookupType): Helper function.
19609
19610 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19611
19612         * codegen.cs: Removed most of the code generation here, and move the
19613         corresponding code generation bits to the statement classes. 
19614
19615         Added support for try/catch/finalize and throw.
19616
19617         * cs-parser.jay: Added support for try/catch/finalize.
19618
19619         * class.cs: Catch static methods having the flags override,
19620         virtual or abstract.
19621
19622         * expression.cs (UserCast): This user cast was not really doing
19623         what it was supposed to do.  Which is to be born in fully resolved
19624         state.  Parts of the resolution were being performed at Emit time! 
19625
19626         Fixed this code.
19627
19628 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19629
19630         * expression.cs: Implicity convert the result from UserCast.
19631
19632 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19633
19634         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19635         prevented it from working correctly. 
19636
19637         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19638         merely ConvertImplicit.
19639
19640 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19641
19642         * typemanager.cs: Make the LookupTypeContainer function static,
19643         and not per-instance.  
19644
19645         * class.cs: Make static FindMembers (the one that takes a Type
19646         argument). 
19647
19648         * codegen.cs: Add EmitForeach here.
19649
19650         * cs-parser.jay: Make foreach a toplevel object instead of the
19651         inline expansion, as we need to perform semantic analysis on it. 
19652
19653 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19654
19655         * expression.cs (Expression::ImplicitUserConversion): Rename to
19656         UserDefinedConversion.
19657
19658         (Expression::UserDefinedConversion): Take an extra argument specifying 
19659         whether we look for explicit user conversions too.
19660
19661         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19662
19663         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19664
19665         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19666         with the appropriate arguments.
19667
19668         * cs-parser.jay (cast_expression): Record location too.
19669
19670         * expression.cs (Cast): Record location info.
19671
19672         (Expression::ConvertExplicit): Take location argument.
19673
19674         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19675         to determine if we are doing explicit conversions.
19676
19677         (UserCast::Emit): Update accordingly.
19678
19679         (Expression::ConvertExplicit): Report an error if everything fails.
19680
19681         * ../errors/cs0030.cs : Add.
19682
19683 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19684
19685         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19686         virtual and newslot bits. 
19687
19688         * class.cs (TypeContainer::RegisterRequiredImplementations):
19689         Record methods we need.
19690
19691         (TypeContainer::MakeKey): Helper function to make keys for
19692         MethodBases, since the Methodbase key is useless.
19693
19694         (TypeContainer::Populate): Call RegisterRequiredImplementations
19695         before defining the methods.   
19696
19697         Create a mapping for method_builders_to_methods ahead of time
19698         instead of inside a tight loop.
19699
19700         (::RequireMethods):  Accept an object as the data to set into the
19701         hashtable so we can report interface vs abstract method mismatch.
19702
19703 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19704
19705         * report.cs: Make all of it static.
19706
19707         * rootcontext.cs: Drop object_type and value_type computations, as
19708         we have those in the TypeManager anyways.
19709
19710         Drop report instance variable too, now it is a global.
19711
19712         * driver.cs: Use try/catch on command line handling.
19713
19714         Add --probe option to debug the error reporting system with a test
19715         suite. 
19716
19717         * report.cs: Add support for exiting program when a probe
19718         condition is reached.
19719
19720 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19721
19722         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19723         we do a forcible conversion regardless of type, to check if 
19724         ForceConversion returns a null.
19725
19726         (Binary::error19): Use location to report error.
19727
19728         (Unary::error23): Use location here too.
19729
19730         * ../errors/cs0019.cs : Check in.
19731
19732         * ../errors/cs0023.cs : Check in.
19733
19734         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19735         case of a non-null MethodInfo object with a length of 0 !
19736
19737         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19738         an applicable member - according to the spec :-)
19739         Also fix logic to find members in base types.
19740
19741         (Unary::ResolveOperator): Same here.
19742
19743         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19744         as I was getting thoroughly confused between this and error19 :-)
19745
19746         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19747         (::FindMostEncompassedType): Implement.
19748         (::FindMostEncompassingType): Implement.
19749         (::StandardConversionExists): Implement.
19750
19751         (UserImplicitCast): Re-vamp. We now need info about most specific
19752         source and target types so that we can do the necessary conversions.
19753
19754         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19755         mathematical union with no duplicates.
19756
19757 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19758
19759         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19760         in order from base classes to child classes, so that we can in
19761         child classes look up in our parent for method names and
19762         attributes (required for handling abstract, virtual, new, override
19763         constructs: we need to instrospect our base class, and if we dont
19764         populate the classes in order, the introspection might be
19765         incorrect.  For example, a method could query its parent before
19766         the parent has any methods and would determine that the parent has
19767         no abstract methods (while it could have had them)).
19768
19769         (RootContext::CreateType): Record the order in which we define the
19770         classes.
19771
19772 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19773
19774         * class.cs (TypeContainer::Populate): Also method definitions can
19775         fail now, keep track of this.
19776
19777         (TypeContainer::FindMembers): Implement support for
19778         DeclaredOnly/noDeclaredOnly flag.
19779
19780         (Constructor::Emit) Return the ConstructorBuilder.
19781
19782         (Method::Emit) Return the MethodBuilder. 
19783         Check for abstract or virtual methods to be public.
19784
19785         * rootcontext.cs (RootContext::CreateType): Register all the
19786         abstract methods required for the class to be complete and the
19787         interface methods that must be implemented. 
19788
19789         * cs-parser.jay: Report error 501 (method requires body if it is
19790         not marked abstract or extern).
19791
19792         * expression.cs (TypeOf::Emit): Implement.
19793
19794         * typemanager.cs: runtime_handle_type, new global type.
19795
19796         * class.cs (Property::Emit): Generate code for properties.
19797
19798 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19799
19800         * expression.cs (Unary::ResolveOperator): Find operators on base type
19801         too - we now conform exactly to the spec.
19802
19803         (Binary::ResolveOperator): Same here.
19804
19805         * class.cs (Operator::Define): Fix minor quirk in the tests.
19806
19807         * ../errors/cs0215.cs : Added.
19808
19809         * ../errors/cs0556.cs : Added.
19810
19811         * ../errors/cs0555.cs : Added.
19812
19813 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19814
19815         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19816         single integer which is really efficient
19817
19818 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19819
19820         *  expression.cs (Expression::ImplicitUserConversion): Use location
19821         even in the case when we are examining True operators.
19822  
19823         * class.cs (Operator::Define): Perform extensive checks to conform
19824         with the rules for operator overloading in the spec.
19825
19826         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19827         some of the other conversions mentioned in the spec.
19828
19829         * typemanager.cs (array_type): New static member for the System.Array built-in
19830         type.
19831
19832         (cloneable_interface): For System.ICloneable interface.
19833
19834         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19835         we start resolving the tree and populating types.
19836
19837         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19838  
19839 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19840
19841         * expression.cs (Expression::ExprClassFromMemberInfo,
19842         Expression::Literalize): Create literal expressions from
19843         FieldInfos which are literals.
19844
19845         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19846         type casts, because they were wrong.  The test suite in tests
19847         caught these ones.
19848
19849         (ImplicitNumericConversion): ushort to ulong requires a widening
19850         cast. 
19851
19852         Int32 constant to long requires widening cast as well.
19853
19854         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19855         for integers because the type on the stack is not i4.
19856
19857 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * expression.cs (report118): require location argument. 
19860
19861         * parameter.cs: Do not dereference potential null value.
19862
19863         * class.cs: Catch methods that lack the `new' keyword when
19864         overriding a name.  Report warnings when `new' is used without
19865         anything being there to override.
19866
19867         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19868
19869         * class.cs: Only add constructor to hashtable if it is non-null
19870         (as now constructors can fail on define).
19871
19872         (TypeManager, Class, Struct): Take location arguments.
19873
19874         Catch field instance initialization in structs as errors.
19875
19876         accepting_filter: a new filter for FindMembers that is static so
19877         that we dont create an instance per invocation.
19878
19879         (Constructor::Define): Catch errors where a struct constructor is
19880         parameterless 
19881
19882         * cs-parser.jay: Pass location information for various new
19883         constructs. 
19884
19885         * delegate.cs (Delegate): take a location argument.
19886
19887         * driver.cs: Do not call EmitCode if there were problesm in the
19888         Definition of the types, as many Builders wont be there. 
19889
19890         * decl.cs (Decl::Decl): Require a location argument.
19891
19892         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19893         into integers, and find the most appropiate integer for it.
19894
19895         * literal.cs: Implement ULongLiteral.
19896
19897         * rootcontext.cs: Provide better information about the location of
19898         failure when CreateType fails.
19899
19900 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19901
19902         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19903         as well.
19904
19905         * expression.cs (Binary::CheckShiftArguments): Add missing type
19906         computation.
19907         (Binary::ResolveOperator): Add type to the logical and and logical
19908         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19909         before.
19910
19911         (Binary::DoNumericPromotions): In the case where either argument
19912         is ulong (and most signed types combined with ulong cause an
19913         error) perform implicit integer constant conversions as well.
19914
19915 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * expression.cs (UserImplicitCast): Method should always be
19918         non-null. 
19919         (Invocation::BetterConversion): Simplified test for IntLiteral.
19920
19921         (Expression::ImplicitNumericConversion): Split this routine out.
19922         Put the code that performs implicit constant integer conversions
19923         here. 
19924
19925         (Expression::Resolve): Become a wrapper around DoResolve so we can
19926         check eclass and type being set after resolve.
19927
19928         (Invocation::Badness): Remove this dead function
19929
19930         (Binary::ResolveOperator): Do not compute the expensive argumnets
19931         unless we have a union for it.
19932
19933         (Probe::Emit): Is needs to do an isinst and then
19934         compare against null.
19935
19936         (::CanConvert): Added Location argument.  If the Location argument
19937         is null (Location.Null), then we do not report errors.  This is
19938         used by the `probe' mechanism of the Explicit conversion.  We do
19939         not want to generate an error for something that the user
19940         explicitly requested to be casted.  But the pipeline for an
19941         explicit cast first tests for potential implicit casts.
19942
19943         So for now, if the Location is null, it means `Probe only' to
19944         avoid adding another argument.   Might have to revise this
19945         strategy later.
19946
19947         (ClassCast): New class used to type cast objects into arbitrary
19948         classes (used in Explicit Reference Conversions).
19949
19950         Implement `as' as well.
19951
19952         Reverted all the patches from Ravi below: they were broken:
19953
19954                 * The use of `level' as a mechanism to stop recursive
19955                   invocations is wrong.  That was there just to catch the
19956                   bug with a strack trace but not as a way of addressing
19957                   the problem.
19958
19959                   To fix the problem we have to *understand* what is going
19960                   on and the interactions and come up with a plan, not
19961                   just get things going.
19962
19963                 * The use of the type conversion cache that I proposed
19964                   last night had an open topic: How does this work across
19965                   protection domains.  A user defined conversion might not
19966                   be public in the location where we are applying the
19967                   conversion, a different conversion might be selected
19968                   (ie, private A->B (better) but public B->A (worse),
19969                   inside A, A->B applies, but outside it, B->A will
19970                   apply).
19971
19972                 * On top of that (ie, even if the above is solved),
19973                   conversions in a cache need to be abstract.  Ie, `To
19974                   convert from an Int to a Short use an OpcodeCast', not
19975                   `To convert from an Int to a Short use the OpcodeCast on
19976                   the variable 5' (which is what this patch was doing).
19977
19978 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19979
19980         * expression.cs (Invocation::ConversionExists): Re-write to use
19981         the conversion cache
19982
19983         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19984         cache all conversions done, not just user-defined ones.
19985
19986         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19987         to determine if a conversion exists instead of acutually trying to 
19988         perform the conversion. It's faster too.
19989
19990         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19991         and only then attempt the implicit conversion.
19992
19993 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19994
19995         * expression.cs (ConvertImplicit): Use a cache for conversions
19996         already found. Check level of recursion and bail out if necessary.
19997
19998 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20001         Export standard methods that we expect for string operations.
20002
20003         * statement.cs (Block::UsageWarning): Track usage of variables and
20004         report the errors for not used variables.
20005
20006         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20007         operator. 
20008
20009 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20010
20011         * codegen.cs: remove unnneded code 
20012
20013         * expression.cs: Removed BuiltinTypeAccess class
20014
20015         Fix the order in which implicit conversions are
20016         done.  
20017
20018         The previous fixed dropped support for boxed conversions (adding a
20019         test to the test suite now)
20020
20021         (UserImplicitCast::CanConvert): Remove test for source being null,
20022         that code is broken.  We should not feed a null to begin with, if
20023         we do, then we should track the bug where the problem originates
20024         and not try to cover it up here.
20025
20026         Return a resolved expression of type UserImplicitCast on success
20027         rather than true/false.  Ravi: this is what I was talking about,
20028         the pattern is to use a static method as a "constructor" for
20029         objects. 
20030
20031         Also, do not create arguments until the very last minute,
20032         otherwise we always create the arguments even for lookups that
20033         will never be performed. 
20034
20035         (UserImplicitCast::Resolve): Eliminate, objects of type
20036         UserImplicitCast are born in a fully resolved state. 
20037
20038         * typemanager.cs (InitCoreTypes): Init also value_type
20039         (System.ValueType). 
20040
20041         * expression.cs (Cast::Resolve): First resolve the child expression.
20042
20043         (LValue): Add new method AddressOf to be used by
20044         the `&' operator.  
20045
20046         Change the argument of Store to take an EmitContext instead of an
20047         ILGenerator, because things like FieldExpr need to be able to call
20048         their children expression to generate the instance code. 
20049
20050         (Expression::Error, Expression::Warning): Sugar functions for
20051         reporting errors.
20052
20053         (Expression::MemberLookup): Accept a TypeContainer instead of a
20054         Report as the first argument.
20055
20056         (Expression::ResolvePrimary): Killed.  I still want to improve
20057         this as currently the code is just not right.
20058
20059         (Expression::ResolveMemberAccess): Simplify, but it is still
20060         wrong. 
20061
20062         (Unary::Resolve): Catch errors in AddressOf operators.
20063
20064         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20065         index to a byte for the short-version, or the compiler will choose
20066         the wrong Emit call, which generates the wrong data.
20067
20068         (ParameterReference::Emit, ::Store): same.
20069
20070         (FieldExpr::AddressOf): Implement.
20071
20072         * typemanager.cs: TypeManager: made public variable instead of
20073         property.
20074
20075         * driver.cs: document --fatal.
20076
20077         * report.cs (ErrorMessage, WarningMessage): new names for the old
20078         Error and Warning classes.
20079
20080         * cs-parser.jay (member_access): Turn built-in access to types
20081         into a normal simplename
20082
20083 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20084
20085         * expression.cs (Invocation::BetterConversion): Fix to cope
20086         with q being null, since this was introducing a bug.
20087
20088         * expression.cs (ConvertImplicit): Do built-in conversions first.
20089
20090 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20091
20092         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20093
20094 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20095
20096         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20097         I had introduced long ago (what's new ?).
20098
20099         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20100         the work of all the checking. 
20101         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20102         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20103
20104         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20105         that is the right way. 
20106
20107         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20108         overloading resolution. Use everywhere instead of cutting and pasting code.
20109
20110         (Binary::ResolveOperator): Use MakeUnionSet.
20111
20112         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20113         we have to convert to bool types. Not complete yet.
20114
20115 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20116
20117         * typemanager.cs (TypeManager::CSharpName): support ushort.
20118
20119         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20120         to provide an expression that performsn an implicit constant int
20121         conversion (section 6.1.6).
20122         (Expression::ConvertImplicitRequired): Reworked to include
20123         implicit constant expression conversions.
20124
20125         (Expression::ConvertNumericExplicit): Finished.
20126
20127         (Invocation::Emit): If InstanceExpression is null, then it means
20128         that we perform a call on this.
20129
20130 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20131
20132         * expression.cs (Unary::Emit): Remove some dead code.
20133         (Probe): Implement Resolve and Emit for `is'.
20134         (Expression::ConvertImplicitRequired): Attempt to do constant
20135         expression conversions here.  Maybe should be moved to
20136         ConvertImplicit, but I am not sure.
20137         (Expression::ImplicitLongConstantConversionPossible,
20138         Expression::ImplicitIntConstantConversionPossible): New functions
20139         that tell whether is it possible to apply an implicit constant
20140         expression conversion.
20141
20142         (ConvertNumericExplicit): Started work on explicit numeric
20143         conversions.
20144
20145         * cs-parser.jay: Update operator constants.
20146
20147         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20148         (Parameters::GetSignature): Hook up VerifyArgs here.
20149         (Parameters::VerifyArgs): Verifies that no two arguments have the
20150         same name. 
20151
20152         * class.cs (Operator): Update the operator names to reflect the
20153         ones that the spec expects (as we are just stringizing the
20154         operator names).
20155
20156         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20157         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20158         previous usage did only work for our methods.
20159         (Expression::ConvertImplicit): Handle decimal implicit numeric
20160         conversions as well.
20161         (Expression::InternalTypeConstructor): Used to invoke constructors
20162         on internal types for default promotions.
20163
20164         (Unary::Emit): Implement special handling for the pre/post
20165         increment/decrement for overloaded operators, as they need to have
20166         the same semantics as the other operators.
20167
20168         (Binary::ResolveOperator): ditto.
20169         (Invocation::ConversionExists): ditto.
20170         (UserImplicitCast::Resolve): ditto.
20171
20172 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20173
20174         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20175         operator, return after emitting body. Regression tests pass again !
20176
20177         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20178         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20179         (Invocation::OverloadResolve): Ditto.
20180         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20181
20182         * everywhere : update calls to the above methods accordingly.
20183
20184 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20185
20186         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20187
20188         * expression.cs (ExpressionStatement): New base class used for
20189         expressions that can appear in statements, so that we can provide
20190         an alternate path to generate expression that do not leave a value
20191         on the stack.
20192
20193         (Expression::Emit, and all the derivatives): We no longer return
20194         whether a value is left on the stack or not.  Every expression
20195         after being emitted leaves a single value on the stack.
20196
20197         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20198         facilties of ExpressionStatement if possible.
20199
20200         * cs-parser.jay: Update statement_expression.
20201
20202 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20203
20204         * driver.cs: Change the wording of message
20205
20206 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20207
20208         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20209         the type of the expression to the return type of the method if
20210         we have an overloaded operator match ! The regression tests pass again !
20211         (Unary::ResolveOperator): Ditto.
20212
20213         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20214         to find "op_Implicit", not "implicit" ;-)
20215         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20216         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20217
20218         * everywhere : Correct calls to the above accordingly.
20219
20220         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20221         (ConvertImplicit): Do user-defined conversion if it exists.
20222
20223 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20224
20225         * assign.cs: track location.
20226         (Resolve): Use implicit conversions on assignment.
20227
20228         * literal.cs: Oops.  Not good, Emit of short access values should
20229         pass (Bytes) or the wrong argument will be selected.
20230
20231         * expression.cs (Unary::Emit): Emit code for -expr.
20232
20233         (Unary::ResolveOperator): Handle `Substract' for non-constants
20234         (substract from zero from the non-constants).
20235         Deal with Doubles as well. 
20236
20237         (Expression::ConvertImplicitRequired): New routine that reports an
20238         error if no implicit conversion exists. 
20239
20240         (Invocation::OverloadResolve): Store the converted implicit
20241         expressions if we make them
20242
20243 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20244
20245         * class.cs (ConstructorInitializer): Take a Location argument.
20246         (ConstructorBaseInitializer): Same here.
20247         (ConstructorThisInitializer): Same here.
20248
20249         * cs-parser.jay : Update all calls accordingly.
20250
20251         * expression.cs (Unary, Binary, New): Take location argument.
20252         Update accordingly everywhere.
20253
20254         * cs-parser.jay : Update all calls to the above to take a location
20255         argument.
20256
20257         * class.cs : Ditto.
20258
20259 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20260
20261         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20262         (Invocation::BetterConversion): Same here
20263         (Invocation::ConversionExists): Ditto.
20264
20265         (Invocation::ConversionExists): Implement.
20266
20267 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20268
20269         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20270         Also take an additional TypeContainer argument.
20271
20272         * All over : Pass in TypeContainer as argument to OverloadResolve.
20273
20274         * typemanager.cs (CSharpName): Update to check for the string type and return
20275         that too.
20276
20277         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20278         a given method.
20279
20280 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20281
20282         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20283         (Invocation::BetterFunction): Implement.
20284         (Invocation::BetterConversion): Implement.
20285         (Invocation::ConversionExists): Skeleton, no implementation yet.
20286
20287         Okay, things work fine !
20288
20289 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * typemanager.cs: declare and load enum_type, delegate_type and
20292         void_type. 
20293
20294         * expression.cs (Expression::Emit): Now emit returns a value that
20295         tells whether a value is left on the stack or not.  This strategy
20296         might be reveted tomorrow with a mechanism that would address
20297         multiple assignments.
20298         (Expression::report118): Utility routine to report mismatches on
20299         the ExprClass.
20300
20301         (Unary::Report23): Report impossible type/operator combination
20302         utility function.
20303
20304         (Unary::IsIncrementableNumber): Whether the type can be
20305         incremented or decremented with add.
20306         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20307         complemented. 
20308         (Unary::ResolveOperator): Implement ++, !, ~,
20309
20310         (Invocation::Emit): Deal with new Emit convetion.
20311
20312         * All Expression derivatives: Updated their Emit method to return
20313         whether they leave values on the stack or not.
20314
20315         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20316         stack for expressions that are statements. 
20317
20318 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * expression.cs (LValue): New interface.  Must be implemented by
20321         LValue objects.
20322         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20323         LValue interface.
20324
20325         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20326         interface for generating code, simplifies the code.
20327
20328 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20329
20330         * expression.cs (everywhere): Comment out return statements in ::Resolve
20331         methods to avoid the warnings.
20332
20333 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20334
20335         * driver.cs (parse): Report error 2001 if we can not open the
20336         source file.
20337
20338         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20339         not resolve it.
20340
20341         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20342         object. 
20343
20344         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20345         otherwise nested blocks end up with the same index.
20346
20347         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20348
20349         * expression.cs:  Instead of having FIXMEs in the Resolve
20350         functions, throw exceptions so it is obvious that we are facing a
20351         bug. 
20352
20353         * cs-parser.jay (invocation_expression): Pass Location information.
20354
20355         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20356         Use a basename for those routines because .NET does not like paths
20357         on them. 
20358
20359         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20360         already defined.
20361
20362 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20363
20364         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20365         are loading the correct data types (throws an exception if not).
20366         (TypeManager::InitCoreTypes): Use CoreLookupType
20367
20368         * expression.cs (Unary::ResolveOperator): return the child
20369         expression for expressions which are just +expr.
20370         (Unary::ResolveOperator): Return negative literals for -LITERAL
20371         expressions (otherwise they are Unary {Literal}).
20372         (Invocation::Badness): Take into account `Implicit constant
20373         expression conversions'.
20374
20375         * literal.cs (LongLiteral): Implement long literal class.
20376         (IntLiteral): export the `Value' of the intliteral. 
20377
20378 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20379
20380         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20381
20382         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20383         instead of 'Operator'
20384
20385         * expression.cs (Binary::ResolveOperator): Update accordingly.
20386         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20387         and 'Minus'
20388
20389         * cs-parser.jay (unary_expression): Update to use the new names.
20390
20391         * gen-treedump.cs (GetUnary): Same here.
20392
20393         * expression.cs (Unary::Resolve): Implement.
20394         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20395         operators are found instead of making noise ;-)
20396         (Unary::ResolveOperator): New method to do precisely the same thing which
20397         Binary::ResolveOperator does for Binary expressions.
20398         (Unary.method, .Arguments): Add.
20399         (Unary::OperName): Implement.   
20400         (Unary::ForceConversion): Copy and Paste !
20401
20402         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20403         a unary operator.
20404
20405         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20406         for the inbuilt operators. Only overloading works for now ;-)
20407
20408 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20409
20410         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20411         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20412
20413         * expression.cs (This::Emit): Implement. 
20414         (This::Resolve): Implement.
20415         (TypeOf:Resolve): Implement.
20416         (Expression::ResolveSimpleName): Add an implicit this to instance
20417         field references. 
20418         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20419         Bind instance variable to Field expressions.
20420         (FieldExpr::Instance): New field used to track the expression that
20421         represents the object instance.
20422         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20423         binding 
20424         (FieldExpr::Emit): Implement.
20425
20426         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20427         the last instruction contains a return opcode to avoid generating
20428         the last `ret' instruction (this generates correct code, and it is
20429         nice to pass the peverify output).
20430
20431         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20432         initializer for static and instance variables.
20433         (Constructor::Emit): Allow initializer to be null in the case of
20434         static constructors.  Only emit initializer for instance
20435         constructors. 
20436
20437         (TypeContainer::FindMembers): Return a null array if there are no
20438         matches.
20439
20440         Also fix the code for the MemberTypes.Method branch, as it was not
20441         scanning that for operators (or tried to access null variables before).
20442
20443         * assign.cs (Assign::Emit): Handle instance and static fields. 
20444
20445         * TODO: Updated.
20446
20447         * driver.cs: Stop compilation if there are parse errors.
20448
20449         * cs-parser.jay (constructor_declaration): Provide default base
20450         initializer for non-static constructors.
20451         (constructor_declarator): Do not provide a default base
20452         initializers if none was specified.
20453         Catch the fact that constructors should not have parameters.
20454
20455         * class.cs: Do not emit parent class initializers for static
20456         constructors, that should be flagged as an error.
20457
20458 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20459
20460         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20461         Move back code into TypeContainer::Populate.
20462
20463 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20464
20465         * class.cs (TypeContainer::AddConstructor): Fix the check to
20466         compare against Name, not Basename. 
20467         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20468
20469         * cs-parser.jay : Update accordingly.
20470
20471         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20472         for methods, don't forget to look into the operators too.
20473         (RegisterMethodBuilder): Helper method to take care of this for
20474         methods, constructors and operators.
20475         (Operator::Define): Completely revamp.
20476         (Operator.OperatorMethod, MethodName): New fields.
20477         (TypeContainer::Populate): Move the registering of builders into
20478         RegisterMethodBuilder.
20479         (Operator::Emit): Re-write.
20480
20481         * expression.cs (Binary::Emit): Comment out code path to emit method
20482         invocation stuff for the case when we have a user defined operator. I am
20483         just not able to get it right !
20484
20485 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20486
20487         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20488         argument. 
20489
20490         (Expression::MemberLookup): Provide a version that allows to
20491         specify the MemberTypes and BindingFlags. 
20492
20493         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20494         so it was not fetching variable information from outer blocks.
20495
20496         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20497         Beforefieldinit as it was buggy.
20498
20499         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20500         that Ravi put here.  
20501
20502         * class.cs (Constructor::Emit): Only emit if block is not null.
20503         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20504         deal with this by semantically definining it as if the user had
20505         done it.
20506
20507         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20508         constructors as we now "emit" them at a higher level.
20509
20510         (TypeContainer::DefineDefaultConstructor): Used to define the
20511         default constructors if none was provided.
20512
20513         (ConstructorInitializer): Add methods Resolve and Emit. 
20514
20515         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20516
20517 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20518
20519         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20520         the default constructor builder with our hashtable for methodbuilders
20521         to methodcores.
20522
20523         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20524         and argument_count is 0 in which case we have a match.
20525         (Binary::ResolveOperator): More null checking and miscellaneous coding
20526         style cleanup.
20527
20528 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20529
20530         * rootcontext.cs (IsNameSpace): Compare against null.
20531
20532         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20533
20534         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20535         and Unary::Operator.
20536
20537         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20538         accordingly.
20539
20540         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20541         we have overloaded operators.
20542         (Binary::ResolveOperator): Implement the part which does the operator overload
20543         resolution.
20544
20545         * class.cs (Operator::Emit): Implement.
20546         (TypeContainer::Emit): Emit the operators we have too.
20547
20548         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20549         the case when we have a user-defined operator.
20550
20551 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20552
20553         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20554
20555 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20556
20557         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20558         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20559         (Constructor::Emit): Implement.
20560         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20561         if we have no work to do. 
20562         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20563         Emit method.
20564
20565         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20566         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20567
20568         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20569         of parent.parent.
20570
20571 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20572
20573         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20574         in the source.
20575         (Tree::RecordNamespace): Method to do what the name says ;-)
20576         (Tree::Namespaces): Property to get at the namespaces hashtable.
20577
20578         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20579         keep track.
20580
20581         * rootcontext.cs (IsNamespace): Fixed it :-)
20582
20583 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20584
20585         * class.cs (TypeContainer::FindMembers): Add support for
20586         constructors. 
20587         (MethodCore): New class that encapsulates both the shared aspects
20588         of a Constructor and a Method.  
20589         (Method, Constructor): Factored pieces into MethodCore.
20590
20591         * driver.cs: Added --fatal which makes errors throw exceptions.
20592         Load System assembly as well as part of the standard library.
20593
20594         * report.cs: Allow throwing exceptions on errors for debugging.
20595
20596         * modifiers.cs: Do not use `parent', instead use the real type
20597         container to evaluate permission settings.
20598
20599         * class.cs: Put Ravi's patch back in.  He is right, and we will
20600         have to cope with the
20601
20602 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20603
20604         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20605         FamORAssem, not FamANDAssem.
20606
20607 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20608
20609         * driver.cs: Added --parse option that only parses its input files
20610         and terminates.
20611
20612         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20613         incorrect.  IsTopLevel is not used to tell whether an object is
20614         root_types or not (that can be achieved by testing this ==
20615         root_types).  But to see if this is a top-level *class* (not
20616         necessarly our "toplevel" container). 
20617
20618 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20619
20620         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20621         parent instead of a direct call to GetType.
20622
20623 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20624
20625         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20626         Modifiers.TypeAttr. This should just be a call to that method.
20627
20628         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20629         object so that we can determine if we are top-level or not.
20630
20631         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20632         TypeContainer too.
20633
20634         * enum.cs (Enum::Define): Ditto.
20635
20636         * modifiers.cs (FieldAttr): Re-write.
20637
20638         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20639         (TypeContainer::HaveStaticConstructor): New property to provide access
20640         to precisely that info.
20641
20642         * modifiers.cs (MethodAttr): Re-write.
20643         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20644
20645         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20646         of top-level types as claimed.
20647
20648 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * expression.cs (MemberLookup): Fruitless attempt to lookup
20651         constructors.  Maybe I need to emit default constructors?  That
20652         might be it (currently .NET emits this for me automatically).
20653         (Invocation::OverloadResolve): Cope with Arguments == null.
20654         (Invocation::EmitArguments): new function, shared by the new
20655         constructor and us.
20656         (Invocation::Emit): Handle static and instance methods.  Emit
20657         proper call instruction for virtual or non-virtual invocations.
20658         (New::Emit): Implement.
20659         (New::Resolve): Implement.
20660         (MemberAccess:Resolve): Implement.
20661         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20662         to track instances.
20663         (FieldExpr::Resolve): Set type.
20664
20665         * support.cs: Handle empty arguments.
20666                 
20667         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20668         SimpleLookup): Auxiliary routines to help parse a qualifier
20669         identifier.  
20670
20671         Update qualifier_identifier rule.
20672
20673         * codegen.cs: Removed debugging messages.
20674
20675         * class.cs: Make this a global thing, this acts just as a "key" to
20676         objects that we might have around.
20677
20678         (Populate): Only initialize method_builders_to_methods once.
20679
20680         * expression.cs (PropertyExpr): Initialize type from the
20681         PropertyType. 
20682
20683         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20684         Resolve pattern.  Attempt to implicitly convert value to boolean.
20685         Emit code.
20686
20687         * expression.cs: Set the type for the int32/int32 argument case.
20688         (Binary::ResolveOperator): Set the return type to boolean for
20689         comparission operators
20690
20691         * typemanager.cs: Remove debugging print code.
20692
20693         (Invocation::Resolve): resolve type.
20694
20695         * class.cs: Allocate a MemberInfo of the correct size, as the code
20696         elsewhere depends on the test to reflect the correct contents.
20697
20698         (Method::) Keep track of parameters, due to System.Reflection holes
20699
20700         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20701         mapping here.
20702
20703         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20704         of the exact size and return that.
20705
20706         (Class::LookupMethodByBuilder): New function that maps
20707         MethodBuilders to its methods.  Required to locate the information
20708         on methods because System.Reflection bit us again.
20709
20710         * support.cs: New file, contains an interface ParameterData and
20711         two implementations: ReflectionParameters and InternalParameters
20712         used to access Parameter information.  We will need to grow this
20713         as required.
20714
20715         * expression.cs (Invocation::GetParameterData): implement a cache
20716         and a wrapper around the ParameterData creation for methods. 
20717         (Invocation::OverloadResolve): Use new code.
20718
20719 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20720
20721         * class.cs (TypeContainer::EmitField): Remove and move into 
20722         (Field::Define): here and modify accordingly.
20723         (Field.FieldBuilder): New member.
20724         (TypeContainer::Populate): Update accordingly.
20725         (TypeContainer::FindMembers): Implement.
20726
20727 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20728
20729         * statement.cs: (VariableInfo::VariableType): New field to be
20730         initialized with the full type once it is resolved. 
20731
20732 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20733
20734         * parameter.cs (GetParameterInfo): Use a type cache to compute
20735         things only once, and to reuse this information
20736
20737         * expression.cs (LocalVariableReference::Emit): Implement.
20738         (OpcodeCast::Emit): fix.
20739
20740         (ParameterReference::Resolve): Implement.
20741         (ParameterReference::Emit): Implement.
20742
20743         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20744         that are expressions need to stay as Expressions.
20745
20746         * typemanager.cs (CSharpName): Returns the C# name of a type if
20747         possible. 
20748
20749         * expression.cs (Expression::ConvertImplicit): New function that
20750         implements implicit type conversions.
20751
20752         (Expression::ImplicitReferenceConversion): Implements implicit
20753         reference conversions.
20754
20755         (EmptyCast): New type for transparent casts.
20756
20757         (OpcodeCast): New type for casts of types that are performed with
20758         a sequence of bytecodes.
20759
20760         (BoxedCast): New type used for casting value types into reference
20761         types.  Emits a box opcode.
20762
20763         (Binary::DoNumericPromotions): Implements numeric promotions of
20764         and computation of the Binary::Type.
20765
20766         (Binary::EmitBranchable): Optimization.
20767
20768         (Binary::Emit): Implement code emission for expressions.
20769
20770         * typemanager.cs (TypeManager): Added two new core types: sbyte
20771         and byte.
20772
20773 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20774
20775         * class.cs (TypeContainer::FindMembers): Method which does exactly
20776         what Type.FindMembers does, only we don't have to use reflection. No
20777         implementation yet.
20778
20779         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20780         typecontainer objects as we need to get at them.
20781         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20782
20783         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20784         typecontainer object.
20785
20786         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20787         of just a Report object.
20788
20789 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20790
20791         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20792         "remove_"
20793         (TypeContainer::Populate): Now define the delegates of the type too.
20794         (TypeContainer.Delegates): Property to access the list of delegates defined
20795         in the type.
20796
20797         * delegates.cs (Delegate::Define): Implement partially.
20798
20799         * modifiers.cs (TypeAttr): Handle more flags.
20800
20801 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20802
20803         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20804         and not <=
20805         (Operator::Define): Re-write logic to get types by using the LookupType method
20806         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20807         (Indexer::Define): Ditto.
20808         (Event::Define): Ditto.
20809         (Property::Define): Ditto.
20810
20811 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20812
20813         * class.cs (TypeContainer::Populate): Now define operators too. 
20814         (TypeContainer.Operators): New property to access the list of operators
20815         in a type.
20816         (Operator.OperatorMethodBuilder): New member to hold the method builder
20817         for the operator we are defining.
20818         (Operator::Define): Implement.
20819
20820 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20821
20822         * class.cs (Event::Define): Make the prefixes of the accessor methods
20823         addOn_ and removeOn_ 
20824
20825         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20826         of the location being passed in too. Ideally, this should go later since all
20827         error reporting should be done through the Report object.
20828
20829         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20830         (Populate): Iterate thru the indexers we have and define them too.
20831         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20832         for the get and set accessors.
20833         (Indexer::Define): Implement.
20834
20835 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20836
20837         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20838         my previous implementation, did not work.
20839
20840         * typemanager.cs: Add a couple of missing types (the longs).
20841
20842         * literal.cs: Use TypeManager.bool_type instead of getting it.
20843
20844         * expression.cs (EventExpr): New kind of expressions.
20845         (Expressio::ExprClassFromMemberInfo): finish
20846
20847 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20848
20849         * assign.cs: Emit stores to static fields differently.
20850
20851 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20852
20853         * Merge in changes and adjust code to tackle conflicts. Backed out my
20854         code in Assign::Resolve ;-) 
20855
20856 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20857
20858         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20859         instead Report.Error and also pass in the location.
20860         (CSharpParser::Lexer): New readonly property to return the reference
20861         to the Tokenizer object.
20862         (declare_local_variables): Use Report.Error with location instead of plain 
20863         old error.
20864         (CheckDef): Ditto.
20865
20866         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20867         (Operator.CheckBinaryOperator): Ditto.
20868
20869         * cs-parser.jay (operator_declarator): Update accordingly.
20870
20871         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20872         (CheckBinaryOperator): Same here.
20873
20874         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20875         on the name without any prefixes of namespace names etc. This is because we
20876         already might have something already fully qualified like 
20877         'System.Console.WriteLine'
20878
20879         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20880
20881 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20882
20883         * cs-tokenizer.cs (location): Return a string which also contains
20884         the file name.
20885
20886         * expression.cs (ElementAccess): New class for expressions of the
20887         type 'element access.'
20888         (BaseAccess): New class for expressions of the type 'base access.'
20889         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20890         respectively.
20891
20892         * cs-parser.jay (element_access): Implement action.
20893         (base_access): Implement actions.
20894         (checked_expression, unchecked_expression): Implement.
20895
20896         * cs-parser.jay (local_variable_type): Correct and implement.
20897         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20898
20899         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20900
20901         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20902         name and the specifiers.
20903
20904         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20905
20906         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20907         making them all public ;-)
20908
20909         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20910         class anyways.
20911
20912 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20913
20914         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20915         PropertyExprs.
20916         (FieldExpr, PropertyExprs): New resolved expressions.
20917         (SimpleName::MemberStaticCheck): Perform static checks for access
20918         to non-static fields on static methods. Maybe this should be
20919         generalized for MemberAccesses. 
20920         (SimpleName::ResolveSimpleName): More work on simple name
20921         resolution. 
20922
20923         * cs-parser.jay (primary_expression/qualified_identifier): track
20924         the parameter index.
20925
20926         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20927         (EmitContext::EmitBoolExpression): Chain to expression generation
20928         instead of temporary hack.
20929         (::EmitStatementExpression): Put generic expression code generation.
20930
20931         * assign.cs (Assign::Emit): Implement variable assignments to
20932         local variables, parameters and fields.
20933
20934 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20935
20936         * statement.cs (Block::GetVariableInfo): New method, returns the
20937         VariableInfo for a variable name in a block.
20938         (Block::GetVariableType): Implement in terms of GetVariableInfo
20939
20940         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20941         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20942
20943 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20944
20945         * cs-parser.jay (operator_declaration): Continue on my quest : update
20946         to take attributes argument.
20947         (event_declaration): Ditto.
20948         (enum_declaration): Ditto.
20949         (indexer_declaration): Ditto.
20950
20951         * class.cs (Operator::Operator): Update constructor accordingly.
20952         (Event::Event): Ditto.
20953
20954         * delegate.cs (Delegate::Delegate): Same here.
20955
20956         * enum.cs (Enum::Enum): Same here.
20957
20958 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20959
20960         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20961
20962         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20963
20964         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20965         being passed around as an arraylist.
20966         (Attributes::AddAttribute): Method to add attribute sections.
20967
20968         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20969         (struct_declaration): Update accordingly.
20970         (constant_declaration): Update.
20971         (field_declaration): Update.
20972         (method_header): Update.
20973         (fixed_parameter): Update.
20974         (parameter_array): Ditto.
20975         (property_declaration): Ditto.
20976         (destructor_declaration): Ditto.
20977
20978         * class.cs (Struct::Struct): Update constructors accordingly.
20979         (Class::Class): Ditto.
20980         (Field::Field): Ditto.
20981         (Method::Method): Ditto.
20982         (Property::Property): Ditto.
20983         (TypeContainer::OptAttribute): update property's return type.
20984
20985         * interface.cs (Interface.opt_attributes): New member.
20986         (Interface::Interface): Update to take the extra Attributes argument.
20987
20988         * parameter.cs (Parameter::Parameter): Ditto.
20989
20990         * constant.cs (Constant::Constant): Ditto.
20991
20992         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20993         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20994         the attributes as a parameter.
20995         (InterfaceProperty): Update constructor call.
20996         (InterfaceEvent): Ditto.
20997         (InterfaceMethod): Ditto.
20998         (InterfaceIndexer): Ditto.
20999
21000         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21001         pass the attributes too.
21002         (interface_event_declaration): Ditto.
21003         (interface_property_declaration): Ditto.
21004         (interface_method_declaration): Ditto.
21005         (interface_declaration): Ditto.
21006
21007 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21008
21009         * class.cs (Method::Define): Track the "static Main" definition to
21010         create an entry point. 
21011
21012         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21013         EntryPoint if we find it. 
21014
21015         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21016         (EmitContext::ig): Make this variable public.
21017
21018         * driver.cs: Make the default output file be the first file name
21019         with the .exe extension.  
21020
21021         Detect empty compilations
21022
21023         Handle various kinds of output targets.  Handle --target and
21024         rename -t to --dumper.
21025
21026         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21027         methods inherited from Expression return now an Expression.  This
21028         will is used during the tree rewriting as we resolve them during
21029         semantic analysis.
21030
21031         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21032         the spec.  Missing entirely is the information about
21033         accessability of elements of it.
21034
21035         (Expression::ExprClassFromMemberInfo): New constructor for
21036         Expressions that creates a fully initialized Expression based on
21037         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21038         a Type.
21039
21040         (Invocation::Resolve): Begin implementing resolution of invocations.
21041
21042         * literal.cs (StringLiteral):  Implement Emit.
21043
21044 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21045
21046         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21047         member.
21048
21049 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21050
21051         * cs-parser.jay (attribute_arguments): Implement actions.
21052         (attribute): Fix bug in production. Implement action.
21053         (attribute_list): Implement.
21054         (attribute_target): Implement.
21055         (attribute_target_specifier, opt_target_specifier): Implement
21056         (CheckAttributeTarget): New method to check if the attribute target
21057         is valid.
21058         (attribute_section): Implement.
21059         (opt_attributes): Implement.
21060
21061         * attribute.cs : New file to handle attributes.
21062         (Attribute): Class to hold attribute info.
21063
21064         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21065         (attribute_section): Modify production to use 2 different rules to 
21066         achieve the same thing. 1 s/r conflict down !
21067         Clean out commented, useless, non-reducing dimension_separator rules.
21068
21069         * class.cs (TypeContainer.attributes): New member to hold list
21070         of attributes for a type.
21071         (Struct::Struct): Modify to take one more argument, the attribute list.
21072         (Class::Class): Ditto.
21073         (Field::Field): Ditto.
21074         (Method::Method): Ditto.
21075         (Property::Property): Ditto.
21076
21077         * cs-parser.jay (struct_declaration): Update constructor call to
21078         pass in the attributes too.
21079         (class_declaration): Ditto.
21080         (constant_declaration): Ditto.
21081         (field_declaration): Ditto.
21082         (method_header): Ditto.
21083         (fixed_parameter): Ditto.
21084         (parameter_array): Ditto.
21085         (property_declaration): Ditto.
21086
21087         * constant.cs (Constant::Constant): Update constructor similarly.
21088         Use System.Collections.
21089
21090         * parameter.cs (Parameter::Parameter): Update as above.
21091
21092 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21093
21094         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21095         (TypeContainer.delegates): New member to hold list of delegates.
21096
21097         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21098         this time as I seem to be on crack ;-)
21099
21100 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21101
21102         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21103         tell whether an identifier represents a namespace.
21104
21105         * expression.cs (NamespaceExpr): A namespace expression, used only
21106         temporarly during expression resolution.
21107         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21108         utility functions to resolve names on expressions.
21109
21110 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21111
21112         * codegen.cs: Add hook for StatementExpressions. 
21113
21114         * class.cs: Fix inverted test for static flag in methods.
21115
21116 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21117
21118         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21119         to make it coincide with MS' number.
21120         (Operator::CheckBinaryOperator): Ditto.
21121
21122         * ../errors/errors.txt : Remove error numbers added earlier.
21123
21124         * ../errors/cs1019.cs : Test case for error # 1019
21125
21126         * ../errros/cs1020.cs : Test case for error # 1020
21127
21128         * cs-parser.jay : Clean out commented cruft.
21129         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21130         used anywhere - non-reducing rule.
21131         (namespace_declarations): Non-reducing rule - comment out.
21132
21133         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21134         with TypeContainer::AddEnum.
21135
21136         * delegate.cs : New file for delegate handling classes.
21137         (Delegate): Class for declaring delegates.
21138
21139         * makefile : Update.
21140
21141         * cs-parser.jay (delegate_declaration): Implement.
21142
21143 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21144
21145         * class.cs (Event::Define): Implement.
21146         (Event.EventBuilder): New member.
21147
21148         * class.cs (TypeContainer::Populate): Update to define all enums and events
21149         we have.
21150         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21151         readonly fields for all these cases ?
21152
21153 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21154
21155         * class.cs (Property): Revamp to use the convention of making fields readonly.
21156         Accordingly modify code elsewhere.
21157
21158         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21159         the Define method of the Property class.
21160
21161         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21162         trivial bug.
21163         (TypeContainer::Populate): Update to define all the properties we have. Also
21164         define all enumerations.
21165
21166         * enum.cs (Define): Implement.
21167
21168 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21169
21170         * cs-parser.jay (overloadable_operator): The semantic value is an
21171         enum of the Operator class.
21172         (operator_declarator): Implement actions.
21173         (operator_declaration): Implement.
21174
21175         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21176         validity of definitions.
21177         (Operator::CheckBinaryOperator): Static method to check for binary operators
21178         (TypeContainer::AddOperator): New method to add an operator to a type.
21179
21180         * cs-parser.jay (indexer_declaration): Added line to actually call the
21181         AddIndexer method so it gets added ;-)
21182
21183         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21184         already taken care of by the MS compiler ?  
21185
21186 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21187
21188         * class.cs (Operator): New class for operator declarations.
21189         (Operator::OpType): Enum for the various operators.
21190
21191 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21192
21193         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21194         ostensibly handle this in semantic analysis.
21195
21196         * cs-parser.jay (general_catch_clause): Comment out
21197         (specific_catch_clauses, specific_catch_clause): Ditto.
21198         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21199         (catch_args, opt_catch_args): New productions.
21200         (catch_clause): Rewrite to use the new productions above
21201         (catch_clauses): Modify accordingly.
21202         (opt_catch_clauses): New production to use in try_statement
21203         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21204         and re-write the code in the actions to extract the specific and
21205         general catch clauses by being a little smart ;-)
21206
21207         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21208         Hooray, try and catch statements parse fine !
21209
21210 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21211
21212         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21213         string from the hashtable of variables.
21214
21215         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21216         I end up making that mistake ;-)
21217         (catch_clauses): Fixed gross error which made Key and Value of the 
21218         DictionaryEntry the same : $1 !!
21219
21220 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21221
21222         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21223
21224         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21225         when the add and remove accessors are specified. 
21226
21227 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21228
21229         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21230         information about indexer_declarator.
21231         (indexer_declarator): Implement actions.
21232         (parsing_indexer): New local boolean used to keep track of whether
21233         we are parsing indexers or properties. This is necessary because 
21234         implicit_parameters come into picture even for the get accessor in the 
21235         case of an indexer.
21236         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21237
21238         * class.cs (Indexer): New class for indexer declarations.
21239         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21240         (TypeContainer::indexers): New member to hold list of indexers for the
21241         type.
21242
21243 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21244
21245         * cs-parser.jay (add_accessor_declaration): Implement action.
21246         (remove_accessor_declaration): Implement action.
21247         (event_accessors_declaration): Implement
21248         (variable_declarators): swap statements for first rule - trivial.
21249
21250         * class.cs (Event): New class to hold information about event
21251         declarations.
21252         (TypeContainer::AddEvent): New method to add an event to a type
21253         (TypeContainer::events): New member to hold list of events.
21254
21255         * cs-parser.jay (event_declaration): Implement actions.
21256
21257 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21258
21259         * cs-parser.jay (dim_separators): Implement. Make it a string
21260         concatenating all the commas together, just as they appear.
21261         (opt_dim_separators): Modify accordingly
21262         (rank_specifiers): Update accordingly. Basically do the same
21263         thing - instead, collect the brackets here.
21264         (opt_rank_sepcifiers): Modify accordingly.
21265         (array_type): Modify to actually return the complete type string
21266         instead of ignoring the rank_specifiers.
21267         (expression_list): Implement to collect the expressions
21268         (variable_initializer): Implement. We make it a list of expressions
21269         essentially so that we can handle the array_initializer case neatly too.
21270         (variable_initializer_list): Implement.
21271         (array_initializer): Make it a list of variable_initializers
21272         (opt_array_initializer): Modify accordingly.
21273
21274         * expression.cs (New::NType): Add enumeration to help us
21275         keep track of whether we have an object/delegate creation
21276         or an array creation.
21277         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21278         members to hold data about array creation.
21279         (New:New): Modify to update NewType
21280         (New:New): New Overloaded contructor for the array creation
21281         case.
21282
21283         * cs-parser.jay (array_creation_expression): Implement to call
21284         the overloaded New constructor.
21285
21286 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21287
21288         * class.cs (TypeContainer::Constructors): Return member
21289         constructors instead of returning null.
21290
21291 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21292
21293         * typemanager.cs (InitCoreTypes): Initialize the various core
21294         types after we have populated the type manager with the user
21295         defined types (this distinction will be important later while
21296         compiling corlib.dll)
21297
21298         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21299         on Expression Classification.  Now all expressions have a method
21300         `Resolve' and a method `Emit'.
21301
21302         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21303         generation from working.     Also add some temporary debugging
21304         code. 
21305
21306 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21307
21308         * codegen.cs: Lots of code generation pieces.  This is only the
21309         beginning, will continue tomorrow with more touches of polish.  We
21310         handle the fundamentals of if, while, do, for, return.  Others are
21311         trickier and I need to start working on invocations soon.
21312
21313         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21314         s.InitStatement. 
21315
21316         * codegen.cs (EmitContext): New struct, used during code
21317         emission to keep a context.   Most of the code generation will be
21318         here. 
21319
21320         * cs-parser.jay: Add embedded blocks to the list of statements of
21321         this block.  So code generation proceeds in a top down fashion.
21322
21323 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21324
21325         * statement.cs: Add support for multiple child blocks.
21326
21327 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21328
21329         * codegen.cs (EmitCode): New function, will emit the code for a
21330         Block of code given a TypeContainer and its ILGenerator. 
21331
21332         * statement.cs (Block): Standard public readonly optimization.
21333         (Block::Block constructors): Link children. 
21334         (Block::Child): Child Linker.
21335         (Block::EmitVariables): Emits IL variable declarations.
21336
21337         * class.cs: Drop support for MethodGroups here, delay until
21338         Semantic Analysis.
21339         (Method::): Applied the same simplification that I did before, and
21340         move from Properties to public readonly fields.
21341         (Method::ParameterTypes): Returns the parameter types for the
21342         function, and implements a cache that will be useful later when I
21343         do error checking and the semantic analysis on the methods is
21344         performed.
21345         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21346         and made a method, optional argument tells whether this is a class
21347         or a structure to apply the `has-this' bit.
21348         (Method::GetCallingConvention): Implement, returns the calling
21349         convention. 
21350         (Method::Define): Defines the type, a second pass is performed
21351         later to populate the methods.
21352
21353         (Constructor::ParameterTypes): implement a cache similar to the
21354         one on Method::ParameterTypes, useful later when we do semantic
21355         analysis. 
21356
21357         (TypeContainer::EmitMethod):  New method.  Emits methods.
21358
21359         * expression.cs: Removed MethodGroup class from here.
21360
21361         * parameter.cs (Parameters::GetCallingConvention): new method.
21362
21363 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21364
21365         * class.cs (TypeContainer::Populate): Drop RootContext from the
21366         argument. 
21367
21368         (Constructor::CallingConvention): Returns the calling convention.
21369         (Constructor::ParameterTypes): Returns the constructor parameter
21370         types. 
21371
21372         (TypeContainer::AddConstructor): Keep track of default constructor
21373         and the default static constructor.
21374
21375         (Constructor::) Another class that starts using `public readonly'
21376         instead of properties. 
21377
21378         (Constructor::IsDefault): Whether this is a default constructor. 
21379
21380         (Field::) use readonly public fields instead of properties also.
21381
21382         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21383         track of static constructors;  If none is used, turn on
21384         BeforeFieldInit in the TypeAttributes. 
21385
21386         * cs-parser.jay (opt_argument_list): now the return can be null
21387         for the cases where there are no arguments. 
21388
21389         (constructor_declarator): If there is no implicit `base' or
21390         `this', then invoke the default parent constructor. 
21391
21392         * modifiers.cs (MethodAttr): New static function maps a set of
21393         modifiers flags into a MethodAttributes enum
21394         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21395         MethodAttr, TypeAttr to represent the various mappings where the
21396         modifiers are used.
21397         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21398
21399 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21400
21401         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21402         method arguments.
21403
21404         * interface.cs (PopulateIndexer): Implemented the code generator
21405         for interface indexers.
21406
21407 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21408
21409         * interface.cs (InterfaceMemberBase): Now we track the new status
21410         here.  
21411
21412         (PopulateProperty): Implement property population.  Woohoo!  Got
21413         Methods and Properties going today. 
21414
21415         Removed all the properties for interfaces, and replaced them with
21416         `public readonly' fields. 
21417
21418 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21419
21420         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21421         initialize their hashtables/arraylists only when they are needed
21422         instead of doing this always.
21423
21424         * parameter.cs: Handle refs and out parameters.
21425
21426         * cs-parser.jay: Use an ArrayList to construct the arguments
21427         instead of the ParameterCollection, and then cast that to a
21428         Parameter[] array.
21429
21430         * parameter.cs: Drop the use of ParameterCollection and use
21431         instead arrays of Parameters.
21432
21433         (GetParameterInfo): Use the Type, not the Name when resolving
21434         types. 
21435
21436 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21437
21438         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21439         and instead use public readonly fields.
21440
21441         * class.cs: Put back walking code for type containers.
21442
21443 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21444
21445         * class.cs (MakeConstant): Code to define constants.
21446
21447         * rootcontext.cs (LookupType): New function.  Used to locate types 
21448
21449
21450 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21451
21452         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21453         this System.Reflection code is.  Kudos to Microsoft
21454
21455         * typemanager.cs: Implement a type cache and avoid loading all
21456         types at boot time.  Wrap in LookupType the internals.  This made
21457         the compiler so much faster.  Wow.  I rule!
21458
21459         * driver.cs: Make sure we always load mscorlib first (for
21460         debugging purposes, nothing really important).
21461
21462         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21463         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21464
21465         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21466         on namespaces that have been imported using the `using' keyword.
21467
21468         * class.cs (TypeContainer::TypeAttr): Virtualize.
21469         (Class::TypeAttr): Return attributes suitable for this bad boy.
21470         (Struct::TypeAttr): ditto.
21471         Handle nested classes.
21472         (TypeContainer::) Remove all the type visiting code, it is now
21473         replaced with the rootcontext.cs code
21474
21475         * rootcontext.cs (GetClassBases): Added support for structs. 
21476
21477 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21478
21479         * interface.cs, statement.cs, class.cs, parameter.cs,
21480         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21481         Drop use of TypeRefs, and use strings instead.
21482
21483 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21484
21485         * rootcontext.cs: 
21486
21487         * class.cs (Struct::Struct): set the SEALED flags after
21488         checking the modifiers.
21489         (TypeContainer::TypeAttr): new property, returns the
21490         TypeAttributes for a class.  
21491
21492         * cs-parser.jay (type_list): Oops, list production was creating a
21493         new list of base types.
21494
21495         * rootcontext.cs (StdLib): New property.
21496         (GetInterfaceTypeByName): returns an interface by type name, and
21497         encapsulates error handling here.
21498         (GetInterfaces): simplified.
21499         (ResolveTree): Encapsulated all the tree resolution here.
21500         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21501         types. 
21502
21503         * driver.cs: Add support for --nostdlib, to avoid loading the
21504         default assemblies.
21505         (Main): Do not put tree resolution here. 
21506
21507         * rootcontext.cs: Beginning of the class resolution.
21508
21509 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21510
21511         * rootcontext.cs: Provide better error reporting. 
21512
21513         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21514
21515         * rootcontext.cs (CreateInterface): Handle the case where there
21516         are no parent interfaces.
21517
21518         (CloseTypes): Routine to flush types at the end.
21519         (CreateInterface): Track types.
21520         (GetInterfaces): Returns an array of Types from the list of
21521         defined interfaces.
21522
21523         * typemanager.c (AddUserType): Mechanism to track user types (puts
21524         the type on the global type hash, and allows us to close it at the
21525         end). 
21526
21527 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21528
21529         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21530         RecordInterface instead.
21531
21532         * cs-parser.jay: Updated to reflect changes above.
21533
21534         * decl.cs (Definition): Keep track of the TypeBuilder type that
21535         represents this type here.  Not sure we will use it in the long
21536         run, but wont hurt for now.
21537
21538         * driver.cs: Smaller changes to accomodate the new code.
21539
21540         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21541         when done. 
21542
21543         * rootcontext.cs (CreateInterface):  New method, used to create
21544         the System.TypeBuilder type for interfaces.
21545         (ResolveInterfaces): new entry point to resolve the interface
21546         hierarchy. 
21547         (CodeGen): Property, used to keep track of the code generator.
21548
21549 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21550
21551         * cs-parser.jay: Add a second production for delegate_declaration
21552         with `VOID'.
21553
21554         (enum_body): Put an opt_comma here instead of putting it on
21555         enum_body or enum_member_declarations so we can handle trailing
21556         commas on enumeration members.  Gets rid of a shift/reduce.
21557
21558         (type_list): Need a COMMA in the middle.
21559
21560         (indexer_declaration): Tell tokenizer to recognize get/set
21561
21562         * Remove old targets.
21563
21564         * Re-add the parser target.
21565
21566 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21567
21568         * cs-parser.jay: Add precendence rules for a number of operators
21569         ot reduce the number of shift/reduce conflicts in the grammar.
21570
21571 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21572
21573         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21574         and put it here.
21575
21576         Get rid of old crufty code.
21577
21578         * rootcontext.cs: Use this to keep track of the parsed
21579         representation and the defined types available to the program. 
21580
21581         * gen-treedump.cs: adjust for new convention.
21582
21583         * type.cs: Split out the type manager, and the assembly builder
21584         from here. 
21585
21586         * typemanager.cs: the type manager will live here now.
21587
21588         * cil-codegen.cs: And the code generator here. 
21589
21590 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21591
21592         * makefile: Fixed up for easy making.
21593
21594 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21595
21596         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21597         the 
21598
21599         (unary_expression): Expand pre_increment_expression and
21600         post_decrement_expression to reduce a shift/reduce.
21601
21602 2001-07-11  Simon Cozens
21603
21604         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21605
21606         Improve allow_keyword_as_indent name.
21607
21608 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21609
21610         * Adjustments for Beta2. 
21611
21612 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21613
21614         * decl.cs: Added `Define' abstract method.
21615         (InTransit): new property, used to catch recursive definitions. 
21616
21617         * interface.cs: Implement `Define'. 
21618
21619         * modifiers.cs: Map Modifiers.constants to
21620         System.Reflection.TypeAttribute flags.
21621
21622         * class.cs: Keep track of types and user-defined types.
21623         (BuilderInit): New method for creating an assembly
21624         (ResolveType): New function to launch the resolution process, only
21625         used by interfaces for now.
21626
21627         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21628         that are inserted into the name space. 
21629
21630 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21631
21632         * ARGH.  I have screwed up my tree so many times due to the use of
21633         rsync rather than using CVS.  Going to fix this at once. 
21634
21635         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21636         load types.
21637
21638 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * Experiment successful: Use System.Type rather that our own
21641         version of Type.  
21642
21643 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21644
21645         * cs-parser.jay: Removed nsAliases from here.
21646
21647         Use new namespaces, handle `using XXX;' 
21648
21649         * namespace.cs: Reimplemented namespace handling, use a recursive
21650         definition of the class.  Now we can keep track of using clauses
21651         and catch invalid using clauses.
21652
21653 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21654
21655         * gen-treedump.cs: Adapted for all the renaming.
21656
21657         * expression.cs (Expression): this class now has a Type property
21658         which returns an expression Type.
21659
21660         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21661         `Type', as this has a different meaning now in the base
21662
21663 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * interface.cs, class.cs: Removed from all the sources the
21666         references to signature computation, as we can not do method
21667         signature computation during the parsing time, as we are not
21668         trying to solve at that point distinguishing:
21669
21670         class X {
21671                 void a (Blah x) {}
21672                 void a (NS.Blah x) {}
21673         }
21674
21675         Which depending on the context might be valid or not, as we do not
21676         know if Blah is the same thing as NS.Blah at that point.
21677
21678         * Redid everything so the code uses TypeRefs now instead of
21679         Types.  TypeRefs are just temporary type placeholders, that need
21680         to be resolved.  They initially have a pointer to a string and the
21681         current scope in which they are used.  This is used later by the
21682         compiler to resolve the reference to an actual Type. 
21683
21684         * DeclSpace is no longer a CIR.Type, and neither are
21685         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21686         are all DeclSpaces, but no Types. 
21687
21688         * type.cs (TypeRefManager): This implements the TypeRef manager,
21689         which keeps track of all the types that need to be resolved after
21690         the parsing has finished. 
21691
21692 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21693
21694         * ARGH.  We are going to have to store `foreach' as a class rather
21695         than resolving it, as we need to verify error 1579 after name
21696         resolution.   *OR* we could keep a flag that says `This request to
21697         IEnumerator comes from a foreach statement' which we can then use
21698         to generate the error.
21699
21700 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21701
21702         * class.cs (TypeContainer.AddMethod): we now add methods to the
21703         MethodGroup instead of the method hashtable.  
21704
21705         * expression.cs: Add MethodGroup abstraction, which gets us one
21706         step closer to the specification in the way we handle method
21707         declarations.  
21708
21709         * cs-parser.jay (primary_expression): qualified_identifier now
21710         tried to match up an identifier to a local variable reference or
21711         to a parameter reference.
21712
21713         current_local_parameters is now a parser global variable that
21714         points to the current parameters for the block, used during name
21715         lookup.
21716
21717         (property_declaration): Now creates an implicit `value' argument to
21718         the set accessor.
21719
21720 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21721
21722         * parameter.cs: Do not use `param' arguments as part of the
21723         signature, per the spec.
21724
21725 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * decl.cs: Base class for classes, structs and interfaces.  This
21728         is the "Declaration Space" 
21729
21730         * cs-parser.jay: Use CheckDef for checking declaration errors
21731         instead of having one on each function.
21732
21733         * class.cs: Factor out some code for handling error handling in
21734         accordance to the "Declarations" section in the "Basic Concepts"
21735         chapter in the ECMA C# spec.
21736
21737         * interface.cs: Make all interface member classes derive from
21738         InterfaceMemberBase.
21739
21740 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21741
21742         * Many things: all interfaces are parsed and generated in
21743         gen-treedump.  Support for member variables, constructors,
21744         destructors, properties, constants is there.
21745
21746         Beginning of the IL backend, but very little done, just there for
21747         testing purposes. 
21748
21749 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21750
21751         * cs-parser.jay: Fix labeled statement.
21752
21753         * cs-tokenizer.cs (escape): Escape " and ' always.
21754         ref_line, ref_name: keep track of the line/filename as instructed
21755         by #line by the compiler.
21756         Parse #line.
21757
21758 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21759
21760         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21761         to match the values in System.CodeDOM.
21762
21763         Divid renamed to Divide.
21764
21765         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21766         statements. 
21767         (Statements.set): remove.
21768
21769         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21770         statements. 
21771
21772         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21773         falseStatements always have valid values. 
21774
21775         * cs-parser.jay: Use System.CodeDOM now.
21776