0e4fea4108ac7ca57e9ae19e3a7b6b22c9d183f6
[mono.git] / mcs / mcs / ChangeLog
1 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2
3         Fix #76369.
4         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
5
6 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
7
8         * attribute.cs: Changed error message.
9
10         * cs-tokenizer.cs: One more check.
11
12 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
13
14         * statement.cs (Block.Resolve): Ignore empty statement.
15
16 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
17
18         * report.cs: Made error/warning methods more strict to avoid
19         their misuse.
20
21         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
22         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
23         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
24         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
25
26 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
27
28         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
29         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
30
31         * class.cs (TypeContainer.IsComImport): New property.
32         (Constructor.Define): Create proper ctor for ComImport types.
33
34         * expression.cs (New.CheckComImport): Fixed.
35
36 2005-11-07  Miguel de Icaza  <miguel@novell.com>
37
38         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
39         that a parameter has been captured does not mean that we do not
40         have to do the rest of the processing.  This fixes the second part
41         of #76592.  If there was another anonymous method capturing
42         values in the past, the Scope would never be set for the second
43         method that captured the same parameter.
44
45         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
46         properly manipulate the stack.   Second part of fix for #76592.
47
48         * expression.cs (New): Add support for invoking "new" on
49         interfaces that have been flagged with the ComImport attribute and
50         the CoClass.  Fixes #76637 
51
52         * statement.cs (Try.DoEmit): When a variable is captured, do not
53         try to emit the vi.LocalBuilder variable as it has been captured.
54         Create a temporary variable and store the results on the
55         FieldBuilder.  Fixes #76642
56
57 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
58
59         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
60
61         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
62
63         * expression.cs (Binary.DoResolve): Added && optimalization.
64     
65         * typemanager.cs (AddUserType): Removed useless argument.
66
67 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
68
69         * statement.cs (Block.variables): Uses ListDictionary.
70
71 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
72
73         Fix #75969.
74         * class.cs (PartialContainer.EmitType): Customized to emit
75         security attributes.
76         (ClassPart.ApplyAttributeBuilder): Transform security attribute
77         for partial classes.
78
79 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
80
81         Fix #76599.
82         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
83         access has to be fixed.
84         
85         * typemanager.cs (IsUnmanagedType): Wrong common field type.
86
87 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
88
89         Fix #76590.
90         * ecore.cs (NullCast.Reduce): Implemented.
91
92         * expression.cs (ArrayCreation.CheckIndices): Correcly check
93         constant type.
94         
95         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
96         properly.
97         (Foreach.Resolve): Catch null properly.
98
99 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
100  
101         * cs-tokenizer.cs: Warning text fix.
102
103         * driver.cs: AllWarningNumbers exposed on public interface.
104
105         * report.cs (): Reviewed warning numbers.
106         (IsValidWarning): Use binary search.
107
108 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
109  
110         * driver.cs: Implemeted resource visibility.
111         (Resources): New class for code sharing between /res: and
112         /linkres:
113  
114 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
115
116         Fix #76568.
117         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
118         folding.
119         
120         * convert (Convert.ImplicitReferenceConversion): NullCast holds
121         contants only.
122         
123         * ecore.cs (NullCast): Child is contant only.
124         
125         * literal.cs (NullLiteral.Reduce): null can be converted to any
126         reference type.
127
128 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
129
130         * driver.cs: Use Encoding.Default as default code page instead
131           of ISO-28591.
132
133 2005-10-27  Raja R Harinath  <rharinath@novell.com>
134
135         Fix #76085.
136         * expression.cs (Invocation.Error_InvalidArguments): Handle
137         __arglist parameters.
138         (Invocation.VerifyArgumentsCompat): Likewise.
139         * support.cs (ReflectionParameters.GetSignatureForError): Print
140         __arglist parameters.
141         (InternalParamters.GetSignatureForError): Likewise.
142         * parameter.cs (Parameters.GetSignatureForError): Likewise.
143
144 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
145
146         * attribute.cs (GetPropertyValue): Made public.
147
148         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
149         Resolve.
150         Add new property WrapNonExceptionThrows to handle 2.0 assembly
151         attribute.
152         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
153         is not defined.
154         
155         * driver.cs: Reflect method name change.
156         
157         * statement.cs (Try.Resolve): Warn when try has both general
158         exception handlers.
159         
160         * typemanager.cs: runtime_compatibility_attr_type new predefined
161         type.
162
163 2005-10-26  Raja R Harinath  <harinath@gmail.com>
164
165         Fix #76419.
166         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
167         treat it as an empty parameter list.
168
169 2005-10-26  Raja R Harinath  <rharinath@novell.com>
170
171         Fix #76271.     
172         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
173         ResolveAsTypeStep silent.
174         * statement.cs (Block.AddConstant): Mark block as used.
175         (Block.ResolveMeta): Avoid piling on error messages
176         if a constant initializer resolution fails.
177
178 2005-10-25  Raja R Harinath  <rharinath@novell.com>
179
180         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
181         Remove.
182         (NamespaceEntry.VerifyAllUsing): New.
183         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
184         behaviour.  Delegates actual resolution of alias to ...
185         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
186         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
187         Update.
188         * driver.cs (Driver.MainDriver): Update.
189         
190         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
191         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
192         property.
193         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
194         Remove.
195         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
196         RootNamespace.DefineNamespacesForAll.
197
198 2005-10-24  Raja R Harinath  <harinath@gmail.com>
199
200         * typemanager.cs (assemblies, external_aliases, modules)
201         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
202         (ComputeNamespaces, GetRootNamespace): Remove extra staging
203         overhead.  Move resposibility ...
204         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
205         * driver.cs, attribute.cs, codegen.cs: Update to changes.
206
207 2005-10-23  Raja R Harinath  <harinath@gmail.com>
208
209         * namespace.cs (RootNamespace.all_namespaces): Renamed from
210         cached_namespaces.  Improve usage.
211         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
212         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
213         Move from GlobalRootNamespace and simplify.
214         (RootNamespace.Global): Make instance variable.
215         (RootNamespace.RootNamespace): Add "alias name" parameter.
216         (GlobalRootNamespace): Simplify drastically.
217         (Namespace.Lookup): Don't use GetNamespace.
218         * typemanager.cs (GetRootNamespace): Rename from
219         ComputeNamespaceForAlias.
220         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
221
222 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
223
224         * anonymous.cs (AnonymousContainer): Don't crash when container
225         doesn't exist.
226
227 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
228
229         * expression.cs (Binary.DoResolve): Warn when comparing same
230         values.
231
232 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
233
234         Fix #76486.
235         * expression.cs (Binary.DoResolve): It looks like there are no
236         convetsion rules in enum context.
237
238 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
239
240         Add support for extern alias qualifiers.
241         * typemanager.cs: Move some LookupTypeReflection code
242         to namespace.cs, to have cleaner code. Added some methods
243         to help us keep track of the extern aliased references.
244         * driver.cs: Add suport for extern alias assemblies on command
245         line and check for their warnings/errors. Also keep track of the
246         extern aliased assemblies.
247         * namespace.cs: Move the global functionality of Namespace
248         to GlobalRootNamespace/RootNamespace. Now the global namespace
249         is GlobalRootNamespace.Globa. Also the code moved from 
250         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
251         Finally added LocalAliasEntry (AliasEntry before) and
252         ExternAliasEntry, to handle alias statements.
253         * cs-parser.jay: Add support in the grammar for extern alias
254         statement.
255         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
256         Update callings to Namespace (now in GlobalRootNamespace).
257
258 2005-10-18  Raja R Harinath  <rharinath@novell.com>
259
260         Fix #76371.
261         * class.cs (TypeContainer.DefineType): Move updating of
262         topological sort earlier in the code.
263         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
264
265 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
266
267         Fix #76273.
268         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
269         
270         * constant.cs (Constant.TryReduce): Moved from Cast class.
271         (Reduce): Made little bit more OO and fixed missing conversions.
272         
273         * ecore.cs (Reduce): Implemented.
274         (Binary.EnumLiftUp): New method to upgrade values to enum values.
275         
276         * literal.cs (Reduce): Implemented.
277         
278         * class.cs: Reverted Miguel's wrong commit.
279
280 2005-10-14  Miguel de Icaza  <miguel@novell.com>
281
282         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
283
284 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
285
286         * cs-parser.jay, expression.cs : CS0214 was missing error location
287           for constants. Fixed bug #76404.
288
289 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
290
291         Fix #76370.
292         * convert.cs (ExplicitConversionCore): Fixed object->enum
293         conversion.
294
295 2005-10-10  Raja R Harinath  <rharinath@novell.com>
296
297         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
298         InstanceExpression.
299         (PropertyExpr.EmitCall): Likewise.
300         * expression.cs (Invocation.EmitArguments): Handle case where
301         arguments == null.
302         (Invocation.EmitCall): Avoid allocating temporary variable if
303         there are no arguments.
304
305 2005-10-07  Raja R Harinath  <rharinath@novell.com>
306
307         Fix #76323.
308         * convert.cs (ImplicitConversionStandard): Move conversion of
309         void* to arbitrary pointer types ...
310         (ExplicitConversionStandard): .. here.
311         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
312         error to always print typenames.
313
314 2005-10-07  Raja R Harinath  <rharinath@novell.com>
315
316         * convert.cs (GetConversionOperator): Rename from
317         GetConversionOperators.  Move operator selection code from ...
318         (UserDefinedConversion): ... here.
319
320 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
321
322         * convert.cs (ExplicitConversionCore): Removed duplicate enum
323         conversion.
324
325 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
326
327         * assign.cs (Assign.DoResolve): Error method changed.
328
329         * cfold.cs (DoConstantNumericPromotions): Error method changed.
330         
331         * const.cs (ResolveValue): Reset in_transit immediately.
332         
333         * constant.cs: Error method changed.
334         
335         * convert.cs: Removed useless location parameter.
336         (ExplicitNumericConversion): Don't do double enum check.
337         (ExplicitConversionCore): Renamed from ExplicitConversion.
338         (ExplicitUnsafe): Extracted from ExplicitConversion.
339         (ExplicitConversion): Uses for error reporting.
340         
341         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
342         error messages.
343         (ResolveBoolean): Uses common error method.
344         (CastToDecimal): Get rid of ec.
345         (CastFromDecimal): Optimized.
346         (ConvCast): Get rid of ec.
347         
348         * enum.cs (ResolveValue): Reset in_transit immediately.
349         (Emit): Return after first error.
350         
351         * expression.cs: Convert changes.
352         
353         * literal.cs: Error method changed.
354         
355         * statement.cs: Error method changed.
356
357 2005-10-03  Raja R Harinath  <rharinath@novell.com>
358
359         * support.cs (SeekableStreamReader.Position): Don't error out when
360         the requested position is just beyond the end of the current
361         buffered data.
362
363 2005-09-28  Raja R Harinath  <rharinath@novell.com>
364
365         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
366         try to keep in sync with the byte count of the underlying Stream.
367         However, this limits us to a window size of 2048 characters: i.e.,
368         the maximum lookahead of our lexer/parser can be 2048 characters.
369
370 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
371
372         Fix #76255.
373         * driver.cs: Fix compilation files with full root path.
374
375 2005-09-25  Miguel de Icaza  <miguel@novell.com>
376
377         * report.cs (SymbolRelatedToPreviousError): Format the output so
378         it does not use an open parenthesis that is never closed. 
379
380         * driver.cs: Follow coding guidelines
381
382 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
383
384         Fix #72930.
385         * const.cs (Const.ResolveValue): Check for assigning non-null
386         value to reference type.
387
388 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
389
390         * anonymous.cs: Implemented ExprClassName.
391         
392         * assign.cs (Assign.DoResolve): Don't chrash when type is not
393         delegate.
394         
395         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
396         check.
397         
398         * class.cs (StaticClass.DefineContainerMembers): Report protected
399         members as error.
400         
401         * codegen.cs: if(ed) PRODUCTION.
402         
403         * convert.cs (Error_CannotImplicitConversion): Better error
404         distinction.
405         
406         * cs-parser.jay: More error checks.
407         
408         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
409         
410         * driver.cs (CSCParseOption): Enabled wrong option check.
411         
412         * ecore.cs (Expression.ExprClassName): Turned to property.
413         (MemberExpr.CheckIntermediateModification): For checking boxed
414         value types     modification.
415         
416         * statement.cs (Fixed.Resolve): Expression type must be
417         convertible to fixed type.
418         (CollectionForeach.GetEnumeratorFilter,TryType):
419         Small refactoring for easier error checking.
420
421 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
422
423         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
424         attributes.
425         
426         * class.cs (GeneratedBaseInitializer): New class for customization
427         compiler generated initializers.
428         (MemberBase.DoDefine): Check Obsolete attribute here.
429         (FieldMember.DoDefine): Ditto.
430         
431         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
432         constants.
433         
434         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
435         (MemberCore.GetObsoleteAttribute): Removed argument.
436         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
437         (MemberCore.CheckObsoleteType): New helper.
438         
439         * delegate.cs,
440         * enum.cs,
441         * statement.cs: Updates after MemberCore changes.
442         
443         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
444         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
445         
446         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
447         obsolete attribute for compiler construct.
448         (As.DoResolve): Cache result.
449         
450         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
451
452 2005-09-26  Raja R Harinath  <rharinath@novell.com>
453
454         Fix #76133.
455         * expression.cs (This.VerifyFixed): In a value type T, the type of
456         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
457         value type R, 'this' is treated as a value parameter.
458
459 2005-09-22  Miguel de Icaza  <miguel@novell.com>
460
461         * statement.cs (Lock): Use the TemporaryVariable class instead of
462         manually using local variables as those do not work when variables
463         are captured.
464
465         * ecore.cs: Moved the TemporaryVariable class from being a nested
466         class inside Foreach to be a public class that can be employed in
467         other places. 
468
469 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
470
471         * cs-parser.jay: interface_accessors replaced by
472         accessor_declarations.
473
474         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
475         location.
476         
477         * statement.cs (GotoCase.Resolve): Convert null constant to
478         null case.
479         (SwitchLabel.ResolveAndReduce): Ditto.
480         (SwitchLabel.NullStringCase): Custom null stamp.
481         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
482         
483         typemanager.cs (CSharpSignature): Don't skip first argument
484         for full names.
485
486 2005-09-18  Miguel de Icaza  <miguel@novell.com>
487
488         * driver.cs: Set InEmacs based on the environment variable EMACS. 
489
490         * location.cs (InEmacs): in this mode, do not report column
491         location as it confuses Emacs.
492
493 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
494
495         * cfold.cs, constant.cs, convert.cs, ecore.cs,
496         expression.cs, iterators.cs, literal.cs: Store constants and
497         literals location.
498         
499         * class.cs (MemberBase.ShortName): Pass location.
500         
501         * cs-parser.jay: Some location fixes.
502         
503         * ecore.cs (Expression.Location): Made virtual.
504
505 2005-09-05  Miguel de Icaza  <miguel@novell.com>
506
507         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
508         if the underlying types are the same, otherwise we need to produce
509         code that will do the proper cast.
510
511         This was exposed by Marek's constant rewrite which produced
512         invalid code for the call site:
513
514         enum X : long { a }
515         void Method (X v) {}
516
517         Method ((X) 5)
518
519         This fixes test-49.cs
520
521 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
522
523         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
524           Type/Object should be allowed as well. Fixed bug #75968.
525
526 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
527
528         * expression.cs : (Binary.DoResolve): when one is enum constant and
529           another is constant 0, then return enum one *as enum type*.
530           Fixed bug 74846.
531
532 2005-09-02  Raja R Harinath  <rharinath@novell.com>
533
534         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
535         internal.
536
537         Fix #75941.
538         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
539         flow-branching for LocalVariableReferences in case we were invoked
540         from a MemberAccess.
541         * expression.cs (LocalVariableReference.VerifyAssigned): New.
542         Carved out of ...
543         (LocalVariableReference.DoResolveBase): ... this.
544         (MemberAccess.Resolve): Do the check that was disabled during
545         SimpleNameResolve.
546
547 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
548
549         * class.cs :
550           (PartialContainer.Create): check abstract/sealed/static strictly
551           but abstract/sealed can exist only at one side. Fixed bug #75883.
552
553 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
554
555         Fix #75945.
556         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
557         specified, don't default to UnmanagedType.I4.
558
559 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
560
561         * expression.cs : conditional operator should check possibly
562           incorrect assign expression. Fixed bug #75946.
563
564 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
565
566         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
567           Reverting the change. gmcs is much complex than mcs on this matter.
568
569 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
570
571         * cs-tokenizer.cs : To read another token ahead of the actual 
572           consumption, use new SavedToken and cache token instead of moving
573           back the stream with SeekableStreamReader (it seemed problematic).
574         * cs-parser.jay,
575           driver.cs : Thus use StreamReader directly.
576         * support.cs : Thus removed SeekableStreamReader.
577
578 2005-08-30  Raja R Harinath  <rharinath@novell.com>
579
580         Fix #75934.
581         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
582         (ScopeInfo.EmitScopeType): Use it to construct field names from
583         names of captured locals.
584
585         Fix #75929.
586         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
587         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
588         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
589         (ExplicitConversion): Remove enum cases already handled by
590         implicit conversion.  Move implicit conversion check to the beginning.
591         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
592         * expression.cs (ArrayCreation.EmitDynamicInitializers):
593         Don't treat System.Enum as a struct.
594
595 2005-08-30  Jb Evain  <jbevain@gmail.com>
596
597         * attribute.cs: handles as expression in parameters.
598
599 2005-08-30  Raja R Harinath  <rharinath@novell.com>
600
601         Fix #75802.
602         * class.cs (TypeContainer.VerifyClsName): Don't use a
603         PartialContainer when verifying CLS compliance.
604         (AbstractPropertyEventMethod): Set Parent here, ...
605         (PropertyMethod): ... not here.
606
607 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
608
609         * attribute.cs : escaped attribute name should not be allowed to be
610           resolved (e.g. @class as classAttribute). Fixed bug #75930.
611
612 2005-08-29  Raja R Harinath  <rharinath@novell.com>
613
614         Fix #75927.
615         * convert.cs (ImplicitStandardConversionExists): Allow zero also
616         when converting a long constant to unsigned long.
617         * expression.cs (Invocation.OverloadResolve): Add sanity check to
618         detect where IsApplicable and VerifyArgumentsCompat disagree.
619
620 2005-08-29  Raja R Harinath  <rharinath@novell.com>
621         and Carlos Alberto Cortez  <carlos@unixmexico.org>
622
623         Fix #75848.
624         * class.cs (TypeContainer.CanElideInitializer): New helper.
625         (TypeContainer.EmitFieldInitializers): Use it to determine if we
626         can safely emitting the initializer of a field.
627
628 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
629
630         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
631           allowed inside a switch (without loop). Fixed bug #75433.
632
633 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
634
635         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
636         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
637
638 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
639
640         * driver.cs : kinda reverting the default encoding changes (not exact 
641           revert since I noticed that "codepage:reset" might not work fine).
642
643 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
644
645         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
646           Location. Now getter and setter store location correctly.
647           (errors/cs0111-12.cs now reports the expected location.)
648
649 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
650
651         * driver.cs : Use default encoding on the environment.
652           Removed (now that) extra parameter for SeekableStreamReader.
653         * support.cs : (SeekableStreamReader) third .ctor() argument for
654           StreamReader is not required (always true). preamble size could
655           be acquired in simpler and safe way.
656
657 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
658
659         * cs-parser.jay: report CS0642 at warning level 3
660           and report CS0642 for an if else statement also
661           fixes bug #74745. Patch by John Luke (and a bit
662           modified by me).
663           Removed extra CS0642 warning check for "while",
664           "for" and "fixed".
665         * statement.cs: In Block.Resolve(), CS0642 check
666           is reimplemented to check a sequence of an empty
667           statement and a block.
668
669           Both fix bug #66777.
670
671 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
672
673         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
674         detection until I fix it.
675         
676         * cs-tokenizer.cs: Changed error message.
677         
678         * cs-parser.jay: Fixed 2 error locations.
679         
680         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
681         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
682         properties.
683         
684         * enum.cs (GetSignatureForError): Fixed.
685         
686         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
687         method detection.
688         
689         * class.cs,
690         * typemanager.cs (RegisterProperty): Removed.
691         
692         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
693
694 2005-08-24  Raja R Harinath  <rharinath@novell.com>
695
696         Fix #75874.
697         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
698         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
699
700 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
701
702         * expression.cs : tiny fix is required for not warning positive ulong.
703           See test-441.cs.
704
705 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
706
707         * expression.cs : add CS0652 check for constant and integral
708           expression. Fixed bug #53974.
709
710 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
711
712         * expression.cs : in DoNumericPromotions(), check if there is implicit
713           conversion overload for string (to check CS0034). Fixed bug #52492.
714
715 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
716
717         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
718
719 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
720
721         * ecore.cs : report location when it is *not* Null.
722
723 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
724
725         * codegen.cs,
726           ecore.cs,
727           flowanalysis.cs,
728           expression.cs:
729           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
730           correctly. Fixed bug #75721.
731
732 2005-08-23  Raja R Harinath  <rharinath@novell.com>
733
734         * support.cs (SeekableStreamReader.Position): Avoid an expensive
735         loop that performs 'min (pos, char_count)'.
736
737         Fix #75862.
738         * expression.cs (Unary.ResolveOperator): Don't discard implicit
739         converted value in Operator.OnesComplement.
740
741 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
742
743         * anonymous.cs: If the anon method is pulled into a helper class,
744         it needs to be `internal' not `private'. Fixes runtime behavior on
745         msft. bug #75704
746
747 2005-08-20  Martin Baulig  <martin@ximian.com>
748
749         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
750         scope if we don't already have it.
751
752         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
753         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
754         fixes #75867.
755
756 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
757
758         Fix #75803
759         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
760         is a partial class.
761
762 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
763
764         The big constants rewrite
765         Fix #75746, #75685 and more
766         As a side effect saved 1MB for MWF ;-)
767         
768         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
769         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
770         enum based for corlib compilation.
771         
772         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
773         subtractions.
774         
775         * class.cs (FixedField.Define): Use ResolveAsConstant.
776         
777         * const.cs (IConstant): Interface constants and enums.
778         (Const.ResolveValue): New method for constant resolvning.
779         (ExternalConstant): Constants from imported assemblies.
780         
781         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
782         conversion; like enums.
783         (Constant.ToType): Converts this constant to different type.
784         (Constant.Increment): Adds 1.
785         
786         * convert.cs (ImplicitConversionRequired): Simplified.
787         
788         * cs-parser.jay: Create EnumMember directly.
789         
790         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
791         
792         * doc.cs (GenerateEnumDocComment): Removed.
793         
794         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
795         (ConvertIntLiteral): Removed.
796         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
797         
798         * enum.cs (EnumMember): Implement IConstant.
799         (Enum.IsValidEnumConstant): Removed.
800         (Enum.GetNextDefaultValue): Removed.
801         (Enum.FindMembers): Updated.
802         (Enum.GenerateDocComment): Iterate enum members.
803         
804         * expression.cs (Cast.TryReduce): Handle enums correctly.
805         (New.Constantify): Made public.
806         (MemberAccess.DoResolve): Removed contant specific if(s).
807         
808         * literal.cs (NullLiteral): Implement new abstract methods.
809         
810         * statement.cs (GotoCase.Resolve): Use new constant methods.
811         (SwitchLabel.ResolveAndReduce): Use new constant methods.
812         
813         * typemanager.cs (LookupEnum): Removed.
814         (IsEnumType): Fixed to work with corlib.
815         (RegisterConstant): Removed.
816         (LookupConstant): Removed.
817         (GetConstant): Changed to work with IConstant.
818
819 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
820
821         * location.cs : Fixed overflown (>255) column number.
822
823 2005-08-03  Raja R Harinath  <rharinath@novell.com>
824
825         First cut of the qualified-alias-member feature.
826         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
827         token.
828         * cs-parser.jay (DOUBLE_COLON): New token.
829         (namespace_or_type_name): Add rule for recognizing
830         qualified-alias-members.
831         (primary_expression): Likewise.
832         (element_access): Allow QualifiedAliasMember as a possible
833         type-bearing expression.
834         (local_variable_type, local_variable_pointer_type): Likewise.
835         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
836         aliases in the current and enclosing namespace declarations.
837         (NamespaceEntry.UsingAlias): Add CS0440 warning.
838         * decl.cs (MemberName.is_double_colon): New.
839         (MemberName.MemberName): Add new constructor for alias-member.
840         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
841         * expression.cs (QualifiedAliasMember): New expression type.
842
843 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
844
845         * location.cs : it borked when no argument was specified.
846
847 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
848
849         * location.cs : tiny ToString() format fix.
850
851 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
852
853         * statement.cs : oops, it was missing.
854
855 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
856
857         A set of fixes for precise line/column location.
858
859         * location.cs :
860           "token" field now holds a file/line "delta", a line number offset 
861           from the segment, and a column number. See also:
862           http://lists.ximian.com/pipermail/mono-devel-list/2004-
863           December/009508.html
864           Removed static IsNull. Use instance IsNull property instead.
865         * cs-tokenizer.cs :
866           For some tokens it stores Location. For Identifier it stores
867           LocatedToken which is a pair of string name and location.
868           Column numbers are adjusted only at getChar().
869         * report.cs :
870           Use Location.ToString() for reporting (it now contains column).
871         * cs-parser.jay :
872           Largely modified to use LocatedToken instead of
873           string (IDENTIFIER), and to acquire Location from some tokens.
874         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
875           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
876           codegen.cs :
877           Now MemberName holds Location. DeclSpace.ctor() receives Location
878           as a parameter. Removed extra parameters to all derived classes.
879           Replaced Location.IsNull() with instance property.
880         * assign.cs, expression.cs :
881           Added .ctor() overload that omits Location.
882         * attribute.cs :
883           Added "nameEscaped" flag that indicates the identifier was escaped
884           in the source file. This fixes bug #57047.
885
886 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
887
888         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
889         New method, looking for lo-case imported cls type.
890
891         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
892         here.
893
894         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
895
896         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
897
898         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
899         all_imported_types.
900         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
901
902         Optimized to save 3.5 MB for SWF compilation.
903
904 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
905
906         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
907         (PartialContainer.Create): Moved logic AddToContainer.
908         (PartialContainer.MarkForDuplicationCheck): Shares name.
909         
910         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
911         place.
912         
913         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
914         initialization.
915         (Namespace.GetSignatureForError): New method.
916         
917         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
918         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
919
920 2005-08-01  Raja R Harinath  <rharinath@novell.com>
921
922         Fix #75669.
923         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
924         member lookup rather than qualifier_type, since qualifier_type can
925         be null.
926
927 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
928
929         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
930         enum member.
931
932 2005-07-31  Miguel de Icaza  <miguel@novell.com>
933
934         * statement.cs: Copy the local exception into the exception
935         captured local.  Fixes 75674
936
937 2005-07-31  Raja R Harinath  <harinath@gmail.com>
938
939         Fix #75658.
940         * expression.cs (Invocation.OverloadResolve): Don't report error
941         CS1501 if error CS1502 has been reported.
942         (New.DoResolve): Delegate CS1501 reporting to
943         Invocation.OverloadResolve.
944
945         Fix #75656.
946         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
947         invariant-meaning-in-block property in an enclosing block if
948         necessary.
949
950 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
951
952         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
953         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
954         (Switch.CheckSwitch): Just save 50kb for SWF.
955
956 2005-07-27  Martin Baulig  <martin@ximian.com>
957
958         * anonymous.cs (CaptureContext.AddField): Added
959         `AnonymousContainer am' argument; compute its toplevel scope if
960         it's not already computed.  Fixes #75649.
961
962 2005-07-26  Raja R Harinath  <rharinath@novell.com>
963
964         Fix #75628.
965         * class.cs (Constructor.Emit): Reset block to null if the block
966         resolve fails.
967
968 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
969
970         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
971
972 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
973
974         * class.cs (MethodData.Define): Check whether accessor implementing
975         interface is public.
976
977         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
978
979 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
980
981         Fix #57245
982         * namespace.cs (LookupType): Moved same type check to...
983         
984         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
985         with the same name.
986
987 2005-07-21  Raja R Harinath  <rharinath@novell.com>
988
989         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
990         already found a typebuilder.
991         * class.cs (MethodCore.IsDuplicateImplementation): Compare
992         MemberNames, not strings.
993
994         * const.cs (Error_ExpressionMustBeConst): 
995         Rename from Error_EpressionMustBeConst.
996         * const.cs, class.cs, statement.cd: Update.
997
998 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
999
1000         Fix #65573
1001
1002         * const.cs (Const.LookupConstantValue): Report missing contant expression
1003         everytime.
1004         (Error_EpressionMustBeConstant): Only one error method.
1005
1006         * class.cs, statement.c: Updated.
1007
1008 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1009
1010         * statement.cs (Block.Flags): Add back HasVarargs.
1011         (Block.flags): Make protected.
1012         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1013
1014         * typemanager.cs (types, typecontainers, user_types): Remove.
1015         (UserTypes, TypeContainers): Likewise.
1016         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1017         (CleanUp, Reset): Update.
1018         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1019         (GetNestedType): Use Type.GetNestedType.
1020         (CoreLookupType): Take two arguments, the namespace and the
1021         basename of the type.  Update to use the Namespace.Lookup
1022         mechanism.
1023         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1024         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1025         string concatenation and substring matches.
1026         * class.cs, enum.cs, delegate.cs: Update to changes.
1027
1028 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1029
1030         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1031         Expression and made virtual.
1032
1033         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1034         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1035
1036         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1037
1038         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1039         error message.
1040
1041         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1042         change.
1043
1044 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1045
1046         Fix #57707
1047         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1048         AssemblyCultureAttribute is not used on executable.
1049
1050         * rootcontext.cs,
1051         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1052
1053 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1054
1055         Fix #60638.
1056         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1057         New.  Reports CS0252/CS0253.
1058         Mostly taken from preliminary patch by Duncak Mak.
1059         (Binary.DoResolveOperator): Store results of operator lookup.
1060         Use them to detect if we need to warn about unintended reference
1061         comparisons.
1062
1063 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1064
1065         Fix #72969.
1066         * namespace.cs (Namespace.Lookup): Add back location parameter.
1067         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1068         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1069
1070         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1071         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1072         (Namespace.LookupType): ... this.
1073         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1074         of namespaces.
1075         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1076         purported to handle pointers.
1077         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1078         CoreLookupType.
1079
1080 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1081
1082         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1083         type as namespace.
1084
1085 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1086
1087         * namespace.cs (Namespace.Lookup): Drop location parameter.
1088         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1089         (NamespaceEntry.Lookup): ... this.
1090         (NamespaceEntry.Error_AmbiguousTypeReference):
1091         Move here from DeclSpace.
1092         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1093         names ...
1094         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1095         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1096         Move to NamespaceEntry.
1097         * delegate.cs, expression.cs: Update to changes.
1098
1099 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1100
1101         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1102         CheckAttributeType and refactored.
1103         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1104         ResolveAsTypeTerminal error handling.
1105         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1106         handling.
1107         (GetSignatureForError): Print errors in same way.
1108
1109         * class.cs,
1110         * codegen.cs: Reflect attribute GetSignatureForError change.
1111
1112         * ecore.cs,
1113         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1114
1115         * namespace.cs (UsingEntry): Refactored to make fields private.
1116
1117         * assign.cs,
1118         statement.cs: Error_UnexpectedKind has extra parameter.
1119
1120 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1121
1122         * ecore.cs (IAlias): Remove.
1123         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1124         that implement the interface.
1125         * namespace.cs (Namespace): Likewise.
1126         (Namespace.declspaces): Renamed from 'defined_names'.
1127         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1128         DeclSpace instead of an IAlias.
1129         * tree.cs (Tree.AddDecl): Update.
1130
1131 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1132
1133         * statement.cs (Block.Flags); Remove HasVarargs.
1134         (Block.HasVarargs): Move to ToplevelBlock.
1135         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1136         (Block.Variables): Make protected.  Initialize variable hashtable
1137         if necessary.
1138         (Block.AddVariable): Update.
1139         (Block.Resolve): Update to changes.
1140         (ToplevelBlock.HasVarargs): New boolean.
1141         (ToplevelBlock.ThisVariable): Move here from Block.
1142         (ToplevelBlock.AddThisVariable): Likewise.
1143         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1144         * expression.cs (This.ResolveBase): Update to changes.
1145         (ArglistAccess.DoResolve): Likewise.
1146
1147 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1148
1149         Fix #75321
1150         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1151
1152         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1153         not used and not used & assigned.
1154         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1155
1156 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1157
1158         Fix #75053
1159         * expression.cs (Is.DoResolve): null is never provided type.
1160
1161 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1162
1163         Fix #52496
1164         * cs-parser.jay: Less strict event error rule to catch more errors.
1165
1166 2005-07-08  Martin Baulig  <martin@ximian.com>
1167
1168         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1169         gettter (allowed) or setter (not allowed).
1170
1171         * class.cs (Accessor): Implement IIteratorContainer.
1172         (Accessor.Yields): New public field.
1173         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1174         per-accessor basis.
1175
1176         * cs-parser.jay
1177         (get_accessor_declaration, set_accessor_declaration): Set the
1178         `yields' flag on the accessor, not the property.
1179         (property_declaration): Do the iterators check on a per-accessor
1180         basis and not for the whole property.
1181
1182 2005-07-08  Martin Baulig  <martin@ximian.com>
1183
1184         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1185         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1186
1187 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1188
1189         Fix #74975
1190         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1191         (ExtractSecurityPermissionSet): Cope with self referencing security
1192         attributes properly.
1193
1194         * driver.cs (SetOutputFile): Made public property OutputFile.
1195
1196 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1197
1198         Fix #75486.
1199         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1200         has_nonstatic_fields.  Make into a FieldBase pointer.
1201         (TypeContainer.AddField): Add CS0282 check.
1202         (TypeContainer.EmitType): Update.
1203
1204 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1205
1206         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1207         compare if they start with __.
1208
1209 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1210
1211         * statement.cs (Switch.SwitchGoverningType): Only look at
1212         UserCasts that don't need implicit standard conversions to one of
1213         the allowed switch types (Fixes test-322.cs).
1214         (LocalInfo.Resolve): Re-enable sanity-test.
1215
1216 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1217
1218         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1219         
1220         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1221         
1222         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1223
1224 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1225
1226         Fix #75472.
1227         * ecore.cs (SimpleName.GetSignatureForError): Add.
1228         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1229         (MemberAccess.GetSignatureForError): Add.
1230
1231 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1232  
1233         The big error and warning messages review.
1234         
1235         * anonymous.cs,
1236         * assign.cs,
1237         * attribute.cs,
1238         * class.cs,
1239         * codegen.cs,
1240         * convert.cs,
1241         * cs-parser.jay,
1242         * cs-tokenizer.cs,
1243         * decl.cs,
1244         * delegate.cs,
1245         * doc.cs,
1246         * driver.cs,
1247         * ecore.cs,
1248         * enum.cs,
1249         * expression.cs,
1250         * flowanalysis.cs,
1251         * iterators.cs,
1252         * literal.cs,
1253         * location.cs,
1254         * modifiers.cs,
1255         * namespace.cs,
1256         * parameter.cs,
1257         * pending.cs,
1258         * report.cs,
1259         * rootcontext.cs,
1260         * statement.cs,
1261         * support.cs,
1262         * tree.cs,
1263         * typemanager.cs: Updated.
1264         
1265         * class.cs: (MethodCore.SetYields): Moved here to share.
1266         (PropertyMethod.Define): Moved iterator setup here.
1267         
1268         * iterators.cs: Add orig_method to have full access to parent
1269         container.
1270
1271 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1272
1273         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1274         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1275         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1276         variable of struct type.
1277         * expression.cs (Unary.ResolveOperator): Update to change.
1278         (Indirection.VerifyFixed): Likewise.
1279         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1280         (ParameterReference.VerifyFixed): Value parameters are fixed.
1281         (This.VerifyFixed): Treat 'this' as a value parameter.
1282         * statement.cs (LocalInfo.IsFixed): Remove.
1283
1284 2005-07-01  Martin Baulig  <martin@ximian.com>
1285
1286         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1287         `ec.EmitThis ()' to get the correct scope.
1288
1289 2005-07-01  Martin Baulig  <martin@ximian.com>
1290
1291         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1292         instance is a ParameterReference; fixes #75299.
1293
1294 2005-07-01  Martin Baulig  <martin@ximian.com>
1295
1296         Reverted Marek's latest patch (r46725):
1297         - it contains structural changes which are neither mentioned in
1298           the ChangeLog nor explained anywhere; for example the additional
1299           argument of EmitContext's and Iterator's .ctor's and the
1300           TypeContainer.DefineMembers() change.
1301         - structural changes like this should go in in seperate patches
1302           and not be hidden in a huge patch which just seems to affect
1303           warnings and errors.
1304           a big and hard to understand patch.
1305         - it breaks iterators and causes regressions, for instance in
1306           test-iter-03.cs.      
1307
1308 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1309
1310         Fix #75412.
1311         * expression.cs (Indexers.map): Remove.
1312         (Indexers.Append): Filter out inaccessible setters and getters.
1313         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1314
1315         Fix #75283.
1316         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1317         Refactored from ...
1318         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1319         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1320         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1321         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1322
1323 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1324
1325         Fix #75322
1326         * class.cs (FieldBase.GetInitializerExpression): One more field
1327         for backup.
1328
1329 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1330
1331         * pending.cs: Do not define a proxy if the base method is virtual,
1332         it will be picked up by the runtime (bug 75270).
1333
1334 2005-06-08  Martin Baulig  <martin@ximian.com>
1335
1336         The big Iterators rewrite :-)
1337
1338         * iterators.cs: Rewrite this to use the anonymous methods framework.
1339
1340         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1341         before the TypeContainers; see 2test-21.cs.
1342
1343         * class.cs
1344         (TypeContainer.DefineType): Don't create a new EmitContext if we
1345         already have one (this only happens if we're an Iterator).
1346         (TypeContainer.Define): Also call Define() on all our iterators.
1347         (Method.CreateEmitContext): Added support for iterators.
1348
1349         * anonymous.cs
1350         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1351         (AnonymousContainer.CreateMethodHost): Moved here from
1352         AnonymousMethod and made abstract.
1353         (AnonymousContainer.CreateScopeType): New abstract method.
1354         (AnonymousContainer.IsIterator): New public property.
1355         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1356         get the ScopeTypeBuilder rather than manually defining it here. 
1357         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1358         iterators here.
1359
1360         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1361         before RootContext.DefineTypes().
1362
1363         * codegen.cs (EmitContext.RemapToProxy): Removed.
1364         (EmitContext.CurrentAnonymousMethod): Changed type from
1365         AnonymousMethod -> AnonymousContainer.
1366         (EmitContext.ResolveTopBlock): Protect from being called twice.
1367         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1368         (EmitContext.EmitThis): Removed the iterators hacks; use the
1369         anonymous methods framework for that.
1370
1371         * statement.cs
1372         (ToplevelBlock.Container): Make this a property, not a field.
1373         (ToplevelBlock.ReParent): New public method; move the
1374         ToplevelBlock into a new container.
1375         (Foreach.TemporaryVariable): Simplify.
1376
1377 2005-06-05  Martin Baulig  <martin@ximian.com>
1378
1379         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1380         (Block.AddTemporaryVariable): New public method; creates a new
1381         `LocalInfo' for a temporary variable.
1382         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1383         variables here.
1384         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1385         non-iterator variables.
1386
1387 2005-06-05  Martin Baulig  <martin@ximian.com>
1388
1389         * statement.cs (Foreach.TemporaryVariable): Create the
1390         LocalBuilder in the Emit phase and not in Resolve since in some
1391         situations, we don't have an ILGenerator during Resolve; see
1392         2test-19.cs for an example.
1393
1394 2005-06-04  Martin Baulig  <martin@ximian.com>
1395
1396         **** Merged r45395 from GCS ****
1397
1398         The big Foreach rewrite - Part II.
1399
1400         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1401         with `PropertyInfo ienumerator_getcurrent'.
1402
1403         * codegen.cs (VariableStorage): Removed.
1404
1405         * statement.cs
1406         (Foreach): Derive from Statement, not ExceptionStatement.
1407         (Foreach.CollectionForeach): New nested class.  Moved all the code
1408         dealing with collection foreach here.
1409         (Foreach.ForeachHelperMethods): Removed.
1410         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1411
1412 2005-05-23  Martin Baulig  <martin@ximian.com>
1413
1414         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1415         don't need to.  Fix #75014.
1416
1417 2005-05-20  Martin Baulig  <martin@ximian.com>
1418
1419         Merged r44808 from GMCS.
1420
1421         * class.cs (TypeContainer.CircularDepException): Removed.
1422         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1423         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1424         (CS0146) and interface (CS0529) dependencies here.
1425
1426 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1427
1428         * expression.cs (Invocation.EmitCall): Fix initialization
1429         'this_call' to reflect current behaviour.  Fix indentation.
1430
1431         * convert.cs (FindMostEncompassedType): Add two trivial special
1432         cases (number_of_types == 0 || number_of_types == 1).
1433         (FindMostEncompasingType): Likewise.
1434
1435 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1436
1437         Some cleanups preparing for the fix of #75283.
1438         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1439         error testing.
1440         (EventExpr.InstanceResolve): Likewise.
1441         (EventExpr.DoResolve): Remove redundant checks.
1442
1443 2005-06-10  Duncan Mak  <duncan@novell.com>
1444
1445         * cs-tokenizer.cs (process_directives): New flag for controlling
1446         the processing of preprocessor directives.
1447         (x_token): After seeing a '#', return Token.NONE instead of going
1448         to handle_preprocessing_directive() when not processing
1449         directives. This avoids unnecessary processing during the token peek in
1450         is_punct().
1451
1452         This fixes #74939.
1453
1454         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1455         the existing error reporting methods instead of Report.Error.
1456
1457         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1458         after Raja's rewrite.
1459
1460 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1461
1462         * class.cs: Small fix.
1463
1464 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1465
1466         Fix #75160.
1467         * class.cs (GetPartialBases): Fix return value check of
1468         part.GetClassBases.
1469
1470 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1471
1472         Ensure that partial classes are registered in their enclosing
1473         namespace.  Initial part of fix of #75160.
1474         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1475         Register declspace with namespace here, not in
1476         DeclSpace.RecordDecl.
1477         * cs-parser.jay: Pass namespace to RecordDecl.
1478         * class.cs (PartialContainer.Create): Likewise.
1479         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1480         called.
1481         * decl.cs (Declspace.RecordDecl): Remove.
1482         * namespace.cs (NamespaceEntry.DefineName): Remove.
1483
1484 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1485
1486         * rootcontext.cs: Reset TargetExt as well.
1487
1488 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1489
1490         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1491         -langversion:ISO-1.
1492
1493 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1494
1495         Fix #75080, cs0119.cs.
1496         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1497         of ...
1498         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1499         allowing ExprClass.Type and ExprClass.Namespace for
1500         ResolveFlags.VariableOrValue.
1501         (Expression.Resolve) [1-argument variant]: Change default resolve
1502         flags based on language version.
1503         (Expression.Error_UnexpectedKind): Use a simple string array
1504         rather than an ArrayList.
1505         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1506         not ExprClass.Type.
1507         (TypeOfVoid.DoResolve): Likewise.
1508         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1509         flags argument -- it always has the same value.
1510
1511 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1512
1513         Fix #75081.
1514         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1515         Use it in the error message.
1516         * assign.cs, expression.cs, statement.cs: Update.
1517
1518 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1519
1520         Fix #75088.
1521         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1522         the "almostMatchedMember" case too.
1523         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1524         that failed the accessibility checks to 'almost_match'.
1525
1526 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1527
1528         * attribute.cs: Use internal MethodBuilder methods to set
1529         ExactSpelling and SetLastError on PInvoke methods, instead
1530         of passing them via charset.  Fixes #75060.
1531
1532 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1533
1534         * parameter.cs (Parameter): Remove TODO comment.
1535         (Parameter.DefineParameter): Remove Location parameter.
1536         (Parameters.LabelParameters): Likewise.
1537         * class.cs (Constructor.Emit): Update to change.
1538         (MethodData.Emit): Likewise.
1539         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1540         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1541
1542 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1543
1544         * parameter.cs,
1545           Removed Parameters.Location and added Parameter.Location instead.
1546           Removed Location parameter from Emit() and GetSignature().
1547         * anonymous.cs,
1548           class.cs,
1549           cs-parser.jay,
1550           delegate.cs,
1551           iterators.cs,
1552           statement.cs :
1553           Modified all related calls.
1554
1555 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1556
1557         Improve user-defined conversion handling.
1558         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1559         applicable operators.
1560         (AddConversionOperators): New.  Helper for GetConversionOperators.
1561         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1562         there is only one most encompassed/encompassing type.
1563         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1564         "applicable operator" handling.
1565         (UserConversion): Move cache here from GetConversionOperators.
1566         Directly cache the chosen operator, rather than the whole
1567         MethodGroup.
1568         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1569         case.  Allow conversion of decimal to sbyte and byte too.
1570         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1571         New static methods.  Used to avoid allocating EmptyExpressions in
1572         convert.cs.
1573
1574 2005-05-24  Duncan Mak  <duncan@novell.com>
1575
1576         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1577         another class, used in Convert.ExplicitNumericConversion.
1578         (CastToDecimal): New class, similar to above, but casts to
1579         System.Decimal, used in Convert.ImplicitNumericConversion and also
1580         in explicit convesion from double/float to decimal.
1581
1582         * convert.cs (ImplicitNumericConversion): Handle implicit
1583         conversions to System.Decimal.
1584         (ExplicitNumericConversion): handle explicit conversions to
1585         System.Decimal.
1586
1587         This fixes #68711.
1588         
1589 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1590
1591         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1592         know the type at this stage, just break through.   Fixes #75008 
1593
1594 2005-05-19  Martin Baulig  <martin@ximian.com>
1595
1596         * delegate.cs
1597         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1598         to disable error reporting.
1599
1600         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1601         here since we don't want to report an error; see the new test-336.cs.
1602
1603 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1604
1605         * statement.cs (ToplevelBlock.GetParameterReference)
1606         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1607         Move here from class Block.
1608         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1609         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1610
1611 2005-05-18  Martin Baulig  <martin@ximian.com>
1612
1613         Fix #74978.
1614
1615         * flowanalysis.cs
1616         (FlowBranching.Reachability): Add non-static public And() and Or()
1617         methods.
1618         (FlowBranchingSwitch): New class; do the `break_origins' thing
1619         like in FlowBranchingLoop.
1620         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1621         reachability, not just locals and parameters.
1622         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1623         switch; MergeBreakOrigins() now takes care of that.
1624
1625 2005-05-18  Martin Baulig  <martin@ximian.com>
1626
1627         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1628         a loop and may leave it, reset the barrier; fixes #74974.
1629
1630 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1631         
1632         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1633         is back.
1634         
1635         * cs-parser.jay: Catch more lexical errors.
1636         
1637         * report.cs: Add one more Error method.
1638         
1639         * rootcontext.cs,
1640         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1641
1642 2005-05-17  Martin Baulig  <martin@ximian.com>
1643
1644         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1645         #70970. 
1646
1647 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1648
1649         Fix test-382.cs.  Emit values of decimal constants.
1650         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1651         Carved out of ...
1652         (TypeContainer.AddField): ... this.
1653         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1654         with initializers to include 'Const's.
1655         (ClassPart.RegisterFieldForInitialization): Forward to
1656         PartialContainer.
1657         * const.cs (Const.Const): Pass initializer to base class.
1658         (Const.Define): In case of decimal constants, register them for
1659         initialization in a static constructor.
1660
1661 2005-05-14  Martin Baulig  <martin@ximian.com>
1662
1663         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1664         do not call ResolveUnreachable() on unreachable statements in
1665         here, see the comment in the source code.
1666
1667 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1668
1669         Fix #74934.
1670         * expression.cs (BinaryResolveOperator): If one of the operands of
1671         an equality comparison is 'null' and the other is a pointer type,
1672         convert the null to a NullPointer.
1673         * convert.cs (ImplicitReferenceConversion): If the expression is a
1674         NullLiteral and the target type is a pointer type, return a
1675         NullPointer instead.
1676         (ImplicitConversionStandard): Likewise.
1677
1678 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1679         
1680         * cs-parser.jay: Set readonly context based on special constructs.
1681         
1682         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1683         readonly variable error handling.
1684         
1685         * rootcontext.cs (EmitCode): Don't verify members when error
1686         occurred.
1687         
1688         * statement.cs (LocalInfo): Add reaodnly context information.
1689         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1690
1691 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1692
1693         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1694         for #74041 to initialize 'resolved' to false only for explicit
1695         blocks.  Fixes #74873.
1696
1697 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1698
1699         Fix #74920.
1700         * typemanager.cs (unmanaged_enclosing_types): New.
1701         (IsUnmanagedType): Avoid infloops by using
1702         'unmanaged_enclosing_types' to talk with recursive invocations.
1703
1704 2005-05-13  Martin Baulig  <martin@ximian.com>
1705
1706         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1707         instance variable, not a local.  Fix #74873.
1708         (Block.ResolveUnreachable): Set it to true here.
1709
1710 2005-05-11  Duncan Mak  <duncan@novell.com>
1711
1712         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1713         continuing to process for 'arg'.
1714         (handle_preprocessing_directive): Check the argument of the #endif
1715         directive and report error CS1025 if there are any trailing
1716         characters.
1717
1718         According to the C# spec, having even whitespace after the #endif
1719         directive is illegal; however, because we call arg.TrimEnd ()
1720         beforehand, we have the same behavior as csc, allowing whitespace
1721         after the directive.
1722
1723         Fixes #74892.
1724
1725 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1726
1727         Fix #74863.
1728         
1729         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1730         (Constructor.GetObsoleteAttribute): Implemented correctly.
1731
1732 2005-05-10  Martin Baulig  <martin@ximian.com>
1733
1734         * support.cs (ReflectionParameters.ParameterModifier): Use
1735         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1736         and `ParameterAttributes.In'.  Fixes #74884.
1737
1738 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1739
1740         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1741         
1742         * expression.cs (Argument.GetParameterModifier): Turned to property.
1743         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1744         
1745         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1746         its C# equivalent.
1747         
1748 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1749
1750         Fix #74852.
1751         * decl.cs (MemberCache.AddMethods): Register override methods,
1752         rather than non-override methods.
1753         * typemanager.cs (RegisterOverride): New.
1754         (IsOverride): Update.
1755
1756 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1757
1758         Fix #73105.
1759         
1760         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1761         recursive declaration.
1762         
1763         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1764         
1765 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1766
1767         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1768         
1769         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1770
1771 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1772
1773         Fix #74797.
1774         * decl.cs (DeclSpace.FamilyAccessible): 
1775         Use TypeManager.IsNestedFamilyAccessible.
1776
1777         Fix reopened #64812.
1778         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1779         internal'.
1780
1781 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1782             Abin Thomas  <projectmonokochi@rediffmail.com>
1783             Anoob V E  <projectmonokochi@rediffmail.com>
1784             Harilal P R  <projectmonokochi@rediffmail.com>
1785
1786         Fix #64812.
1787         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1788         allow access to all static members.
1789
1790 2005-05-04  Martin Baulig  <martin@ximian.com>
1791
1792         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1793
1794 2005-05-04  Martin Baulig  <martin@ximian.com>
1795
1796         Fix #74655.
1797
1798         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1799         section at the end; make things work if `default' is not the last
1800         section.        
1801
1802 2005-05-04  Martin Baulig  <martin@ximian.com>
1803
1804         Fix #70400.
1805
1806         * statement.cs (Switch): Replaced the `got_default' field with a
1807         `default_section' one.
1808         (Switch.CheckSwitch): Set `default_section' here.
1809         (Switch.Resolve): If we're a constant switch and the constant is
1810         not found, use the default section.
1811
1812 2005-05-03  Martin Baulig  <martin@ximian.com>
1813
1814         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1815
1816         * statement.cs (Foreach.ArrayForeach): New nested class.
1817         (Foreach.TemporaryVariable): New nested class.
1818         (Foreach.EmitArrayForeach): Removed; this is now in the new
1819         ArrayForeach class.
1820
1821 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1822
1823         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1824         more conservative.
1825         (VerifyPendingMethods): Revert change below.
1826
1827         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1828         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1829         that used to trigger warning -28.  Remove warning -28.
1830         * expression.cs (Invocation.OverloadResolve): Use
1831         TypeManager.IsOverride to distinguish override methods.
1832
1833         Fix #74773.
1834         * pending.cs (VerifyPendingMethods): If a base type implements the
1835         requested interface, don't bother checking individual methods of
1836         the base type.  As a side-effect, this prevents the creation of
1837         unnecessary proxies.
1838
1839 2005-05-02  Martin Baulig  <martin@ximian.com>
1840
1841         Fix #70182.
1842
1843         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1844         Also `And' the locals if the old vector is null.
1845         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1846         null; in this case we basically reset all the variables.        
1847
1848 2005-05-02  Martin Baulig  <martin@ximian.com>
1849
1850         Fix #74529.
1851
1852         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1853         Added `FlowBranching branching' argument; always `and' the
1854         variables instead of `or'ing them unless we're an infinite loop.
1855
1856         * statement.cs (While.Resolve): Create a new sibling unless we're
1857         infinite.       
1858
1859 2005-05-02  Martin Baulig  <martin@ximian.com>
1860
1861         Fix #70140.
1862
1863         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1864         arguments; use it instead of creating a new TopLevelBlock.
1865         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1866         our ConstructorInitializer.
1867
1868         * statement.cs
1869         (TopLevelBlock.TopLevelBranching): New public property.
1870         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1871         and create our `TopLevelBranching'.
1872
1873         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1874         anonymous method host, use `block.TopLevelBranching' rather than
1875         creating a new branching.
1876
1877 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1878
1879         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1880         a ScopeInfo, if any of the current children is a child of the new
1881         entry, move those children there.
1882
1883 2005-04-30  Martin Baulig  <martin@ximian.com>
1884
1885         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1886         at the beginning of a SwitchSection.  Fix #73335.
1887
1888 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1889
1890         Fix #74378
1891         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1892         
1893         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1894         (FieldExpr.DoResolve): Obsolete members are ignored for field
1895         initializers.
1896         
1897 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1898
1899         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1900         of arrays detection.
1901
1902         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1903         verification.
1904         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1905
1906         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1907         arrays report.
1908
1909 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1910
1911         * cs-parser.jay: Use the prefered version of -unsafe in error
1912         message.
1913
1914 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1915
1916         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1917         circumstances.
1918
1919 2005-04-20  John Luke  <john.luke@gmail.com>
1920
1921         * driver.cs: fix typo in error message, --outout to --output
1922
1923 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1924
1925         * codegen.cs (InRefOutArgumentResolving): New field.
1926         
1927         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1928         fields outside contructor.
1929         
1930         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1931         
1932 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1933
1934         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1935         parameter code was not completed ever, so it was not as up-to-date
1936         as local variables.  Must finish it.
1937
1938         The bug fix was to compare the Toplevel of the block, not the
1939         current block.  Thanks for Ben for pointing this out. 
1940
1941 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1942
1943         * decl.cs (AddMethods): Use the declaring type of the problem
1944         method to determine if we want to squash a warning.
1945
1946 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1947
1948         * attribute.cs: Removed debug output.
1949
1950         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1951         
1952         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1953         Report.Stderr.
1954         
1955 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1956
1957         Fix #74481.
1958         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1959         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1960         all null comparisons against reference types.
1961
1962 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1963
1964         Fix# 74565
1965         * class.cs (TypeContainer.CircularDepException) New nested
1966         exception class.
1967         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1968         (TypeContainer.DefineType): Removed error, reset InTransit before
1969         exit.
1970         (Class.DefineType): Throw exception when is in Transit.
1971         Catch exception and report error.
1972         (Struct.DefineType): Throw exception when is in Transit.
1973         Catch exception and report error.
1974         (Interface.DefineType): Throw exception when is in Transit.
1975         Catch exception and report error.
1976
1977         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1978         handle nested exception handlers.
1979
1980         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1981         a catch.
1982
1983         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1984         InFinally and InCatch storage.
1985
1986         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1987         (Catch.Resolve): Set and Restore ec.InCatch.
1988         (Try.Resolve): Set and Restore ec.InFinally.
1989         (Try.HasCatch): True when try has catch.
1990
1991 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1992
1993         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1994           for the same event member, so exclude such cases from warning 419.
1995           Fixed bug #74633.
1996
1997 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1998
1999         * expression.cs (Binary.ResolveOperator): Apply patch from John
2000         Luke to fix bug 59864: operators &, | and ^ on enumerations
2001         require that the same enum type on both sides.
2002
2003         * driver.cs: Add warnings to old flag usage, this is to assist
2004         people who produce Makefiles and hope that the Makefiles will be
2005         used on Windows.
2006
2007         * class.cs (TypeContainer.EmitType): Moved the definition of the
2008         special $PRIVATE$ field from the resolve phase to the Emit phase.
2009         During resolve we do not know if we are a struct with
2010         HasExplicitLayout, we know this only after the attributes for the
2011         type are emitted.
2012
2013         Set the FieldOffset to zero on the dummy field that we create for
2014         the class.   Fixes 74590.
2015
2016 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2017
2018         Fix #73834.
2019         * ecore.cs (PropertyExpr.resolved): New.
2020         (DoResolve): Use it to handle a case of double resolution here.
2021         Handle a case of identical-name-and-type-name.
2022         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2023         resolution by storing the results of expression resolution back
2024         into the "probes" array.
2025
2026 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2027
2028         Fix cs0208-7.cs and cs0208-8.cs.
2029         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2030         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2031         error reporting to point out the reason a struct is not unmanaged.
2032
2033 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2034
2035         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2036           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2037
2038 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2039
2040         Fix #74528.
2041         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2042         IdenticalNameAndTypeName here.
2043         (EventExpr.InstanceResolve): Likewise.
2044
2045 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2046
2047         C# 2.0 DefaultCharSetAttribute implementation
2048         
2049         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2050         which allows us to set GlobalNamespace for every resolve.
2051         (Attribute.ResolveArguments): Cut from Resolve.
2052         (Attribute.GetCharSetValue): Returns CharSet named argument.
2053         (Attribute.DefinePInvokeMethod): Gets default charset from
2054         module settings.
2055         (GlobalAttribute.ResolveAsTypeStep): Override.
2056         (GlobalAttribute.ResolveArguments): Override.
2057         
2058         * class.cs (TypeAttr): Is protected.
2059         
2060         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2061         (ModuleClass.DefaultCharSetType): New memeber.
2062         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2063         
2064         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2065         charset from module.
2066         
2067         * delegate.cs (TypeAttr): Override.
2068         (Delegate.DefineType): Use this TypeAttr.
2069         
2070         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2071         at very early stage (before types are defined) to resolve model
2072         module attributes. It will probably not work with corlib but it
2073         should be ok.
2074         
2075         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2076         charset from module.
2077         
2078         * typemanager.cs (default_charset_type): New type.
2079
2080 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2081
2082         * decl.cs (MemberCache.AddMethods): Don't warn if
2083         System.Object.Finalize has buggy MethodAttributes.
2084
2085         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2086         removed below.
2087
2088 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2089
2090         * doc.cs : detect ambiguous reference to overloaded members.
2091           Fixed bug #71603. MS 1.1 csc does not detect it.
2092
2093 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2094
2095         * doc.cs : delegates must not be referenced with parameters.
2096           Fixed bug #71605.
2097
2098 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2099
2100         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2101
2102 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2103
2104         * driver.cs (MainDriver): Stop processing if the CLS stage found
2105         errors. 
2106
2107         (CompilerCallableEntryPoint.InvokeCompiler): Always
2108         reset after execution;   Take a TextWriter argument for the
2109         output.
2110
2111         * report.cs: Use the error stream instead of hardcoding stderr. 
2112
2113 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2114
2115         * class.cs: Reduce code paths to test, too small of an
2116         optimization to make it worth the extra testing.  Always perform
2117         it. 
2118
2119 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2120
2121         Fix #74510.
2122         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2123         operators that had errors reported on them.
2124
2125 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2126
2127         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2128         argument types.
2129         (Attribute.Resolve): Add named argument type checking.
2130         
2131         * class.cs (FixedField.Define): Use IsPrimitiveType
2132         
2133         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2134         
2135         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2136         unsafe parameter types.
2137         
2138         * statement.cs (Using.ResolveExpression): Add better error description.
2139         
2140         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2141         
2142 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2143
2144         Fix #74484.
2145         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2146         AttributeUsageAttribute in the emitcontext of the attribute class,
2147         not in the emitcontext of the attributable entity it was attached to.
2148         * cs-parser.jay: Use 'current_class', not 'current_container',
2149         when creating a GlobalAttribute.
2150
2151 2005-04-08  Alp Toker  <alp@atoker.com>
2152
2153         * pending.cs: The fix to #58413 failed to compile methods implementing
2154         interfaces with/without params modifiers and vice versa, even though
2155         params modifiers aren't part of the signature. Make the modifier check
2156         less strict as in csc.
2157
2158 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2159             Anoob V E  <projectmonokochi@rediffmail.com>
2160             Harilal P R  <projectmonokochi@rediffmail.com>
2161
2162         Fix #58413.
2163         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2164         modifiers of pending methods.
2165         (PendingImplementation.PendingImplementation): Initialize it.
2166         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2167         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2168         with ParameterData.  Add check for modifiers.
2169         * class.cs (MethodData.Define): Update to changes.
2170
2171 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2172
2173         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2174
2175 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2176
2177         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2178         property.
2179         
2180         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2181         
2182         * rootcontext.cs,
2183         * typemanager.cs: Registered RequiredAttributeAttribute.
2184         
2185 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2186
2187         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2188         Warning CS0169 is back at level 3.
2189         (IMethodData.SetMemberIsUsed): New method.
2190         
2191         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2192         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2193         
2194         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2195
2196         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2197         contants.
2198         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2199         is used.
2200         
2201         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2202         is used.
2203         
2204         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2205         to avoid the problems with nested types.
2206
2207 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2208             Anoob V.E  <projectmonokochi@rediffmail.com>
2209             Harilal P.R  <projectmonokochi@rediffmail.com>
2210             Raja R Harinath  <rharinath@novell.com>
2211
2212         Fix #73820.
2213         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2214         attribute.
2215         * typemanager (GetConstructor): Make public.
2216
2217 2005-04-05  John Luke  <john.luke@gmail.com>
2218             Raja R Harinath  <rharinath@novell.com>
2219
2220         Fix #62232.
2221         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2222         struct too.  Return false quicker in a few cases.
2223         (VerifyUnManaged): Use it.
2224
2225 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2226
2227         Fix #74041.
2228         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2229         not 'unreachable_seen'.
2230
2231 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2232
2233         * attribute.cs (Attribute.GetValue): Removed unused.
2234         
2235         * codegen.cs (CodeGen.TrimExt): Removed unused.
2236         
2237         * cs-parser.jay (output): Removed unused.
2238         
2239         * cs-tokenizer.cs (hex_digits): Removed unused.
2240         
2241         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2242         
2243         * expression.cs (Indirection.LoadExprValue): Removed unused.
2244         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2245         
2246         * iterators.cs (Iterator.param_types): Removed unused.
2247         
2248         * statement.cs (Goto.block): Removed unused.
2249         (ToplevelBlock.did): Removed unused.
2250         (Switch.ResolveConstantSwitch): Removed unused.
2251
2252 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2253
2254         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2255         resetting thingy.
2256
2257 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2258
2259         Fix #74232 and cs0208-3.cs.
2260         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2261         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2262         unmanaged type.  Don't use FieldBuilders when 't' is a
2263         TypeBuilder.  Use ModFlags and MemberType fields.
2264         * class.cs (MemberBase.member_type): Rename from MemberType.
2265         (MemberBase.MemberType): New property.  Determines member_type on
2266         demand.
2267         (MemberBase.DoDefine): Don't initialize MemberType here.
2268         (FieldMember.Define): Likewise.
2269
2270 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2271
2272         Fix #74241
2273         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2274         Attributes are emitted there.
2275         
2276 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2277
2278         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2279         keyword in 'partial enum' too.
2280         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2281         is not allowed).
2282         Report from Kamil Skalski <nazgul@omega.pl>.
2283
2284         Fix #74309.
2285         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2286         have partial containers too.
2287
2288         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2289         in block' checks to Block.CheckInvariantMeaningInBlock.
2290         * statement.cs (Block.GetKnownVariableInfo): Make private.
2291         (Block.IsVariableUsedInChildBlock): Remove.
2292         (Block.IsVariableUsedInBlock): Likewise.
2293         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2294         conflicting declaration.
2295         (Block.AddVariable): Make error messages less long-winded and more
2296         specific.  Show location of conflicting declaration.
2297         * parameter.cs (Parameters.Location): New readonly property.
2298
2299 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2300
2301         Clean up semantics of invoking ResolveMemberAccess.
2302         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2303         can have an instance, ensure that we pass in a non-TypeExpression
2304         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2305         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2306         argument.  Update to changes and simplify.
2307         (FieldExpr.Emitinstance): Remove CS0120 check.
2308         (PropertyExpr.EmitInstance): Likewise.
2309         * expression.cs (Argument.Resolve): Likewise.
2310         (Invocation.DoResolve): Update to changes in semantics of
2311         InstanceExpression.
2312
2313 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2314
2315         Fix #74241
2316         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2317         customization.
2318         
2319         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2320
2321 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2322
2323         Fix difference in behaviour with commandline invocation.
2324         * driver.cs (Driver.Reset): New.
2325         (CompilerCallableEntryPoint): Call it.
2326
2327         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2328         variable" warnings if the boolean expression failed to resolve.
2329
2330 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2331
2332         * attribute.cs: Fix the union of several permissions when some of them
2333         are unrestricted (so the result isn't an unrestricted permission set).
2334         Fix #74036.
2335
2336 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2337
2338         * ecore.cs (MemberExpr): New class.  Convert from interface
2339         IMemberExpr.
2340         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2341         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2342         error checks.
2343         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2344         (MethodGroupExpr.IsExplicitImpl): Remove.
2345         (Expression.GetFieldFromEvent): Remove.
2346         (SimpleName.MemberStaticCheck): Remove.
2347         (SimpleName.DoSimpleNameResolve): Update to changes.
2348         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2349         (MemberAccess.IdenticalNameAndTypeName): Remove.
2350         (MemberAccess.error176): Move to MemberExpr.
2351         (MemberAccess.DoResolve): Update to changes.
2352         (BaseAccess.DoResolve): Likewise.
2353
2354 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2355
2356         C# 2.0 Conditional attribute class implementation
2357         
2358         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2359         Analyzes class whether it has attribute which has ConditionalAttribute
2360         and its condition is not defined.
2361         
2362         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2363         (Class.IsExcluded): New method. Search for at least one defined
2364         condition in ConditionalAttribute of attribute class.
2365
2366 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2367
2368         * ecore.cs (PropertyExpr): Derive from Expression, not
2369         ExpressionStatement.
2370         (PropertyExpr.EmitStatement): Remove.
2371
2372 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2373
2374         Fix #74060.
2375         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2376         internal field "value__" of an enum be private.  The examples for
2377         "value__" that I found on MSDN all used FieldAttributes.Private.
2378
2379         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2380         Don't mention IL method attribute names.
2381
2382         Fix #47991.  Remove a TODO.
2383         * statement.cs (Block.Toplevel): Make into a field.
2384         (Block.Parameters): Move into ToplevelBlock.
2385         (Block.known_variables): Rename from child_variable_names.
2386         (Block.Block): Remove variants that take Parameters.  Initialize
2387         'Toplevel' with the immediately surrounding toplevel block.
2388         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2389         LocalInfo parameter.
2390         (Block.GetKnownVariableInfo): New.
2391         (Block.IsVariableNameUsedInChildBlock): Update.
2392         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2393         the block, even though it may not be in scope.
2394         (Block.AddVariable): Remove Parameters parameter.  Use
2395         Toplevel.Parameters instead.
2396         (Block.AddConstant): Remove Parameters parameter.
2397         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2398         (Block.IsParamaterReference): Likewise.
2399         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2400         (ToplevelBlock.Parameters): New.  Moved from Block.
2401         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2402         initialize Parameters to a non-null value.
2403         * cs-parser.jay: Update to changes.
2404         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2405         simple names that mean different things in the same block.  Use
2406         Block.IsVariableNameUsedInBlock.
2407
2408 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2409
2410         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2411         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2412         GetTypeHandle.  It is possible for a reflected type to derive from
2413         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2414         System.Array during mscorlib compilation).
2415         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2416         contain a method_hash, don't create one either.  Don't create a
2417         deep copy of the base cache's method_hash.
2418         (MemberCache.SetupCache): Rename back from DeepCopy.
2419         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2420         already initialized.  If we see an override function, add its
2421         underlying base virtual function to the member_hash too.
2422
2423         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2424
2425 2005-03-26  Raja R Harinath  <harinath@acm.org>
2426
2427         Fix #73038.
2428         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2429         fails to resolve, ensure that the LHS is still resolved as an
2430         lvalue.
2431
2432 2005-03-25  Raja R Harinath  <harinath@acm.org>
2433
2434         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2435         ec.ContainerType.
2436         (Enum.current_ec): Remove.
2437         (Enum.LookupEnumValue): Remove EmitContext argument.
2438         Just uses the one created during DefineType.
2439         (Enum.FindMembers): Update.
2440         * expression.cs (MemberAccess.DoResolve): Update.
2441
2442 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2443
2444         * assign.cs (Assign.DoResolve): Check for CS1717 when
2445         source and target are same (uses Equals).
2446
2447         * expression.cs (LocalVariableReference, ParameterReference,
2448         This): Implemented Equals, GetHashCode.
2449
2450         * statement.cs (Block.GetParameterReference): Removed useless
2451         local variable.
2452
2453 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2454
2455         Fix cs0128.cs
2456         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2457         blocks before deciding whether the error is cs0136 or cs0128.
2458
2459         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2460         (using_alias_directive, using_namespace_directive): Pass
2461         MemberName, not an expression to Namespace.UsingAlias and
2462         Namespace.Using.
2463         (MakeName): Use the MemberName of the namespace.
2464         * namespace.cs (Namespace.MemberName): New.
2465         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2466         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2467         Likewise.
2468         * decl.cs (MemberName.Name): Make readonly.
2469         (MemberName.FromDotted): New "constructor".
2470         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2471         (MemberCore.Name): Compute from MemberName on demand.
2472         (MemberCore.SetMemberName): Provide a way to change the
2473         MemberName.
2474         (MemberCore.AddToContainer): Don't take a fullname parameter.
2475         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2476         fully qualified name of the container to the member name.
2477         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2478         only if the type is a member of the root container.
2479         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2480         MemberName.Left rather than searching for an embedded ".".
2481         (PartialContainer.CreatePart): Update to changes in RootContext.
2482         (MemberBase.ShortName): Turn into a property.  Use
2483         MemberCore.SetMemberName.
2484         (MemberBase.ExplicitInterfaceName): Remove.
2485         (MemberBase.UpdateMemberName): Remove.
2486         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2487         (PropertyBase.SetMemberName): New override.
2488         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2489         (Tree.GetDecl): New.
2490         (Tree.AllDecls): Rename from Decls.
2491         * attribute.cs, enum.cs, report.cs: Update to changes.
2492         * driver.cs (MainDriver): Use MemberName.FromDotted on
2493         RootContext.MainClass.
2494
2495 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2496
2497         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2498         checks.
2499
2500         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2501
2502 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2503
2504         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2505         property accessor modifiers.
2506
2507         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2508         fixed buffer attribute (CS1716).
2509         (PropertyMethod.HasCustomAccessModifier): When property accessor
2510         has custom modifier.
2511
2512         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2513         modifiers.
2514         (PropertyExpr.DoResolveLValue): Add CS0272.
2515
2516 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2517
2518         * convert.cs: When converting to a pointer, use the proper Conv.U
2519         or Conv.I depending on the source data type.
2520
2521         * cs-tokenizer.cs: Make the size for large decimal constants,
2522         fixes #72957.
2523
2524 2005-03-17  Martin Baulig  <martin@ximian.com>
2525
2526         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2527         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2528
2529 2005-03-17  Martin Baulig  <martin@ximian.com>
2530
2531         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2532         to bool so we can return an error condition.
2533         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2534         returned an error.
2535
2536 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2537
2538         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2539         attributes.
2540
2541 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2542
2543         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2544         Refactor to avoid traversing the list of assemblies, and to avoid
2545         string concatenation.
2546         * typemanager.cs (guid_attr_type): Remove.
2547         (negative_hits, pointers, references): Remove hashes.
2548         (type_hash): New.
2549         (GetConstructedType): New.  Uses type_hash to handle constructed
2550         types (arrays, references, pointers).
2551         (GetReferenceType, GetPointerType): Use it.
2552         (GetNestedType): New.  Uses type_hash to handle nested types of
2553         reflected types.
2554         (LookupType, LookupTypeDirect): Remove.
2555         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2556         'types' hash and LookupTypeReflection directly.
2557         (params_string, params_object): Use GetConstructedType.
2558         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2559         top-level types.
2560         (Namespace.Lookup): Use cached_types.
2561         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2562         provided by old TypeManager.LookupType.
2563         * rootcontext.cs (MakeFQN): Remove.
2564         * decl.cs (DeclSpace.MakeFQN): Likewise.
2565         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2566         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2567         TypeManager.GetConstructedType.
2568         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2569
2570 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2571
2572         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2573         indexers.
2574
2575         * cs-parser.jay: Reports CS1527 for any namespace element.
2576
2577         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2578         Added CS0407.
2579
2580         * expression.cs (ParameterReference.IsAssigned): Changed error to
2581         CS0269.
2582         (Error_WrongNumArguments): Moved CS0245 detection here.
2583
2584         * statement.cs (Return.Resolve): Add CS1622 report.
2585
2586 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2587
2588         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2589
2590 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2591
2592         * attribute.cs expression.cs: Get rid of some allocations.
2593
2594 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2595
2596         * doc.cs : just eliminate the latest change.
2597
2598 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2599
2600         * doc.cs : commented out the latest change. It breaks xml-030.cs
2601
2602 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2603
2604         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2605           fail. So invoke CreateType() in FindDocumentedType().
2606
2607 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2608
2609         * cs-tokenizer.cs : added IsKeyword().
2610         * doc.cs : Detect keyword incorrectly used as identifier.
2611           Allow identifiers prefixed by @.
2612
2613 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2614
2615         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2616         It caused exception in namespace resolving (again!).
2617         
2618         * class.cs (Class.ctor): Removed exit.
2619         (PropertyMethod.ctor): ditto.
2620         
2621         * codegen.cs (Codegen.Reset): Reset static data.
2622         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2623         
2624         * cs-tokenizer.cs (Cleanup): Removed.
2625         
2626         * driver.cs (GetSystemDir): Rewrote to one line command.
2627         It caused problem with unloaded dynamic modules.
2628         (UnixParseOption): Removed Exit.
2629         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2630         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2631         Now can be mcs used as library.
2632         
2633         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2634         empty location.
2635         
2636         * location.cs (Reset): Reset static data.
2637         
2638         * namespace.cs (Reset): Reset static data.
2639         
2640         * report.cs (Report.Reset): Reset static data.
2641         
2642         * rootcontext.cs (RootContext.Reset): Reset static data.
2643         
2644         * tree.cs (RootTypes.ctor): Use Location.Null
2645         
2646         * typemanager.cs (TypeManager.Reset): Reset static data.
2647         (CoreLookupType): Removed Exit.
2648         (TypeHandle.Reset): Reset static data.
2649         
2650 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2651
2652         Fix #73516.
2653         * typemanager.cs (ComputeNamespaces): Import namespaces from
2654         referenced modules too.
2655
2656 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2657
2658         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2659         than '.'.
2660
2661 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2662
2663         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2664         enclosing DeclSpace.  This ensures that a name-lookup populates
2665         more caches and there are fewer 'TypeExpression's.  Carve out
2666         nested type lookup into ...
2667         (LookupNestedTypeInHierarchy): ... this.
2668
2669 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2670
2671         Clean up a few partial-class semantics.  
2672         Fixes test-357.cs and cs1618-2.cs.
2673         * cs-parser.jay (struct_declaration): Use 'current_class' as
2674         parent of newly-created struct.  Remove call to Register ().
2675         Use 'pop_current_class' to complete handing the current struct.
2676         (interface_declaration): Likewise.
2677         (class_declaration): Likewise.
2678         (enum_declaration): Use 'current_class' as parent of newly created
2679         enum.
2680         (delegate_declaration): Likewise.
2681         (pop_current_class): New function.  This is used to handle closing
2682         up the 'current_class' and 'current_container', and pointing them
2683         to the enclosing class/container.
2684         (CSharpParser): Initialize 'current_class' too.
2685         * decl.cs (MemberCore): Add check for invariant: a partial
2686         container is not a parsed entity, and thus does not enclose any
2687         parsed members.
2688         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2689         (DeclSpace.BaseTypeExpr): Use it.
2690         (DeclSpace.LookupType): Add check for invariant.
2691         * class.cs (TypeContainer): Add check for invariant: a nested
2692         class should have the same NamespaceEntry as its enclosing class.
2693         (TypeContainer.EmitFieldInitializers): Make virtual.
2694         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2695         MemberCore.
2696         (TypeContainer.Register): Remove.
2697         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2698         null.  Use TypeResolveEmitContext for resolving base types and
2699         interfaces.  Move initialization of Parts.TypeBuilder here from
2700         ...
2701         (TypeContainer.DefineNestedTypes): ... here.
2702         (PartialContainer): Take a Namespace not a NamespaceEntry.
2703         (PartialContainer.Create): Don't use Register.  Call the
2704         appropriate Add... function directly.
2705         (ClassPart): Take both the PartialContainer and the enclosing
2706         class as constructor arguments.
2707         (ClassPart.EmitFieldInitializers): Override.
2708         (ClassPart.PartFindNestedTypes): Remove.
2709         (FieldBase.GetInitializerExpression): Resolve the initializer
2710         expression in the emit context of the enclosing class.
2711         * tree.cs (RootTypes): Remove Register ().
2712         
2713 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2714
2715         * cs-parser.jay: Removed CS0134.
2716         
2717         * driver.cs: Removed CS1901.
2718         
2719         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2720         for predefined types.
2721
2722 2005-03-07  Duncan Mak  <duncan@novell.com>
2723
2724         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2725         well. Fixes bug #73454.
2726
2727 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2728
2729         * cs-tokenizer.cs (xtoken): Add CS1035.
2730         
2731         * class.cs (MethodData.Define): Add CS0683.
2732         (FieldMember.ctor): Add CS0681.
2733
2734 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2735
2736         * ecore.cs (SimpleName.DoResolve): Rename from
2737         SimpleName.DoResolveAllowStatic.
2738         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2739         Pass 'intermediate' flag to MemberStaticCheck.
2740         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2741         of "intermediate" lookups via MemberAccess.
2742         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2743         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2744
2745 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2746
2747         Fix #73394.
2748         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2749         slipped in because of variable names that are identical to a
2750         builtin type's BCL equivalent ('string String;', 'int Int32;').
2751         (PropertyExpr.EmitInstance): Likewise.
2752
2753 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2754
2755         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2756         
2757         * report.cs (warning_ignore_table): Made public.
2758
2759 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2760
2761         Fix #73282.
2762         * class.cs (MethodData.Emit): Pass 'container' to
2763         container.GetObsoleteAttribute instead of 'container.Parent'.
2764
2765 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2766
2767         * cs-parser.jay: Add 1534 error test.
2768
2769         * iterators.cs (Yield.CheckContext): Add error 1629.
2770         (Iterator.ctor): Save unsafe modifier.
2771         (MoveNextMethod.DoEmit): Restore unsafe context.
2772
2773         * namespace.cs (UsingAlias): Better error message.
2774
2775 2005-03-03  Dan Winship  <danw@novell.com>
2776
2777         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2778         the warning message [#73219]
2779
2780 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2781
2782         Fix compile with MCS 1.0.0.0.
2783         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2784         w_restore to not depend on string constant folding.
2785
2786 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2787
2788         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2789         CS0246 check to users who passed 'silent = false'.
2790         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2791         check.
2792         (SimpleName.SimpleNameResolve): Update.
2793         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2794         (MemberAccess.IdenticalNameAndTypeName): Update.
2795         * doc.cs (FindDocumentedTypeNonArray): Update.
2796
2797 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2798
2799         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2800         * parameters.cs (ComputeAndDefineParameters): Remove.
2801         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2802         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2803         Use GetParameterInfo.
2804
2805 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2806
2807         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2808
2809 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2810
2811         Unify DeclSpace.LookupType and DeclSpace.FindType.
2812         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2813         is in charge of defining nested types on demand.
2814         (DeclSpace.LookupType): Use it when the current_type is a
2815         TypeBuilder.  Use LookupTypeDirect for reflected types.
2816         (DeclSpace.FindType): Remove.
2817         (DeclSpace.LookupInterfaceOrClass): Likewise.
2818         (DeclSpace.DefineTypeAndParents): Likewise.
2819         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2820         DeclSpace.LookupType.
2821         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2822         * typemanager.cs (LookupType): Simplify.
2823         (AddUserType): Remove type from negative_hits.
2824         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2825         * class.cs (TypeContainer.FindMembers): Move handling of nested
2826         types ...
2827         (TypeContainer.FindMembers_NestedTypes): ... here.
2828         (TypeContainer.FindNestedType): Implement override.
2829         (ClassPart.FindNestedType): Delegate to PartialContainer.
2830         (ClassPart.PartFindNestedType): Looks up the nested types of the
2831         part alone.
2832
2833 2005-03-02  Martin Baulig  <martin@ximian.com>
2834
2835         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2836         static constructor in static classes.
2837
2838 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2839
2840         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2841         sizeParamIndex is not specified.
2842
2843 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2844
2845         Fix #73117
2846         * report.cs (WarningMessage.IsEnabled): Missing null check.
2847
2848 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2849
2850         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2851         in the fields and not in the properties.
2852
2853 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2854
2855         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2856         fields as well.
2857
2858 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2859
2860         * attribute.cs: Small refactoring (improved robustness).
2861         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2862         (ValidateGuid): Removed.
2863         (Resolve): Removed referenced to above mentioned.
2864         (GetAttributeUsage): Made private and changed to work without
2865         class assistance.
2866         (GetIndexerAttributeValue): Don't crash.
2867         (GetConditionalAttributeValue): Ditto.
2868         (GetClsCompliantAttributeValue): Ditto.
2869         (ExtractSecurityPermissionSet): All attributes exceptions are
2870         error 648.
2871         (GetPropertyValue): New helper.
2872         (GetMethodImplOptions): New method.
2873         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2874         some missing properties.
2875         
2876         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2877         (Method.ApplyAttributeBuilder): Updated.
2878         
2879         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2880         exception.
2881
2882 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2883
2884         Fix #73052.
2885         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2886         non-simple types (array, pointer, reference).
2887
2888 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2889
2890         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2891
2892         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2893         for operators.
2894         (Method.CheckBase): Catch wrong destructor here.
2895         (MethodData.Define): Add errors 550, 668.
2896
2897         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2898
2899         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2900
2901         * pending.cs (VerifyPendingMethods): Add error 551.
2902
2903         * typemanager.cs (CSharpName): Next error report helper.
2904
2905 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2906
2907         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2908         attributes. Removed useless attribute double check.
2909         It saves almost 2MBs for corlib.
2910
2911 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2912
2913         Fix #72924.
2914         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2915         called twice in case of error.
2916
2917 2005-02-23  Chris Toshok  <toshok@ximian.com>
2918
2919         Fix compiler portions of #72827.
2920         * statement.cs (Block.Emit): call Begin/EndScope on the
2921         EmitContext instead of the ILGenerator.
2922
2923         * codegen.cs (EmitContext.BeginScope): new method, call
2924         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2925         we have one.)
2926         (EmitContext.BeginScope): same, but EndScope and CloseScope
2927
2928         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2929         offset and call the superclass's OpenScope(int) with it.
2930         (SymbolWriter.CloseScope): get the current il
2931         offset and call superclass's CloseScope(int) with it.
2932
2933 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2934
2935         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2936         CS1677 for out and ref as well.
2937
2938         * class.cs (Method.Define): Add error CS1599 detection.
2939         
2940         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2941         
2942         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2943         
2944         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2945         
2946         * support.cs.cs (ModifierDesc): New helper method.
2947
2948 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2949             Abin Thomas  <projectmonokochi@rediffmail.com>
2950             Anoob V E  <projectmonokochi@rediffmail.com>
2951             Harilal P R  <projectmonokochi@rediffmail.com>
2952
2953         Fix #57851, #72718.
2954         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2955         MemberLookup (used for error reporting) actually returns a result.
2956         Fix error report number (122, not 112).
2957
2958 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2959             Anoob V E  <projectmonokochi@rediffmail.com>
2960             Harilal P R  <projectmonokochi@rediffmail.com>
2961
2962         Fix #71134.
2963         * pending.cs (PendingImplementation.GetAbstractMethods):
2964         Find NonPublic members too.
2965
2966 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2967
2968         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2969         Fixed error 217.
2970         
2971         * class.cs (MethodCore.CheckMethodAgainstBase):
2972         Add error 239 report.
2973
2974 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2975
2976         Fix #68955.
2977         * expression.cs (Invocation.IsApplicable): Make public.
2978         (Invocation.IsParamsMethodApplicable): Likewise.
2979         * delegate.cs (Delegate.VerifyApplicability): Don't use
2980         Invocation.VerifyArgumentCompat for parameter applicability
2981         testing.  Use Invocation.IsApplicable and
2982         Invocation.IsParamsMethodApplicable.
2983
2984 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2985
2986         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2987         
2988         * class.cs (Operator.Define): Add error 217 report.
2989         
2990 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2991
2992         * namespace.cs (UsingEntry.Resolve): Undo change below.
2993
2994 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2995
2996         Fix #72756.
2997         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2998         disable the error message when the extended MemberLookup also
2999         fails.
3000         (Expression.MemberLookupFinal): Update.
3001         (SimpleName.DoSimpleNameResolve): Update.
3002         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3003         Don't use MemberLookupFinal.
3004         (New.DoResolve): Update.
3005         (BaseAccess.CommonResolve): Update.
3006
3007 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3008
3009         Fix #72732.
3010         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3011         occured previously, don't resolve again.
3012
3013 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3014
3015         Fix #69949
3016         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3017         argument. Call ResolveAttributeUsage for unresolved.
3018         when types doesn't match ctor arguments.
3019         
3020         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3021         for nested attribute classes.
3022         (Class.attribute_usage): Removed.
3023         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3024         for attribute class.
3025         
3026         * ecore.cs (IsAttribute): Removed.
3027         
3028         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3029         
3030         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3031         now normal types.
3032         (attribute_types): Removed.
3033         (EmitCode): Global attributes are emited as the latest.
3034
3035 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3036
3037         * class.cs (EmitFieldInitializers): Don't emit field initializer
3038         for default values when optimilization is on.
3039         
3040         * constant.cs (Constant.IsDefaultValue): New property.
3041         
3042         * driver.cs: Add /optimize handling.
3043         
3044         * constant.cs,
3045         * ecore.cs,
3046         * literal.cs: Implement new IsDefaultValue property.
3047         
3048         * rootcontext.cs (Optimize): New field, holds /optimize option.
3049
3050 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3051
3052         Fix crasher in re-opened #72347.
3053         * namespace.cs (Namespace.Lookup): Return null if
3054         DeclSpace.DefineType returns null.
3055
3056         Fix #72678.
3057         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3058
3059 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3060
3061         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3062         now returns null if it cannot resolve to an lvalue.
3063         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3064         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3065         returned null.  Remove check for SimpleName.
3066         (EventExpr.DoResolveLValue): New.
3067         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3068         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3069         error from ...
3070         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3071         avoid CS0131 error.
3072         (Unary.ResolveOperator): Move CS0211 check ...
3073         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3074         CS0131 error.
3075         (Unary.DoResolveLValue): Simplify.
3076         (AddressOf.DoResolveLValue): New.
3077         (ArrayAccess.DoResolveLValue): New.
3078
3079 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3080
3081         * attribute.cs (Attribute.Resolve): Add arguments casting for
3082         when types doesn't match ctor arguments.
3083
3084 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3085
3086         Fix parts of #63202.
3087         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3088         lookup of operator in base type.  Ensure that all checks happen
3089         when the operator resolves to an "op_..." method.
3090
3091 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3092
3093         Fix #71992.
3094         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3095         'ignore_cs0104' parameter.  Pass it to ...
3096         (NamespaceEntry.Lookup): ... this.
3097         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3098         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3099         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3100         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3101         Update.  Request that cs0104 errors be ignored.
3102         (ComposedCast.ResolveAsTypeStep): Update.
3103
3104 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3105
3106         Fix #59209.
3107         * expression.cs (Invocation.BetterFunction): Remove support for
3108         comparing virtual functions and their overrides.
3109         (Invocation.IsOverride): New.
3110         (Invocation.OverloadResolve): Don't consider 'override' functions
3111         during candidate selection.  Store them in a lookaside list.
3112         If the selected method is a 'virtual' function, use the list to
3113         find any overrides that are closer to the LHS type.
3114
3115 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3116
3117         * expression.cs (New.DoResolve): Add complex core type reduction.
3118         (New.Constantify): Converts complex core type syntax like 'new int ()'
3119         to simple constant.
3120         
3121 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3122
3123         * decl.cs (EntryType.EntryType): New constructor to create an
3124         updated copy of a cache entry.
3125         (MemberCache.AddMethods): Use it.
3126         (MemberCache.ClearDeclaredOnly): Remove.
3127         (MemberCache.MemberCache): Update.
3128
3129 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3130
3131         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3132         variable.  This one is represents the actual low-level declaration
3133         of the method, as opposed to the semantic level `IsStatic'.   
3134
3135         An anonymous method which is hosted into a static method might be
3136         actually an instance method.  IsStatic would reflect the
3137         container, while MethodIsStatic represents the actual code
3138         generated.
3139
3140         * expression.cs (ParameterReference): Use the new MethodIsStatic
3141         instead of IsStatic.
3142
3143         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3144         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3145         set on the current EmitContext. 
3146
3147         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3148         resolve our casted expression as an LValue.  This triggers the
3149         proper LValue processing that is later required by Assign.
3150
3151         This fixes 72347.
3152
3153         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3154
3155 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3156
3157         C# 2.0 Fixed buffer implementation
3158
3159         * anonymous.cs: Update after RegisterHelperClass renaming.
3160
3161         * attribute.cs (AttributeTester.fixed_buffer_cache):
3162         Cache of external fixed buffers.
3163         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3164         implementation if field is fixed buffer else null.
3165
3166         * class.cs
3167         (TypeContainer.AddField): Accept FieldMember instead of Field.
3168         (FieldBase.IsFieldClsCompliant): Extracted code from
3169         VerifyClsCompliance descendant customization.
3170         (FixedField): New class handles fixed buffer fields.
3171         (FixedFieldExternal): Keeps information about imported fixed
3172         buffer.
3173         (IFixedField): Make access to internal or external fixed buffer
3174         same.
3175
3176         * cs-parser.jay: Add fixed buffer parsing.
3177
3178         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3179         buffer.
3180
3181         * expression.cs (Indirection): Extended implementation to accept
3182         fixed buffer field.
3183         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3184         (ElementAccess.MakePointerAccess): Get type as parameter.
3185         (DoResolve): Add fixed buffer field expression conversion.
3186         (DoResolveLValue): Ditto.
3187         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3188         (ArrayPtr): Derives from FixedBufferPtr.
3189         (ArrayPtr.Emit): Add extra emit for array elements.
3190
3191         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3192
3193         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3194         for compiler generated types.
3195         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3196
3197         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3198         and consume less memory.
3199         (Fixed.Resolve): Add fixed buffer case.
3200
3201         * typemanager.cs (compiler_generated_attr_ctor,
3202         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3203         (HasElementType): Add our own implementation to work on every
3204         runtime.
3205
3206 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3207
3208         * anonymous.cs (CaptureContext): Track whether `this' has been
3209         referenced.   
3210
3211         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3212         only captured `this' if it was implicitly done (instance
3213         methods/variables were used). 
3214
3215         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3216         `this' must be captured.
3217
3218 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3219  
3220         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3221         is null it means that there has been no need to capture anything,
3222         so we just create a sibling.
3223
3224         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3225
3226         Just a partial fix.  The other half is fairly elusive.
3227         
3228 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3229
3230         Fix #52586, cs0121-4.cs.
3231         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3232         and return a hashtable.
3233         (MemberCache.ClearDeclaredOnly): New.
3234         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3235         the method_hash of a base type too.
3236         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3237         type methods.  Overwrite entries with the same MethodHandle so
3238         that the ReflectedType is correct.  The process leaves in base
3239         virtual functions and their overrides as distinct entries.
3240         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3241         matters since it was boxed in a ArrayList before.
3242         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3243         modifier.
3244         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3245         case of a virtual function and its override (choose the overload
3246         as better).
3247         (Invocation.OverloadResolve): Avoid 'override' members during
3248         'applicable_type' calculation.
3249
3250 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3251
3252         Combine two near-redundant caches.
3253         * typemanager.cs (method_params): Rename from method_internal_params.
3254         (TypeManager.GetParameterData): New.  Replace
3255         Invocation.GetParameterData.
3256         (TypeManager.LookupParametersByBuilder): Remove.
3257         * expression.cs (Invocation.method_parameter_cache): Remove.
3258         (Invocation.GetParameterData): Remove.
3259         Update to changes.
3260         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3261         Update to changes.
3262
3263 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3264
3265         Fix #72015.
3266         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3267         TypeManager.multicast_delegate_type is null, resolve it by looking
3268         up "System.MulticastDelegate".
3269         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3270
3271 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3272             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3273             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3274
3275         Fix cs0164.cs.
3276         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3277         (LabeledStatement.AddReference): New.  Set 'referenced'.
3278         (Goto.Resolve): Use it.
3279
3280 2005-02-05  John Luke  <john.luke@gmail.com>
3281
3282         * driver.cs: remove duplicate -doc line in Usage ()
3283
3284 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3285
3286         * location.cs (Location.AddFile): Fix CS2002 error report.
3287
3288 2005-02-02  Martin Baulig  <martin@ximian.com>
3289
3290         * delegate.cs (Delegate.DefineType): Report an internal error if
3291         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3292         details.        
3293
3294 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3295
3296         Fix a crasher in a variant of #31984.
3297         * const.cs (Constant.CheckBase): New override that defers the
3298         new-or-override check in case the base type hasn't been populated
3299         yet.
3300         (Constant.Define): Ensure the new-or-override check is performed.
3301
3302 2005-02-01  Duncan Mak  <duncan@ximian.com>
3303
3304         * const.cs (LookupConstantValue): Check that `ce' is not null
3305         before calling GetValue ().
3306
3307 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3308
3309         Fix test-334.cs (#69519).
3310         * cs-parser.jay (using_alias_directive): Pass in an expression to
3311         NamespaceEntry.UsingAlias.
3312         (using_namespace_directive): Pass in an expression to
3313         NamespaceEntry.Using.
3314         (namespace_name): Don't flatten to a string.
3315         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3316         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3317         ResolveAsTypeStep.
3318         (NamespaceEntry.UsingEntry): Likewise.
3319         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3320         changes.
3321         (NamespaceEntry.LookupForUsing): Remove.
3322         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3323         names.
3324         (NamespaceEntry.Lookup): Remove support for dotted names.
3325
3326 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3327
3328         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3329         split into two.
3330         (NamespaceEntry.ImplicitParent): Compute on demand.
3331         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3332         parallels the current.
3333         (NamespaceEntry.LookupForUsing): Use it.
3334         (NamespaceEntry.Lookup): If the current namespace-entry is
3335         implicit, don't search aliases and using tables.
3336
3337 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3338
3339         Fix #31984.
3340         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3341         BaseCache here.
3342         (TypeContainer.BaseCache): Compute on demand.
3343         (TypeContainer.FindMembers): Define constants and types if they're
3344         not already created.
3345         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3346         check.
3347         * const.cs (Constant.Define): Make idempotent.
3348
3349 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3350
3351         * pending.cs: Produce better code (no nops produced by using Ldarg
3352         + value).
3353         
3354         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3355         i - 1' it should be arg + 1.
3356
3357         Fixes bug #71819.
3358
3359 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3360
3361         * attribute.cs (Attribute.CheckAttributeType): Make private
3362         non-virtual.
3363         (Attribute.ResolveType): Make virtual.
3364         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3365         handling of RootContext.Tree.Types.
3366
3367 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3368
3369         Update attribute-handling to use the SimpleName/MemberAccess
3370         mechanisms.
3371         * cs-parser.jay (attribute): Pass in an expression to the
3372         constructors of Attribute and GlobalAttribute.
3373         * attribute.cs (Attribute): Take an expression for the name.
3374         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3375         passed in attribute name expression.
3376         (Attribute.CheckAttributeType): Use it.
3377         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3378         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3379         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3380         argument to prevent error messages if the lookup fails.
3381
3382 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3383
3384         * expression.cs (Indirection): Implemented IVariable interface
3385         to support indirection in AddressOf operator.
3386         (PointerArithmetic.Emit): Add optimalization for case where
3387         result can be precomputed.
3388
3389 2005-01-26  Martin Baulig  <martin@ximian.com>
3390
3391         * class.cs (TypeContainer.AttributeTargets): Return the correct
3392         AttributeTargets depending on our `Kind' instead of throwing an
3393         exception; fixes #71632.
3394
3395 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3396
3397         Fix #71257
3398         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3399         constant members.
3400
3401 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3402
3403         Fix #71602.
3404         * expression.cs (MemberAccess.DoResolve): Don't complain with
3405         cs0572 when the LHS of a member access has identical name and type
3406         name.
3407
3408 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3409
3410         Fix #71651, #71675
3411         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3412         CreatePermission.
3413         Create custom PermissionSet only for PermissionSetAttribute.
3414
3415 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3416
3417         Fix #71649
3418         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3419         delegates in static class.
3420
3421 2005-01-24  Martin Baulig  <martin@ximian.com>
3422
3423         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3424         merging an implicit block, just use its reachability.
3425
3426         * statement.cs (Block.Resolve): Make the unreachable code check
3427         work wrt. implicit blocks; see test-337 from #63842.
3428
3429 2005-01-21  Alp Toker  <alp@atoker.com>
3430  
3431         * cs-parser.jay: destructor_declaration's container is PartialContainer
3432         not Class when partial types are used, so use Kind prop instead of
3433         'is'.
3434         
3435 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3436
3437         * cs-parser.jay: Improve error reporting when an interface
3438         declares new types.
3439
3440 2005-01-20  Dick Porter  <dick@ximian.com>
3441
3442         * support.cs: SeekableStreamReader fix from Sandor Dobos
3443         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3444         chars are read.  Fixes bug 70369.
3445
3446 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3447
3448         * cs-parser.jay (catch_clause): Simplify current_block handling
3449         somewhat.
3450
3451 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3452
3453         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3454         code with ImplicitStandardConversion to handle the implicit
3455         conversion of method groups into valid delegate invocations. 
3456
3457         The problem is that in parameter handling we were using this code
3458         path.  Fixes bug #64698
3459
3460 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3461
3462         * cs-parser.jay: Fix several infelicities.
3463         - Avoid assigning to the parser value stack.  Code like 
3464           '$3 = null' is unclean.  Synthesize a value for the code block
3465           instead. 
3466         - Avoid using oob_stack for storing location information.  Use ...
3467         (_mark_): ... this.  New (empty) rule.  Saves the current location
3468         in $$.
3469         (foreach_statement): Avoid using oob_stack for current_block
3470         handling.  Use technique used in for_statement and
3471         using_statement.  Synthesize a value for the code block to store
3472         additional intermediate information.
3473
3474 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3475
3476         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3477         of a different type is only allowed to private fields of a
3478         containing type, not on fields of a base class.
3479
3480         See test-174.cs and error cs0122-9.cs
3481
3482 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3483
3484         Fix test-335.cs (bug #58126).
3485         * cs-parser.jay (argument): Split out non-expression parts of the
3486         rule into 'non_simple_argument'.
3487         (invocation_expression): Support parenthesized invocations with
3488         multiple arguments, and with single non-simple arguments.
3489
3490 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3491
3492         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3493         places.
3494
3495 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3496
3497         Fix cs0038-1.cs, cs1640-6.cs.
3498         * ecore.cs (Expression.Resolve): Remove special-case for
3499         SimpleName in error-handling.
3500         (Expression.almostMatchedMembers): Relax access permission to
3501         protected.
3502         (Expression.MemberLookupFailed): Handle duplicates in
3503         almostMatchedMembers list.
3504         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3505         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3506         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3507         overload if the passed in MemberInfo is a MethodBase.
3508
3509 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3510
3511         Fix #70749
3512         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3513         for non-CAS & merge permission sets properly.
3514
3515 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3516
3517         Improve standard-compliance of simple name and member access 
3518         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3519         * ecore.cs (FullNamedExpression): New abstract base class 
3520         for Namespaces and TypeExpressions.
3521         (ResolveFlags.SimpleName): Remove.
3522         (SimpleName): Remove support for dotted names.
3523         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3524         DeclSpace.FindType and DeclSpace.LookupType.
3525         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3526         (Expression.ExprClassName): Make member function.
3527         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3528         a namespace.  Remove creation of dotted "SimpleName"s.
3529         (MemberAccess.DoResolve): Likewise.
3530         * decl.cs (DeclSpace.Cache): Make private.
3531         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3532         (DeclSpace.FindType): Update.
3533         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3534         FullNamedExpression.
3535         * namespace.cs (Namespace): Derive from FullNamedExpression
3536         so that it can be part of expression resolution.
3537         (Namespace.Lookup): Return an FullNamedExpression.
3538         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3539         namespace.
3540         * rootcontext.cs (NamespaceLookup): Remove.
3541         (LookupType): Move to DeclSpace.
3542         * attribute.cs (CheckAttributeType): Update.
3543         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3544         (FindDocumentedTypeNonArray): Likewise.
3545
3546 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3547
3548         Fix cs0509.cs, cs1632.cs.
3549         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3550         is the same as IsInterface.
3551         (TypeContainer.GetClassBases): Likewise.
3552         * statement.cs (LabeledStatement.ig): New field.
3553         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3554         label.
3555         (LabeledStatement.DoEmit): Check that the label was created with
3556         the same ILGenerator.
3557
3558 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3559
3560         Fix #71058
3561         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3562         accessors to its properties.
3563
3564         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3565         from accessors to property.
3566         
3567 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3568
3569         Fix #70722
3570         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3571         only for overrides.
3572         
3573 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3574
3575         * attribute.cs: Check for null and empty strings.  
3576
3577         I have lost another battle to Paolo.
3578
3579 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3580
3581         Fix #70942
3582         * class.cs (PropertyMethod): Set Parent field in ctors.
3583         (SetMethod.InternalParameters): Add unsafe switch hack.
3584         Override MarkForDuplicationCheck where it is appropriate.
3585
3586         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3587         It says whether container allows members with the same name.
3588         Base default is no.
3589         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3590         Removed is_method parameter.
3591
3592 2005-01-06  Duncan Mak  <duncan@ximian.com>
3593
3594         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3595         because the previous change led to incorrect reporting of CS1032
3596         ("Cannot define/undefine preprocessor symbols after first token in
3597         file"). Instead of using `tokens_seen' as the only flag that
3598         triggers CS1040, introduce `comments_seen'. This new flag is used
3599         to signify having seen comments on the current line, so it is
3600         unset after a newline.
3601
3602 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3603
3604         * doc.cs : When searching for a type, find nested type too.
3605           This fixes bug #71040.
3606
3607 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3608
3609         * doc.cs :
3610           - Warn missing member comment on those classes which also does not
3611             have doc comments. Fixed bug #71041.
3612           - Don't warn missing doc comment on default constructor.
3613             Fixed bug #71042.
3614
3615 2005-01-06  Duncan Mak  <duncan@ximian.com>
3616
3617         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3618         comments, set `tokens_seen' to true. This allows us to detect
3619         misplaced preprocessor directives (i.e. not at the beginning of
3620         the a line, nor after whitespaces). In that case, report error
3621         CS1040. This fixes bug #56460.
3622
3623         * cs-parser.jay (interface_member_declaration): Add checks for
3624         IsExplicitImpl, and report CS0541 error if an interface member is
3625         defined as an explicit interface declaration.
3626
3627 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3628
3629         Fix #70817
3630         * class.cs (PropertyMethod): Set Parent field in ctors.
3631         (SetMethod.InternalParameters): Add unsafe switch hack.
3632         
3633         * decl.cs (MemberCore.Parent): Cannot be readonly.
3634
3635 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3636
3637         * decl.cs (DeclSpace.ResolveType): Remove.
3638         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3639         Merge in code from ...
3640         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3641         * class.cs, enum.cs: Update to changes.
3642
3643 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3644
3645         * anonymous.cs: Ensure that we init the scope of our parent if it
3646         has not been initialized yet.
3647
3648 2004-12-30  Duncan Mak  <duncan@ximian.com>
3649
3650         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3651         if field.FieldBuilder is null. Fixes #70758.
3652
3653         * convert.cs: Fixed some typos and updated some of the comments.
3654         (ImplicitStandardConversionExists):
3655         (TryImplicitIntConversion): If `target_type' is an interface and
3656         the type of `ic' implements this interface, return true or a new
3657         BoxedCast instead of null. This fixes #70468.
3658
3659 2004-12-29  Duncan Mak  <duncan@ximian.com>
3660
3661         * expression.cs (Argument.Emit): Check that Expr is
3662         IMemoryLocation before casting to it, and report CS1510 otherwise.
3663
3664         This fixes #70402.
3665
3666 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3667
3668         * statement.cs (Block.ThisVariable): remove the recursion here, to
3669         make the --profile more sane.
3670
3671 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3672
3673         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3674         assembly, by JB Evain.
3675
3676 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3677
3678         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3679           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3680         "parent" refers to enclosing type/class.  "base" refers to superclass.
3681
3682 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3683
3684         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3685         Ensure that we only have GlobalAttributes.
3686         * attribute.cs (Attribute.Emit): Make non-virtual.
3687         (GlobalAttribute.Emit): Remove.
3688         (Attribute.Resolve): Make virtual.
3689         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3690         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3691         the argument. Don't create one.
3692         (Attribute.GetObsoleteAttribute): Likewise.
3693         (Attribute.GetClsCompliantAttributeValue): Likewise.
3694         * class.cs, decl.cs: Update to changes.
3695
3696 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3697
3698         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3699         
3700         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3701         
3702         * statement.cs (Foreach.Resolve): Add error 186 report.
3703
3704 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3705
3706         * expression.cs (Conditional.DoResolve): Add warning 429.
3707         
3708         * statement.cs (If.Resolve): Add warning 665.
3709
3710 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3711
3712         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3713         except when in the parser, and in GlobalAttribute.
3714         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3715         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3716         RootContext.Tree.Types.NamespaceEntry once work is done.
3717         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3718         and resets RootContext.Tree.Types.NamespaceEntry.
3719
3720 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3721
3722         * cs-parser.jay: Don't create a block for every variable.
3723
3724 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3725
3726         * location.cs: Provide extra information.
3727
3728         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3729         variables from the captured environment, it is the ldarg_0.
3730
3731 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3732
3733         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3734         find a conclusion.
3735         
3736         * class.cs: Changed warning level for 169 to avoid developer
3737         displeasure from warning flooding. It will be changed back when they
3738         fix most of current BCL warnings.
3739         
3740         * RootContext.cs: Pushed default WarningLevel to 3.
3741         
3742         * statement.cs: Removed unused variable.
3743
3744 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3745
3746         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3747         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3748         Add error 502 report.
3749         (StaticClass.DefineType): Add error 441 report.
3750         (Class.AllowedModifiersProp): New virtual property as temporary
3751         extension to AllowedModifiers.
3752         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3753         to share implementation with StaticClass and don't call virtual
3754         methods from ctor.
3755         
3756         * driver.cs (MainDriver): Add error 1558 test.
3757
3758         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3759         report. Moved error 36 test here.
3760
3761         * statement.cs (Throw.Resolve): Add error 724 report.
3762
3763         * typemanager.cs: Add out_attribute_type core type.
3764         
3765 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3766
3767         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3768         3018 report.
3769         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3770
3771         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3772         3017 report.
3773         
3774         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3775
3776         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3777         Add error 3023 report.
3778         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3779
3780         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3781         implementation.
3782
3783 2004-12-12  John Luke  <john.luke@gmail.com>
3784
3785         * driver.cs (AddArgs): take -- into account when
3786         adding arguments, fixes bug 65710 
3787
3788 2004-12-12  Martin Baulig  <martin@ximian.com>
3789
3790         * expression.cs (Unary.TryReduceNegative): Added support for
3791         SByteConstant and ByteConstant.
3792         (Unary.Reduce): Check error values from TryReduceNegative().
3793
3794 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3795
3796         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3797         and report exception as error 182.
3798
3799 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3800
3801         * driver.cs (Main): Fix message when there are warnings.
3802
3803 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3804
3805         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3806
3807 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3808
3809         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3810         Reduced number of warnings.
3811         
3812         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3813
3814 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3815
3816         * driver.cs: Removed message.
3817
3818         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3819
3820 2004-12-08    <vargaz@freemail.hu>
3821
3822         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3823
3824 2004-12-08  Martin Baulig  <martin@ximian.com>
3825
3826         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3827         instead of a CS3002 for properties and indexer.
3828
3829 2004-12-08  Martin Baulig  <martin@ximian.com>
3830
3831         * decl.cs (MemberName.ToString): Make this work again.
3832
3833 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3834
3835         * attribute.cs (Resolve): Add error 591 detection.
3836
3837         * class.cs (FieldMember.Define): Add error 1547 detection.
3838         (Indexer.Define): Add error 620 detection.
3839         (Operator.Define): Add error 590 detection.
3840
3841         * ecore.cs: Missing argument for error 79.
3842
3843         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3844         detection.
3845
3846 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3847
3848         Fix #70106
3849         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3850         only.
3851
3852 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3853
3854         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3855           Some operator comments were suppressed.
3856         * doc.cs : Implicit/explicit operator name in doc comments are like
3857           "op_Explicit(type)~returnType", so added suffix handling.
3858
3859 2004-12-07  Martin Baulig  <martin@ximian.com>
3860
3861         * decl.cs
3862         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3863         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3864         (DeclSpace.ec): New protected field; store the EmitContext here.
3865         (DeclSpace.EmitContext): New public property; moved here from
3866         `TypeContainer'.
3867         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3868         EmitContext.
3869
3870         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3871         (Enum.Emit): Don't create a new EmitContext.
3872
3873         * delegate.cs (Delegate.DefineType): Always create the
3874         EmitContext.
3875
3876         * iterators.cs (Iterators.DefineIterator): Create a new
3877         EmitContext and store it in `ec'.
3878
3879 2004-08-24  Martin Baulig  <martin@ximian.com>
3880
3881         * typemanager.cs
3882         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3883         this for accessibility checks.
3884         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3885         IsNestedFamilyAccessible.
3886         (TypeManager.IsSubclassOf): New method, do what the name actually
3887         says.   
3888
3889 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3890
3891         Fix crash on cs0657-17.cs.
3892         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3893         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3894         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3895         the case where the NamespaceEntry gets overwritten.
3896
3897 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3898
3899         Fixed #69195, #56821
3900         * ecore.cs (ResolveBoolean): Tiny refactoring.
3901
3902         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3903         of right expression resolving when left is false constant and
3904         operator is LogicalAnd OR true constant and operator is LogicalOr.
3905
3906         * statement.cs (ResolveUnreachable): Always reports warning.
3907
3908 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3909
3910         * class.cs: Distinguish between 1721 and 1722 (just a little help
3911         for the programmer).
3912
3913 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3914
3915         * delegate.cs: Only allow this on new versions of the language. 
3916
3917 2004-12-02  Duncan Mak  <duncan@ximian.com>
3918
3919         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3920         Expression class.
3921         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3922         here as a static method. Take an additional bool out parameter
3923         `must_do_cs1540_check' for signaling to InstanceResolve.
3924         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3925         member field from PropertyExpr class and made it an argument of
3926         the method instead.
3927         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3928         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3929         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3930         and `remove_accessor' as well as InstanceResolve: report CS0122
3931         where applicable.
3932
3933         Fixes #70129.
3934
3935 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3936
3937         Fix test-327.cs, test-328.cs, and put in early infrastructure
3938         for eventually fixing #52697.
3939         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3940         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3941         from other methods.
3942         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3943         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3944         (VerifyUsing, error246): Update.
3945         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3946         'NamespaceEntry.LookupNamespaceOrType'.
3947
3948 2004-12-03  Martin Baulig  <martin@ximian.com>
3949
3950         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3951         method as our child, call AnonymousMethod.Compatible() on it.
3952
3953 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3954
3955         Disable XML documentation support in 'basic' profile.
3956         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
3957         Redirect XmlElement to System.Object.
3958         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
3959         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
3960         * mcs.exe.sources: Add doc-bootstrap.cs.
3961         * doc-bootstrap.cs: New file.  Contains empty stub implementation
3962         of doc.cs.
3963
3964 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3965
3966         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3967           comments are allowed.
3968
3969 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3970
3971         * delegate.cs: Add checks for subtypes in paramaters and return values
3972         in VerifyMethod () to add support for Covariance/Contravariance
3973         in delegates.
3974         
3975 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3976
3977         * report.cs: Remove extra closing parenthesis.
3978
3979         * convert.cs (Error_CannotImplicitConversion): If the name of the
3980         types are the same, provide some extra information.
3981
3982         * class.cs (FieldBase): Use an unused bit field from the field to
3983         encode the `has_offset' property from the FieldMember.  This saves
3984         a couple of Ks on bootstrap compilation.
3985
3986         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3987         method as our child, return the AnonymousMethod resolved
3988         expression.
3989
3990         * expression.cs (New.DoResolve): Allow return values from
3991         NewDelegate to also include AnonymousMethods.
3992
3993         Fixes #70150.
3994
3995 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3996
3997         Fix bug #70102
3998         * attribute.cs (Resolve): Improved implementation of params
3999         attribute arguments.
4000
4001         * support.cs (ParameterData): Add HasParams to be faster.
4002
4003 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4004
4005         all things are for /doc support:
4006
4007         * doc.cs: new file that supports XML documentation generation.
4008         * mcs.exe.sources: added doc.cs.
4009         * driver.cs:
4010           Handle /doc command line option.
4011           Report error 2006 instead of 5 for missing file name for /doc.
4012           Generate XML documentation when required, after type resolution.
4013         * cs-tokenizer.cs:
4014           Added support for picking up documentation (/// and /** ... */),
4015           including a new XmlCommentState enumeration.
4016         * cs-parser.jay:
4017           Added lines to fill Documentation element for field, constant,
4018           property, indexer, method, constructor, destructor, operator, event
4019           and class, struct, interface, delegate, enum.
4020           Added lines to warn incorrect comment.
4021         * rootcontext.cs :
4022           Added Documentation field (passed only when /doc was specified).
4023         * decl.cs:
4024           Added DocComment, DocCommentHeader, GenerateDocComment() and
4025           OnGenerateDocComment() and some supporting private members for
4026           /doc feature to MemberCore.
4027         * class.cs:
4028           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4029         * delegate.cs:
4030           Added overriden DocCommentHeader.
4031         * enum.cs:
4032           Added overriden DocCommentHeader and GenerateDocComment().
4033
4034 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4035
4036         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4037         unwrapping the enumeration values, chain to
4038         DoConstantNumericPromotions again, so we can promote things to the
4039         fundamental types (takes care of enums that are bytes, sbytes).
4040
4041         Fixes bug #62054.
4042
4043 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4044
4045         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4046         Fix long-standing bug in type-lookup.  Use FindType instead of
4047         LookupType when ec.ResolvingTypeTree.
4048         (Attribute.ResolveType, Attribute.Resolve)
4049         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4050         Update to changes.
4051         (Attributes.Search): Remove internal version.  Update.
4052         (Attributes.SearchMulti): Update.
4053         (Attributes.GetClsCompliantAttribute): Remove.
4054         (Attributes.GetIndexerNameAttribute): Remove.
4055         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4056         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4057         * class.cs (Indexer.Define): Likewise.
4058
4059 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4060
4061         Fix bug #68790
4062         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4063         MarshallByReference members access.
4064
4065         * expression.cs: Use CheckMarshallByRefAccess;
4066         Better error CS0197 message.
4067
4068         * report.cs: Print whole related error message.
4069
4070 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4071
4072         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4073         the current directory to help debugging.
4074
4075 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4076
4077         * class (GetClassBases): Better error 60 report.
4078         (EventProperty): Disabled warning 67 detection.
4079
4080 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4081
4082         Fix bug #60324
4083         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4084
4085         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4086         precise values.
4087
4088 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4089
4090         Fix bug #49488
4091         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4092
4093         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4094
4095 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4096
4097         * attribute.cs (Attribute.Resolve): Refine error reporting and
4098         report a cs0117 if the identifier does not exist, to distinguish
4099         from 0617 which is a miss-use of the actual identifier.
4100
4101         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4102         between cs0070 and cs0079.
4103
4104         * class.cs (MemberBase.DoDefine): When reporting a wrong
4105         accessibility level, we use MethodCore to compare instead of
4106         Method (this was a regression in some refactoring effort).
4107
4108         So now we correctly report cs0056 again.
4109
4110         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4111         testing the target_type (which was known to be object_type) and
4112         not the source type (which is anonymous_method).
4113
4114         Fixed reporting of error cs1660.
4115
4116         * expression.cs (UserCast.Source): Expose the underlying cast.
4117
4118         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4119         allowed types to find a match to int32 first (most common).
4120
4121         In addition, it ignores any ImplicitUserConversions that did an
4122         internal implicit conversion (as the switch statement allows only
4123         one integral conversion to exist).
4124
4125         * class.cs (PartialContainer.Create): rename `name' to
4126         `member_name' for clarity.  Then replace the string calls with a
4127         call to MemberName.GetPartialName, as now using
4128         MemberName.ToString is an error (this is due to the side effects
4129         it had, that were fixed in the past).
4130
4131         This will restore the error reporting on a number of partial class
4132         errors that were missusing this (and getting an exception as a
4133         results, which is now just a plain textual warning, because
4134         yyparse debug output would crash otherwise).
4135
4136 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4137
4138         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4139
4140 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4141
4142         * rootcontext.cs (LookupType): Make sure to cache lookups that
4143         don't give us a negative result. This saves about 5% of corlib
4144         compilation time.
4145
4146 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4147
4148         * report.cs (AbstractMessage.Print): messages are sent to stderr
4149
4150         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4151         non-interface in the list of interfaces (at this point, either
4152         parent was properly set, or a base class is being listed in the
4153         interfaces section).
4154
4155         This flags error 1722, and resolves the crash from bug 69259.
4156
4157 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4158
4159         * statement.cs (Using.EmitExpressionFinally): make this work right
4160         for valuetypes. Fixes 69926.
4161
4162 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4163
4164         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4165         converted to an enum" here, before we try to change the underlying
4166         type.  This code exists, but it is a different code path than the
4167         one used while encoding constants.
4168
4169         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4170         old bug: when converting from the null literal to a pointer,
4171         return an EmptyCast, not the NullLiteral.
4172
4173         This fixes #69921, the recent null_type changes probably made this
4174         bug more prominent.
4175
4176         (ImplicitReferenceConversionExists): In addition, resynchronized
4177         the code here, so it matches the same code in
4178         ImplicitReferenceConversionExists for the `from any class-type S
4179         to any interface-type T'.
4180         
4181
4182 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4183
4184         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4185
4186 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4187
4188         * cs-parser.jay: Use verbosity accordingly. 
4189
4190 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4191
4192         * expression.cs (Unary.ResolveOperator): Do not report warning;
4193         AddressOf reads from variable.
4194         
4195         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4196
4197 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4198
4199         Fix bug #69462
4200
4201         * attribute.cs (Attributable): Removed CheckTargets.
4202         (Attributes.Emit): Explicit attribute targets are tested here.
4203
4204         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4205         not enabled for interfaces.
4206
4207         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4208         (GetAssemblyName): Ouch next bug there.
4209
4210 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4211
4212         * expression.cs: Error 275 added.
4213         
4214 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4215
4216         Fix bug #69177 (Implemented decimal constant support)
4217
4218         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4219         (BinaryFold): Add DecimalConstant.
4220
4221         * const.cs (Define): Decimal constant 
4222         (is not constant.
4223         (ChangeType): Add decimal type handling.
4224         (LookupConstantValue): Don't set value for decimal type but
4225         emit DecimalConstantAttribute. Needed for constant optimization.
4226
4227         * constant.cs (ToDecimal): New method.
4228         (ConvertToDecimal): New method.
4229         (IntConstant): Implemented ConvertToDecimal.
4230         (DecimalConstant.Emit): Emit optimized version for decimals in
4231         int range.
4232
4233         * expression.cs (ResolveOperator): Changed order of constant
4234         reduction to work correctly with native types which have
4235         overloaded operators.
4236         (ResolveMemberAccess): Extract constant value from attribute
4237         for decimal type.
4238
4239         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4240
4241         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4242         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4243         (ChangeType): Decimal is special.
4244         (TypeToCoreType): Add decimal type.
4245
4246 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4247
4248         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4249         decimal types.
4250
4251 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4254         test cs1667-5.cs.
4255
4256 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4257
4258         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4259
4260         * pending.cs (PendingImplementation): Grab only interfaces.
4261
4262 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4263
4264         * statement.cs (ForeachHelperMethods): Add location member and
4265         error 202 detection.
4266
4267 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4268
4269         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4270         automatically handled by executable.make.
4271         (PROGRAM): Make profile-specific.
4272
4273 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4274
4275         * expression.cs (DoResolveBase): Fixed wrong warning for out
4276         variables.
4277
4278 2004-11-18  Martin Baulig  <martin@ximian.com>
4279
4280         Merged latest changes into gmcs.  Please keep this comment in
4281         here, it makes it easier for me to see what changed in MCS since
4282         the last time I merged.
4283
4284 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4285
4286         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4287         (TypeHandle.GetMemberCache): New.
4288         (TypeHandle.TypeHandle): Update.
4289         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4290         (TypeManager.LookupParentInterfacesCache):
4291         Rename from LookupInterfaceCache.  Optimize slightly.
4292         (TypeManager.MemberLookup_FindMembers): Update.
4293         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4294         multi-type variant.
4295         (AddCacheContents): Rename from AddHashtable.
4296         * class.cs (TypeContainer.parent_container): Remove.
4297         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4298         (TypeContainer.DoDefineMembers): Don't initialize it.
4299         Update to name changes.
4300         
4301 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4302
4303         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4304         that factors the code to check access modifiers on override.  
4305
4306         (PropertyBase): Use the code here.
4307
4308         Patch from Lluis S'anchez, fixes bug #69361.
4309
4310 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4311
4312         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4313         routine that is used to report the use of a captured variable
4314         whose address has been taken.
4315
4316         There are two checks: one when variables are being captured and
4317         the other check is when the address of a variable is taken. 
4318         
4319         (because an anonymous methods might be resolved before *or* after
4320         the address has been taken) and 
4321
4322         * expression.cs (Conditional.DoResolve): Remove the special
4323         casing that Martin added to trueExpr and falseExpr being both
4324         NullLiteral.  We get the right behavior now just by introducing
4325         the null_type into the compiler. 
4326
4327         * convert.cs (ExplicitConversion): Change the code to use
4328         null_type instead of testing `expr is NullLiteral'.
4329         (ImplicitConversionStandard): use null_type too.
4330         (ImplicitReferenceConversionExists): use null_type too.
4331         (ImplicitReferenceConversion): use null_type too.
4332
4333         * literal.cs: The type of `NullLiteral' is now null_type instead
4334         of object_type. 
4335         (Resolve): Set the type here.
4336
4337         * typemanager.cs: Introduce null_type.
4338
4339 2004-11-17  Martin Baulig  <martin@ximian.com>
4340
4341         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4342         direction, like FindMembers() does.  Fixes #69546, testcase is in
4343         test-315.cs.    
4344
4345 2004-11-16  Martin Baulig  <martin@ximian.com>
4346
4347         This is based on a patch from Marek Safar, see bug #69082.
4348         Fixes bugs #63705 and #67130.
4349
4350         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4351         method; create a MemberCache for an interface type and cache the
4352         result.
4353
4354         * decl.cs (IMemberContainer.ParentContainer): Removed.
4355         (IMemberContainer.ParentCache): New property.
4356         (MemberCache.SetupCacheForInterface): Removed.
4357         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4358         to create a cache for an interface's "parent".
4359
4360         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4361         interfaces too.
4362
4363 2004-11-16  Martin Baulig  <martin@ximian.com>
4364
4365         Merged back from gmcs; these changes already went into gmcs a
4366         couple of weeks ago.
4367
4368         * typemanager.cs
4369         (TypeManager.AddUserType): Removed the `ifaces' argument.
4370         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4371         `TypeExpr []'.
4372         (TypeManager.AddUserInterface): Removed.
4373         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4374         `TypeExpr []'.
4375         (TypeManager.GetInterfaces): Likewise.
4376         (TypeManager.GetExplicitInterfaces): Likewise.
4377
4378         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4379
4380         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4381         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4382
4383 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4384
4385         * statement.cs: Avoid adding bools to a hashtable.
4386
4387 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4388
4389         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4390         calling an unsafe method from a safe location.
4391
4392 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4393
4394         Fix #69167
4395         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4396
4397 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4398
4399         * namespace.cs (VerifyUsing): use GetPartialName instead of
4400         ToString. 
4401
4402 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4403
4404         * statement.cs (Return.Resolve): Fix regression in typo: if
4405         `in_exc', we have to request a NeedReturnLabel, this was a typo
4406         introduced in the anonymous method check-in.  Fixes #69131.
4407
4408         * Indexers were using the ShortName when defining themselves,
4409         causing a regression in the compiler bootstrap when applying the
4410         patch from 2004-11-02 (first part), now they use their full name
4411         and the bug is gone.
4412
4413 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4414
4415         * driver.cs: Strip the path from the names of embedded resources. Fixes
4416         #68519.
4417
4418 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4419
4420         Fix error message regression: cs0104-2.cs.
4421         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4422         (AliasEntry.Resolve): Update.
4423         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4424         'silent' flag.
4425         (RootContext.LookupType): Update.
4426
4427 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4428
4429         * cs-parser.jay: Add support for handling accessor modifiers
4430         * class: Add support port accessor modifiers and error checking,
4431         define PropertyMethod.Define as virtual (not abstract anymore)
4432         * ecore.cs: Add checking for proeprties access with access modifiers
4433         * iterators.cs: Modify Accessor constructor call based in the modified
4434         constructor
4435 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4436
4437         * expression.cs (StringConcat): Handle being called twice,
4438         as when we have a concat in a field init with more than two
4439         ctors in the class
4440
4441 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4442
4443         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4444         special case explicit implementations, we should always produce
4445         the .property or .event declaration.
4446         
4447         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4448         since it will not return correct data if people use this
4449         unresolved in the presence of using statements (see test-313).
4450
4451         * class.cs (MethodData.Define): If we are an explicit interface
4452         implementation, set the method name to the full name of the
4453         interface plus the name of the method.  
4454
4455         Notice that using the method.MethodName.GetFullName() does not
4456         work, as it will only contain the name as declared on the source
4457         file (it can be a shorthand in the presence of using statements)
4458         and not the fully qualifed type name, for example:
4459
4460         using System;
4461
4462         class D : ICloneable {
4463                 object ICloneable.Clone ()  {
4464                 }
4465         }
4466
4467         Would produce a method called `ICloneable.Clone' instead of
4468         `System.ICloneable.Clone'.
4469
4470         * namespace.cs (Alias.Resolve): Use GetPartialName.
4471         
4472 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4473
4474         * cs-parser.jay: Add error 1055 report.
4475
4476 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4477
4478         * assign.cs (Assign.DoResolve): Only do the transform of
4479         assignment into a New if the types are compatible, if not, fall
4480         through and let the implicit code deal with the errors and with
4481         the necessary conversions. 
4482
4483 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4484
4485         * cs-parser.jay: Add error 1031 report.
4486
4487         * cs-tokenizer.cs: Add location for error 1038.
4488
4489 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4490
4491         * cs-parser.jay: Add error 1016 report.
4492
4493 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4494
4495         * cs-parser.jay: Add errors 1575,1611 report.
4496
4497 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4498
4499         * cs-parser.jay: Add error 1001 report.
4500
4501 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4502
4503         Fix #68850
4504         * attribute.cs (GetMarshal): Add method argument for
4505         caller identification.
4506
4507         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4508         agument for GetMarshal and RuntimeMissingSupport.
4509
4510 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4511
4512         * attribute.cs (ExtractSecurityPermissionSet): Removed
4513         TypeManager.code_access_permission_type.
4514
4515         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4516
4517 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4518
4519         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4520         for obsolete use of a variable here.   Fixes regression on errors
4521         cs0619-25 and cs0619-26.
4522
4523 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4524
4525         Fix #62358, implemented security attribute encoding.
4526
4527         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4528         Tests permitted SecurityAction for assembly or other types.
4529         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4530         data from SecurityPermissionAttribute to PermisionSet class.
4531
4532         * class.cs (ApplyAttributeBuilder): Added special handling
4533         for System.Security.Permissions.SecurityAttribute based types.
4534
4535         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4536         special handling for System.Security.Permissions.SecurityAttribute
4537         based types.
4538
4539         * enum.cs (ApplyAttributeBuilder): Added special handling
4540         for System.Security.Permissions.SecurityAttribute based types.
4541
4542         * parameter.cs (ApplyAttributeBuilder): Added special handling
4543         for System.Security.Permissions.SecurityAttribute based types.
4544
4545         * rootcontext.cs: Next 2 core types.
4546
4547         * typemanager.cs (TypeManager.security_permission_attr_type):
4548         Built in type for the SecurityPermission Attribute.
4549         (code_access_permission_type): Build in type.
4550
4551 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4552
4553         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4554         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4555         all of this information into
4556         EmitContext.EmitCapturedVariableInstance.
4557         
4558         * codegen.cs (EmitCapturedVariableInstance): move here the
4559         funcionality of emitting an ldarg.0 in the presence of a
4560         remapping.   This centralizes the instance emit code.
4561
4562         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4563         then emit a load of this: it means that we have reached the
4564         topmost ScopeInfo: the one that contains the pointer to the
4565         instance of the class hosting the anonymous method.
4566
4567         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4568         captures to the topmost CaptureContext.
4569
4570 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4571
4572         * expression.cs (LocalVariableReference): Move the knowledge about
4573         the iterators into codegen's EmitCapturedVariableInstance.
4574
4575 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4576
4577         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4578         all code paths return a value from an anonymous method (it is the
4579         same as the 161 error, but for anonymous methods).
4580
4581 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4582
4583         The introduction of anonymous methods in the compiler changed
4584         various ways of doing things in the compiler.  The most
4585         significant one is the hard split between the resolution phase
4586         and the emission phases of the compiler.
4587
4588         For instance, routines that referenced local variables no
4589         longer can safely create temporary variables during the
4590         resolution phase: they must do so from the emission phase,
4591         since the variable might have been "captured", hence access to
4592         it can not be done with the local-variable operations from the runtime.
4593         
4594         * statement.cs 
4595
4596         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4597         is a toplevel block.
4598
4599         (ToplevelBlock): A new kind of Block, these are the blocks that
4600         are created by the parser for all toplevel method bodies.  These
4601         include methods, accessors and anonymous methods.
4602
4603         These contain some extra information not found in regular blocks:
4604         A pointer to an optional CaptureContext (for tracking captured
4605         local variables and parameters).  A pointer to the parent
4606         ToplevelBlock.
4607         
4608         (Return.Resolve): Catch missmatches when returning a value from an
4609         anonymous method (error 1662).
4610         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4611         phase.
4612
4613         (Break.Resolve): ditto.
4614
4615         (SwitchLabel): instead of defining the labels during the
4616         resolution phase, we now turned the public ILLabel and ILLabelCode
4617         labels into methods called GetILLabelCode() and GetILLabel() that
4618         only define the label during the Emit phase.
4619
4620         (GotoCase): Track the SwitchLabel instead of the computed label
4621         (its contained therein).  Emit the code by using
4622         SwitchLabel.GetILLabelCode ().
4623
4624         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4625         whether the Local has been captured or not.
4626
4627         (LocalInfo.IsCaptured): New property, used to tell whether the
4628         local has been captured.
4629         
4630         * anonymous.cs: Vastly updated to contain the anonymous method
4631         support.
4632
4633         The main classes here are: CaptureContext which tracks any
4634         captured information for a toplevel block and ScopeInfo used to
4635         track the activation frames for various local variables.   
4636
4637         Each toplevel block has an optional capture context associated
4638         with it.  When a method contains an anonymous method both the
4639         toplevel method and the anonymous method will create a capture
4640         context.   When variables or parameters are captured, they are
4641         recorded on the CaptureContext that owns them, for example:
4642
4643         void Demo () {
4644              int a;
4645              MyDelegate d = delegate {
4646                  a = 1;
4647              }
4648         }
4649
4650         Here `a' will be recorded as captured on the toplevel
4651         CapturedContext, the inner captured context will not have anything
4652         (it will only have data if local variables or parameters from it
4653         are captured in a nested anonymous method.
4654
4655         The ScopeInfo is used to track the activation frames for local
4656         variables, for example:
4657
4658         for (int i = 0; i < 10; i++)
4659                 for (int j = 0; j < 10; j++){
4660                    MyDelegate d = delegate {
4661                         call (i, j);
4662                    }
4663                 }
4664
4665         At runtime this captures a single captured variable `i', but it
4666         captures 10 different versions of the variable `j'.  The variable
4667         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4668         recorded on a child.  
4669
4670         The toplevel ScopeInfo will also track information like the `this'
4671         pointer if instance variables were referenced (this is necessary
4672         as the anonymous method lives inside a nested class in the host
4673         type of the method). 
4674
4675         (AnonymousMethod): Expanded to track the Toplevel, implement
4676         `AnonymousMethod.Compatible' to tell whether an anonymous method
4677         can be converted to a target delegate type. 
4678
4679         The routine now also produces the anonymous method content
4680
4681         (AnonymousDelegate): A helper class that derives from
4682         DelegateCreation, this is used to generate the code necessary to
4683         produce the delegate for the anonymous method that was created. 
4684
4685         * assign.cs: API adjustments for new changes in
4686         Convert.ImplicitStandardConversionExists.
4687
4688         * class.cs: Adjustments to cope with the fact that now toplevel
4689         blocks are of type `ToplevelBlock'. 
4690
4691         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4692         insteda of standard blocks.
4693
4694         Flag errors if params arguments are passed to anonymous methods.
4695
4696         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4697         `CurrentAnonymousMethod' which points to the current Anonymous
4698         Method.  The variable points to the AnonymousMethod class that
4699         holds the code being compiled.  It is set in the new EmitContext
4700         created for the anonymous method.
4701
4702         (EmitContext.Phase): Introduce a variable and an enumeration to
4703         assist in enforcing some rules about when and where we are allowed
4704         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4705         only one that enfonces this right now).
4706
4707         (EmitContext.HaveCaptureInfo): new helper method that returns
4708         whether we have a CapturedContext initialized.
4709
4710         (EmitContext.CaptureVariable): New method used to register that a
4711         LocalInfo must be flagged for capturing. 
4712
4713         (EmitContext.CapturedParameter): New method used to register that a
4714         parameters must be flagged for capturing. 
4715         
4716         (EmitContext.CapturedField): New method used to register that a
4717         field must be flagged for capturing. 
4718
4719         (EmitContext.HaveCapturedVariables,
4720         EmitContext.HaveCapturedFields): Return whether there are captured
4721         variables or fields. 
4722
4723         (EmitContext.EmitMethodHostInstance): This is used to emit the
4724         instance for the anonymous method.  The instance might be null
4725         (static methods), this (for anonymous methods that capture nothing
4726         and happen to live side-by-side with the current method body) or a
4727         more complicated expression if the method has a CaptureContext.
4728
4729         (EmitContext.EmitTopBlock): Routine that drives the emission of
4730         code: it will first resolve the top block, then emit any metadata
4731         and then emit the code.  The split is done so that we can extract
4732         any anonymous methods and flag any captured variables/parameters.
4733         
4734         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4735         during this phase, the ILGenerator should not be used as labels
4736         and local variables declared here might not be accessible to any
4737         code that is part of an anonymous method.  
4738
4739         Exceptions to this include the temporary variables that are
4740         created by some statements internally for holding temporary
4741         variables. 
4742         
4743         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4744         metadata for a cb
4745
4746         (EmitContext.TemporaryReturn): This method is typically called
4747         from the Emit phase, and its the only place where we allow the
4748         ReturnLabel to be defined other than the EmitMeta.  The reason is
4749         that otherwise we would have to duplicate a lot of logic in the
4750         Resolve phases of various methods that today is on the Emit
4751         phase. 
4752
4753         (EmitContext.NeedReturnLabel): This no longer creates the label,
4754         as the ILGenerator is not valid during the resolve phase.
4755
4756         (EmitContext.EmitThis): Extended the knowledge in this class to
4757         work in anonymous methods in addition to iterators. 
4758
4759         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4760         code is necessary on the stack to access the instance to a local
4761         variable (the variable will be accessed as a field).
4762
4763         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4764         EmitContext.EmitAddressOfParameter): Routines to support
4765         parameters (not completed at this point). 
4766         
4767         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4768         will also remove the parameters.
4769
4770         * convert.cs (Convert): Define a `ConstantEC' which points to a
4771         null.  This is just to prefity some code that uses
4772         ImplicitStandardConversion code and do not have an EmitContext
4773         handy.
4774
4775         The idea is to flag explicitly that at that point in time, it is
4776         known that the conversion will not trigger the delegate checking
4777         code in implicit conversions (which requires a valid
4778         EmitContext). 
4779
4780         Everywhere: pass new EmitContext parameter since
4781         ImplicitStandardConversionExists now requires it to check for
4782         anonymous method conversions. 
4783
4784         (Convert.ImplicitStandardConversionExists): If the type of an
4785         expression is the anonymous_method_type, and the type is a
4786         delegate, we invoke the AnonymousMethod.Compatible method to check
4787         whether an implicit conversion is possible. 
4788
4789         (Convert.ImplicitConversionStandard): Only do implicit method
4790         group conversions if the language level is not ISO_1.
4791
4792         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4793         MethodInfo for the Invoke method.  used by Delegate and
4794         AnonymousDelegate.
4795
4796         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4797         method conversions if the target type is a delegate.
4798
4799         Removed extra debugging nops.
4800
4801         (LocalVariableReference): Turn the `local_info' into a public
4802         field. 
4803
4804         Add `prepared' field, the same hack used for FieldExprs to cope
4805         with composed assignments, as Local variables do not necessarily
4806         operate purely on the stack as they used to: they can be captured
4807         fields. 
4808
4809         Add `temp' for a temporary result, like fields.
4810
4811         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4812
4813         It now copes with Local variables that are captured and emits the
4814         proper instance variable to load it from a field in the captured
4815         case. 
4816
4817         (ParameterReference.DoResolveBase): During the resolve phase,
4818         capture parameters if we are in an anonymous method.
4819
4820         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4821         anonymous method, use the EmitContext helper routines to emit the
4822         parameter reference.
4823
4824         * iterators.cs: Set RemapToProxy to true/false during the
4825         EmitDispose class.
4826
4827         * parameters.cs (GetParameterByName): New helper method. 
4828
4829         * typemanager.cs (anonymous_method_type) a new type that
4830         represents an anonyous method.  This is always an internal type,
4831         used as a fencepost to test against the anonymous-methodness of an
4832         expression. 
4833         
4834 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4835
4836         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4837         561 report.
4838         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4839
4840 2004-10-18  Martin Baulig  <martin@ximian.com>
4841
4842         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4843         `Type' directly, but call ResolveType() on it.
4844         (Catch.Resolve): Likewise.
4845         (Foreach.Resolve): Likewise.
4846
4847 2004-10-18  Martin Baulig  <martin@ximian.com>
4848
4849         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4850         `Type' directly, but call ResolveType() on it.
4851         (Probe.DoResolve): Likewise.
4852         (ArrayCreation.LookupType): Likewise.
4853         (TypeOf.DoResolve): Likewise.
4854         (SizeOf.DoResolve): Likewise.
4855
4856 2004-10-18  Martin Baulig  <martin@ximian.com>
4857
4858         * expression.cs (Invocation.BetterFunction): Put back
4859         TypeManager.TypeToCoreType().
4860
4861 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4862
4863         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4864         the ResolveType.
4865
4866 2004-10-18  Martin Baulig  <martin@ximian.com>
4867
4868         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
4869         `Type' directly, but call ResolveType() on it.
4870
4871 2004-10-18  Martin Baulig  <martin@ximian.com>
4872
4873         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4874         `Type' directly, but call ResolveType() on it.
4875         (MemberBase.DoDefine): Likewise.
4876
4877         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4878         `Type' directly, but call ResolveType() on it.
4879         (ComposedCast.DoResolveAsTypeStep): Likewise.
4880
4881         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4882         `Type' directly, but call ResolveType() on it.
4883
4884 2004-10-17  John Luke  <john.luke@gmail.com>
4885
4886         * class.cs (Operator.GetSignatureForError): use CSharpName
4887
4888         * parameter.cs (Parameter.GetSignatureForError): Returns
4889         correct name even if was not defined.
4890
4891 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4892
4893         Fix #65816.
4894         * class.cs (TypeContainer.EmitContext): New property.
4895         (DefineNestedTypes): Create an emitcontext for each part.
4896         (MethodCore.DoDefineParameters): Use container's emitcontext.
4897         Pass type array to InternalParameters.
4898         (MemberBase.DoDefine): Use container's emitcontext.
4899         (FieldMember.Define): Likewise.
4900         (Event.Define): Likewise.
4901         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4902         Pass type array to InternalParameters.
4903         (SetIndexerMethod.GetParameterInfo): Likewise.
4904         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4905         * delegate.cs (Define): Pass emitcontext to
4906         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4907         array to InternalParameters.
4908         * expression.cs (ParameterReference.DoResolveBase): Pass
4909         emitcontext to GetParameterInfo.
4910         (ComposedCast.DoResolveAsTypeStep): Remove check on
4911         ec.ResolvingTypeTree.
4912         * parameter.cs (Parameter.Resolve): Change argument to
4913         EmitContext.  Use ResolveAsTypeTerminal.
4914         (Parameter.GetSignature): Change argument to EmitContext.
4915         (Parameters.ComputeSignature): Likewise.
4916         (Parameters.ComputeParameterTypes): Likewise.
4917         (Parameters.GetParameterInfo): Likewise.
4918         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4919         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4920         * support.cs (InternalParameters..ctor): Remove variant that takes
4921         a DeclSpace.
4922         * typemanager.cs (system_intptr_expr): New.
4923         (InitExpressionTypes): Initialize it.
4924
4925 2004-10-12  Chris Toshok  <toshok@ximian.com>
4926
4927         * cs-parser.jay: fix location for try_statement and catch_clause.
4928
4929 2004-10-11  Martin Baulig  <martin@ximian.com>
4930
4931         * report.cs: Don't make --fatal abort on warnings, we have
4932         -warnaserror for that.
4933
4934 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4935
4936         More DeclSpace.ResolveType avoidance.
4937         * decl.cs (MemberCore.InUnsafe): New property.
4938         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4939         with newly created EmitContext.
4940         (FieldMember.Define): Likewise.
4941         * delegate.cs (Delegate.Define): Likewise.
4942         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4943         only if normal name-lookup fails.
4944         (TypeExpr.DoResolve): Enable error-checking.
4945         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4946         (SizeOf.DoResolve): Likewise.
4947         (ComposedCast.DoResolveAsTypeStep): Likewise.
4948         (StackAlloc.DoResolve): Likewise.
4949         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4950         (Block.Unsafe): New property.
4951         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4952         (Unsafe): Set 'unsafe' flag of contained block.
4953         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4954         (Fixed.Resolve): Likewise.
4955         (Catch.Resolve): Likewise.
4956         (Using.ResolveLocalVariableDecls): Likewise.
4957         (Foreach.Resolve): Likewise.
4958
4959 2004-10-05  John Luke <john.luke@gmail.com>
4960
4961         * cs-parser.jay: add location to error CS0175
4962
4963 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4964
4965         * ecore.cs (Expression.Constantity): Add support for turning null
4966         into a constant.
4967
4968         * const.cs (Const.Define): Allow constants to be reference types
4969         as long as the value is Null.
4970
4971 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4972
4973         * namespace.cs (NamespaceEntry.Using): No matter which warning
4974         level is set, check if this namespace name has already been added.
4975
4976 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4977
4978         * expression.cs: reftype [!=]= null should always use br[true,false].
4979         # 67410
4980
4981 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4982
4983         Fix #67108
4984         * attribute.cs: Enum conversion moved to 
4985         GetAttributeArgumentExpression to be applied to the all
4986         expressions.
4987
4988 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4989
4990         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4991         * class.c (TypeContainer.DefineType): Flag error if
4992         base types aren't accessible due to access permissions.
4993         * decl.cs (DeclSpace.ResolveType): Move logic to
4994         Expression.ResolveAsTypeTerminal.
4995         (DeclSpace.ResolveTypeExpr): Thin layer over
4996         Expression.ResolveAsTypeTerminal.
4997         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4998         Refactor code into NestedAccess.  Use it.
4999         (DeclSpace.NestedAccess): New.
5000         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5001         argument to silence errors.  Check access permissions.
5002         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5003         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5004         (Cast.DoResolve): Likewise.
5005         (New.DoResolve): Likewise.
5006         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5007         (TypeOf.DoResolve): Likewise.
5008
5009         * expression.cs (Invocation.BetterConversion): Return the Type of
5010         the better conversion.  Implement section 14.4.2.3 more faithfully.
5011         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5012         section 14.4.2.2 explicit.
5013         (Invocation.OverloadResolve): Update.
5014         (Invocation): Remove is_base field.
5015         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5016         (Invocation.Emit): Likewise.
5017
5018 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5019
5020         * README: Update to changes.
5021
5022 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5023
5024         * cs-parser.jay: Reverted 642 warning fix.
5025
5026 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5027
5028         Fix bug #66615
5029         * decl.cs (FindMemberWithSameName): Indexer can have more than
5030         1 argument.
5031
5032 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5033
5034         * expression.cs (LocalVariableReference.DoResolveLValue):
5035         Do not report warning 219 for out values.
5036         (EmptyExpression.Null): New member to avoid extra allocations.
5037
5038 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5039
5040         * cs-parser.jay: Fix wrong warning 642 report.
5041
5042         * cs-tokenizer.cs (CheckNextToken): New helper;
5043         Inspect next character if is same as expected.
5044
5045 2004-09-23  Martin Baulig  <martin@ximian.com>
5046
5047         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5048         (Convert.ImplicitReferenceConversionExists): Likewise.
5049
5050 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5051
5052         * class.cs (Operator.Define): Add error 448 and 559 report.
5053
5054 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * class.cs (MemberBase.IsTypePermitted): New protected
5057         method for checking error CS0610.
5058
5059 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5060
5061         * class.cs (TypeContainer.HasExplicitLayout): New property
5062         Returns whether container has StructLayout attribute set Explicit.
5063         (FieldMember): New abstract class for consts and fields.
5064         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5065         (Field): Reuse FieldMember.
5066
5067         * const.cs (Const): Reuse FieldMember.
5068
5069         * rootcontext.cs: EmitConstants call moved to class.
5070
5071 2004-09-22  Martin Baulig  <martin@ximian.com>
5072
5073         Thanks to Peter Sestoft for this bug report.
5074
5075         * expression.cs (Conditional): If both the `trueExpr' and the
5076         `falseExpr' is a NullLiteral, return a NullLiteral.
5077
5078 2004-09-22  Martin Baulig  <martin@ximian.com>
5079
5080         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5081         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5082         for the "get_Current" call.
5083
5084 2004-09-22  Martin Baulig  <martin@ximian.com>
5085
5086         Marek and me just fixed one of our oldest bugs: #28562 :-)
5087
5088         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5089
5090         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5091         we're an EnumConstant, just return that.
5092         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5093         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5094         to get the value which'll actually be written into the attribute.
5095         However, we have to use GetValue() to access the attribute's value
5096         in the compiler.        
5097
5098 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5099
5100         * constant.cs (Constant.IsNegative): New abstract property
5101         IsNegative.
5102
5103         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5104         (StackAlloc.DoResolve): Reused IsNegative.
5105
5106 2004-09-21  Martin Baulig  <martin@ximian.com>
5107
5108         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5109         if we're used in an iterator, we may be called from different
5110         methods.
5111
5112         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5113         we actually have an exception block.
5114
5115 2004-09-20  John Luke <jluke@cfl.rr.com>
5116
5117         * class.cs, cs-parser.jay: Improve the error report for 1520:
5118         report the actual line where the error happens, not where the
5119         class was declared.
5120
5121         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5122         Pass location information that was available elsewhere.
5123
5124 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5125
5126         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5127         runtime to delay sign assemblies.
5128
5129 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5130
5131         * cs-parser.jay: Do not report the stack trace, this is barely
5132         used nowadays.
5133
5134 2004-08-22  John Luke  <john.luke@gmail.com>
5135  
5136         * driver.cs : check that a resource id is not already used
5137         before adding it, report CS1508 if it is, bug #63637
5138
5139 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5140
5141         * ecore.cs: Removed dead code.
5142
5143 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5144
5145         * class.cs: Do not report warning CS0067 on the interfaces.
5146
5147 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5148
5149         * cs-parser.jay: Add error 504 report.
5150
5151 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5152
5153         * rootcontext.cs: WarningLevel is 4 by default now.
5154
5155         * statement.cs (Fixed.Resolve): Do not null
5156         VariableInfo.
5157
5158 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5159
5160         Fixed bug #55780
5161         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5162         deep search when property is not virtual.
5163         (PropertyExpr.ResolveAccessors): Make one call for both
5164         accessors.
5165
5166 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5167
5168         Fixed bug #65766
5169         * statement.cs: Error 152 report constains also location.
5170
5171 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5172
5173         Fixed bug #65766
5174         * const.cs: Explicitly set constant as static.
5175
5176 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5177
5178         Fixed bug #64226
5179         * cs-parser.jay: Add error 1017 report.
5180
5181 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5182
5183         Fixed bug #59980, #64224
5184         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5185
5186         * typemanager.cs (IsSpecialMethod): Simplified
5187
5188 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5189
5190         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5191         condition with better params.
5192
5193 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5194
5195         Fixed bug #65238
5196         * attribute.cs (Resolve): Property has to have both
5197         accessors.
5198
5199 2004-09-14  Martin Baulig  <martin@ximian.com>
5200
5201         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5202
5203 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5204
5205         Fixed bug #61902
5206         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5207         called and is obsolete then this member suppress message
5208         when call is inside next [Obsolete] method or type.
5209
5210         * expression.cs: Use TestObsoleteMethodUsage member.
5211
5212 2004-09-14  Martin Baulig  <martin@ximian.com>
5213
5214         * cs-parser.jay: Sync a bit with the GMCS version.
5215
5216 2004-09-14  Martin Baulig  <martin@ximian.com>
5217
5218         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5219         (CSharpParser.yacc_verbose_flag): New public field.
5220
5221         * genericparser.cs: Removed.
5222
5223 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5224
5225         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5226
5227 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5228
5229         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5230
5231 2004-09-10  Martin Baulig  <martin@ximian.com>
5232
5233         Backported my MemberName changes from GMCS into MCS.
5234
5235         - we are now using a special `MemberName' class instead of using
5236         strings; in GMCS, the `MemberName' also contains the type
5237         arguments.
5238
5239         - changed the grammar rules a bit:
5240           * the old `member_name' is now a `namespace_or_type_name':
5241             The rule is that we use `namespace_or_type_name' everywhere
5242             where we expect either a "member name" (GetEnumerator) or a
5243             "member name" with an explicit interface name
5244             (IEnumerable.GetEnumerator).
5245             In GMCS, the explicit interface name may include type arguments
5246             (IEnumerable<T>.GetEnumerator).
5247           * we use `member_name' instead of just `IDENTIFIER' for
5248             "member names":
5249             The rule is that we use `member_name' wherever a member may
5250             have type parameters in GMCS.       
5251
5252         * decl.cs (MemberName): New public class.
5253         (MemberCore.MemberName): New public readonly field.
5254         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5255         (DeclSpace): Likewise.
5256
5257         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5258         * enum.cs (Enum.ctor): Likewise.
5259
5260         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5261         MemberName.     
5262         (AliasEntry.ctor): Take a MemberName, not an Expression.
5263         (AliasEntry.UsingAlias): Likewise.
5264
5265         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5266         (IMethodData.MemberName): Changed type from string to MemberName.
5267         (MemberBase.ExplicitInterfaceName): Likewise.
5268         (AbstractPropertyEventMethod.SetupName): Make this private.
5269         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5270         argument; compute the member name here.
5271         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5272         on the `member.MemberName' and the `prefix'.
5273
5274         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5275         not `type_name'.
5276         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5277         thus, we get a `MemberName' instead of a `string'.  These
5278         declarations may have type parameters in GMCS.
5279         (interface_method_declaration, delegate_declaration): Likewise.
5280         (class_declaration, interface_declaration): Likewise.
5281         (method_header): Use `namespace_or_type_name' instead of
5282         `member_name'.  We may be an explicit interface implementation.
5283         (property_declaration, event_declaration): Likewise.
5284         (member_name): This is now just an `IDENTIFIER', not a
5285         `namespace_or_type_name'.
5286         (type_name, interface_type): Removed.
5287         (namespace_or_type_name): Return a MemberName, not an Expression.
5288         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5289         call GetTypeExpression() on the MemberName to get an expression.
5290         (IndexerDeclaration.interface_type): Changed type from string to
5291         MemberName.
5292         (MakeName): Operate on MemberName's instead of string's.
5293
5294 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5295
5296         Fix bug #55770.
5297         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5298         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5299         lookup to avoid symbols introduced by 'using'.
5300         * rootcontext.cs (NamespaceLookup): Update.
5301
5302 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5303
5304         * class.cs (TypeContainer.DoDefineMembers): Do not call
5305         DefineDefaultConstructor for static classes.
5306
5307 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5308
5309         * attribute.cs (Attribute.Resolve): Add error 653 report.
5310
5311         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5312         report.
5313         (Method.ApplyAttributeBuilder): Add error 685 report.
5314         (Operator.Define): Add error 564 report.
5315
5316         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5317
5318         * expression.cs (Invocation.DoResolve): Add error
5319         245 and 250 report.
5320
5321         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5322         error 674 report.
5323
5324 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5325
5326         * class.cs (ConstructorInitializer.Resolve):
5327         Wrong error number (515->516).
5328
5329 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5330
5331         * class.cs (Indexer.Define): Add error 631 report.
5332
5333 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5334
5335         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5336
5337 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5338
5339         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5340
5341 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5342
5343         * cs-parser.jay: Added error CS0241 report.
5344
5345 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5346
5347         * cs-parser.jay (fixed_statement): Introduce a scope for the
5348         declaration in the 'fixed' statement.
5349
5350 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5351
5352         * cs-parser.jay: Added CS0230 error report.
5353
5354 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5355
5356         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5357
5358 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5359
5360         * expression.cs (Argument.Resolve): Added error CS0192 and
5361         CS0199 report.
5362
5363 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5364
5365         C# 2.0 #pragma warning feature
5366
5367         * cs-tokenizer.cs (PreProcessPragma): New method; 
5368         Handles #pragma directive.
5369
5370         * report.cs (WarningRegions): New class; Support
5371         class for #pragma warning directive. It tests whether
5372         warning is enabled for a given line.
5373
5374 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5375
5376         * const.cs: Add more descriptive error report, tahnks to
5377         Sebastien. 
5378
5379 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5380
5381         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5382
5383 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5384
5385         * expression.cs: Apply patch from Ben: Remove dead code from
5386         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5387         as that code just threw an exception anwyays.
5388
5389         * const.cs: Remove the call to the turnintoconstant, for details
5390         see bug: #63144
5391         
5392         * literal.cs: The type of the null-literal is the null type;  So
5393         we use a placeholder type (literal.cs:System.Null, defined here)
5394         for it.
5395
5396         * expression.cs (Conditional.DoResolve): Remove some old code that
5397         is no longer needed, conversions have been fixed.
5398
5399         (ArrayCreationExpression.DoResolve): Return false if we fail to
5400         resolve the inner expression.
5401
5402 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5403
5404         Fix test-290.cs.
5405         * cs-parser.jay (delegate_declaration): Record a delegate
5406         declaration as a type declaration.
5407         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5408
5409 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5410
5411         * parameter.cs: Do not crash if the type can not be resolved. 
5412
5413         * expression.cs: Report errors with unsafe pointers, fixes #64896
5414
5415 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5416
5417         * expression.cs: Pointer arith always needs to do a conv.i
5418         if the operand is a long. fix 65320
5419
5420 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5421
5422         Fixed cs0619-37.cs, cs0619-38.cs
5423
5424         * enum.cs (GetObsoleteAttribute): Removed.
5425
5426         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5427         on Enum member is double staged. The first is tested member
5428         and then enum.
5429
5430 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5431
5432         Fixed #56986, #63631, #65231
5433
5434         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5435         adds member to name container.
5436         (TypeContainer.AddToTypeContainer): New method, adds type to
5437         name container.
5438         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5439         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5440         AddOperator): Simplified by reusing AddToMemberContainer.
5441         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5442         instead of field.
5443         (Method.CheckForDuplications): Fixed implementation to test all
5444         possibilities.
5445         (MemberBase): Detection whether member is explicit interface
5446         implementation is now in constructor.
5447         (MemberBase.UpdateMemberName): Handles IndexerName.
5448         (Accessor): Changed to keep also location information.
5449         (AbstractPropertyEventMethod): Is derived from MemberCore.
5450         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5451         will be emited or not.
5452         (PropertyBase.AreAccessorsDuplicateImplementation):
5453         Tests whether accessors are not in collision with some method.
5454         (Operator): Is derived from MethodCore to simplify common
5455         operations.
5456
5457         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5458         must be performed.
5459         (DeclSpace.AddToContainer): Adds the member to defined_names
5460         table. It tests for duplications and enclosing name conflicts.
5461
5462         * enum.cs (EnumMember): Clean up to reuse the base structures
5463
5464 2004-09-03  Martin Baulig  <martin@ximian.com>
5465
5466         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5467         into TypeContainer, to make partial classes work again.
5468
5469 2004-09-03  Martin Baulig  <martin@ximian.com>
5470
5471         * rootcontext.cs (RootContext.V2): Removed.
5472
5473 2004-03-23  Martin Baulig  <martin@ximian.com>
5474
5475         * expression.cs (Invocation.OverloadResolve): Added `bool
5476         may_fail' argument and use it instead of the Location.IsNull() hack.
5477
5478 2004-09-03  Martin Baulig  <martin@ximian.com>
5479
5480         Merged latest changes into gmcs.  Please keep this comment in
5481         here, it makes it easier for me to see what changed in MCS since
5482         the last time I merged.
5483
5484 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5485
5486         Fix #61128.
5487         * expression.cs (BetterConversion): Don't allow either conversion 
5488         to be null.  Remove redundant implicit conversion test when 'q ==
5489         null' -- when this function is invoked, we already know that the
5490         implicit conversion exists.
5491         (BetterFunction): Assume that 'best' is non-null.  Remove
5492         redundant reimplementation of IsApplicable when 'best' is null.
5493         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5494         number of arguments.
5495         (IsAncestralType): Extract from OverloadResolve.
5496         (OverloadResolve): Make robust to the MethodGroupExpr being
5497         unsorted.  Implement all the logic of Section 14.5.5.1, and
5498         support overloading of methods from multiple applicable types.
5499         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5500
5501         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5502         (RealError, Warning): Append type of report to related symbol.
5503
5504 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5505
5506         * enum.cs: Fixed CLS-Compliance checks for enum members.
5507         Error tests cs3008-8.cs, cs3014-8.cs
5508
5509 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5510
5511         Fixed bug #62342, #63102
5512         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5513         like ImplementMethod.
5514
5515 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5516
5517         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5518         Fixed bug #65170.
5519
5520 2004-09-02  Martin Baulig  <martin@ximian.com>
5521
5522         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5523         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5524         on the MethodBase.
5525
5526 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5527
5528         C# 2.0 Static classes implemented
5529
5530         * class.cs (TypeContainer): instance_constructors,
5531         initialized_fields, initialized_static_fields,
5532         default_constructor, base_inteface_types are protected to be
5533         accessible from StaticClass.
5534         (TypeContainer.DefineDefaultConstructor): New virtual method
5535         for custom default constructor generating
5536         (StaticClass): New class to handle "Static classes" feature.
5537
5538         * cs-parser.jay: Handle static keyword on class like instance
5539         of StaticClass.
5540
5541         * driver.cs: Added "/langversion" command line switch with two
5542         options (iso-1, default).
5543
5544 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5545
5546         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5547
5548 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5549
5550         * delegate.cs: Style.
5551
5552 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5553
5554         * delegate.cs: Add seperate instance expr field for miguel.
5555
5556 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5557
5558         * PointerArithmetic (Resolve): make sure we are not doing
5559         pointer arith on void*. Also, make sure we are resolved
5560         by not setting eclass until resolve.
5561
5562         All callers: Make sure that PointerArithmetic gets resolved.
5563
5564 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5565
5566         * ArrayCreation (LookupType): If the type does not resolve 
5567         to an array, give an error.
5568
5569 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5570
5571         * statement.cs (Try.Resolve): Fixed bug #64222
5572
5573 2004-08-27  Martin Baulig  <martin@ximian.com>
5574
5575         * class.cs
5576         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5577         crash here.     
5578
5579 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5580
5581         * ecore.cs (Constantify): Get underlying type via
5582         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5583         Windows in special cases.
5584
5585 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5586
5587         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5588         for obtaining also private methods.
5589         (GetRemoveMethod): Used GetRemoveMethod (true)
5590         for obtaining also private methods.
5591
5592 2004-08-24  Martin Baulig  <martin@ximian.com>
5593
5594         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5595         MethodAttributes.HideBySig for operators.
5596
5597 2004-08-23  Martin Baulig  <martin@ximian.com>
5598
5599         Back to the old error reporting system :-)
5600
5601         * report.cs (Message): Removed.
5602         (Report.MessageData, ErrorData, WarningData): Removed.
5603         (Report.Error, Warning): Back to the old system.
5604
5605 2004-08-23  Martin Baulig  <martin@ximian.com>
5606
5607         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5608
5609         * class.cs (TypeContainer.ParentContainer): New public virtual
5610         method; replaces the explicit interface implementation.
5611         (ClassPart.ParentContainer): Override.
5612
5613 2004-08-23  Martin Baulig  <martin@ximian.com>
5614
5615         * statement.cs (Switch): Added support for constant switches; see
5616         #59428 or test-285.cs.
5617
5618 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5619
5620         Fixed bug #62740.
5621         * statement.cs (GetEnumeratorFilter): Removed useless
5622         logic because C# specs is strict. GetEnumerator must be
5623         public.
5624
5625 2004-08-22  Martin Baulig  <martin@ximian.com>
5626
5627         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5628         a switch and may break, reset the barrier.  Fixes #59867.
5629
5630 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5631
5632         CLS-Compliance speed up (~5% for corlib)
5633
5634         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5635         New method. Tests container for CLS-Compliant names
5636
5637         * class.cs (TypeContainer.VerifyClsName): New method.
5638         Checks whether container name is CLS Compliant.
5639         (Constructor): Implements IMethodData.
5640
5641         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5642         low-case table for CLS Compliance test.
5643         (MemberCache.VerifyClsParameterConflict): New method.
5644         Checks method parameters for CS3006 error.
5645
5646         * enum.cs (EnumMember): Is derived from MemberCore.
5647         (Enum.VerifyClsName): Optimized for better performance.
5648
5649 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5650
5651         * report.cs: Renamed Error_T to Error and changed all
5652         references.
5653
5654 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5655
5656         * class.cs (TypeContainer.IndexerArrayList): New inner class
5657         container for indexers.
5658         (TypeContainer.DefaultIndexerName): New constant for default
5659         indexer name. Replaced all "Item" with this constant.
5660         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5661
5662         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5663         DefaultMemberAttribute constructor.
5664
5665 2004-08-05  Martin Baulig  <martin@ximian.com>
5666
5667         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5668         Fix bug #59429.
5669
5670 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5671
5672         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5673         multi platforms problem.
5674
5675         * compiler.csproj: Included shared files.
5676
5677 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5678
5679         Fix bug 60333, 55971 in the more general way
5680         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5681         Added arg_type argument for constant conversion.
5682         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5683
5684 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5685
5686         Fix bug #59760
5687         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5688         OperatorArrayList, MethodCoreArrayList for typecontainer
5689         containers. Changed class member types to these new types.
5690         (MethodArrayList.DefineMembers): Added test for CS0659.
5691
5692 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5693
5694         * cfold.cs: Synchronize the folding with the code in expression.cs
5695         Binary.DoNumericPromotions for uint operands.
5696
5697         * attribute.cs: Revert patch from Raja, it introduced a regression
5698         while building Blam-1.2.1 (hard to isolate a test case).
5699
5700 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5701
5702         Fix for #55382
5703         * class.cs:
5704         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5705         name collision.
5706         (MethodCore.parent_method): New member. The method we're overriding
5707         if this is an override method.
5708         (MethodCore.CheckBase): Moved from Method class and made common.
5709         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5710         private.
5711         (MethodCore.CheckForDuplications): New abstract method. For custom
5712         member duplication search in a container
5713         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5714         method and its return type.
5715         (Event.conflict_symbol): New member. Symbol with same name in the
5716         parent class.
5717
5718         * decl.cs:
5719         (MemberCache.FindMemberWithSameName): New method. The method
5720         is looking for conflict with inherited symbols.
5721
5722 2004-08-04  Martin Baulig  <martin@ximian.com>
5723
5724         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5725
5726         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5727
5728 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5729
5730         * report.cs (Message): New enum for better error, warning reference in
5731         the code.
5732         (MessageData): New inner abstract class. It generally handles printing of
5733         error and warning messages.
5734         Removed unused Error, Warning, Message methods.
5735
5736 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5737
5738         Fix for cs0592-8.cs test
5739         * attribute.cs
5740         (Attributable.ValidAttributeTargets): Made public.
5741         (Attribute.ExplicitTarget): New member for explicit target value.
5742         (Attribute.CheckTargets): Now we translate explicit attribute
5743         target to Target here.
5744
5745 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5746
5747         * ecore.cs (MethodGroupExpr): new IsBase property.
5748
5749         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5750
5751         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5752         rather than an instance expr.
5753
5754         (DelegateCreation.Emit): Use the method group rather than
5755         the instance expression. Also, if you have base.Foo as the
5756         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5757
5758         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5759
5760         (NewDelegate.DoResolve): Only check for the existance of Invoke
5761         if the method is going to be needed. Use MethodGroupExpr.
5762
5763         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5764
5765         * expression.cs: For pointer arith., make sure to use
5766         the size of the type, not the size of the pointer to
5767         the type.
5768
5769 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5770
5771         Fix for #60722
5772         * class.cs (Class): Added error CS0502 test.
5773
5774 2004-08-03  John Luke  <jluke@cfl.rr.com>
5775             Raja R Harinath  <rharinath@novell.com>
5776
5777         Fix for #60997.
5778         * attribute.cs (Attribute.complained_before): New flag.
5779         (Attribute.ResolveType, Attribute.Resolve),
5780         (Attribute.DefinePInvokeMethod): Set it.
5781         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5782         
5783 2004-08-03  Martin Baulig  <martin@ximian.com>
5784
5785         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5786         use a user-defined operator; we still need to do numeric
5787         promotions in case one argument is a builtin type and the other
5788         one has an implicit conversion to that type.  Fixes #62322.
5789
5790 2004-08-02  Martin Baulig  <martin@ximian.com>
5791
5792         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5793         (LocalInfo.IsThis): New public property.
5794         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5795
5796 2004-08-01  Martin Baulig  <martin@ximian.com>
5797
5798         * class.cs (TypeContainer.GetClassBases): Don't set the default
5799         here since we may get called from GetPartialBases().
5800         (TypeContainer.DefineType): If GetClassBases() didn't return a
5801         parent, use the default one.
5802
5803 2004-07-30  Duncan Mak  <duncan@ximian.com>
5804
5805         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
5806
5807 2004-07-30  Martin Baulig  <martin@ximian.com>
5808
5809         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5810
5811         * class.cs (SourceMethod): New public class, derive from the
5812         symbol writer's ISourceMethod.
5813         (Method): Use the new symbol writer API.
5814
5815         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5816         as argument and use the new symbol writer.
5817
5818         * location.cs
5819         (SourceFile): Implement the symbol writer's ISourceFile.
5820         (Location.SymbolDocument): Removed.
5821         (Location.SourceFile): New public property.
5822
5823         * symbolwriter.cs: Use the new symbol writer API.
5824
5825 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5826
5827         * Makefile (install-local): Remove.  Functionality moved to
5828         executable.make.
5829
5830 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5831
5832         * Makefile: Install mcs.exe.config file together with mcs.exe.
5833         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5834         correct runtime version.
5835         
5836 2004-07-25  Martin Baulig  <martin@ximian.com>
5837
5838         * class.cs
5839         (TypeContainer.RegisterOrder): Removed, this was unused.
5840         (TypeContainer, interface_order): Removed.
5841         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5842         TypeContainer as argument since we can also be called with a
5843         `PartialContainer' for a partial class/struct/interface.
5844         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5845         of checking whether we're an `Interface' - we could be a
5846         `PartialContainer'.
5847         (PartialContainer.Register): Override; call
5848         AddClass()/AddStruct()/AddInterface() on our parent.
5849
5850         * cs-parser.jay (interface_member_declaration): Add things to the
5851         `current_container', not the `current_class'.
5852
5853         * rootcontext.cs (RegisterOrder): The overloaded version which
5854         takes an `Interface' was unused, removed.
5855
5856         * typemanager.cs (TypeManager.LookupInterface): Return a
5857         `TypeContainer', not an `Interface'.
5858         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5859         contain a `PartialContainer' for an interface, so check it's
5860         `Kind' to figure out what it is.
5861
5862 2004-07-25  Martin Baulig  <martin@ximian.com>
5863
5864         * class.cs (Class.DefaultTypeAttributes): New public constant.
5865         (Struct.DefaultTypeAttributes): Likewise.
5866         (Interface.DefaultTypeAttributes): Likewise.
5867         (PartialContainer.TypeAttr): Override this and add the
5868         DefaultTypeAttributes.
5869
5870 2004-07-25  Martin Baulig  <martin@ximian.com>
5871
5872         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5873         we can just use the `Parent' field instead.
5874
5875 2004-07-25  Martin Baulig  <martin@ximian.com>
5876
5877         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5878
5879 2004-07-25  Martin Baulig  <martin@ximian.com>
5880
5881         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5882         our parts before defining any methods.
5883         (TypeContainer.VerifyImplements): Make this virtual.
5884         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5885         on our PartialContainer.
5886
5887 2004-07-25  Martin Baulig  <martin@ximian.com>
5888
5889         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5890
5891         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5892         argument, we can just use the `Parent' field instead.
5893
5894         * class.cs
5895         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5896         (MemberBase.DoDefine): Likewise.
5897
5898 2004-07-24  Martin Baulig  <martin@ximian.com>
5899
5900         * decl.cs (MemberCore.Parent): New public field.
5901         (DeclSpace.Parent): Moved to MemberCore.
5902
5903         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5904         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5905         parent's .ctor.
5906         (FieldBase, Field, Operator): Likewise.
5907         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5908         (EventField, Event): Likewise.
5909
5910 2004-07-23  Martin Baulig  <martin@ximian.com>
5911
5912         * class.cs (PartialContainer): New public class.
5913         (ClassPart): New public class.
5914         (TypeContainer): Added support for partial classes.
5915         (TypeContainer.GetClassBases): Splitted some of the functionality
5916         out into GetNormalBases() and GetPartialBases().
5917
5918         * cs-tokenizer.cs (Token.PARTIAL): New token.
5919         (Tokenizer.consume_identifier): Added some hacks to recognize
5920         `partial', but only if it's immediately followed by `class',
5921         `struct' or `interface'.
5922
5923         * cs-parser.jay: Added support for partial clases.
5924
5925 2004-07-23  Martin Baulig  <martin@ximian.com>
5926
5927         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5928         a `DeclSpace' and also made it readonly.
5929         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5930         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5931         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5932
5933         * cs-parser.jay: Pass the `current_class', not the
5934         `current_container' (at the moment, this is still the same thing)
5935         to a new Method, Property, Event, Indexer or Constructor.
5936
5937 2004-07-23  Martin Baulig  <martin@ximian.com>
5938
5939         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5940         and removed the `current_interface' one.
5941         (struct_declaration, class_declaration, interface_declaration):
5942         Set `current_class' to the newly created class/struct/interface;
5943         set their `Bases' and call Register() before parsing their body.
5944
5945 2004-07-23  Martin Baulig  <martin@ximian.com>
5946
5947         * class.cs (Kind): New public enum.
5948         (TypeContainer): Made this class abstract.
5949         (TypeContainer.Kind): New public readonly field.
5950         (TypeContainer.CheckDef): New public method; moved here from
5951         cs-parser.jay.
5952         (TypeContainer.Register): New public abstract method.
5953         (TypeContainer.GetPendingImplementations): New public abstract
5954         method.
5955         (TypeContainer.GetClassBases): Removed the `is_class' and
5956         `is_iface' parameters.
5957         (TypeContainer.DefineNestedTypes): Formerly known as
5958         DoDefineType().
5959         (ClassOrStruct): Made this class abstract.
5960
5961         * tree.cs (RootTypes): New public type. 
5962
5963 2004-07-20  Martin Baulig  <martin@ximian.com>
5964
5965         * tree.cs (Tree.RecordNamespace): Removed.
5966         (Tree.Namespaces): Removed.
5967
5968         * rootcontext.cs (RootContext.IsNamespace): Removed.
5969
5970         * cs-parser.jay (namespace_declaration): Just create a new
5971         NamespaceEntry here.
5972
5973 2004-07-20  Martin Baulig  <martin@ximian.com>
5974
5975         * statement.cs (ExceptionStatement): New abstract class.  This is
5976         now used as a base class for everyone who's using `finally'.
5977         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
5978         our local variables before using them.
5979
5980         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
5981         virtual method.  This is used by Yield.Resolve() to "steal" an
5982         outer block's `finally' clauses.
5983         (FlowBranchingException): The .ctor now takes an ExceptionStatement
5984         argument.
5985
5986         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
5987         version which takes an ExceptionStatement.  This version must be
5988         used to create exception branchings.
5989
5990         * iterator.cs
5991         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
5992         (Iterator.EmitMoveNext): Added exception support; protect the
5993         block with a `fault' clause, properly handle 'finally' clauses.
5994         (Iterator.EmitDispose): Run all the `finally' clauses here.
5995
5996 2004-07-20  Martin Baulig  <martin@ximian.com>
5997
5998         * iterator.cs: This is the first of a set of changes in the
5999         iterator code.  Match the spec more closely: if we're an
6000         IEnumerable, then GetEnumerator() must be called.  The first time
6001         GetEnumerator() is called, it returns the current instance; all
6002         subsequent invocations (if any) must create a copy.
6003
6004 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6005
6006         * expression.cs: Resolve the constant expression before returning
6007         it. 
6008
6009 2004-07-19  Martin Baulig  <martin@ximian.com>
6010
6011         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6012         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6013         the return type of the new EmitContext.
6014
6015 2004-07-18  Martin Baulig  <martin@ximian.com>
6016
6017         * class.cs (Property.Define): Fix iterators.
6018
6019         * iterators.cs (Iterator.Define): Moved the
6020         `container.AddInterator (this)' call here from the .ctor; only do
6021         it if we resolved successfully.
6022
6023 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6024
6025         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6026         `true' for preprocessing directives that we parse.  The return
6027         value indicates whether we should return to regular tokenizing or
6028         not, not whether it was parsed successfully.
6029
6030         In the past if we were in: #if false ... #line #endif, we would
6031         resume parsing after `#line'.  See bug 61604.
6032
6033         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6034         building: IsEnumType should return true only for enums, not for
6035         enums or System.Enum itself.  This fixes #61593.
6036
6037         Likely what happened is that corlib was wrong: mcs depended on
6038         this bug in some places.  The bug got fixed, we had to add the
6039         hack, which caused bug 61593.
6040
6041         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6042         that was a workaround for the older conditions.
6043
6044 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6045
6046         * assign.cs: IAssignMethod has a new interface, as documented
6047         inline. All assignment code now uses this new api.
6048
6049         * ecore.cs, expression.cs: All classes which implement
6050         IAssignMethod now use the new interface.
6051
6052         * expression.cs (Invocation): add a hack to EmitCall so that
6053         IndexerAccess can be the target of a compound assignment without
6054         evaluating its arguments twice.
6055
6056         * statement.cs: Handle changes in Invocation api.
6057
6058 2004-07-16  Martin Baulig  <martin@ximian.com>
6059
6060         * iterators.cs: Rewrote this.  We're now using one single Proxy
6061         class for both the IEnumerable and the IEnumerator interface and
6062         `Iterator' derives from Class so we can use the high-level API.
6063
6064         * class.cs (TypeContainer.AddIterator): New method.
6065         (TypeContainer.DoDefineType): New protected virtual method, which
6066         is called from DefineType().
6067         (TypeContainer.DoDefineMembers): Call DefineType() and
6068         DefineMembers() on all our iterators.
6069         (TypeContainer.Emit): Call Emit() on all our iterators.
6070         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6071
6072         * codegen.cs (EmitContext.CurrentIterator): New public field.
6073
6074 2004-07-15  Martin Baulig  <martin@ximian.com>
6075
6076         * typemanager.cs
6077         (TypeManager.not_supported_exception_type): New type.   
6078
6079 2004-07-14  Martin Baulig  <martin@ximian.com>
6080
6081         * iterators.cs: Use real error numbers.
6082
6083 2004-07-14  Martin Baulig  <martin@ximian.com>
6084
6085         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6086         requires this to be a System.Collection.IEnumerable and not a
6087         class implementing that interface.
6088         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6089
6090 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6091
6092         * class.cs: Fixed previous fix, it broke some error tests.
6093
6094 2004-07-12  Martin Baulig  <martin@ximian.com>
6095
6096         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6097         Fixes #61293.
6098
6099 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6100
6101         * assign.cs (LocalTemporary): Add new argument: is_address,If
6102         `is_address' is true, then the value that we store is the address
6103         to the real value, and not the value itself.
6104         
6105         * ecore.cs (PropertyExpr): use the new local temporary
6106         stuff to allow us to handle X.Y += z (where X is a struct)
6107
6108 2004-07-08  Martin Baulig  <martin@ximian.com>
6109
6110         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6111         not always return, just like we're doing in Using.Resolve().
6112
6113 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6114
6115         * cs-parser.jay (fixed_statement): flag this as Pinned.
6116
6117 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6118
6119         * typemanager.cs (TypeManager): Removed MakePinned method, this
6120         mechanism is replaced with the .NET 2.x compatible mechanism of
6121         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6122
6123         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6124         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6125         `IsFixed' property which has a different meaning.
6126
6127 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6128
6129         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6130         visible from inside a nested class, not just the names of the
6131         immediately enclosing class.
6132         Fix for bug #60730.
6133
6134 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6135
6136         * expression.cs (BetterConversion): Remove buggy special-case
6137         handling of "implicit constant expression conversions".  At this
6138         point, we already know that the conversion is possible -- we're
6139         only checking to see which is better.
6140
6141 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6142
6143         * cs-parser.jay: Added error CS0210 test.
6144
6145 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6146
6147         * cs-parser.jay: Added error CS0134 test.
6148
6149 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6150
6151         Fix bug #52507
6152         * cs-parser.jay: Added error CS0145 test.
6153
6154 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6155
6156         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6157
6158 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6159         
6160         * expression.cs (StackAlloc.Resolve): The argument may not
6161         be a constant; deal with this case.
6162         
6163 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6164
6165         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6166         GetIndexerAttributeValue.
6167         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6168
6169         * class.cs (Indexer.Define): Added error tests for CS0415,
6170         CS0609.
6171
6172 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6173
6174         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6175         property code.
6176
6177 2004-06-23  Martin Baulig  <martin@ximian.com>
6178
6179         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6180         neither return nor throw, reset the barrier as well.  Fixes #60457.
6181
6182 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6183
6184         * class.cs : EventAttributes is now set to None by default.
6185           This fixes bug #60459.
6186
6187 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6188
6189         Fix bug #60219
6190         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6191         Don't throw exception but return null (it's sufficient now).
6192
6193 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6194
6195         * typemanager.cs (GetArgumentTypes): Faster implementation.
6196
6197 2004-06-18  Martin Baulig  <martin@ximian.com>
6198
6199         * attribute.cs (Attribute.Resolve): Check whether we're an
6200         EmptyCast which a Constant child.  Fixes #60333.
6201
6202 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6203
6204         * statement.cs (EmitCollectionForeach): Account for the fact that
6205         not all valuetypes are in areas which we can take the address of.
6206         For these variables, we store to a temporary variable. Also, make
6207         sure that we dont emit a `callvirt' on a valuetype method.
6208
6209 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6210
6211         * expression.cs (StackAlloc.DoReSolve): Added test for
6212         negative parameter (CS0247).
6213
6214 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6215
6216         Fix bug #59792
6217         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6218
6219 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6220
6221         Fix bug #59781
6222         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6223         ulong.
6224
6225 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6226
6227         Fix bug #58254 & cs1555.cs, cs1556.cs
6228         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6229
6230 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6231
6232         * cs-parser.jay: Added error CS1669 test for indexers.
6233
6234 2004-06-11  Martin Baulig  <martin@ximian.com>
6235
6236         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6237         call this twice: for params and varargs methods.
6238
6239 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6240
6241         * class.cs:
6242         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6243
6244 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6245
6246         * attribute.cs (Attribute.GetValidTargets): Made public.
6247
6248         * class.cs: 
6249         (AbstractPropertyEventMethod): New class for better code sharing.
6250         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6251         CS1667 report.
6252         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6253
6254 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6255
6256         Fix bug #59477.
6257         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6258         that the call to Resolve is part of a MemberAccess.
6259         (Expression.Resolve): Use it for SimpleName resolution.
6260         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6261         Add 'intermediate' boolean argument.
6262         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6263         error message when the SimpleName can be resolved ambiguously
6264         between an expression and a type.
6265         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6266         public.
6267         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6268         call on the left-side.
6269
6270 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6271
6272         * class.cs:
6273         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6274
6275 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6276
6277         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6278
6279 2004-06-11  Martin Baulig  <martin@ximian.com>
6280
6281         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6282         varargs methods if applicable.
6283
6284 2004-06-11  Martin Baulig  <martin@ximian.com>
6285
6286         * expression.cs (Invocation.EmitCall): Don't use
6287         `method.CallingConvention == CallingConventions.VarArgs' since the
6288         method could also have `CallingConventions.HasThis'.
6289
6290 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6291
6292         * class.cs (Event.GetSignatureForError): Implemented.
6293         Fixed crash in error test cs3010.cs
6294
6295 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6296
6297         * cs-tokenizer.cs: Change the way we track __arglist to be
6298         consistent with the other keywords.
6299
6300 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6301
6302         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6303         tomorrow.
6304
6305 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6306
6307         * codegen.cs: Check that all referenced assemblies have a strongname
6308         before strongnaming the compiled assembly. If not report error CS1577.
6309         Fix bug #56563. Patch by Jackson Harper.
6310         * typemanager.cs: Added a method to return all referenced assemblies.
6311         Fix bug #56563. Patch by Jackson Harper.
6312
6313 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6314
6315         * class.cs:
6316         (Method.ApplyAttributeBuilder): Moved and added conditional
6317         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6318
6319         * delegate.cs:
6320         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6321
6322 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6323
6324         Fixed #59640
6325         * class.cs: (EventField.attribute_targets): Changed default target.
6326
6327 2004-06-08  Martin Baulig  <martin@ximian.com>
6328
6329         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6330
6331 2004-06-08  Martin Baulig  <martin@ximian.com>
6332
6333         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6334
6335 2004-06-07  Martin Baulig  <martin@ximian.com>
6336
6337         Added support for varargs methods.
6338
6339         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6340         keyword.
6341
6342         * cs-parser.jay: Added support for `__arglist'.
6343
6344         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6345
6346         * expression.cs (Argument.AType): Added `ArgList'.
6347         (Invocation): Added support for varargs methods.
6348         (ArglistAccess): New public class.
6349         (Arglist): New public class.
6350
6351         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6352
6353         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6354         a method's top-level block if the method has varargs.
6355
6356         * support.cs (ReflectionParameters, InternalParameters): Added
6357         support for varargs methods.    
6358
6359 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6360
6361         * class.cs: Provide location in indexer error report.
6362
6363         * driver.cs: Use standard names.
6364
6365         * namespace.cs: Catch the use of using after a namespace has been
6366         declared also on using aliases.
6367
6368 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6369
6370         Bug #50820.
6371         * typemanager.cs (closure_private_ok, closure_invocation_type)
6372         (closure_qualifier_type, closure_invocation_assembly)
6373         (FilterWithClosure): Move to ...
6374         (Closure): New internal nested class.
6375         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6376         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6377         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6378         (MemberLookup, MemberLookupFailed): Use it.
6379         * expression.cs (New.DoResolve): Treat the lookup for the
6380         constructor as being qualified by the 'new'ed type.
6381         (Indexers.GetIndexersForTypeOrInterface): Update.
6382
6383 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6384
6385         * attribute.cs
6386         (GetConditionalAttributeValue): New method. Returns
6387         condition of ConditionalAttribute.
6388         (SearchMulti): New method.  Returns all attributes of type 't'.
6389         Use it when attribute is AllowMultiple = true.
6390         (IsConditionalMethodExcluded): New method.
6391
6392         * class.cs
6393         (Method.IsExcluded): Implemented. Returns true if method has conditional
6394         attribute and the conditions is not defined (method is excluded).
6395         (IMethodData): Extended interface for ConditionalAttribute support.
6396         (PropertyMethod.IsExcluded): Implemented.
6397
6398         * decl.cs
6399         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6400
6401         * expression.cs
6402         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6403         on the method.
6404
6405 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6406
6407         * expression.cs (ArrayCreationExpression): Make this just an
6408         `expression'. It can't be a statement, so the code here was
6409         dead.
6410
6411 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6412
6413         Fixed #59072
6414         * typemanager.cs (GetFullNameSignature): New method for
6415         MethodBase types.
6416
6417 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6418
6419         Fixed #56452
6420         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6421         Use this method when MethodBuilder is null.
6422         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6423         Added test for error CS0626 (MONO reports error for this situation).
6424         (IMethodData.GetSignatureForError): Extended interface.
6425
6426 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6427
6428         * attribute.cs
6429         (AttributeTester.GetObsoleteAttribute): Returns instance of
6430         ObsoleteAttribute when type is obsolete.
6431
6432         * class.cs
6433         (TypeContainer.VerifyObsoleteAttribute): Override.
6434         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6435         (MethodCode.VerifyObsoleteAttribute): Override.
6436         (MemberBase.VerifyObsoleteAttribute): Override.
6437
6438         * decl.cs
6439         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6440         and report proper error.
6441
6442         *delegate.cs
6443         Delegate.VerifyObsoleteAttribute): Override.
6444
6445         * ecore.cs
6446         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6447         and report proper error.
6448         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6449
6450         * enum.cs
6451         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6452         and enum member.
6453
6454         * expression.cs
6455         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6456         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6457         Added test for ObsoleteAttribute.
6458
6459         * statement.cs
6460         (Catch): Derived from Statement.
6461
6462 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6463  
6464         Fixed bug #59071 & cs0160.cs
6465  
6466         * statement.cs (Try.Resolve): Check here whether order of catch
6467         clauses matches their dependencies.
6468
6469 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6470
6471         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6472         caused a regression: #59343.  Referencing nested classes from an
6473         assembly stopped working.
6474
6475 2004-05-31  Martin Baulig  <martin@ximian.com>
6476
6477         MCS is now frozen for beta 2.
6478
6479 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6480
6481         * convert.cs: add a trivial cache for overload operator resolution.
6482
6483 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6484
6485         * decl.cs: If possible, use lookuptypedirect here. We can only do
6486         this if there is no `.' after the namespace. Avoids using
6487         LookupType, which does lots of slow processing.
6488         (FindNestedType) New method, does what it says :-).
6489         * namespace.cs: use LookupTypeDirect.
6490         * rootcontext.cs: use membercache, if possible.
6491         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6492
6493 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6494
6495         * expression.cs:
6496         According to the spec, 
6497
6498         In a member access of the form E.I, if E is a single identifier,
6499         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6500         field, property, localvariable, or parameter with the same type as
6501         the meaning of E as a type-name (§3.8), then both possible
6502         meanings of E are permitted.
6503
6504         We did not check that E as a simple-name had the same type as E as
6505         a type name.
6506
6507         This trivial check gives us 5-7% on bootstrap time.
6508
6509 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6510
6511         * expression.cs (Invocation.OverloadResolve): Avoid the
6512         use of hashtables and boxing here by allocating on demand.
6513
6514 2004-05-30  Martin Baulig  <martin@ximian.com>
6515
6516         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6517         we're doing a silent lookup.  Don't try to lookup nested types in
6518         TypeManager.object_type (thanks to Ben Maurer).
6519
6520 2004-05-30  Martin Baulig  <martin@ximian.com>
6521
6522         Committing a patch from Ben Maurer.
6523
6524         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6525
6526 2004-05-29  Martin Baulig  <martin@ximian.com>
6527
6528         * class.cs (IMethodData.ShouldIgnore): New method.
6529
6530         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6531         `Location' argument, we don't need it anywhere.  Use
6532         `IMethodData.ShouldIgnore ()' instead of
6533         `MethodData.GetMethodFlags ()'.
6534         (TypeManager.AddMethod): Removed.
6535         (TypeManager.AddMethod2): Renamed to AddMethod.
6536
6537 2004-05-29  Martin Baulig  <martin@ximian.com>
6538
6539         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6540
6541         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6542         converting from a class type S to an interface type and we already
6543         have an object on the stack, don't box it again.  Fixes #52578.
6544
6545 2004-05-29  Martin Baulig  <martin@ximian.com>
6546
6547         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6548         Added support for `params' parameters.  Fixes #59267.
6549
6550 2004-05-29  Martin Baulig  <martin@ximian.com>
6551
6552         * literal.cs (NullPointer): Provide a private .ctor which sets
6553         `type' to TypeManager.object_type.  Fixes #59048.
6554
6555 2004-05-29  Martin Baulig  <martin@ximian.com>
6556
6557         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6558         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6559
6560         * ecore.cs (EventExpr.instance_expr): Make the field private.
6561
6562 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6563
6564         Fixed bug #50080 & cs0214-2.cs
6565         * expression.cs (Cast.DoResolve): Check unsafe context here.
6566         
6567         * statement.cs (Resolve.DoResolve): Likewise.
6568
6569 2004-05-26  Martin Baulig  <martin@ximian.com>
6570
6571         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6572
6573         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6574         (RootContext.LookupType): Pass down the `silent' flag.
6575
6576 2004-05-25  Martin Baulig  <martin@ximian.com>
6577
6578         * expression.cs
6579         (MethodGroupExpr.IdenticalTypeName): New public property.
6580         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6581         expression actually refers to a type.
6582
6583 2004-05-25  Martin Baulig  <martin@ximian.com>
6584
6585         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6586         for #56176 and made it actually work.
6587
6588 2004-05-25  Martin Baulig  <martin@ximian.com>
6589
6590         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6591         (FieldExpr, PropertyExpr): Override and implement
6592         CacheTemporaries.  Fixes #52279.
6593
6594 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6595
6596         * location.cs: In the new compiler listing a file twice is a
6597         warning, not an error.
6598
6599 2004-05-24  Martin Baulig  <martin@ximian.com>
6600
6601         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6602         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6603
6604 2004-05-24  Martin Baulig  <martin@ximian.com>
6605
6606         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6607         walking the `using' list.  Fixes #53921.
6608
6609 2004-05-24  Martin Baulig  <martin@ximian.com>
6610
6611         * const.cs (Const.LookupConstantValue): Added support for
6612         EmptyCast's; fixes #55251.
6613
6614 2004-05-24  Martin Baulig  <martin@ximian.com>
6615
6616         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6617         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6618         which does the CS0135 check.  The reason is that we first need to
6619         check whether the variable actually exists.
6620
6621 2004-05-24  Martin Baulig  <martin@ximian.com>
6622
6623         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6624         than RootContext.LookupType() to find the explicit interface
6625         type.  Fixes #58584.
6626
6627 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6628
6629         * Makefile: Simplify.  Use executable.make.
6630         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6631
6632 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6633
6634         * decl.cs:
6635         * enum.cs:
6636         Use the invariant culture when doing String.Compare for CLS case
6637         sensitivity.
6638         
6639 2004-05-23  Martin Baulig  <martin@ximian.com>
6640
6641         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6642         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6643
6644         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6645         
6646 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6647
6648         * class.cs (MemberBase.Define): Reuse MemberType member for 
6649         resolved type. Other methods can use it too.
6650
6651 2004-05-23  Martin Baulig  <martin@ximian.com>
6652
6653         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6654         the variable also exists in the current block (otherwise, we need
6655         to report a CS0103).  Fixes #58670.
6656
6657 2004-05-23  Martin Baulig  <martin@ximian.com>
6658
6659         * flowanalysis.cs (Reachability.Reachable): Compute this
6660         on-the-fly rather than storing it as a field.
6661
6662 2004-05-23  Martin Baulig  <martin@ximian.com>
6663
6664         * flowanalysis.cs (Reachability.And): Manually compute the
6665         resulting `barrier' from the reachability.      
6666        
6667 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6668
6669         Fix bug #57835
6670         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6671         instance of ObsoleteAttribute when symbol is obsolete.
6672
6673         * class.cs
6674         (IMethodData): Extended interface for ObsoleteAttribute support.
6675
6676 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6677
6678         * attribute.cs: Fix bug #55970
6679
6680 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6681
6682         Fix bug #52705
6683         * attribute.cs
6684         (GetObsoleteAttribute): New method. Creates the instance of
6685         ObsoleteAttribute.
6686         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6687         ObsoleteAttribute when member is obsolete.
6688         (AttributeTester.Report_ObsoleteMessage): Common method for
6689         Obsolete error/warning reporting.
6690
6691         * class.cs
6692         (TypeContainer.base_classs_type): New member for storing parent type.
6693
6694         * decl.cs
6695         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6696         for this MemberCore.
6697
6698 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6699
6700         * attribute.cs, const.cs: Fix bug #58590
6701
6702 2004-05-21  Martin Baulig  <martin@ximian.com>
6703
6704         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6705         out parameters if the end of the method is unreachable.  Fixes
6706         #58098. 
6707
6708 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6709
6710         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6711         Hari was right, why extra method.
6712
6713 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6714
6715         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6716
6717 2004-05-20  Martin Baulig  <martin@ximian.com>
6718
6719         Merged this back from gmcs to keep the differences to a minumum.
6720
6721         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6722         instead of a Declspace.
6723         (Attribute.ResolveType): Likewise.
6724         (Attributes.Search): Likewise.
6725         (Attributes.Contains): Likewise.
6726         (Attributes.GetClsCompliantAttribute): Likewise.
6727
6728         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6729         argument.
6730         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6731         DeclSpace.
6732
6733 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6734
6735         Fix bug #58688 (MCS does not report error when the same attribute
6736         is assigned twice)
6737
6738         * attribute.cs (Attribute.Emit): Distinction between null and default.
6739
6740 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6741
6742         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6743         of a top-level attribute without an attribute target.
6744         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6745         Make non-static.
6746         (Attribute.Conditional_GetConditionName), 
6747         (Attribute.Obsolete_GetObsoleteMessage): Update.
6748         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6749         part of ScanForIndexerName.
6750         (Attribute.CanIgnoreInvalidAttribute): New function.
6751         (Attribute.ScanForIndexerName): Move to ...
6752         (Attributes.ScanForIndexerName): ... here.
6753         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6754         (Attributes.Search): New internal variant that can choose not to
6755         complain if types aren't resolved.  The original signature now
6756         complains.
6757         (Attributes.GetClsCompliantAttribute): Use internal variant, with
6758         complaints suppressed.
6759         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6760         only if it not useful.
6761         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6762         top-level for attributes that are shared between the assembly
6763         and a top-level class.
6764         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6765         * class.cs: Update to reflect changes.
6766         (DefineIndexers): Fuse loops.
6767         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6768         a couple more variants of attribute names.
6769
6770 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6771
6772         Fix bug #52585 (Implemented explicit attribute declaration)
6773
6774         * attribute.cs:
6775         (Attributable.ValidAttributeTargets): New abstract method. It gets
6776         list of valid attribute targets for explicit target declaration.
6777         (Attribute.Target): It holds target itself.
6778         (AttributeSection): Removed.
6779         (Attribute.CheckTargets): New method. It checks whether attribute
6780         target is valid for the current element.
6781
6782         * class.cs:
6783         (EventProperty): New class. For events that are declared like
6784         property (with add and remove accessors).
6785         (EventField): New class. For events that are declared like field.
6786         class.cs
6787
6788         * cs-parser.jay: Implemented explicit attribute target declaration.
6789
6790         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6791         Override ValidAttributeTargets.
6792
6793         * parameter.cs:
6794         (ReturnParameter): Class for applying custom attributes on 
6795         the return type.
6796         (ParameterAtribute): New class. Class for applying custom
6797         attributes on the parameter type.
6798
6799 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6800
6801         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6802         definitions. 
6803
6804         (Method): Allow UNSAFE here.
6805
6806         * modifiers.cs: Support unsafe reporting.
6807
6808 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6809
6810         * decl.cs: Fix bug #58478.
6811
6812 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6813
6814         * statement.cs: When checking for unreachable code on an EmptyStatement,
6815         set the location. Fixes bug #58488.
6816
6817 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6818
6819         * driver.cs: Add -pkg handling.
6820
6821         From Gonzalo: UseShelLExecute=false
6822
6823 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6824
6825         * attribute.cs:
6826         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6827         for attribute.
6828         (Attribute.IsClsCompliaceRequired): Moved to base for better
6829         accesibility.
6830         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6831         when attribute is AttributeUsageAttribute.
6832         (Attribute.GetValidTargets): Simplified.
6833         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6834         attribute for this type.
6835         (Attribute.ApplyAttributes): Method renamed to Emit and make
6836         non-static.
6837         (GlobalAttributeSection): New class for special handling of global
6838         attributes (assembly, module).
6839         (AttributeSection.Emit): New method.
6840
6841         * class.cs: Implemented Attributable abstract methods.
6842         (MethodCore.LabelParameters): Moved to Parameter class.
6843         (Accessor): Is back simple class.
6844         (PropertyMethod): Implemented Attributable abstract class.
6845         (DelegateMethod): Implemented Attributable abstract class.
6846         (Event): New constructor for disctintion between normal Event
6847         and Event with accessors.
6848
6849         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6850
6851         * codegen.cs, const.cs, decl.cs, delegate.cs:
6852         (CommonAssemblyModulClass): Implemented Attributable abstract class
6853         and simplified.
6854
6855         * enum.cs: Implement IAttributeSupport interface.
6856         (EnumMember): New class for emum members. Implemented Attributable
6857         abstract class
6858
6859         * parameter.cs:
6860         (ParameterBase): Is abstract.
6861         (ReturnParameter): New class for easier [return:] attribute handling.
6862
6863         * typemanager.cs: Removed builder_to_attr.
6864
6865 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6866
6867         Fix bug #57151.
6868         * attribute.cs (Attribute.GetPositionalValue): New function.
6869         * class.cs (TypeContainer.VerifyMembers): New function.
6870         (TypeContainer.Emit): Use it.
6871         (ClassOrStruct): New base class for Class and Struct.
6872         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6873         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6874         class.
6875         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6876         then each non-static field should have a FieldOffset attribute.
6877         Otherwise, none of the fields should have a FieldOffset attribute.
6878         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6879         and FieldOffset attributes.
6880         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6881         (TypeManager.field_offset_attribute_type): New core types.
6882         (TypeManager.InitCoreTypes): Initialize them.
6883
6884 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6885
6886         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6887         Return correct type.
6888         From bug #58270.
6889
6890 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6891
6892         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6893         be implicitly converted to ulong.
6894         
6895         * expression.cs: The logic for allowing operator &, | and ^ worked
6896         was wrong, it worked before because we did not report an error in
6897         an else branch.  Fixes 57895.
6898
6899         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6900         allow volatile fields to be reference types.
6901
6902 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6903
6904         * driver.cs: Add support for /debug-
6905
6906 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6907
6908         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6909         Add a 'complain' parameter to silence errors.
6910         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6911         silently overlooked type-resolutions.
6912         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6913         to reflect changes.
6914         (Attributes.Search): New function.
6915         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6916         (Attributes.GetAttributeFullName): Remove hack.
6917         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6918         Update to reflect changes.
6919         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6920         Use Attributes.Search instead of nested loops.
6921
6922 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6923
6924         * decl.cs:
6925         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6926         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6927         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6928
6929         * report.cs: (Report.Warning): Renamed to Warning_T because of
6930         parameter collision.
6931
6932 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6933
6934         * expression.cs (MemberAccess.ResolveMemberAccess):
6935         Exit with non-zero status after Report.Error.
6936         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6937         Likewise.
6938         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6939
6940 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6941
6942         * support.cs: Don't hang when the file is empty.
6943
6944 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6945
6946         * support.cs: In SeekableStreamReader, compute the preamble size of the
6947           underlying stream. Position changes should take into account that initial
6948           count of bytes.
6949
6950 2004-05-03  Todd Berman  <tberman@sevenl.net>
6951
6952         * driver.cs: remove unused GetSysVersion function.
6953
6954 2004-05-03  Todd Berman  <tberman@sevenl.net>
6955
6956         * driver.cs: Remove the hack from saturday, as well as the hack
6957         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6958         link_paths to get that bit proper.
6959
6960 2004-05-01  Todd Berman  <tberman@sevenl.net>
6961
6962         * driver.cs: Try a LoadFrom before a Load, this checks the current
6963         path. This is currently a bug in mono that is be fixed, however, this
6964         provides a workaround for now. This will be removed when the bug
6965         is fixed.
6966
6967 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6968
6969         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6970         incomplete key pairs (#57941).
6971
6972 2004-05-01  Todd Berman  <tberman@sevenl.net>
6973
6974         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6975         from the GAC
6976
6977 2004-04-30  Jackson Harper  <jackson@ximian.com>
6978
6979         * codegen.cs: Open keys readonly.
6980         
6981 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6982
6983         * typemanager.cs: don't report cyclic struct layout when a struct
6984         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6985         which has 2 Pango.Rectangle fields.
6986
6987 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6988
6989         * expression.cs: Handle IntPtr comparisons with IL code
6990         rather than a method call.
6991
6992 2004-04-29  Martin Baulig  <martin@ximian.com>
6993
6994         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6995         the list of PropertyInfo's in class hierarchy and find the
6996         accessor.  Fixes #56013.
6997
6998 2004-04-29  Martin Baulig  <martin@ximian.com>
6999
7000         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7001
7002 2004-04-29  Martin Baulig  <martin@ximian.com>
7003
7004         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7005
7006         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7007
7008 2004-04-29  Martin Baulig  <martin@ximian.com>
7009
7010         * class.cs (ConstructorInitializer.Resolve): Check whether the
7011         parent .ctor is accessible.  Fixes #52146.
7012
7013 2004-04-29  Martin Baulig  <martin@ximian.com>
7014
7015         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7016
7017         * statement.cs (Using.EmitLocalVariableDecls): Use
7018         TypeManager.idisposable_type, not typeof (IDisposable).
7019         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7020
7021 2004-04-29  Martin Baulig  <martin@ximian.com>
7022
7023         * class.cs (Event.Define): Don't emit the field and don't set
7024         RTSpecialName and SpecialName for events on interfaces.  Fixes
7025         #57703. 
7026
7027 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7028
7029         Refactor Attribute.ApplyAttributes.
7030         * attribute.cs (Attributable): New base class for objects that can
7031         have Attributes applied on them.
7032         (Attribute): Make AttributeUsage fields public.
7033         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7034         (Attribute.IsInternalCall): New property.
7035         (Attribute.UsageAttr): Convert to a public read-only property.
7036         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7037         (Attribute.ResolveType, Attribute.Resolve)
7038         (Attribute.ScanForIndexerName): Update to reflect changes.
7039         (Attribute.CheckAttributeTarget): Re-format.
7040         (Attribute.ApplyAttributes): Refactor, to various
7041         Attributable.ApplyAttributeBuilder methods.
7042         * decl.cs (MemberCore): Make Attributable.
7043         * class.cs (Accessor): Make Attributable.
7044         (MethodData.ApplyAttributes): Use proper attribute types, not
7045         attribute names.
7046         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7047         (TypeContainer.ApplyAttributeBuilder)
7048         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7049         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7050         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7051         (Operator.ApplyAttributeBuilder): New factored-out methods.
7052         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7053         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7054         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7055         * parameter.cs (ParameterBase): New Attributable base class
7056         that can also represent Return types.
7057         (Parameter): Update to the changes.
7058
7059 2004-04-29  Jackson Harper  <jackson@ximian.com>
7060
7061         * driver.cs: Prefer the corlib system version when looking for
7062         assemblies in the GAC. This is still a hack, but its a better hack
7063         now.
7064         
7065 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7066
7067         * decl.cs, enum.cs: Improved error 3005 reporting.
7068   
7069         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7070         (related_symbols): New private member for list of symbols
7071         related to reported error/warning.
7072         
7073         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7074
7075 2004-04-29  Martin Baulig  <martin@ximian.com>
7076
7077         * ecore.cs (Expression.Constantify): If we're an enum and
7078         TypeManager.TypeToCoreType() doesn't give us another type, use
7079         t.UnderlyingSystemType.  Fixes #56178.  
7080
7081 2004-04-29  Martin Baulig  <martin@ximian.com>
7082
7083         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7084         interfaces and for each interface, only add members directly
7085         declared in that interface.  Fixes #53255.
7086
7087 2004-04-28  Martin Baulig  <martin@ximian.com>
7088
7089         * expression.cs (ConditionalLogicalOperator): Use a temporary
7090         variable for `left' to avoid that we evaluate it more than once;
7091         bug #52588.
7092
7093 2004-04-28  Martin Baulig  <martin@ximian.com>
7094
7095         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7096         `void[]' (CS1547).
7097
7098 2004-04-28  Martin Baulig  <martin@ximian.com>
7099
7100         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7101         void (CS1547).
7102
7103         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7104         whether the type is not void (CS1547).
7105
7106 2004-04-28  Martin Baulig  <martin@ximian.com>
7107
7108         * expression.cs (Unary.DoResolveLValue): Override this and report
7109         CS0131 for anything but Operator.Indirection.
7110
7111 2004-04-28  Martin Baulig  <martin@ximian.com>
7112
7113         Committing a patch from Ben Maurer; see bug #50820.
7114
7115         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7116         check for classes.
7117
7118         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7119         classes.        
7120
7121 2004-04-28  Martin Baulig  <martin@ximian.com>
7122
7123         Committing a patch from Ben Maurer; see bug #50820.
7124
7125         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7126         check for classes.
7127
7128         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7129         classes.        
7130
7131 2004-04-28  Martin Baulig  <martin@ximian.com>
7132
7133         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7134         (Block.AddLabel): Call DoLookupLabel() to only search in the
7135         current block.
7136
7137 2004-04-28  Martin Baulig  <martin@ximian.com>
7138
7139         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7140         comparing StringConstants and NullLiterals in Equality and Inequality.
7141
7142 2004-04-28  Jackson Harper  <jackson@ximian.com>
7143
7144         * driver.cs: Attempt to load referenced assemblies from the
7145         GAC. This is the quick and dirty version of this method that
7146         doesnt take into account versions and just takes the first
7147         canidate found. Will be good enough for now as we will not have more
7148         then one version installed into the GAC until I update this method.
7149
7150 2004-04-28  Martin Baulig  <martin@ximian.com>
7151
7152         * typemanager.cs (TypeManager.CheckStructCycles): New public
7153         static method to check for cycles in the struct layout.
7154
7155         * rootcontext.cs (RootContext.PopulateTypes): Call
7156         TypeManager.CheckStructCycles() for each TypeContainer.
7157         [Note: We only need to visit each type once.]
7158
7159 2004-04-28  Martin Baulig  <martin@ximian.com>
7160
7161         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7162
7163         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7164         success and added `out object value'.  Use a `bool resolved' field
7165         to check whether we've already been called rather than
7166         `ConstantValue != null' since this breaks for NullLiterals.
7167
7168 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7169
7170         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7171         setting of this flag, since the 'set' method may be non-public.
7172
7173 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7174
7175         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7176         check on current_vector.Block.
7177
7178 2004-04-27  Martin Baulig  <martin@ximian.com>
7179
7180         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7181         a field initializer.  Fixes #56459.
7182
7183 2004-04-27  Martin Baulig  <martin@ximian.com>
7184
7185         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7186         we're not attempting to use an indexer.  Fixes #52154.
7187
7188 2004-04-27  Martin Baulig  <martin@ximian.com>
7189
7190         * statement.cs (Return): Don't create a return label if we don't
7191         need it; reverts my change from January 20th.  Thanks to Ben
7192         Maurer for this.
7193
7194 2004-04-27  Martin Baulig  <martin@ximian.com>
7195
7196         According to the spec, `goto' can only leave a nested scope, but
7197         never enter it.
7198
7199         * statement.cs (Block.LookupLabel): Only lookup in the current
7200         block, don't recurse into parent or child blocks.
7201         (Block.AddLabel): Check in parent and child blocks, report
7202         CS0140/CS0158 if we find a duplicate.
7203         (Block): Removed this indexer for label lookups.
7204         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7205         this already does the error reporting for us.
7206
7207         * flowanalysis.cs
7208         (FlowBranching.UsageVector.Block): New public variable; may be null.
7209         (FlowBranching.CreateSibling): Added `Block' argument.
7210         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7211         label for the target of a `goto' and check whether we're not
7212         leaving a `finally'.
7213
7214 2004-04-27  Martin Baulig  <martin@ximian.com>
7215
7216         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7217         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7218         just for returns).
7219
7220 2004-04-27  Martin Baulig  <martin@ximian.com>
7221
7222         * statement.cs (Block.AddLabel): Also check for implicit blocks
7223         and added a CS0158 check.
7224
7225 2004-04-27  Martin Baulig  <martin@ximian.com>
7226
7227         * flowanalysis.cs (FlowBranchingLoop): New class.
7228         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7229         UsageVector's instead of an ArrayList.
7230         (FlowBranching.Label): Likewise.
7231         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7232         (FlowBranching.AddBreakVector): New method.
7233
7234 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7235
7236         * attribute.cs: Small regression fix: only convert the type if we
7237         the type is different, fixes System.Drawing build.
7238
7239 2004-04-27  Martin Baulig  <martin@ximian.com>
7240
7241         * attribute.cs (Attribute.Resolve): If we have a constant value
7242         for a named field or property, implicity convert it to the correct
7243         type.
7244
7245 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7246
7247         * statement.cs (Block.Block): Implicit blocks share
7248         'child_variable_names' fields with parent blocks.
7249         (Block.AddChildVariableNames): Remove.
7250         (Block.AddVariable): Mark variable as "used by a child block" in
7251         every surrounding block.
7252         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7253         been used in a child block, complain about violation of "Invariant
7254         meaning in blocks" rule.
7255         * cs-parser.jay (declare_local_variables): Don't use
7256         AddChildVariableNames.
7257         (foreach_statement): Don't create an implicit block: 'foreach'
7258         introduces a scope.
7259
7260 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7261
7262         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7263         converting from 0L to ulong.  Fixes 57522.
7264
7265 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7266
7267         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7268         derived class hides via 'new' keyword field from base class (test-242.cs).
7269         TODO: Handle this in the more general way.
7270         
7271         * class.cs (CheckBase): Ditto.
7272
7273 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7274
7275         * decl.cs (caching_flags): New member for storing cached values
7276         as bit flags.
7277         (MemberCore.Flags): New enum where bit flags for caching_flags
7278         are defined.
7279         (MemberCore.cls_compliance): Moved to caching_flags.
7280         (DeclSpace.Created): Moved to caching_flags.
7281
7282         * class.cs: Use caching_flags instead of DeclSpace.Created
7283         
7284 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7285
7286         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7287         if we are only a derived class, not a nested class.
7288
7289         * typemanager.cs: Same as above, but do this at the MemberLookup
7290         level (used by field and methods, properties are handled in
7291         PropertyExpr).   Allow for the qualified access if we are a nested
7292         method. 
7293
7294 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7295
7296         * class.cs: Refactoring.
7297         (IMethodData): New inteface; Holds links to parent members
7298         to avoid member duplication (reduced memory allocation).
7299         (Method): Implemented IMethodData interface.
7300         (PropertyBase): New inner classes for get/set methods.
7301         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7302         (Event): New inner classes for add/remove methods.
7303         (Event.DelegateMethod): Implemented IMethodData interface.
7304
7305         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7306         EmitContext (related to class.cs refactoring).
7307
7308 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7309
7310         * delegate.cs (Delegate.VerifyApplicability): If the number of
7311         arguments are the same as the number of parameters, first try to
7312         verify applicability ignoring  any 'params' modifier on the last
7313         parameter.
7314         Fixes #56442.
7315
7316 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7317
7318         * class.cs (TypeContainer.AddIndexer): Use
7319         'ExplicitInterfaceName' to determine if interface name was
7320         explicitly specified.  'InterfaceType' is not initialized at this time.
7321         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7322         Indexers array is already in the required order.  Initialize
7323         'IndexerName' only if there are normal indexers.
7324         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7325         (TypeContainer.Emit): Emit DefaultMember attribute only if
7326         IndexerName is initialized.
7327         Fixes #56300.
7328
7329 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7330
7331         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7332         Fixes #57007
7333
7334 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7335
7336         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7337         attributes.
7338         Fix for #56456.
7339
7340         * attribute.cs (Attribute.Resolve): Check for duplicate named
7341         attributes.
7342         Fix for #56463.
7343
7344 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7345
7346         * iterators.cs (MarkYield): track whether we are in an exception,
7347         and generate code accordingly.  Use a temporary value to store the
7348         result for our state.
7349
7350         I had ignored a bit the interaction of try/catch with iterators
7351         since their behavior was not entirely obvious, but now it is
7352         possible to verify that our behavior is the same as MS .NET 2.0
7353
7354         Fixes 54814
7355
7356 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7357
7358         * iterators.cs: Avoid creating temporaries if there is no work to
7359         do. 
7360
7361         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7362         Enumerations, use TypeManager.EnumToUnderlying and call
7363         recursively. 
7364
7365         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7366         bug #57013
7367
7368         (This.Emit): Use EmitContext.EmitThis to emit our
7369         instance variable.
7370
7371         (This.EmitAssign): Ditto.
7372
7373         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7374         codepaths, we will move all the functionality into
7375         Mono.CSharp.This 
7376
7377         (FieldExpr.EmitAssign): Ditto.
7378
7379         This fixes several hidden bugs that I uncovered while doing a code
7380         review of this today.
7381
7382         * codegen.cs (EmitThis): reworked so the semantics are more clear
7383         and also support value types "this" instances.
7384
7385         * iterators.cs: Changed so that for iterators in value types, we
7386         do not pass the value type as a parameter.  
7387
7388         Initialization of the enumerator helpers is now done in the caller
7389         instead of passing the parameters to the constructors and having
7390         the constructor set the fields.
7391
7392         The fields have now `assembly' visibility instead of private.
7393
7394 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7395
7396         * expression.cs (Argument.Resolve): Check if fields passed as ref
7397         or out are contained in a MarshalByRefObject.
7398
7399         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7400         another compiler type.
7401
7402 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7403
7404         * class.cs (Indexer.Define): use the new name checking method.
7405         Also, return false on an error.
7406         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7407         (is_identifier_[start/part]_character): make static.
7408
7409 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7410
7411         * expression.cs (Binary.ResolveOperator): Do no append strings
7412         twice: since we can be invoked more than once (array evaluation)
7413         on the same concatenation, take care of this here.  Based on a fix
7414         from Ben (bug #56454)
7415
7416 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7417
7418         * codegen.cs: Fix another case where CS1548 must be reported (when 
7419         delay-sign isn't specified and no private is available #56564). Fix
7420         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7421         error when MCS is used on the MS runtime and we need to delay-sign 
7422         (which seems unsupported by AssemblyBuilder - see #56621).
7423
7424 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7425
7426         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7427         (TypeManager.ComputeNamespaces): Faster implementation for
7428         Microsoft runtime.
7429
7430         * compiler.csproj: Updated AssemblyName to mcs.
7431
7432 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * rootcontext.cs: Add new types to the boot resolution.
7435
7436         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7437         MulticastDelegate is not allowed.
7438
7439         * typemanager.cs: Add new types to lookup: System.TypedReference
7440         and ArgIterator.
7441
7442         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7443         check for TypedReference or ArgIterator, they are not allowed. 
7444
7445         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7446         makes us properly catch 1510 in some conditions (see bug 56016 for
7447         details). 
7448
7449 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7450
7451         * CryptoConvert.cs: update from corlib version
7452         with endian fixes.
7453
7454 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7455
7456         * class.cs (Indexer.Define): Check indexername declaration
7457
7458 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7459
7460         * attribute.cs (IsClsCompliant): Fixed problem with handling
7461         all three states (compliant, not-compliant, undetected).
7462
7463 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7464
7465         * attribute.cs (Attribute): Location is now public.
7466         (Resolve): Store resolved arguments (pos_values) in attribute class.
7467         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7468         (GetClsCompliantAttributeValue): New method that gets
7469         CLSCompliantAttribute value.
7470         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7471         if exists else null.
7472         (AttributeTester): New class for CLS-Compliant verification routines.
7473
7474         * class.cs (Emit): Add CLS-Compliant verification.
7475         (Method.GetSignatureForError): Implemented.
7476         (Constructor.GetSignatureForError): Implemented
7477         (Constructor.HasCompliantArgs): Returns if constructor has
7478         CLS-Compliant arguments.
7479         (Constructor.Emit): Override.
7480         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7481         is needed to test only parameters.
7482         (FieldBase.GetSignatureForError): Implemented.
7483         (TypeContainer): New member for storing base interfaces.
7484         (TypeContainer.FindMembers): Search in base interfaces too.
7485
7486         * codegen.cs (GetClsComplianceAttribute): New method that gets
7487         assembly or module CLSCompliantAttribute value.
7488         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7489         for assembly.
7490         (ModuleClass.Emit): Add error 3012 test.
7491
7492         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7493
7494         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7495         state for all decl types.
7496         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7497         if CLS-Compliant tests are required.
7498         (IsClsCompliaceRequired): New method. Analyze whether code
7499         must be CLS-Compliant.
7500         (IsExposedFromAssembly): New method. Returns true when MemberCore
7501         is exposed from assembly.
7502         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7503         value or gets cached value.
7504         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7505         is explicitly marked with CLSCompliantAttribute.
7506         (IsIdentifierClsCompliant): New abstract method. This method is
7507         used to testing error 3005.
7508         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7509         for identifier and parameters CLS-Compliant testing.
7510         (VerifyClsCompliance): New method. The main virtual method for
7511         CLS-Compliant verifications.
7512         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7513         null. I don't know why is null (too many public members !).
7514         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7515         and get value of first CLSCompliantAttribute that found.
7516
7517         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7518         (VerifyClsCompliance): Override and add extra tests.
7519
7520         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7521         clscheck- disable CLS-Compliant verification event if assembly is has
7522         CLSCompliantAttribute(true).
7523
7524         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7525         ApllyAttribute is now called in emit section as in the other cases.
7526         Possible future Emit integration.
7527         (IsIdentifierClsCompliant): New override.
7528         (VerifyClsCompliance): New override.
7529         (GetEnumeratorName): Returns full enum name.
7530
7531         * parameter.cs (GetSignatureForError): Implemented.
7532
7533         * report.cs (WarningData): New struct for Warning message information.
7534         (LocationOfPreviousError): New method.
7535         (Warning): New method. Reports warning based on the warning table.
7536         (Error_T): New method. Reports error based on the error table.
7537
7538         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7539         verifications are done here.
7540
7541         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7542
7543         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7544         CLSCompliantAttribute.
7545         (all_imported_types): New member holds all imported types from other
7546         assemblies.
7547         (LoadAllImportedTypes): New method fills static table with exported types
7548         from all referenced assemblies.
7549         (Modules): New property returns all assembly modules.
7550
7551 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7552
7553         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7554         throwing a parser error.
7555
7556         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7557         which removes the hardcoded get_/set_ prefixes for properties, as
7558         IL allows for the properties to be named something else.  
7559
7560         Bug #56013
7561
7562         * expression.cs: Do not override operand before we know if it is
7563         non-null.  Fix 56207
7564
7565 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7566
7567         * typemanager.cs: support for pinned variables.
7568
7569 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7570
7571         * decl.cs, typemanager.cs: Avoid using an arraylist
7572         as a buffer if there is only one result set.
7573
7574 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7575
7576         * expression.cs: Make sure you cant call a static method
7577         with an instance expression, bug #56174.
7578
7579 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7580
7581         * class.cs (IsDuplicateImplementation): Improve error reporting to
7582         flag 663 (method only differs in parameter modifier).
7583
7584         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7585         in preprocessor directives.
7586
7587         * location.cs (LookupFile): Allow for the empty path.
7588
7589         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7590         better approach for some of that patch, but its failing with the
7591         CharSet enumeration.  For now try/catch will do.
7592
7593         * typemanager.cs: Do not crash if a struct does not have fields.
7594         Fixes 56150.
7595
7596 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7597
7598         * expression.cs: cs0213, cant fix a fixed expression.
7599         fixes 50231.
7600
7601 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7602
7603         * cs-parser.jay: detect invalid embeded statements gracefully.
7604         bug #51113.
7605
7606 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7607
7608         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7609         As a regex:
7610         s/
7611         the invocation type may not be a subclass of the tye of the item/
7612         The type of the item must be a subclass of the invocation item.
7613         /g
7614
7615         Fixes bug #50820.
7616
7617 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7618
7619         * attribute.cs: Added methods to get a string and a bool from an
7620         attribute. Required to information from AssemblyKeyFileAttribute,
7621         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7622         * codegen.cs: Modified AssemblyName creation to include support for
7623         strongnames. Catch additional exceptions to report them as CS1548.
7624         * compiler.csproj: Updated include CryptoConvert.cs.
7625         * compiler.csproj.user: Removed file - user specific configuration.
7626         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7627         Mono.Security assembly. The original class is maintained and tested in
7628         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7629         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7630         like CSC 8.0 (C# v2) supports.
7631         * Makefile: Added CryptoConvert.cs to mcs sources.
7632         * rootcontext.cs: Added new options for strongnames.
7633
7634 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7635
7636         * driver.cs: For --expect-error, report error code `2'
7637         if the program compiled with no errors, error code `1' if
7638         it compiled with an error other than the one expected.
7639
7640 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7641
7642         * compiler.csproj: Updated for Visual Studio .NET 2003.
7643         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7644         * compiler.sln: Updated for Visual Studio .NET 2003.
7645
7646 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7647
7648         * expression.cs: Fix bug #47234. We basically need to apply the
7649         rule that we prefer the conversion of null to a reference type
7650         when faced with a conversion to 'object' (csc behaviour).
7651
7652 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7653
7654         * statement.cs: Shorter form for foreach, eliminates
7655         a local variable. r=Martin.
7656
7657 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7658
7659         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7660         checks if we can use brtrue/brfalse to test for 0.
7661         * expression.cs: use the above in the test for using brtrue/brfalse.
7662         cleanup code a bit.
7663
7664 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7665
7666         * expression.cs: Rewrite string concat stuff. Benefits:
7667
7668         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7669         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7670         rather than a concat chain.
7671
7672         * typemanager.cs: Add lookups for more concat overloads.
7673
7674 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7675
7676         * expression.cs: Emit shorter il code for array init.
7677
7678         newarr
7679         dup
7680         // set 1
7681
7682         // set 2
7683
7684         newarr
7685         stloc.x
7686
7687         ldloc.x
7688         // set 1
7689
7690         ldloc.x
7691         // set 2
7692
7693 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7694
7695         * statement.cs: Before, two switch blocks would be merged if the
7696         total size of the blocks (end_item - begin_item + 1) was less than
7697         two times the combined sizes of the blocks.
7698
7699         Now, it will only merge if after the merge at least half of the
7700         slots are filled.
7701
7702         fixes 55885.
7703
7704 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7705
7706         * class.cs : csc build fix for GetMethods(). See bug #52503.
7707
7708 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7709
7710         * expression.cs: Make sure fp comparisons work with NaN.
7711         This fixes bug #54303. Mig approved this patch a long
7712         time ago, but we were not able to test b/c the runtime
7713         had a related bug.
7714
7715 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7716
7717         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7718
7719 2004-03-19  Martin Baulig  <martin@ximian.com>
7720
7721         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7722         error here and not in our caller.
7723
7724 2004-03-19  Martin Baulig  <martin@ximian.com>
7725
7726         * interface.cs: Completely killed this file.
7727         (Interface): We're now a TypeContainer and live in class.cs.
7728
7729         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7730         argument; we're now also called for interfaces.
7731         (TypeContainer.DefineMembers): Allow this method being called
7732         multiple times.
7733         (TypeContainer.GetMethods): New public method; formerly known as
7734         Interface.GetMethod().  This is used by PendingImplementation.
7735         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7736         it's now private and non-static.
7737         (Interface): Moved this here; it's now implemented similar to
7738         Class and Struct.
7739         (Method, Property, Event, Indexer): Added `bool is_interface'
7740         argument to their .ctor's.
7741         (MemberBase.IsInterface): New public field.
7742
7743         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7744         instances instead of InterfaceMethod, InterfaceProperty, etc.
7745         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7746         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7747
7748 2004-03-19  Martin Baulig  <martin@ximian.com>
7749
7750         * class.cs (MethodCore.IsDuplicateImplementation): New private
7751         method which does the CS0111 checking.
7752         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7753         Use IsDuplicateImplementation().
7754
7755 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7756
7757         * decl.cs (FindMemberToOverride): New method to find the correct
7758         method or property to override in the base class.
7759         * class.cs
7760             - Make Method/Property use the above method to find the
7761               version in the base class.
7762             - Remove the InheritableMemberSignatureCompare as it is now
7763               dead code.
7764
7765         This patch makes large code bases much faster to compile, as it is
7766         O(n) rather than O(n^2) to do this validation.
7767
7768         Also, it fixes bug 52458 which is that nested classes are not
7769         taken into account when finding the base class member.
7770
7771         Reviewed/Approved by Martin.
7772
7773 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7774
7775         * interface.cs: In all interface classes removed redundant
7776         member initialization.
7777
7778 2004-03-16  Martin Baulig  <martin@ximian.com>
7779
7780         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7781
7782 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7783
7784         * decl.cs (DefineTypeAndParents): New helper method to define a
7785         type's containers before the type itself is defined;  This is a
7786         bug exposed by the recent changes to Windows.Forms when an
7787         implemented interface was defined inside a class that had not been
7788         built yet.   
7789
7790         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7791
7792         (Check): Loop correctly to report errors modifiers
7793         (UNSAFE was not in the loop, since it was the same as TOP).
7794
7795         * interface.cs: Every interface member now takes a ModFlags,
7796         instead of a "is_new" bool, which we set on the base MemberCore. 
7797
7798         Every place where we called "UnsafeOk" in the interface, now we
7799         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7800         the unsafe settings from the member declaration instead of the
7801         container interface. 
7802
7803         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7804
7805         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7806         `set_indexer_name' to the pending bits (one per type).
7807
7808         We fixed a bug today that was picking the wrong method to
7809         override, since for properties the existing InterfaceMethod code
7810         basically ignored the method name.  Now we make sure that the
7811         method name is one of the valid indexer names.
7812
7813 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7814  
7815         * support.cs (SeekableStreamReader): Keep track of stream byte
7816         positions and don't mix them with character offsets to the buffer.
7817
7818         Patch from Gustavo Giráldez
7819
7820 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7821
7822         * interface.cs (InterfaceSetGetBase): Removed double member
7823         initialization, base class does it as well.
7824
7825 2004-03-13  Martin Baulig  <martin@ximian.com>
7826
7827         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7828         when compiling corlib.
7829
7830 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7831
7832         * convert.cs (ExplicitConversion): We were reporting an error on
7833         certain conversions (object_type source to a value type, when the
7834         expression was `null') before we had a chance to pass it through
7835         the user defined conversions.
7836
7837         * driver.cs: Replace / and \ in resource specifications to dots.
7838         Fixes 50752
7839
7840         * class.cs: Add check for duplicate operators.  Fixes 52477
7841
7842 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7843
7844         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7845         that are in the middle of the statements, not only at the end.
7846         Fixes #54987
7847
7848         * class.cs (TypeContainer.AddField): No longer set the
7849         `HaveStaticConstructor' flag, now we call it
7850         `UserDefineStaticConstructor' to diferentiate the slightly
7851         semantic difference.
7852
7853         The situation is that we were not adding BeforeFieldInit (from
7854         Modifiers.TypeAttr) to classes that could have it.
7855         BeforeFieldInit should be set to classes that have no static
7856         constructor. 
7857
7858         See:
7859
7860         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7861
7862         And most importantly Zoltan's comment:
7863
7864         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7865
7866         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7867          before its static fields are used', i.e. initialization does not need
7868          to be triggered by the first access to the type. Setting this flag
7869          helps the JIT to compile better code, since it can run the static
7870          constructor at JIT time, and does not need to generate code to call it
7871          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7872          this flag for lots of classes like String. 
7873          
7874          csc sets this flag if the type does not have an explicit static 
7875          constructor. The reasoning seems to be that if there are only static
7876          initalizers for a type, and no static constructor, then the programmer
7877          does not care when this initialization happens, so beforefieldinit
7878          can be used.
7879          
7880          This bug prevents the AOT compiler from being usable, since it 
7881          generates so many calls to mono_runtime_class_init that the AOT code
7882          is much slower than the JITted code. The JITted code is faster, 
7883          because it does not generate these calls if the vtable is type is
7884          already initialized, which is true in the majority of cases. But the
7885          AOT compiler can't do this."
7886
7887 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7888
7889         * class.cs (MethodData.Emit): Refactor the code so symbolic
7890         information is generated for destructors;  For some reasons we
7891         were taking a code path that did not generate symbolic information
7892         before. 
7893
7894 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7895
7896         * class.cs: Create a Constructor.CheckBase method that
7897         takes care of all validation type code. The method
7898         contains some code that was moved from Define.
7899
7900         It also includes new code that checks for duplicate ctors.
7901         This fixes bug #55148.
7902
7903 2004-03-09  Joshua Tauberer <tauberer@for.net>
7904
7905         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7906         a { ... }-style array creation invokes EmitStaticInitializers
7907         which is not good for reference-type arrays.  String, decimal
7908         and now null constants (NullCast) are not counted toward
7909         static initializers.
7910
7911 2004-03-05  Martin Baulig  <martin@ximian.com>
7912
7913         * location.cs (SourceFile.HasLineDirective): New public field;
7914         specifies whether the file contains or is referenced by a "#line"
7915         directive.
7916         (Location.DefineSymbolDocuments): Ignore source files which
7917         either contain or are referenced by a "#line" directive.        
7918
7919 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7920
7921         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7922         direct access to our parent, so check the method inline there.
7923
7924 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7925
7926         * expression.cs (Invocation.EmitCall): Miguel's last commit
7927         caused a regression. If you had:
7928
7929             T t = null;
7930             t.Foo ();
7931
7932         In Foo the implict this would be null.
7933
7934 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7935
7936         * expression.cs (Invocation.EmitCall): If the method is not
7937         virtual, do not emit a CallVirt to it, use Call.
7938
7939         * typemanager.cs (GetFullNameSignature): Improve the method to
7940         cope with ".ctor" and replace it with the type name.
7941
7942         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7943         as an argument the ConstructorBuilder where it is being defined,
7944         to catch the recursive constructor invocations.
7945
7946 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7947
7948         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7949         routines to check if a type is an enumerable/enumerator allow
7950         classes that implement the IEnumerable or IEnumerator interfaces.
7951
7952         * class.cs (Property, Operator): Implement IIteratorContainer, and
7953         implement SetYields.
7954
7955         (Property.Define): Do the block swapping for get_methods in the
7956         context of iterators.   We need to check if Properties also
7957         include indexers or not.
7958
7959         (Operator): Assign the Block before invoking the
7960         OperatorMethod.Define, so we can trigger the Iterator code
7961         replacement. 
7962
7963         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7964         Property and Operator classes are not created when we parse the
7965         declarator but until we have the block completed, so we use a
7966         singleton SimpleIteratorContainer.Simple to flag whether the
7967         SetYields has been invoked.
7968
7969         We propagate this setting then to the Property or the Operator to
7970         allow the `yield' to function.
7971
7972 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7973
7974         * codegen.cs: Implemented attribute support for modules.
7975         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7976         Assembly/Module functionality.
7977
7978         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7979         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7980         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7981
7982 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7983
7984         * interface.cs (FindMembers): The operation is performed on all base
7985         interfaces and not only on the first. It is required for future CLS Compliance patch.
7986
7987 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7988
7989         * statement.cs, codegen.cs:
7990         This patch deals with patterns such as:
7991
7992         public class List : IEnumerable {
7993
7994                 public MyEnumerator GetEnumerator () {
7995                         return new MyEnumerator(this);
7996                 }
7997
7998                 IEnumerator IEnumerable.GetEnumerator () {
7999                         ...
8000                 }
8001                 
8002                 public struct MyEnumerator : IEnumerator {
8003                         ...
8004                 }
8005         }
8006
8007         Before, there were a few things we did wrong:
8008         1) we would emit callvirt on a struct, which is illegal
8009         2) we emited ldarg when we needed to emit ldarga
8010         3) we would mistakenly call the interface methods on an enumerator
8011         type that derived from IEnumerator and was in another assembly. For example:
8012
8013         public class MyEnumerator : IEnumerator
8014
8015         Would have the interface methods called, even if there were public impls of the
8016         method. In a struct, this lead to invalid IL code.
8017
8018 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8019
8020         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8021           renamed to Emit.
8022
8023         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8024
8025 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8026
8027         * cs-parser.jay: Fix small regression: we were not testing V2
8028         compiler features correctly.
8029
8030         * interface.cs: If the emit context is null, then create one
8031
8032 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8033
8034         * decl.cs (GetSignatureForError): New virtual method to get full name
8035           for error messages.
8036
8037         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8038           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8039
8040         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8041           Duplicated members and code in these classes has been removed.
8042           Better encapsulation in these classes.
8043
8044 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8045
8046         * assign.cs (Assign.DoResolve): When dealing with compound
8047         assignments, there is a new rule in ECMA C# 2.4 (might have been
8048         there before, but it is documented here) that states that in:
8049
8050         a op= b;
8051
8052         If b is of type int, and the `op' is a shift-operator, then the
8053         above is evaluated as:
8054
8055         a = (int) a op b 
8056
8057         * expression.cs (Binary.ResolveOperator): Instead of testing for
8058         int/uint/long/ulong, try to implicitly convert to any of those
8059         types and use that in pointer arithmetic.
8060
8061         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8062         method to print information for from the type, not from the
8063         null-method we were given.
8064
8065 2004-02-01  Duncan Mak  <duncan@ximian.com>
8066
8067         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8068         parsing for cmd, fixes bug #53694.
8069
8070 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8071
8072         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8073         in the member name duplication tests. Property and operator name duplication
8074         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8075
8076 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8077
8078         * interface.cs (PopulateMethod): Fixed crash when interface method
8079         returns not existing type (error test cs0246-3.cs).
8080
8081 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8082
8083         * cs-parser.jay (interface_accessors): Re-write actions to also
8084         store attributes attached to get and set methods. Fix spelling
8085         while at it.
8086
8087         (inteface_property_declaration): Modify accordingly.
8088
8089         (InterfaceAccessorInfo): New helper class to store information to pass
8090         around between rules that use interface_accessors.
8091
8092         * interface.cs (Emit): Apply attributes on the get and set
8093         accessors of properties and indexers too.
8094
8095         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8096         right MethodBuilder when applying attributes to the get and set accessors.
8097
8098 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8099
8100         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8101
8102 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8103
8104         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8105
8106 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8107
8108         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8109         changes that treat `yield' specially when present before `break'
8110         or `return' tokens.
8111
8112         * cs-tokenizer.cs: yield is no longer a keyword.
8113
8114 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8115
8116         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8117         setting for default constructors.
8118         For default constructors are almost every time set wrong Modifier. The
8119         generated IL code has been alright. But inside mcs this values was
8120         wrong and this was reason why several of my CLS Compliance tests
8121         failed.
8122
8123 2004-01-22  Martin Baulig  <martin@ximian.com>
8124
8125         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8126         not a QualifiedIdentifier.  This is what `type_name_expression'
8127         was previously doing.
8128         (type_name_expression): Removed; the code is now in
8129         `namespace_or_type_name'.
8130         (qualified_identifier): Removed, use `namespace_or_type_name'
8131         instead.
8132         (QualifiedIdentifier): Removed this class.      
8133
8134 2004-01-22  Martin Baulig  <martin@ximian.com>
8135
8136         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8137         not a string as alias name.
8138
8139 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8140
8141         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8142         #52730 bug, and instead compute correctly the need to use a
8143         temporary variable when requesting an address based on the
8144         static/instace modified of the field and the constructor.
8145  
8146 2004-01-21  Martin Baulig  <martin@ximian.com>
8147
8148         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8149         class and namespace before looking up aliases.  Fixes #52517.
8150
8151 2004-01-21  Martin Baulig  <martin@ximian.com>
8152
8153         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8154         assinged in a 'try'; fixes exception4.cs.
8155
8156 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8157         * class.cs : Implemented parameter-less constructor for TypeContainer
8158
8159         * decl.cs: Attributes are now stored here. New property OptAttributes
8160
8161         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8162
8163         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8164
8165 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8166
8167         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8168           (CSharpSignature): New method for indexer and property signature.
8169
8170 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8171
8172         * pending.cs (IsVirtualFilter): Faster implementation.
8173
8174 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8175
8176         * typemanager.cs: Avoid inclusion of same assembly more than once.
8177
8178 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8179
8180         * cs-parser.jay: Fixed problem where the last assembly attribute
8181           has been applied also to following declaration (class, struct, etc.)
8182           
8183 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8184
8185         * class.cs: Added error CS0538, CS0539 reporting.
8186         Fixed crash on Microsoft runtime when field type is void.
8187
8188         * cs-parser.jay: Added error CS0537 reporting.
8189
8190         * pending.cs: Added error CS0535 reporting.
8191         Improved error report for errors CS0536, CS0534.
8192
8193 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8194
8195         Merge a few bits from the Anonymous Method MCS tree.
8196
8197         * statement.cs (ToplevelBlock): New class for toplevel methods,
8198         will hold anonymous methods, lifted variables.
8199
8200         * cs-parser.jay: Create toplevel blocks for delegates and for
8201         regular blocks of code. 
8202
8203 2004-01-20  Martin Baulig  <martin@ximian.com>
8204
8205         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8206         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8207         and `NeedExplicitReturn'; added `IsLastStatement'.
8208         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8209         have a `ReturnLabel' or we're not unreachable.
8210
8211         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8212         child's reachability; don't just override ours with it.  Fixes
8213         #58058 (lluis's example).
8214         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8215         InFinally(), InLoop(), InSwitch() and
8216         BreakCrossesTryCatchBoundary() methods.
8217
8218         * statement.cs (Return): Do all error checking in Resolve().
8219         Unless we are the last statement in a top-level block, always
8220         create a return label and jump to it.
8221         (Break, Continue): Do all error checking in Resolve(); also make
8222         sure we aren't leaving a `finally'.
8223         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8224         statement in a top-level block.
8225         (Block.Flags): Added `IsDestructor'.
8226         (Block.IsDestructor): New public property.
8227
8228 2004-01-20  Martin Baulig  <martin@ximian.com>
8229
8230         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8231
8232 2004-01-20  Martin Baulig  <martin@ximian.com>
8233
8234         * statement.cs (Statement.ResolveUnreachable): New public method.
8235         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8236         (Block.Resolve): Resolve unreachable statements.
8237
8238 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8239
8240         * expression.cs: We need to fix the case where we do
8241         not have a temp variable here.
8242
8243         * assign.cs: Only expression compound assignments need
8244         temporary variables.
8245
8246 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8247
8248         * flowanalysis.cs: Reduce memory allocation in a few ways:
8249           - A block with no variables should not allocate a bit
8250             vector for itself.
8251           - A method with no out parameters does not need any tracking
8252             for assignment of the parameters, so we need not allocate
8253             any data for it.
8254           - The arrays:
8255                 public readonly Type[] VariableTypes;
8256                 public readonly string[] VariableNames;
8257             Are redundant. The data is already stored in the variable
8258             map, so we need not allocate another array for it.
8259           - We need to add alot of checks for if (params | locals) == null
8260             due to the first two changes.
8261
8262 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8263
8264         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8265         implement IMemoryLocation, we store a copy on a local variable and
8266         take the address of it.  Patch from Benjamin Jemlich
8267
8268         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8269         to use a special "type_name_expression" rule which reduces the
8270         number of "QualifiedIdentifier" classes created, and instead
8271         directly creates MemberAccess expressions.
8272
8273 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8274
8275         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8276         that fixes #52853.  Null literal assignment to ValueType
8277
8278         * class.cs (MethodData.Emit): Instead of checking the name of the
8279         method to determine if its a destructor, create a new derived
8280         class from Method called Destructor, and test for that.  
8281
8282         * cs-parser.jay: Create a Destructor object instead of a Method.  
8283
8284         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8285
8286         Fixes: 52933
8287
8288 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8289
8290         * expression.cs (Binary.ResolveOperator): Perform an implicit
8291         conversion from MethodGroups to their delegate types on the
8292         Addition operation.
8293
8294         * delegate.cs: Introduce a new class DelegateCreation that is the
8295         base class for `NewDelegate' and `ImplicitDelegateCreation',
8296         factor some code in here.
8297
8298         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8299         conversion from MethodGroups to compatible delegate types. 
8300
8301         * ecore.cs (Expression.Resolve): Do not flag error 654
8302         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8303         we allow conversions from MethodGroups to delegate types now.
8304
8305         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8306         assignments in v2 either.
8307
8308 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8309
8310         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8311         static read-only fields in ctors.
8312
8313         Applied patch from Benjamin Jemlich 
8314
8315         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8316
8317 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8318
8319         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8320         here to return true, as they can be used like this:
8321
8322                 (XXX) int.MEMBER ()
8323
8324         Fixed 49836 and all the other dups
8325
8326 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8327
8328         * driver.cs: Implement /win32res and /win32icon.
8329
8330 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8331
8332         * cs-parser.jay: Add a rule to improve error handling for the
8333         common mistake of placing modifiers after the type.
8334
8335 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8336
8337         * cs-parser.jay (interface_event_declaration): Catch
8338         initialization of events on interfaces, and report cs0068
8339
8340         * cs-parser.jay (interface_event_declaration): Catch
8341         initialization of events. 
8342
8343         * ecore.cs: Better report missing constructors.
8344
8345         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8346         the error reporting done in the wrong place.  Fix.
8347
8348         * expression.cs (Binary.ResolveOperator): Catch the 
8349         operator + (E x, E y) error earlier, and later allow for implicit
8350         conversions in operator +/- (E e, U x) from U to the underlying
8351         type of E.
8352
8353         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8354         52596, if the container class is abstract, the default constructor
8355         is protected otherwise its public (before, we were always public).
8356
8357         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8358         fixed statement.
8359
8360         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8361         Jemlich that fixes bug #52597, MCS was generating invalid code for
8362         idisposable structs.   Thanks to Ben for following up with this
8363         bug as well.
8364
8365 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8366
8367         * driver.cs: Allow assemblies without code to be generated, fixes
8368         52230.
8369
8370 2004-01-07  Nick Drochak <ndrochak@gol.com>
8371
8372         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8373
8374 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8375
8376         * cs-parser.jay: Add rules to improve error reporting if fields or
8377         methods are declared at the namespace level (error 116)
8378
8379         * Add rules to catch event add/remove
8380
8381 2004-01-04  David Sheldon <dave-mono@earth.li>
8382
8383   * expression.cs: Added matching ")" to error message for 
8384   CS0077
8385
8386 2004-01-03 Todd Berman <tberman@gentoo.org>
8387
8388         * ecore.cs, attribute.cs:
8389         Applying fix from #52429.
8390
8391 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8392
8393         * ecore.cs, expression.cs, statement.cs:
8394         Total rewrite of how we handle branching. We
8395         now handle complex boolean expressions with fewer
8396         jumps. As well if (x == 0) no longer emits a ceq.
8397
8398         if (x is Foo) is much faster now, because we generate
8399         better code.
8400
8401         Overall, we get a pretty big improvement on our benchmark
8402         tests. The code we generate is smaller and more readable.
8403
8404         I did a full two-stage bootstrap. The patch was reviewed
8405         by Martin and Miguel.
8406
8407 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8408
8409         * cs-parser.jay: Make primary_expression not take a QI.
8410         we dont need this because the member_access rule covers
8411         us here. So we replace the rule with just IDENTIFIER.
8412
8413         This has two good effects. First, we remove a s/r conflict.
8414         Second, we allocate many fewer QualifiedIdentifier objects.
8415
8416 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8417
8418         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8419         set the correct information via SRE. This prevents
8420         hanging on the MS runtime. Fixes #29374.
8421
8422 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8423
8424         * convert.cs: correctly handle conversions to value types
8425         from Enum and ValueType as unboxing conversions.
8426
8427         Fixes bug #52569. Patch by Benjamin Jemlich.
8428
8429 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8430
8431         * expression.cs (BetterConversion): Prefer int -> uint
8432         over int -> ulong (csc's behaviour). This fixed bug #52046.
8433
8434 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8435
8436         * decl.cs (MemberCache.FindMembers): now returns a
8437         MemberInfo [].
8438
8439         * typemanager.cs: In general, go with with ^^.
8440         (CopyNewMethods): take an IList.
8441         (RealMemberLookup): Only allocate an arraylist
8442         if we copy from two sets of methods.
8443
8444         This change basically does two things:
8445         1) Fewer array lists allocated due to CopyNewMethods.
8446         2) the explicit cast in MemberList costed ALOT.
8447
8448 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8449
8450         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8451         a hashtable to avoid needless string allocations when an identifier is
8452         used more than once (the common case).
8453
8454 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8455
8456         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8457         is broken, it will not return anything. So, we
8458         have to use the information we have in mcs to
8459         do the task.
8460
8461         * typemanager.cs: Add a cache for GetInterfaces,
8462         since this will now be used more often (due to ^^)
8463
8464         (GetExplicitInterfaces) New method that gets the
8465         declared, not effective, interfaces on a type
8466         builder (eg, if you have interface IFoo, interface
8467         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8468         { IBar }.
8469
8470         This patch makes MCS able to bootstrap itself on
8471         Windows again.
8472
8473 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8474
8475         * expression.cs: Remove the Nop's that Miguel put
8476         in by mistake.
8477
8478 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8479
8480         * report.cs, codegen.cs: Give the real stack trace to
8481         the error when an exception is thrown.
8482
8483 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8484
8485         * decl.cs: only allocate hashtables for ifaces if 
8486         it is an iface!
8487
8488 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8489
8490         * expression.cs: fix the error from cs0121-2.cs
8491         (a parent interface has two child interfaces that
8492         have a function with the same name and 0 params
8493         and the function is called through the parent).
8494
8495 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8496
8497         * class.cs, rootcontext.cs, typmanager.cs: do not
8498         leak pointers.
8499
8500 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8501
8502         * codegen.cs: remove stack for the ec flow branching.
8503         It is already a linked list, so no need.
8504
8505 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8506
8507         * Makefile: Allow custom profiler here.
8508
8509 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8510
8511         * typemanager.cs (LookupType):
8512           - Use a static char [], because split takes
8513             a param array for args, so it was allocating
8514             every time.
8515           - Do not store true in a hashtable, it boxes.
8516
8517 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8518
8519         * flowanalysis.cs: bytify common enums.
8520
8521 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8522
8523         * modifiers.cs: Add a new set of flags for the
8524         flags allowed on explicit interface impls.
8525         * cs-parser.jay: catch the use of modifiers in
8526         interfaces correctly.
8527         * class.cs: catch private void IFoo.Blah ().
8528
8529         All related to bug #50572.
8530
8531 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8532
8533         * decl.cs: Rewrite the consistant accessability checking.
8534         Accessability is not linear, it must be implemented in
8535         a tableish way. Fixes #49704.
8536
8537 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8538
8539         * expression.cs: Handle negation in a checked context.
8540         We must use subtraction from zero. Fixes #38674.
8541
8542 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8543
8544         * class.cs: Ignore static void main in DLLs.
8545         * rootcontext.cs: Handle the target type here,
8546         since we are have to access it from class.cs
8547         * driver.cs: account for the above.
8548
8549 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8550
8551         * report.cs: Give line numbers and files if available.
8552
8553 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8554
8555         * driver.cs: Implement /addmodule.
8556
8557         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8558         ModuleBuilders.
8559
8560 2003-12-20  Martin Baulig  <martin@ximian.com>
8561
8562         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8563         (FieldBase.IsAssigned): Removed this field.
8564         (FieldBase.SetAssigned): New public method.
8565         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8566
8567 2003-12-20  Martin Baulig  <martin@ximian.com>
8568
8569         * expression.cs (LocalVariableReference.DoResolve): Don't set
8570         `vi.Used' if we're called from DoResolveLValue().
8571
8572         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8573         returns the usage vector it just merged into the current one -
8574         pass this one to UsageWarning().
8575         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8576         of the `EmitContext', don't call this recursively on our children.
8577
8578 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8579
8580         * driver.cs: Implement /target:module.
8581
8582 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8583
8584         * support.cs (CharArrayHashtable): New helper class.
8585
8586         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8587         char arrays, not strings, so we can avoid creating a string in
8588         consume_identifier if the identifier is a keyword.
8589
8590 2003-12-16  Martin Baulig  <martin@ximian.com>
8591
8592         * statement.cs (LocalInfo.Assigned): Removed this property.
8593         (LocalInfo.Flags): Removed `Assigned'.
8594         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8595         and uses flow analysis.
8596         (Block.UsageWarning): Made this method private.
8597         (Block.Resolve): Call UsageWarning() if appropriate.
8598
8599         * expression.cs (LocalVariableReference.DoResolve): Always set
8600         LocalInfo.Used here.
8601
8602 2003-12-13  Martin Baulig  <martin@ximian.com>
8603
8604         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8605         any value here; we're now using flow analysis to figure out
8606         whether a statement/block returns a value.
8607
8608 2003-12-13  Martin Baulig  <martin@ximian.com>
8609
8610         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8611         working again.
8612         (FlowBranching.MergeFinally): Don't call
8613         `branching.CheckOutParameters()' here, this is called in
8614         MergeTopBlock().
8615         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8616         when adding the `finally' vector.       
8617
8618 2003-12-13  Martin Baulig  <martin@ximian.com>
8619
8620         * flowanalysis.cs
8621         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8622         actually work and also fix #48962.
8623
8624 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8625
8626         * decl.cs: Do not check System.Object for nested types,
8627         since we know it does not have any. Big bang for buck:
8628
8629         BEFORE:
8630            Run 1:   8.35 seconds
8631            Run 2:   8.32 seconds
8632            corlib:  17.99 seconds
8633         AFTER:
8634            Run 1:   8.17 seconds
8635            Run 2:   8.17 seconds
8636            corlib:  17.39 seconds
8637
8638 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8639
8640         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8641         time we are returning 0 members, so we save alot here.
8642
8643 2003-12-11  Martin Baulig  <martin@ximian.com>
8644
8645         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8646         `MergeChild()', also just take the `FlowBranching' as argument;
8647         call Merge() on it and return the result.
8648         (FlowBranching.Merge): We don't need to do anything if we just
8649         have one sibling.
8650
8651 2003-12-11  Martin Baulig  <martin@ximian.com>
8652
8653         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8654         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8655         Maurer for this idea.
8656
8657 2003-12-11  Martin Baulig  <martin@ximian.com>
8658
8659         * flowanalysis.cs (MergeResult): This class is now gone; we now
8660         use the `UsageVector' for this.  The reason for this is that if a
8661         branching just has one sibling, we don't need to "merge" them at
8662         all - that's the next step to do.
8663         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8664         `MergeResult'.
8665
8666 2003-12-11  Martin Baulig  <martin@ximian.com>
8667
8668         Reworked flow analyis and made it more precise and bug-free.  The
8669         most important change is that we're now using a special `Reachability'
8670         class instead of having "magic" meanings of `FlowReturns'.  I'll
8671         do some more cleanups and optimizations and also add some more
8672         documentation this week.
8673
8674         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8675         largely reworked this class.
8676         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8677         the new `Reachability' class instead of having "magic" values here.
8678         (FlowBranching): We're now using an instance of `Reachability'
8679         instead of having separate `Returns', `Breaks' etc. fields.
8680
8681         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8682         based on flow analysis; ignore the return value of block.Emit ().
8683
8684 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8685
8686         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8687         if they are private.
8688
8689 2003-12-09  Martin Baulig  <martin@ximian.com>
8690
8691         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8692         call them directly on the UsageVector.
8693
8694 2003-12-09  Martin Baulig  <martin@ximian.com>
8695
8696         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8697         Changed return type from `FlowReturns' to `Reachability'.
8698
8699 2003-12-09  Martin Baulig  <martin@ximian.com>
8700
8701         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8702         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8703         `Reachable' fields with a single `Reachability' one.
8704
8705 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8706
8707         * class.cs (FindMembers): Remove foreach's.
8708
8709         Bootstrap times:
8710
8711         BEFORE
8712                 Run 1:   8.74 seconds
8713                 Run 2:   8.71 seconds
8714
8715         AFTER
8716                 Run 1:   8.64 seconds
8717                 Run 2:   8.58 seconds
8718
8719
8720 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8721
8722         * cs-parser.jay:
8723         * gen-treedump.cs:
8724         * statement.cs:
8725         This patch does a few things:
8726                 1. EmptyStatement is now a singleton, so it is never reallocated.
8727                 2. All blah is EmptyStatement constructs have been changed to
8728                    blah == EmptyStatement.Value, which is much faster and valid
8729                    now that EmptyStatement is a singleton.
8730                 3. When resolving a block, rather than allocating a new array for
8731                    the non-empty statements, empty statements are replaced with
8732                    EmptyStatement.Value
8733                 4. Some recursive functions have been made non-recursive.
8734         Mainly the performance impact is from (3), however (1) and (2) are needed for
8735         this to work. (4) does not make a big difference in normal situations, however
8736         it makes the profile look saner.
8737
8738         Bootstrap times:
8739
8740         BEFORE
8741         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8742         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8743         Total memory allocated: 56397 KB
8744
8745         AFTER
8746         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8747         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8748         Total memory allocated: 55666 KB
8749
8750 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8751
8752         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8753         than the hashtable in a hashtable version
8754
8755         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8756         we always end up concating a string. This results in a huge perf
8757         loss, because many strings have to be tracked by the GC. In this
8758         patch, we first use a hashtable that works with two keys, so that
8759         the strings do not need to be concat'ed.
8760
8761         Bootstrap times:
8762         BEFORE
8763                 Run 1:   8.74 seconds
8764                 Run 2:   8.71 seconds
8765
8766         AFTER
8767                 Run 1:   8.65 seconds
8768                 Run 2:   8.56 seconds
8769
8770 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8771
8772         * Makefile: Add a new target `do-time' that does a quick and simple
8773         profile, leaving easy to parse output.
8774
8775 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8776
8777         * codegen.cs (Init): Create the dynamic assembly with 
8778         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8779
8780 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8781
8782         * support.cs: Make the PtrHashtable use only one
8783         instance of its comparer.
8784
8785 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8786
8787         * typemanager.cs: Fix lookup of GetNamespaces.
8788
8789 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8790
8791         * expression.cs: Removed redundant line.
8792
8793         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8794         ArrayLists, use for loops with bounds.  
8795
8796         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8797         arraylist.
8798
8799         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8800         arraylists, use for loop with bounds.
8801
8802         The above three changes give us a 0.071 second performance
8803         improvement out of 3.294 seconds down to 3.223.  On my machine
8804         the above changes reduced the memory usage by 1,387 KB during
8805         compiler bootstrap.
8806
8807         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8808         QualifiedIdentifiers.  Before we created a new string through
8809         concatenation, and mostly later on, the result would be
8810         manipulated by DecomposeQI through string manipulation.
8811
8812         This reduced the compiler memory usage for bootstrapping from
8813         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8814         compile times in 0.05 seconds.
8815
8816 2003-11-28  Dick Porter  <dick@ximian.com>
8817
8818         * support.cs: Do string compares with the Invariant culture.
8819
8820         * rootcontext.cs: 
8821         * gen-treedump.cs: 
8822         * expression.cs: 
8823         * driver.cs: 
8824         * decl.cs: 
8825         * codegen.cs: 
8826         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8827         the comparison is done with the Invariant culture.
8828
8829 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8830
8831         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8832         GetEnumerator method.
8833
8834         (ProbeCollectionType): Iterate starting at the most specific type
8835         upwards looking for a GetEnumerator
8836
8837         * expression.cs: Shift count can be up to 31 for int/uint and 63
8838         for long/ulong.
8839
8840 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8841
8842         * statement.cs (Block.LookupLabel): Also look for the label on the
8843         children blocks.  Use a hash table to keep track of visited
8844         nodes. 
8845
8846         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8847         we actually did transform the other operand, otherwise fall back
8848         to the common codepath that casts to long.
8849
8850         * cs-tokenizer.cs: Use the same code pattern as the int case.
8851         Maybe I should do the parsing myself, and avoid depending on the
8852         Parse routines to get this done.
8853
8854 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8855
8856         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8857         which fixes bug 51347.  This time test it.
8858
8859         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8860         attributes for example can not tell the difference between these.
8861         The difference was only a syntax feature of the language. 
8862
8863         * attribute.cs: Apply attributes to delegates.
8864
8865         * delegate.cs: Call the apply attributes method.
8866
8867 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8868
8869         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8870         comparing 0 vs Byte.MinValue, not the value
8871
8872         (ImplicitConversionRequired): When reporting a conversion error,
8873         use error 31 to print out the constant error instead of the
8874         simpler 29.
8875
8876         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8877         which fixes bug 51347.
8878
8879 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8880
8881         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8882         which fixes the -warnaserror command line option.
8883
8884 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8885
8886         * cfold.cs (DoNumericPromotions): During constant folding of
8887         additions on UIntConstant, special case intconstants with
8888         IntConstants like we do on the expression binary operator. 
8889
8890 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8891
8892         * convert.cs (ImplicitReferenceConversion): We were missing a case
8893         (System.Enum are not value types or class types, so we need to
8894         classify them separatedly).
8895
8896         * driver.cs: We do not support error 2007.
8897
8898 2003-11-12 Jackson Harper <jackson@ximian.com>
8899
8900         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8901         system directory. Also use the full file name so users can
8902         libraries names mscorlib-o-tron.dll in a non system dir.
8903
8904 2003-11-10  Martin Baulig  <martin@ximian.com>
8905
8906         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8907         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8908         calling `ResolveType()' on them, directly assign their `Type'.
8909
8910 2003-11-08  Martin Baulig  <martin@ximian.com>
8911
8912         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8913         return value and the `out parent' parameter.
8914         (TypeContainer.DefineType): Moved the CS0644 check into
8915         GetClassBases().  Don't pass the interface types to the
8916         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8917         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8918
8919         * ecore.cs (TypeExpr.IsAttribute): New property.
8920         (TypeExpr.GetInterfaces): New method.
8921
8922         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8923         TypeExpr instead of a Type.
8924         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8925         (Interface.DefineType): Don't pass the interface types to the
8926         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8927         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8928
8929         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8930         instead of a `Type[]'.
8931         (TypeManager.RegisterBuilder): Likewise.
8932         (TypeManager.AddUserInterface): Likewise.
8933         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8934         `Type[]' and also return a `TypeExpr[]'.
8935         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8936
8937 2003-11-08  Martin Baulig  <martin@ximian.com>
8938
8939         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8940         Expression.     
8941
8942 2003-11-08  Martin Baulig  <martin@ximian.com>
8943
8944         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8945         TypeManager.ResolveExpressionTypes().
8946
8947         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8948         instead of an Expression.
8949         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8950         (TypeExpression): New public class; formerly known as `TypeExpr'.
8951
8952         * expression.cs (ComposedCast): Derive from TypeExpr.
8953
8954         * typemanager.cs (TypeManager.system_*_expr): These are now
8955         TypExpr's instead of Expression's.
8956         (TypeManager.ResolveExpressionTypes): New public static function;
8957         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8958         of them.        
8959
8960 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8961
8962         * expression.cs (New.DoResolve): Do not dereference value that
8963         might be a null return.
8964
8965         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8966         sure that the constant value has the right type.  Fixes an
8967         unreported bug, similar to 50425.
8968
8969         * const.cs (Const.LookupConstantValue): Call
8970         ImplicitStandardConversionExists before doing a conversion to
8971         avoid havng the TypeManager.ChangeType do conversions.
8972
8973         Reduced the number of casts used
8974
8975         (Const.ChangeType): New routine to enable reuse of the constant
8976         type changing code from statement.
8977
8978         * typemanager.cs (ChangeType): Move common initialization to
8979         static global variables.
8980
8981         Fixes #50425.
8982
8983         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8984         every value type to go through, even if it was void.  Fix that. 
8985
8986         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8987         character of the define, and the is_identifier_part_character for
8988         the rest of the string.
8989
8990 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8991
8992         * expression.cs (UnaryMutator.EmitCode): When I updated
8993         LocalVariableReference.DoResolve, I overdid it, and dropped an
8994         optimization done on local variable references.
8995
8996 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8997
8998         * ecore.cs: Convert the return from Ldlen into an int.
8999
9000 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9001
9002         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9003         the accessibility, this is a special case for toplevel non-public
9004         classes (internal for instance).
9005
9006 2003-10-20  Nick Drochak <ndrochak@gol.com>
9007
9008         * ecore.cs: Fix typo and build.  Needed another right paren.
9009
9010 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9011
9012         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9013         `internal' case regular and protected, but not allowing protected
9014         to be evaluated later.  Bug 49840
9015
9016 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9017
9018         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9019         to kb.Nlast, and not the kb.nFirst to isolate the switch
9020         statement.
9021
9022         Extract the underlying type, so enumerations of long/ulong are
9023         treated like long/ulong.
9024
9025 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9026
9027         * expression.cs (New): Overload the meaning of RequestedType to
9028         track the possible creation of the NewDelegate type, since
9029         DoResolve is invoked more than once for new constructors on field
9030         initialization.
9031
9032         See bugs: #48800 and #37014
9033
9034         * cs-parser.jay (declare_local_constants): Take an arraylist
9035         instead of a single constant.
9036
9037         (local_constant_declaration): It should take a
9038         constant_declarators, not a constant_declarator.  Fixes 49487
9039
9040         * convert.cs: Fix error report.
9041
9042 2003-10-13 Jackson Harper <jackson@ximian.com>
9043
9044         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9045         bug #49611
9046
9047 2003-10-09  Martin Baulig  <martin@ximian.com>
9048
9049         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9050         to the .ctor.
9051         (MethodCore.DoDefineParameters): Removed the TypeContainer
9052         argument; use the DeclSpace which was passed to the .ctor instead.
9053         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9054         TypeContainer; we only need a DeclSpace here.
9055
9056 2003-10-09  Martin Baulig  <martin@ximian.com>
9057
9058         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9059         to the .ctor.
9060         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9061         EmitContext's .ctor.    
9062
9063 2003-10-09  Martin Baulig  <martin@ximian.com>
9064
9065         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9066         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9067         AsAccessible(), moved them as well.
9068
9069         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9070
9071 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9072
9073         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9074
9075 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9076
9077         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9078         generation for >=, as spotted by Paolo, bug 48679.  
9079         Patch from David Waite.
9080
9081         * cs-tokenizer.cs: Add handling for #pragma.
9082
9083         * cs-parser.jay: Allow for both yield and yield return in the
9084         syntax.  The anti-cobolization of C# fight will go on!
9085
9086         * class.cs (TypeBuilder.DefineType): Catch error condition here
9087         (Parent.DefineType erroring out and returning null).
9088
9089         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9090         coping with enumerations variables, we were mistakenly processing
9091         them as a regular value type instead of built-in types.  Fixes the
9092         bug #48063
9093
9094         * typemanager.cs (IsBuiltinOrEnum): New method.
9095
9096 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9097
9098         * cs-parser.jay: Upgrade: yield now needs the return clause.
9099
9100 2003-09-19  Martin Baulig  <martin@ximian.com>
9101
9102         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9103         `MemberCache parent' argument.  Normally, an interface doesn't
9104         have a parent type except System.Object, but we use this in gmcs
9105         for generic type parameters.
9106
9107 2003-09-18  Martin Baulig  <martin@ximian.com>
9108
9109         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9110         on `type.IsInterface'; don't check whether the type has a parent
9111         to determine whether it's an interface.
9112
9113 2003-09-15  Martin Baulig  <martin@ximian.com>
9114
9115         * class.cs (TypeContainer.DefineType): Added an error flag to
9116         avoid reporting duplicate CS0146's ("class definition is
9117         circular.").
9118
9119         * driver.cs (Driver.MainDriver): Abort if
9120         RootContext.ResolveTree() reported any errors.
9121
9122 2003-09-07  Martin Baulig  <martin@ximian.com>
9123
9124         * report.cs (Error, Warning): Added overloaded versions which take
9125         a `params object[] args' and call String.Format().
9126
9127 2003-09-07  Martin Baulig  <martin@ximian.com>
9128
9129         * decl.cs (DeclSpace..ctor): Don't call
9130         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9131         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9132         (DeclSpace.RecordDecl): New method.
9133
9134         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9135
9136 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9137
9138         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9139         value attributes to be applied to ParameterBuilders.
9140
9141         * class.cs (MethodCore.LabelParameters): Make static and more
9142         generic so that it can be used from other places - like interface
9143         methods, for instance.
9144
9145         * interface.cs (Interface.Emit): Call LabelParameters before
9146         emitting attributes on the InterfaceMethod.
9147
9148 2003-08-26  Martin Baulig  <martin@ximian.com>
9149
9150         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9151         resolving aliases; fixes #47927.
9152
9153 2003-08-26  Martin Baulig  <martin@ximian.com>
9154
9155         * statement.cs (Using.DoResolve): This is internally emitting a
9156         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9157         do not always return.  Fixes #47681.
9158
9159 2003-08-26  Martin Baulig  <martin@ximian.com>
9160
9161         * decl.cs (MemberCore): Moved WarningNotHiding(),
9162         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9163         into MemberBase.
9164         (AdditionResult): Make this nested in DeclSpace.
9165         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9166         argument; call NamespaceEntry.Define() unless we're nested in a
9167         class or struct.
9168
9169         * namespace.cs (Namespace.DefineName): New public function.  This
9170         is called from DeclSpace's .ctor to add 
9171         (Namespace.Lookup): Include DeclSpaces in the lookup.
9172
9173         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9174
9175         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9176
9177 2003-08-25  Martin Baulig  <martin@ximian.com>
9178
9179         * convert.cs (Convert.ExplicitReferenceConversion): When
9180         converting from an interface type to a class, unbox if the target
9181         type is a struct type.  Fixes #47822.
9182
9183 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9184
9185         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9186         #47854.
9187
9188 2003-08-22  Martin Baulig  <martin@ximian.com>
9189
9190         * class.cs (TypeManager.DefineType): When defining a nested type,
9191         call DefineType() on our parent; fixes #47801.
9192
9193 2003-08-22  Martin Baulig  <martin@ximian.com>
9194
9195         * class.cs (MethodData.Define): While checking if a method is an
9196         interface implementation, improve the test a bit more to fix #47654.
9197
9198 2003-08-22  Martin Baulig  <martin@ximian.com>
9199
9200         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9201         correctly; fixes #47722.
9202
9203 2003-08-22  Martin Baulig  <martin@ximian.com>
9204
9205         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9206         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9207
9208         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9209
9210 2003-08-22  Martin Baulig  <martin@ximian.com>
9211
9212         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9213         can only be assigned in static constructors.  Fixes #47161.
9214
9215 2003-08-22  Martin Baulig  <martin@ximian.com>
9216
9217         Rewrote and improved the flow analysis code.
9218
9219         * flowbranching.cs (FlowBranching): Make this class abstract.
9220         (FlowBranching.CreateBranching): New static function to create a
9221         new flow branching.
9222         (FlowBranchingBlock, FlowBranchingException): New classes.
9223         (FlowBranching.UsageVector.Type): New public readonly field.
9224         (FlowBranching.UsageVector.Breaks): Removed the setter.
9225         (FlowBranching.UsageVector.Returns): Removed the setter.
9226         (FlowBranching.UsageVector): Added Break(), Return(),
9227         NeverReachable() and Throw() methods to modify the reachability.
9228         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9229         done by FlowBranching.Merge().
9230         (FlowBranching.UsageVector.MergeChild): New method; merges the
9231         merge result into the current vector.
9232         (FlowBranching.Merge): New abstract method to merge a branching.
9233
9234 2003-08-12  Martin Baulig  <martin@ximian.com>
9235
9236         * expression.cs (Indirection.CacheTemporaries): Create the
9237         LocalTemporary with the pointer type, not its element type.
9238
9239 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9240
9241         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9242         token was a keyword or not.
9243
9244         Add `error' options where an IDENTIFIER was expected;  Provide
9245         CheckToken and CheckIdentifierToken convenience error reporting
9246         functions. 
9247
9248         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9249
9250         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9251         NameSpaceEntry NameSpaceEntry.
9252
9253         (LookupInterfaceOrClass): Avoid creating a full qualified name
9254         from namespace and name: avoid doing lookups when we know the
9255         namespace is non-existant.   Use new Tree.LookupByNamespace which
9256         looks up DeclSpaces based on their namespace, name pair.
9257
9258         * driver.cs: Provide a new `parser verbose' to display the
9259         exception thrown during parsing.  This is turned off by default
9260         now, so the output of a failure from mcs is more graceful.
9261
9262         * namespace.cs: Track all the namespaces defined in a hashtable
9263         for quick lookup.
9264
9265         (IsNamespace): New method
9266
9267 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9268
9269         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9270         we know that we need to concatenate (full typename can never be
9271         null). 
9272
9273         * class.cs: ditto.
9274
9275         * statement.cs: Use a bitfield;  Do not initialize to null things
9276         which are done by the constructor by default.
9277
9278         * cs-parser.jay: bug fix, parameter was 4, not 3.
9279
9280         * expression.cs: Just use the property;
9281
9282         * statement.cs: No need for GetVariableInfo method.
9283
9284 2003-08-08  Martin Baulig  <martin@ximian.com>
9285
9286         * flowanalysis.cs (FlowReturns): This is now nested in the
9287         `FlowBranching' class.
9288         (MyBitVector): Moved this here from statement.cs.
9289         (FlowBranching.SiblingType): New enum type.
9290         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9291
9292 2003-08-07  Martin Baulig  <martin@ximian.com>
9293
9294         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9295         `FlowBranching' class and called `BranchingType'.
9296
9297 2003-08-07  Martin Baulig  <martin@ximian.com>
9298
9299         * flowanalysis.cs: Moved all the control flow analysis code into
9300         its own file.
9301
9302 2003-08-07  Martin Baulig  <martin@ximian.com>
9303
9304         * assign.cs (Assign.DoResolve): `target' must either be an
9305         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9306         #37319.
9307
9308 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9309
9310         * expression.cs (BinaryMethod): This kind of expression is created by the
9311         Binary class if it determines that the operator has to be handled
9312         by a method.
9313
9314         (BinaryDelegate): This kind of expression is created if we are
9315         dealing with a + or - operator on delegates.
9316
9317         (Binary): remove method, argumetns, and DelegateOperator: when
9318         dealing with methods, 
9319
9320         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9321
9322         * statement.cs (Block): use bitfields for the three extra booleans
9323         we had in use.   Remove unused topblock parameter.
9324
9325         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9326
9327         * assign.cs: Drop extra unneeded tests.
9328
9329 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9330
9331         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9332
9333         * statement.cs (Foreach): Use VariableStorage instead of
9334         LocalBuilders.   
9335
9336         * codegen.cs (VariableStorage): New class used by clients that
9337         require a variable stored: locals or fields for variables that
9338         need to live across yield.
9339
9340         Maybe provide a convenience api for EmitThis+EmitLoad?
9341
9342         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9343         these bad boys.
9344
9345 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9346
9347         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9348         RemapParameterLValue): New methods that are used to turn a
9349         precomputed FieldInfo into an expression like this:
9350
9351                 instance.FieldInfo
9352
9353         The idea is to use this instead of making LocalVariableReference
9354         have more than one meaning.
9355
9356         * cs-parser.jay: Add error production to BASE.
9357
9358         * ecore.cs: Deal with TypeManager.GetField returning null, which
9359         is now a valid return value.
9360
9361         (FieldExprNoAddress): New expression for Fields whose address can
9362         not be taken.
9363
9364         * expression.cs (LocalVariableReference): During the resolve
9365         phases, create new expressions if we are in a remapping context.
9366         Remove code that dealt with remapping here.
9367
9368         (ParameterReference): same.
9369
9370         (ProxyInstance): New expression, like the `This' expression, but
9371         it is born fully resolved.  We know what we are doing, so remove
9372         the errors that are targeted to user-provided uses of `this'.
9373
9374         * statement.cs (Foreach): our variable is now stored as an
9375         Expression;  During resolution, follow the protocol, dont just
9376         assume it will return this.
9377
9378 2003-08-06  Martin Baulig  <martin@ximian.com>
9379
9380         * support.cs (SeekableStreamReader.cs): New public class.
9381
9382         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9383         SeekableStreamReader instead of the normal StreamReader.
9384
9385 2003-08-04  Martin Baulig  <martin@ximian.com>
9386
9387         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9388         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9389         deambiguate casts and delegate invocations.
9390         (parenthesized_expression): Use the new tokens to ensure this is
9391         not a cast of method invocation.
9392
9393         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9394         when reading a `)' and Deambiguate_CloseParens () was previously
9395         called.
9396
9397         * expression.cs (ParenthesizedExpression): New class.  This is
9398         just used for the CS0075 test.
9399         (Binary.DoResolve): Check for CS0075.   
9400
9401 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9402
9403         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9404         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9405         reference comparison.
9406
9407         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9408         examine the ReturnType for equality - this is necessary in the
9409         cases of implicit and explicit operators whose signature also
9410         includes the return type.
9411
9412 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9413
9414         * namespace.cs: Cache the result of the namespace computation,
9415         instead of computing it every time.
9416
9417 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9418
9419         * decl.cs: Use a global arraylist that we reuse over invocations
9420         to avoid excesive memory consumption.  Reduces memory usage on an
9421         mcs compile by one meg (45 average).
9422
9423         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9424         private, work around that.
9425
9426 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9427
9428         * literal.cs (IntLiteral): Define Zero and One static literals. 
9429
9430         * cs-parser.jay (integer_literal): use static literals to reduce
9431         memory usage for the most used literals (0, 1 and -1).  211kb
9432         reduced in memory usage.
9433
9434         Replace all calls to `new ArrayList' with `new
9435         ArrayList(4)' which is a good average number for most allocations,
9436         and also requires only 16 bytes of memory for its buffer by
9437         default. 
9438
9439         This reduced MCS memory usage in seven megabytes for the RSS after
9440         bootstrapping.
9441
9442 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9443
9444         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9445         handle params methods the correct way by forming only one
9446         applicable set with params and normal methods in them. Earlier we
9447         were looking at params methods only if we found no normal methods
9448         which was not the correct thing to do.
9449
9450         (Invocation.BetterFunction): Take separate arguments indicating
9451         when candidate and the best method are params methods in their
9452         expanded form.
9453
9454         This fixes bugs #43367 and #46199.
9455
9456         * attribute.cs: Documentation updates.
9457
9458         (CheckAttribute): Rename to CheckAttributeTarget.
9459         (GetValidPlaces): Rename to GetValidTargets.
9460
9461         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9462         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9463
9464         Fixes bug #44468.
9465
9466 2003-07-28  Martin Baulig  <martin@ximian.com>
9467
9468         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9469         name when looking up the base class of a nested class.  Fixes #46977.
9470
9471 2003-07-26  Martin Baulig  <martin@ximian.com>
9472
9473         * expression.cs (Indexers.Indexer): New nested struct; contains
9474         getter, setter and the indexer's type.
9475         (Indexers.Properties): This is now an ArrayList of
9476         Indexers.Indexer's.
9477         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9478         indexer doesn't have any getters.
9479
9480         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9481         for embedded property and indexer assignments.
9482
9483 2003-07-26  Martin Baulig  <martin@ximian.com>
9484
9485         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9486         preprocessor directive is not the first non-whitespace character
9487         on a line.
9488
9489 2003-07-26  Martin Baulig  <martin@ximian.com>
9490
9491         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9492         namespace parsing, follow the spec more closely.
9493
9494         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9495         NamespaceEntry.Lookup().
9496
9497 2003-07-25  Martin Baulig  <martin@ximian.com>
9498
9499         * MethodCore.cs (OverridesSomething): New public field; it's set
9500         from TypeContainer.DefineMembers if this method overrides
9501         something (which doesn't need to be a method).  Fix #39462.
9502
9503 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9504
9505         * typemanager.cs (GetMembers): Ensure that the list of members is
9506         reversed. This keeps things in sync.
9507
9508         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9509         find an AttributeUsage attribute.
9510
9511         * expression.cs (Invocation.OverloadResolve): Perform the check
9512         which disallows Invoke to be directly called on a Delegate.
9513
9514         (Error_InvokeOnDelegate): Report error cs1533.
9515
9516 2003-07-25  Martin Baulig  <martin@ximian.com>
9517
9518         * expression.cs (Indexers.GetIndexersForType): Only look in the
9519         interface hierarchy if the requested type is already an
9520         interface.  Fixes #46788 while keeping #46502 fixed.
9521
9522 2003-07-25  Martin Baulig  <martin@ximian.com>
9523
9524         * class.cs (TypeContainer.DefineMembers): Check whether all
9525         readonly fields have been assigned and report warning CS0649 if
9526         not.
9527
9528         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9529         a valuetype.
9530
9531 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9532
9533         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9534         returned from GetMethods to make things consistent with the
9535         assumptions MCS makes about ordering of methods.
9536
9537         This should comprehensively fix bug #45127 and it does :-)
9538
9539         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9540         ordering is actually reverse.
9541
9542         * Clean up some debug messages I left lying around.
9543
9544         * interface.cs (Populate*): Get rid of code which emits attributes
9545         since the stage in which we emit attributes is the 'Emit' stage,
9546         not the define stage.
9547
9548         (Emit): Move attribute emission for interface members here.
9549
9550 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9551
9552         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9553         closely: we eliminate methods in base types when we have an
9554         applicable method in a top-level type.
9555
9556         Please see section 14.5.5.1 for an exact description of what goes
9557         on. 
9558
9559         This fixes bug #45127 and a host of other related to corlib compilation.
9560
9561         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9562         array is the method corresponding to the top-level type (this is
9563         because of the changes made to icall.c) so we change this
9564         accordingly.
9565
9566         (MethodGroupExpr.Name): This too.
9567
9568         * typemanager.cs (GetElementType): New method which does the right
9569         thing when compiling corlib. 
9570
9571         * everywhere: Make use of the above in the relevant places.
9572
9573 2003-07-22  Martin Baulig  <martin@ximian.com>
9574
9575         * cs-parser.jay (invocation_expression): Moved
9576         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9577         `cast_expression', but create a InvocationOrCast which later
9578         resolves to either an Invocation or a Cast.
9579
9580         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9581         method; call this before EmitStatement() to make sure that this
9582         expression can be used as a statement.
9583
9584         * expression.cs (InvocationOrCast): New class; resolves to either
9585         an Invocation or a Cast.
9586
9587         * statement.cs (StatementExpression): Call ResolveStatement() on
9588         the ExpressionStatement before emitting it.
9589
9590 2003-07-21  Martin Baulig  <martin@ximian.com>
9591
9592         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9593         `ref' and `out' attributes match; fixes #46220.
9594         (MemberAccess.ResolveMemberAccess): You can't reference a type
9595         through an expression; fixes #33180.
9596         (Indexers.GetIndexersForType): Don't return the indexers from
9597         interfaces the class implements; fixes #46502.
9598
9599 2003-07-21  Martin Baulig  <martin@ximian.com>
9600
9601         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9602         CS0661 checks; fixes bug #30442.
9603
9604 2003-07-21  Martin Baulig  <martin@ximian.com>
9605
9606         * decl.cs (AdditionResult): Added `Error'.
9607
9608         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9609
9610         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9611         makes cs0031.cs actually work.
9612
9613 2003-07-20  Martin Baulig  <martin@ximian.com>
9614
9615         * namespace.cs: Fixed that bug which caused a crash when compiling
9616         the debugger's GUI.
9617
9618 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9619
9620         * typemanager.cs (LookupTypeReflection): Never expose types which
9621         are NotPublic, NestedPrivate, NestedAssembly, or
9622         NestedFamANDAssem.  We used to return these, and later do a check
9623         that would report a meaningful error, but the problem is that we
9624         would not get the real match, if there was a name override.
9625
9626 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9627
9628         * namespace.cs (Namespace, Name): Do not compute the namespace
9629         name dynamically, compute it in the constructor.  This reduced
9630         memory usage by 1697 KB.
9631
9632         * driver.cs: Use --pause to pause at the end.
9633
9634 2003-07-17  Peter Williams  <peter@newton.cx>
9635
9636         * Makefile: Change the name of the test target so that it doesn't
9637         conflict with the recursive test target.
9638
9639 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9640
9641         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9642         AddressOf): Do not use EmitThis, that was wrong, use the actual
9643         this pointer.
9644
9645 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9646
9647         * class.cs (MethodData.Define): While checking if a method is an
9648         interface implementation, improve the test: If we are not public
9649         (use new test here: use the computed MethodAttributes directly,
9650         instead of the parsed modifier flags) check if the `implementing'
9651         method comes from an interface or not.
9652
9653         * pending.cs (VerifyPendingMethods): Slightly better error
9654         message.
9655
9656         * makefile: add test target that does the mcs bootstrap.
9657
9658 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9659
9660         * interface.cs (Define): Do nothing here since there are no
9661         members to populate etc. Move the attribute emission out of here
9662         since this was just totally the wrong place to put it. Attribute
9663         application happens during the 'Emit' phase, not in the 'Define'
9664         phase.
9665
9666         (Emit): Add this method and move the attribute emission here
9667
9668         * rootcontext.cs (EmitCode): Call the Emit method on interface
9669         types too.
9670
9671 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9672
9673         * expression.cs (OverloadResolve): Report error only if Location
9674         is not 'Null' which means that there was a probe going on.
9675
9676 2003-07-14  Martin Baulig  <martin@ximian.com>
9677
9678         * expression.cs (ConditionalLogicalOperator): New public class to
9679         implement user defined conditional logical operators.
9680         This is section 14.11.2 in the spec and bug #40505.
9681
9682 2003-07-14  Martin Baulig  <martin@ximian.com>
9683
9684         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9685
9686 2003-07-14  Martin Baulig  <martin@ximian.com>
9687
9688         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9689
9690         * ecore.cs (IVariable.VerifyFixed): New interface method.
9691
9692         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9693         operator, check whether the variable is actually fixed.  Fixes bug
9694         #36055.  Set a variable definitely assigned when taking its
9695         address as required by the spec.
9696
9697         * statement.cs (LocalInfo.IsFixed): New field.
9698         (LocalInfo.MakePinned): Set `IsFixed' to true.
9699
9700 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9701
9702         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9703         for .ctors, ensure that we only ask for members declared in the
9704         attribute type (BindingFlags.DeclaredOnly).
9705
9706         Fixes bug #43632.
9707
9708         * expression.cs (Error_WrongNumArguments): Report error 1501
9709         correctly the way CSC does.
9710
9711 2003-07-13  Martin Baulig  <martin@ximian.com>
9712
9713         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9714         lookup on the fully qualified name, to make things like "X.X" work
9715         where "X.X" is a fully qualified type name, but we also have a
9716         namespace "X" in the using list.  Fixes #41975.
9717
9718 2003-07-13  Martin Baulig  <martin@ximian.com>
9719
9720         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9721         function. If we're a CompoundAssign, we need to create an embedded
9722         CompoundAssign, not an embedded Assign.
9723         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9724         Fixes #45854.
9725
9726 2003-07-13  Martin Baulig  <martin@ximian.com>
9727
9728         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9729         work to fix bug #46088.
9730
9731 2003-07-13  Ravi Pratap <ravi@ximian.com>
9732
9733         * class.cs (Operator.Emit): Do not emit attributes here - it is
9734         taken care of by the Method class that we delegate too. This takes
9735         care of bug #45876.
9736
9737 2003-07-10  Martin Baulig  <martin@ximian.com>
9738
9739         * expression.cs (TypeOfVoid): New class.
9740         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9741
9742 2003-07-10  Martin Baulig  <martin@ximian.com>
9743
9744         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9745         bug #35957.
9746
9747 2003-07-10  Martin Baulig  <martin@ximian.com>
9748
9749         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9750         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9751
9752         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9753
9754         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9755
9756 2003-07-10  Martin Baulig  <martin@ximian.com>
9757
9758         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9759         of decimal.  Fixes #42850.
9760
9761         NOTE: I also fixed the created byte blob, but this doesn't work on
9762         the MS runtime and csc never produces any byte blobs for decimal
9763         arrays.
9764
9765 2003-07-10  Martin Baulig  <martin@ximian.com>
9766
9767         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9768         structs; fixes #32068.
9769         (Block.AddChildVariableNames): Fixed #44302.
9770
9771 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9772
9773         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9774
9775 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9776
9777         * attribute.cs: And this test is onger needed.
9778
9779 2003-07-08  Martin Baulig  <martin@ximian.com>
9780
9781         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9782         inaccessible types.  Fixes #36313.
9783
9784         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9785
9786         * namespace.cs (NamespaceEntry): Create implicit entries for all
9787         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9788         implicit entries for N1.N2 and N1.
9789
9790 2003-07-08  Martin Baulig  <martin@ximian.com>
9791
9792         Rewrote the handling of namespaces to fix a lot of the issues
9793         wrt. `using' aliases etc.
9794
9795         * namespace.cs (Namespace): Splitted this class into a
9796         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9797
9798         * typemanager.cs (TypeManager.IsNamespace): Removed.
9799         (TypeManager.ComputeNamespaces): Only compute namespaces from
9800         loaded assemblies here, not the namespaces from the assembly we're
9801         currently compiling.
9802
9803 2003-07-08  Martin Baulig  <martin@ximian.com>
9804
9805         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9806
9807 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9808
9809         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9810         already fixed it.  
9811
9812         I thought about the memory savings here, but LookupTypeReflection
9813         is used under already very constrained scenarios.  Compiling
9814         corlib or mcs only exposes one hit, so it would not really reduce
9815         any memory consumption.
9816
9817 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9818
9819         * typemanager.cs: fixes bug #45889 by only adding public types from
9820         other assemblies to the list of known types.
9821
9822 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9823
9824         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9825         on the type we resolved.
9826
9827 2003-07-05  Martin Baulig  <martin@ximian.com>
9828
9829         * pending.cs (PendingImplementation.ParentImplements): Don't
9830         create the proxy if the parent is abstract.
9831
9832         * class.cs (TypeContainer.DefineIndexers): Process explicit
9833         interface implementations first.  Fixes #37714.
9834
9835 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9836
9837         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9838         defined recursively;  but since we modify the input parameters
9839         (left is set to `this' temporarily), we reset this value if the
9840         left_is_explicit is false, which gives the original semantics to
9841         the code.  
9842
9843         * literal.cs (NullPointer): new class used to represent a null
9844         literal in a pointer context.
9845
9846         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9847         type is a pointer, use a NullPointer object instead of a
9848         NullLiteral.   Closes 43687
9849
9850         (ExplicitConversion): Convert pointer values using
9851         the conv opcode to the proper type.
9852
9853         * ecore.cs (New): change ValueTypeVariable property into a method,
9854         that returns whether the valuetype is suitable for being used.
9855
9856         * expression.cs (Binary.DoNumericPromotions): Only return if we
9857         the int constant was a valid uint, and we can return both left and
9858         right as uints.  If not, we continue processing, to trigger the
9859         type conversion.  This fixes 39018.
9860
9861         * statement.cs (Block.EmitMeta): During constant resolution, set
9862         the CurrentBlock property on the emitcontext, so that we resolve
9863         constants propertly.
9864
9865 2003-07-02  Martin Baulig  <martin@ximian.com>
9866
9867         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9868         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9869
9870         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9871         than emitting it here.
9872
9873         * statement.cs: Fixed some more flow analysis bugs.
9874
9875 2003-07-02  Martin Baulig  <martin@ximian.com>
9876
9877         * class.cs (MethodData.Define): When implementing interface
9878         methods, set Final unless we're Virtual.
9879
9880         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9881         check work for interface methods.
9882
9883 2003-07-01  Martin Baulig  <martin@ximian.com>
9884
9885         * ecore.cs (EmitContext.This): Replaced this property with a
9886         GetThis() method which takes a Location argument.  This ensures
9887         that we get the correct error location for a CS0188.
9888
9889 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9890
9891         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9892         ImplicitStandardConversion.
9893
9894         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9895
9896 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9897
9898         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9899         optimization.
9900
9901 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9902
9903         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9904         constructors.
9905
9906         (MethodData.Define): Turn off initlocals for unsafe methods.
9907
9908 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9909
9910         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9911         complete;  Fixes #37521.
9912
9913         * delegate.cs: Use Modifiers.TypeAttr to compute the
9914         TypeAttributes, instead of rolling our own.  This makes the flags
9915         correct for the delegates.
9916
9917 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9918
9919         * class.cs (Constructor.Define): Set the private flag for static
9920         constructors as well.
9921
9922         * cs-parser.jay (statement_expression): Set the return value to
9923         null, to avoid a crash when we catch an error.
9924
9925 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9926
9927         * cs-parser.jay: Applied patch from Jackson that adds support for
9928         extern and unsafe modifiers to destructor declarations.
9929
9930         * expression.cs: Report error 21 if the user is trying to index a
9931         System.Array.
9932
9933         * driver.cs: Add an error message, suggested by the bug report.
9934
9935         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9936         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9937
9938 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9939
9940         * namespace.cs: Add some information to reduce FAQs.
9941
9942 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9943
9944         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9945         underlying enumeration types.  Fixes #43915.
9946
9947         * expression.cs: Treat ushort/short as legal values to be used in
9948         bitwise operations.
9949
9950 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9951
9952         * delegate.cs: transfer custom attributes for paramenters from
9953         the delegate declaration to Invoke and BeginInvoke.
9954
9955 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9956
9957         * attribute.cs: handle custom marshalers and emit marshal info
9958         for fields, too.
9959
9960 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9961
9962         * makefile.gnu: Added anonymous.cs to the compiler sources.
9963
9964 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9965
9966         * iterators.cs: Change the name of the proxy class to include two
9967         underscores.
9968
9969         * cs-parser.jay: Update grammar to include anonymous methods.
9970
9971         * anonymous.cs: new file.
9972
9973 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9974
9975         * class.cs (Field.Define): Add missing test for pointers and
9976         safety. 
9977
9978 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9979
9980         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9981         we use the stobj opcode.
9982
9983         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9984         since it wasn't the correct fix. 
9985
9986         It still is puzzling that we are required to use stobj for IntPtr
9987         which seems to be a ValueType.
9988
9989 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9990
9991         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9992         during regular simple name resolution.   Now, the trick is that
9993         instead of returning for processing the simplename, we do a
9994         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9995         contextual lookup type).   If a match is found, return that, if
9996         not, return for further composition.
9997
9998         This fixes long-standing 30485.
9999
10000         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10001         using the address to initialize an object, do an Stobj instead of
10002         using the regular Stelem.
10003
10004         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10005         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10006         Because if we are a BaseIndexerAccess that value will be true.
10007         Fixes 43643.
10008
10009         * statement.cs (GotoCase.Resolve): Return after reporting an
10010         error, do not attempt to continue. 
10011
10012         * expression.cs (PointerArithmetic.Emit): If our operand is a
10013         long, convert our constants to match the operand before
10014         multiplying.  Convert to I type before adding.   Fixes 43670.
10015
10016 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10017
10018         * enum.cs (ImplicitConversionExists) : Rename to
10019         ImplicitEnumConversionExists to remove ambiguity. 
10020
10021         * ecore.cs (NullCast): New type of cast expression class which
10022         basically is very similar to EmptyCast with the difference being
10023         it still is a constant since it is used only to cast a null to
10024         something else
10025         (eg. (string) null)
10026
10027         * convert.cs (ImplicitReferenceConversion): When casting a null
10028         literal, we return a NullCast.
10029
10030         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10031         should be around anymore.
10032
10033         The renaming (reported was slightly wrong). Corrections:
10034
10035         ConvertImplicitStandard -> ImplicitConversionStandard
10036         ConvertExplicitStandard -> ExplicitConversionStandard
10037
10038         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10039         before passing them in !
10040
10041         * convert.cs (ImplicitConversionStandard): When comparing for
10042         equal expr and target types, ensure that expr is not a
10043         NullLiteral.
10044
10045         In general, we must not be checking (expr_type ==
10046         target_type) in the top level conversion methods
10047         (ImplicitConversion, ExplicitConversion etc). This checking is
10048         done in the methods that they delegate to.
10049
10050 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10051
10052         * convert.cs: Move Error_CannotConvertType,
10053         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10054         ImplicitNumericConversion, ImplicitConversionExists,
10055         ImplicitUserConversionExists, StandardConversionExists,
10056         FindMostEncompassedType, FindMostSpecificSource,
10057         FindMostSpecificTarget, ImplicitUserConversion,
10058         ExplicitUserConversion, GetConversionOperators,
10059         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10060         TryImplicitIntConversion, Error_CannotConvertImplicit,
10061         ConvertImplicitRequired, ConvertNumericExplicit,
10062         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10063         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10064         its own file.
10065
10066         Perform the following renames:
10067
10068         StandardConversionExists -> ImplicitStandardConversionExists
10069         ConvertImplicit -> ImplicitConversion
10070         ConvertImplicitStandard -> ImplicitStandardConversion
10071         TryImplicitIntConversion -> ImplicitIntConversion
10072         ConvertImplicitRequired -> ImplicitConversionRequired
10073         ConvertNumericExplicit -> ExplicitNumericConversion
10074         ConvertReferenceExplicit -> ExplicitReferenceConversion
10075         ConvertExplicit -> ExplicitConversion
10076         ConvertExplicitStandard -> ExplicitStandardConversion
10077
10078 2003-05-19  Martin Baulig  <martin@ximian.com>
10079
10080         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10081         (TypeInfo): Added support for structs having structs as fields.
10082
10083         * ecore.cs (FieldExpr): Implement IVariable.
10084         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10085         VariableInfo for the field.
10086
10087 2003-05-18  Martin Baulig  <martin@ximian.com>
10088
10089         * expression.cs (This.DoResolve): Report a CS0027 if we're
10090         emitting a field initializer.
10091
10092 2003-05-18  Martin Baulig  <martin@ximian.com>
10093
10094         * expression.cs (This.ResolveBase): New public function.
10095         (This.DoResolve): Check for CS0188.
10096
10097         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10098         This.Resolve().
10099
10100         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10101         `instance_expression' to null if we don't have any non-static
10102         methods.
10103
10104 2003-05-18  Martin Baulig  <martin@ximian.com>
10105
10106         Reworked the way how local variables and parameters are handled by
10107         the flow analysis code.
10108
10109         * statement.cs (TypeInfo, VariableMap): New public classes.
10110         (VariableInfo): New public class.  This is now responsible for
10111         checking whether a variable has been assigned.  It is used for
10112         parameters and local variables.
10113         (Block.EmitMeta): Take the InternalParameters as argument; compute
10114         the layout of the flow vectors here.
10115         (Block.LocalMap, Block.ParameterMap): New public properties.
10116         (FlowBranching): The .ctor doesn't get the InternalParameters
10117         anymore since Block.EmitMeta() now computes the layout of the flow
10118         vector.
10119         (MyStructInfo): This class is now known as `StructInfo' and nested
10120         in `TypeInfo'; we don't access this directly anymore.
10121
10122         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10123         property and removed IsAssigned(), IsFieldAssigned(),
10124         SetAssigned() and SetFieldAssigned(); we now call them on the
10125         VariableInfo so we don't need to duplicate this code everywhere.
10126
10127         * expression.cs (ParameterReference): Added `Block block' argument
10128         to the .ctor.
10129         (LocalVariableReference, ParameterReference, This): The new
10130         VariableInfo class is now responsible for all the definite
10131         assignment stuff.
10132
10133         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10134         IsParameterAssigned, SetParameterAssigned): Removed.
10135
10136 2003-05-18  Martin Baulig  <martin@ximian.com>
10137
10138         * typemanager.cs (InitCoreTypes): Try calling
10139         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10140         the 3-args-version.  Corlib now also needs our `void_type'.
10141         (GetMethod): Added overloaded version which takes an optional
10142         `bool report_errors' to allow lookups of optional methods.
10143
10144 2003-05-12  Martin Baulig  <martin@ximian.com>
10145
10146         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10147         only used for locals and not for parameters.
10148
10149 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10150
10151         * support.cs (InternalParameters.ParameterType): Return the
10152         ExternalType of the parameter.
10153
10154         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10155         they were unused.
10156
10157 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10158
10159         * class.cs (MethodData.Define): Do not set the `newslot' on
10160         interface members, if they are also flagged as "override".
10161
10162         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10163         better code for ++i and i++.  This only works for static fields
10164         and local variables.
10165
10166         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10167         want to pull the DeclSpace out of the builder_to_declspace instead
10168         of the TypeBuilder (like in TypeContainer.FindMembers).
10169
10170         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10171         instead of LookupTypeContainer.  Fixes the crash on .NET for
10172         looking up interface members.
10173
10174         * const.cs: Create our own emit context during the Definition
10175         stage, so that constants are evaluated in the proper context, when
10176         a recursive definition happens.
10177
10178 2003-05-11  Martin Baulig  <martin@ximian.com>
10179
10180         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10181         new block for a switch section.
10182         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10183         the adding/lookup in the switch block.  Fixes #39828.
10184
10185 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10186
10187         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10188         functionality: I needed to convert the data after I had performed
10189         the add/sub operation into the operands type size.
10190
10191         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10192         pass the type for the box operation, otherwise the resulting
10193         object would have been of type object.
10194
10195         (BoxedCast): Add constructor to specify the type to box as.
10196
10197 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10198
10199         * iterators.cs: I was reusing the `count' variable inadvertently,
10200         take steps to not allow this to happen.
10201
10202 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10203
10204         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10205         by creating an array at the point where the params starts and
10206         putting all those arguments there, then adjusting the size of the
10207         array.
10208
10209 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10210
10211         * expression.cs (New.AddressOf): Implement interface
10212         IMemoryLocation.  This is used when the `new' operator is used in
10213         the context of an invocation to a method on a value type.
10214
10215         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10216         example. 
10217
10218         * namespace.cs: Also check the using aliases here.
10219
10220         * driver.cs: Move the test for using validity after the types have
10221         been entered, so we do a single pass that also includes the using
10222         aliases. 
10223
10224         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10225         in the regular case.   CreateSiblingForFinally is doing extra
10226         error checking.
10227
10228         * attribute.cs (GetAttributeArgumentExpression): Store the result
10229         on an out value, and use the return value to indicate failure
10230         instead of using null (which is a valid return for Constant.GetValue).
10231
10232         * statement.cs: Perform the analysis flow for the increment
10233         portion after the statement, because this will be the real flow of
10234         execution.  Fixes #42385
10235
10236         * codegen.cs (EmitContext.EmitArgument,
10237         EmitContext.EmitStoreArgument): New helper functions when the
10238         RemapToProxy flag is set.
10239
10240         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10241         function.
10242
10243         Add support for remapping parameters. 
10244
10245         * iterators.cs: Propagate parameter values;  Store parameter
10246         values in the proxy classes.
10247
10248 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10249
10250         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10251         need a proxy reference;  I do not know what I was thinking
10252
10253         * cs-parser.jay (constructor_initializer): catch another error,
10254         and display nice message.
10255
10256         (field_declaration): catch void field declaration
10257         to flag a better error. 
10258
10259         * class.cs (MemberBase.CheckBase): Report an error instead of a
10260         warning if a new protected member is declared in a struct. 
10261         (Field.Define): catch the error of readonly/volatile.
10262
10263         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10264
10265         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10266         volatile variable is taken
10267
10268 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10269
10270         * statement.cs (Fixed.Resolve): Report an error if we are not in
10271         an unsafe context.
10272
10273 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10274
10275         * typemanager.cs: reuse the code that handles type clashes for
10276         delegates and enumerations.
10277
10278         * class.cs (Report28): Always report.
10279
10280         * expression.cs (EncodeAsAttribute): Allow nulls here.
10281
10282 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10285         the functionality for testing whether an expression is valid for
10286         an attribute here.  Also handle the case of arrays of elements
10287         being stored. 
10288
10289         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10290         encoding a linear array into an array of objects that are suitable
10291         to be passed to an CustomAttributeBuilder.
10292
10293         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10294
10295         * ecore.cs: (FieldExpr): Handle field remapping here.
10296
10297         * iteratators.cs: Pass the instance variable (if the method is an
10298         instance method) to the constructors, so we can access the field
10299         variables on the class.
10300
10301         TODO: Test this with structs.  I think the THIS variable on
10302         structs might have to be a pointer, and not a refenrece
10303
10304 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10305
10306         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10307         local variables to fields in a proxy class.
10308
10309         * iterators.cs (PopulateProxy): Rename our internal fields to
10310         <XXX>.  
10311         Create a <THIS> field if we are an instance method, so we can
10312         reference our parent container variables.
10313         (MapVariable): Called back from the EmitContext code to enter a
10314         new variable to field mapping into the proxy class (we just create
10315         a FieldBuilder).
10316
10317         * expression.cs
10318         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10319         for using the remapped locals to fields.
10320
10321         I placed the code here, because that gives the same semantics to
10322         local variables, and only changes the Emit code.
10323
10324         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10325         statements inside iterators.
10326         (VariableInfo): Add a FieldBuilder for the cases when we are
10327         remapping local variables to fields in a proxy class
10328
10329         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10330         current_block != null.
10331
10332         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10333         not cope with strings, as it has been moved to the
10334         TableSwitchEmit.  Fixed bug in switch generation.
10335
10336         * expression.cs (New.DoResolve): Provide more context for the user
10337         when reporting an error.
10338
10339         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10340         pointers. 
10341
10342         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10343         check the permissions for it.  Note than in a type-resolution
10344         context the check was already present in DeclSpace.ResolveType,
10345         but was missing from the MemberAccess.
10346
10347         (ArrayCreation.CheckIndices): warn if the user has
10348         more nested levels of expressions, but there are no more
10349         dimensions specified.  Avoids crash on bug 41906.
10350
10351 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10352
10353         * statement.cs (Block): replace Implicit bool, for a generic
10354         flags.   
10355         New flag: `Unchecked'.  This is used during the EmitMeta phase
10356         (which is out-of-line with the regular Resolve/Emit process for a
10357         statement, as this is done ahead of time, but still gets a chance
10358         to call constant resolve).
10359
10360         (Block.Flags): new enum for adding a new flag.
10361
10362         (Block.EmitMeta): track the state of unchecked.
10363
10364         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10365         to enable constant resolution to work there as well.
10366
10367 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10368
10369         * typemanager.cs (ienumerable_type): Also look up
10370         System.Collections.IEnumerable. 
10371
10372 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10373
10374         TODO: Test more than one conditional per method.
10375
10376         * class.cs (Indexer.Define): Report the location where the user is
10377         referencing the unsupported feature.
10378
10379         (MethodData): Overload the use of `conditionals' to
10380         minimize the creation of needless ArrayLists.   This saves roughly
10381         212kb on my machine.
10382
10383         (Method): Implement the new IIteratorContainer interface.
10384         (Method.SetYields): Implement the method by setting the ModFlags
10385         to contain METHOD_YIELDS.
10386
10387         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10388         which just got set to null.
10389
10390         * iterators.cs: New file.
10391
10392         (Yield, YieldBreak): New statements.
10393
10394         * statement.cs (Return.Resolve): Flag an error if we are used in
10395         an iterator method.
10396
10397         * codegen.cs (InIterator): New flag set if the code is being
10398         compiled in an iterator method.
10399
10400         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10401         internal modifier, and we just use it to avoid adding extra
10402         fields, as this is seldom used.  
10403
10404         * cs-parser.jay: Add yield_statement (yield and yield break).
10405
10406         * driver.cs: New flag -v2 to turn on version 2 features. 
10407
10408         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10409         hashtable when v2 is enabled.
10410
10411 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10412
10413         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10414         there is already a namespace defined with this name.
10415
10416         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10417         people upgraded their corlibs.
10418
10419         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10420         always use fully qualified types, no need to use the compiler
10421         front end.
10422
10423         (TypeManager.IsNamespace): Use binarysearch.
10424
10425         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10426         AddDelegate): I did not quite use the new IsValid API properly: I
10427         have to pass the short-name and the fullname.  I was passing only
10428         the basename instead of the fullname sometimes. 
10429
10430         (TypeContainer.DefineType): call NamespaceClash.
10431
10432         * interface.cs (Interface.DefineType): use NamespaceClash before
10433         defining the type.
10434
10435         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10436         defining the type.
10437
10438         * enum.cs: (Enum.DefineType): use NamespaceClash before
10439         defining the type.
10440
10441         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10442         speed increase.  First, use the negative_hits cache when we get a
10443         negative.  Second, add the type with its full original name
10444         instead of the new . and + encoded name (reflection uses + to
10445         separate type from a nested type).  Use LookupTypeReflection
10446         directly which bypasses the type->name hashtable (that we already
10447         know does not contain the type.
10448
10449         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10450         location/container type. 
10451
10452         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10453
10454 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10455
10456         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10457
10458         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10459         method is being referenced in the method group from a static
10460         context, and report error 120 if so.
10461
10462         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10463         Error118. 
10464
10465         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10466         is created, we create the A namespace).
10467
10468         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10469         Fixes #41591
10470
10471 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10472
10473         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10474         invocation to ModuleBuilder.GetType with the same values will
10475         return a new type instance, so we need to cache its return
10476         values. 
10477
10478         * expression.cs (Binary.ResolveOperator): Only allow the compare
10479         operators on enums if they are of the same type.
10480
10481         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10482         types of ValueType on their own case.  Before we were giving them
10483         the same treatment as objects.
10484
10485         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10486         fullname.  Short name is used to compare against container name.
10487         Fullname is used to check against defined namespace names.
10488
10489         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10490         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10491
10492         (Method.CheckBase): Call parent.
10493         (MemberBase.CheckBase): Check for protected members on sealed
10494         classes.
10495         (PropertyBase.CheckBase): Call parent.
10496         (Field.Define): Call parent.
10497
10498         * report.cs: Negative error codes are now mapped to 8000 - code,
10499         so that the display is render more nicely.
10500
10501         * typemanager.cs: Do not use try/catch, instead report a regular
10502         error. 
10503
10504         (GetPointerType, GetReferenceType): These methods provide
10505         mechanisms to obtain the T* and T& from a T.  We had the code
10506         previously scattered around the code base, and it also used
10507         TypeManager.LookupType that would go through plenty of caches.
10508         This one goes directly to the type source.
10509
10510         In some places we did the Type.GetType followed by
10511         ModuleBuilder.GetType, but not in others, so this unifies the
10512         processing as well.
10513
10514         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10515         statements now that we have namespace information.
10516
10517         * typemanager.cs (IsNamespace): New method, returns whether the
10518         string presented is a namespace or not.
10519
10520         (ComputeNamespaces): New public entry point, computes the list of
10521         available namespaces, using the GetNamespaces API call in Mono, or
10522         the slower version in MS.NET.   
10523
10524         Now before we start the semantic analysis phase, we have a
10525         complete list of namespaces including everything that the user has
10526         provided.
10527
10528         Deleted old code to cache namespaces in .nsc files.
10529
10530 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10531
10532         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10533         class/struct location definition Location for the implicit
10534         constructor location.
10535
10536         (Operator.Define): Use the location of the operator for the
10537         implicit Method definition.
10538
10539         (Constructor.Emit): use the constructor location for the implicit
10540         base initializer constructor.
10541
10542         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10543         and the Expression class now contains two new methods:
10544
10545         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10546         isolate type lookup from the rest of the resolution process.
10547
10548         Since we use Expressions to hold type definitions due to the way
10549         we parse the input we have historically overloaded Resolve to
10550         perform the Type lookups if a special flag is passed.  Now this is
10551         eliminated and two methods take their place. 
10552
10553         The differences in the two methods between xStep and xTerminal is
10554         that xStep is involved in our current lookup system that uses
10555         SimpleNames to compose a name, while xTerminal is used just to
10556         catch the case where the simplename lookup failed.
10557
10558 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10559
10560         * expression.cs (ResolveMemberAccess): Remove redundant code.
10561         TypeExpr expressions are always born fully resolved.
10562
10563         * interface.cs (PopulateMethod): Do not lookup the types twice.
10564         We were doing it once during SemanticAnalysis and once during
10565         PopulateMethod.
10566
10567         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10568         in local variable type definitions, were being returned as a
10569         SimpleName (we decomposed everything into a string), that is
10570         because primary_expression was being used instead of a type in the
10571         grammar (reduce/reduce conflicts).
10572
10573         The part that was wrong is that we converted the expression into a
10574         string (an oversimplification in one hand, compounded with primary
10575         expressions doing string concatenation).
10576
10577         So things like:
10578
10579         A.B.C [] x;
10580
10581         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10582         using clauses from working on this particular context.  And a type
10583         was being matched directly against "A.B.C[]".
10584
10585         We now use the correct approach, and allow for ComposedCast to be
10586         part of the unary expression.  So the "A.B.C []" become a composed
10587         cast of "A.B.C" (as a nested group of MemberAccess with a
10588         SimpleName at the end) plus the rank composition "[]". 
10589
10590         Also fixes 35567
10591
10592 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10593
10594         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10595         for the access level checking.
10596
10597         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10598         `TypeContainer container', because I kept getting confused when I
10599         was debugging this code.
10600
10601         * expression.cs (Indexers): Instead of tracking getters/setters,
10602         we now track them in parallel.  We create one arraylist less, but
10603         most importantly it is possible now for the LValue code to find a
10604         matching get for a set.
10605
10606         (IndexerAccess.DoResolveLValue): Update the code.
10607         GetIndexersForType has been modified already to extract all the
10608         indexers from a type.  The code assumed it did not.
10609
10610         Also make the code set the correct return type for the indexer.
10611         This was fixed a long time ago for properties, but was missing for
10612         indexers.  It used to be void_type.
10613
10614         (Binary.Emit): Test first for doubles instead of
10615         floats, as they are more common.
10616
10617         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10618         when dealing with floats and the <=, >= operators.  This fixes bug
10619         #39314 
10620
10621         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10622         to load the array value by emitting a load on the foreach variable
10623         type.  This was incorrect.  
10624
10625         We now emit the code to load an element using the the array
10626         variable type, and then we emit the conversion operator.
10627
10628         Fixed #40176
10629
10630 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10631
10632         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10633
10634 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10635
10636         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10637         test for protection before we test for signatures. 
10638
10639         (MethodSignature.ToString): implement.
10640
10641         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10642         to the case where we reduced into a LongConstant.
10643
10644         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10645         depend on whether the information is acurrate, because the
10646         Microsoft runtime will always claim that the array type is public,
10647         regardless of the real state.
10648
10649         If the type is a pointer, another problem happens: the type is
10650         reported as non-public in Microsoft.  
10651
10652         In both cases we have to call CheckAccessLevel recursively with
10653         the underlying type as the argument to be tested.
10654
10655 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10656
10657         * assign.cs (Assign.Emit): If we are dealing with a compound
10658         assignment expression, we should use the code path that stores the
10659         intermediate result in a temporary value.  This fixes #40903.
10660
10661         *expression.cs (Indirection.ToString): Provide ToString method for
10662         debugging. 
10663
10664 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10665
10666         * class.cs: Null out fields holding references to Block objects so
10667         they can be garbage collected.
10668
10669         * expression.cs (OverloadResolve): Remove unused local.
10670
10671 2003-04-07  Martin Baulig  <martin@ximian.com>
10672
10673         * codegen.cs (EmitContext.CurrentFile): New public field.
10674         (EmitContext.Mark): Use the CurrentFile to check whether the
10675         location is in the correct file.
10676         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10677
10678 2003-04-07  Martin Baulig  <martin@ximian.com>
10679
10680         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10681
10682         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10683         location.  [FIXME: The location argument which gets passed to this
10684         method is sometimes wrong!]
10685
10686 2003-04-07  Nick Drochak <ndrochak@gol.com>
10687
10688         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10689
10690 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10691
10692         * expression.cs (Indirection.EmitAssign): We were using the
10693         temporary, but returning immediately instead of continuing the
10694         EmitAssing flow.
10695
10696 2003-04-06  Martin Baulig  <martin@ximian.com>
10697
10698         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10699         if it's a nested child, but also deriving from the outer class.
10700         See test 190.cs.
10701
10702         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10703         nested child, but also deriving from the outer class.  See
10704         test-190.cs.
10705         (FilterWithClosure): We may access private members of the outer
10706         class if we're a nested child and deriving from the outer class.
10707         (RealMemberLookup): Only set `closure_private_ok' if the
10708         `original_bf' contained BindingFlags.NonPublic.
10709
10710 2003-04-05  Martin Baulig  <martin@ximian.com>
10711
10712         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10713
10714 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10715
10716         * class.cs (Event.Define): Do not allow abstract events to have
10717         initializers. 
10718
10719 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10720
10721         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10722         block in event declarations.
10723
10724         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10725         value type, get its address.
10726
10727         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10728         leaving a class on the stack instead of a boolean value (int
10729         0/1).  Change the code so we compare against null, and then the
10730         result against zero.
10731
10732         * class.cs (TypeContainer.GetClassBases): We were checking for the
10733         parent class being sealed too late.
10734
10735         * expression.cs (Binary.Emit): For <= and >= when dealing with
10736         floating point values, use cgt.un and clt.un instead of cgt and
10737         clt alone.
10738
10739 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10740
10741         * statement.cs: Apply the same optimization as MS: skip the 
10742         GetEnumerator returning an IEnumerator, and use the one returning a 
10743         CharEnumerator instead. This allows us to avoid the try-finally block 
10744         and the boxing.
10745
10746 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10747
10748         * cs-parser.jay: Attributes cannot be applied to
10749                          namespaces. Fixes #40473
10750
10751 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10752
10753         * class.cs:
10754         (Add*): check if the name is valid using the full name for constants,
10755         fields, properties and events.
10756
10757 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10758
10759         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10760         char constants to be part of the enumeration.
10761
10762         * expression.cs (Conditional.DoResolve): Add support for operator
10763         true. Implements the missing functionality from 14.12
10764
10765         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10766         operator true/false as required by the spec.
10767
10768         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10769         implicit conversion to boolean.
10770
10771         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10772         also one where the type implements `operator true'. 
10773
10774         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10775         get an expression that will invoke operator true based on an
10776         expression.  
10777
10778         (GetConversionOperators): Removed the hack that called op_True
10779         here.  
10780
10781         (Expression.ResolveBoolean): Move this from Statement.
10782
10783 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10784
10785         * ecore.cs (FieldExpr): do not allow initialization of initonly
10786         fields on derived classes
10787
10788 2003-03-13  Martin Baulig  <martin@ximian.com>
10789
10790         * statement.cs (Block.Emit): Call ig.BeginScope() and
10791         ig.EndScope() when compiling with debugging info; call
10792         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10793
10794 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10795
10796         * expression.cs (Indexers): Do not construct immediately, allow
10797         for new members to be appended as we go.  Fixes 38143
10798
10799 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10800
10801         * expression.cs: save/restore context when resolving an unchecked
10802         expression.
10803
10804 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10805
10806         * cfold.cs: Catch division by zero in modulus operator during
10807         constant folding.
10808
10809 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10810
10811         * interface.cs (Interface.DefineMembers): Avoid defining members
10812         twice. 
10813
10814 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10815
10816         * driver.cs: handle the +/- options for -noconfig
10817
10818         * statement.cs (Unckeched.Resolve): Also track the state of
10819         unchecked in the Resolve phase.
10820
10821 2003-02-27  Martin Baulig  <martin@ximian.com>
10822
10823         * ecore.cs (Expression.MemberLookup): Don't create a
10824         MethodGroupExpr for something which is not a method.  Fixes #38291.
10825
10826 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10827
10828         * class.cs (MemberBase.CheckParameters): Also check that the type
10829         is unmanaged if it is a pointer.
10830
10831         * expression.cs (SizeOf.Resolve): Add location information.
10832
10833         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10834         a managed type is declared.
10835
10836         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10837         parameter modifiers as well.  Fixes bug 38606
10838
10839         * class.cs: Very sad.  Am backing out the speed up changes
10840         introduced by the ArrayList -> Array in the TypeContainer, as they
10841         were not actually that much faster, and introduced a bug (no error
10842         reports on duplicated methods).
10843
10844         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10845         source first, this will guarantee that we have a valid expression
10846         before calling in lower levels functions that will require a
10847         resolved object.  Then use this original_source in the
10848         target.ResolveLValue instead of the original source that was
10849         passed to us.
10850
10851         Another change.  Use target.Resolve instead of LValueResolve.
10852         Although we are resolving for LValues, we will let the Assign code
10853         take care of that (it will be called again from Resolve).  This
10854         basically allows code like this:
10855
10856         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10857         class Y { void A (X x) { x [0] += o; }
10858
10859         The problem was that the indexer was trying to resolve for
10860         set_Item (idx, object o) and never finding one.  The real set_Item
10861         was set_Item (idx, X).  By delaying the process we get the right
10862         semantics. 
10863
10864         Fixes bug 36505
10865
10866 2003-02-23  Martin Baulig  <martin@ximian.com>
10867
10868         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10869         while calling DoEmit ().
10870
10871         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10872         source files; if you use the #line directive inside a method, the
10873         compiler stops emitting line numbers for the debugger until it
10874         reaches the end of the method or another #line directive which
10875         restores the original file.
10876
10877 2003-02-23  Martin Baulig  <martin@ximian.com>
10878
10879         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10880
10881 2003-02-23  Martin Baulig  <martin@ximian.com>
10882
10883         * statement.cs (Block.AddChildVariableNames): We need to call this
10884         recursively, not just for our immediate children.
10885
10886 2003-02-23  Martin Baulig  <martin@ximian.com>
10887
10888         * class.cs (Event.Define): Always make the field private, like csc does.
10889
10890         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10891         actually work, fixes bug #37521.
10892
10893 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10894
10895         * delegate.cs: When creating the various temporary "Parameters"
10896         classes, make sure that we call the ComputeAndDefineParameterTypes
10897         on those new parameters (just like we do with the formal ones), to
10898         allow them to be resolved in the context of the DeclSpace.
10899
10900         This fixes the bug that Dick observed in Bugzilla #38530.
10901
10902 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10903
10904         * expression.cs (ResolveMemberAccess): When resolving a constant,
10905         do not attempt to pull a constant if the value was not able to
10906         generate a valid constant.
10907
10908         * const.cs (LookupConstantValue): Do not report more errors than required.
10909
10910 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10911
10912         * expression.cs: fixes bug #38328.
10913
10914 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10915
10916         * class.cs: Changed all the various members that can be part of a
10917         class from being an ArrayList to be an Array of the right type.
10918         During the DefineType type_list, interface_list, delegate_list and
10919         enum_list are turned into types, interfaces, delegates and enums
10920         arrays.  
10921
10922         And during the member population, indexer_list, event_list,
10923         constant_list, field_list, instance_constructor_list, method_list,
10924         operator_list and property_list are turned into their real arrays.
10925
10926         Although we could probably perform this operation earlier, for
10927         good error reporting we need to keep the lists and remove the
10928         lists for longer than required.
10929
10930         This optimization was triggered by Paolo profiling the compiler
10931         speed on the output of `gen-sample-program.pl' perl script. 
10932
10933         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10934         not crash in methods like MemberLookupFailed that use this field.  
10935
10936         This problem arises when the compiler fails to resolve a type
10937         during interface type definition for example.
10938
10939 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10940
10941         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10942         inherit from System.Object, so we have to stop at null, not only
10943         when reaching System.Object.
10944
10945 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10946
10947         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10948         DeclaredOnly because the parent indexer might have had a different
10949         name, but did not loop until the top of the hierarchy was reached.
10950
10951         The problem this one fixes is 35492: when a class implemented an
10952         indexer from an interface, we were getting the interface method
10953         (which was abstract) and we were flagging an error (can not invoke
10954         abstract method).
10955
10956         This also keeps bug 33089 functioning, and test-148 functioning.
10957
10958         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10959         out if a method is special is to see if it is declared in a
10960         property or event, or whether it is one of the predefined operator
10961         names.   This should fix correctly #36804.
10962
10963 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10964
10965         The goal here is to remove the dependency on EmptyCast.Peel ().
10966         Killing it completely.
10967
10968         The problem is that currently in a number of places where
10969         constants are expected, we have to "probe" for an EmptyCast, and
10970         Peel, which is not the correct thing to do, as this will be
10971         repetitive and will likely lead to errors. 
10972
10973         The idea is to remove any EmptyCasts that are used in casts that
10974         can be reduced to constants, so we only have to cope with
10975         constants. 
10976
10977         This bug hunt was triggered by Bug 37363 and the desire to remove
10978         the duplicate pattern where we were "peeling" emptycasts to check
10979         whether they were constants.  Now constants will always be
10980         constants.
10981
10982         * ecore.cs: Use an enumconstant here instead of wrapping with
10983         EmptyCast.  
10984
10985         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10986         throwing me off.  By handling this we can get rid of a few hacks.
10987
10988         * statement.cs (Switch): Removed Peel() code.
10989
10990 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10991
10992         * class.cs: Location information for error 508
10993
10994         * expression.cs (New.DoResolve): Add a guard against double
10995         resolution of an expression.  
10996
10997         The New DoResolve might be called twice when initializing field
10998         expressions (see EmitFieldInitializers, the call to
10999         GetInitializerExpression will perform a resolve on the expression,
11000         and later the assign will trigger another resolution
11001
11002         This leads to bugs (#37014)
11003
11004         * delegate.cs: The signature for EndInvoke should contain any ref
11005         or out parameters as well.  We were not doing this in the past. 
11006
11007         * class.cs (Field.Define): Do not overwrite the type definition
11008         inside the `volatile' group.  Turns out that volatile enumerations
11009         were changing the type here to perform a validity test, which
11010         broke conversions. 
11011
11012 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11013
11014         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11015         and structs, we do not want to load the instance variable
11016
11017         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11018         enum_type has to be handled like an object reference (implicit
11019         conversions exists from this to object), but the regular IsClass
11020         and IsValueType tests will never return true for this one.
11021
11022         Also we use TypeManager.IsValueType instead of type.IsValueType,
11023         just for consistency with the rest of the code (this is only
11024         needed if we ever use the construct exposed by test-180.cs inside
11025         corlib, which we dont today).
11026
11027 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11028
11029         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11030         just InternalCall.
11031
11032 2003-02-09  Martin Baulig  <martin@ximian.com>
11033
11034         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11035         (Namespace.DefineNamespaces): New static public method; this is
11036         called when we're compiling with debugging to add all namespaces
11037         to the symbol file.
11038
11039         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11040         pass it to the Namespace's .ctor.
11041
11042         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11043         and MethodBase arguments; pass the namespace ID to the symwriter;
11044         pass the MethodBase instead of the token to the symwriter.
11045         (SymbolWriter.DefineNamespace): New method to add a namespace to
11046         the symbol file.
11047
11048 2003-02-09  Martin Baulig  <martin@ximian.com>
11049
11050         * symbolwriter.cs: New file.  This is a wrapper around
11051         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11052         methods here in near future.
11053
11054 2003-02-09  Martin Baulig  <martin@ximian.com>
11055
11056         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11057         ILGenerator.MarkSequencePoint() which are actually used by the
11058         symbol writer.
11059
11060 2003-02-09  Martin Baulig  <martin@ximian.com>
11061
11062         * location.cs (SourceFile): New public sealed class.  This
11063         contains the name and an index which is used in the location's token.
11064         (Location): Reserve an appropriate number of bits in the token for
11065         the source file instead of walking over that list, this gives us a
11066         really huge performance improvement when compiling with debugging.
11067
11068         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11069         `SourceFile' argument instead of a string.
11070         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11071         but don't parse/tokenize here, we need to generate the list of all
11072         source files before we do that.
11073         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11074         the files.
11075
11076         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11077         instead of a string.
11078
11079         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11080         of a string.
11081
11082 2003-02-09  Martin Baulig  <martin@ximian.com>
11083
11084         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11085         filename on `#line default'.
11086
11087 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11088
11089         * statement.cs: don't clear the pinned var when the fixed statement
11090         returns from the method (fixes bug#37752).
11091
11092 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11093
11094         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11095         to IsValueType.
11096
11097 2003-02-07  Martin Baulig  <martin@ximian.com>
11098
11099         * driver.cs: Removed the `--debug-args' command line argument.
11100
11101         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11102         automatically by the AsssemblyBuilder.
11103         (CodeGen.InitializeSymbolWriter): We don't need to call any
11104         initialization function on the symbol writer anymore.  This method
11105         doesn't take any arguments.
11106
11107 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11108
11109         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11110         from referenced assemblies as well.
11111
11112 2003-02-02  Martin Baulig  <martin@ximian.com>
11113
11114         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11115
11116 2003-02-02  Martin Baulig  <martin@ximian.com>
11117
11118         * class.cs (Constructor.Emit): Open the symbol writer before
11119         emitting the constructor initializer.
11120         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11121         single-stepping through constructor initializers.
11122
11123 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11124
11125         * class.cs: Handle error 549: do not allow virtual methods in
11126         sealed classes. 
11127
11128 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11129
11130         * decl.cs: Check access levels when resolving types
11131
11132 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11133
11134         * statement.cs: Add parameters and locals set in catch blocks that might 
11135         return to set vector
11136
11137 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11138
11139         * class.cs (Operator): Set the SpecialName flags for operators.
11140
11141         * expression.cs (Invocation.DoResolve): Only block calls to
11142         accessors and operators on SpecialName methods.
11143
11144         (Cast.TryReduce): Handle conversions from char constants.
11145
11146
11147 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11148
11149         * statement.cs: small memory and time optimization in FlowBranching.
11150
11151 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11152
11153         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11154         problem that the last fix but in the other sid (Set).
11155
11156         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11157         access when there is no indexer in the hierarchy.
11158
11159 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11160
11161         * class.cs: Combine some if statements.
11162
11163 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11164
11165         * driver.cs: fixed bug #37187.
11166
11167 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11168
11169         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11170         any indexer, it's needed to build a list with all the indexers in the
11171         hierarchy (AllGetters), else we have problems. Fixes #35653.
11172
11173 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11174
11175         * class.cs (MethodData.Define): It is wrong for an interface
11176         implementation to be static in both cases: explicit and implicit.
11177         We were only handling this in one case.
11178
11179         Improve the if situation there to not have negations.
11180
11181         * class.cs (Field.Define): Turns out that we do not need to check
11182         the unsafe bit on field definition, only on usage.  Remove the test.
11183
11184 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11185
11186         * driver.cs: use assembly.Location instead of Codebase (the latest
11187         patch made mcs fail when using MS assemblies).
11188
11189 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11190
11191         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11192         get the path to *corlib.dll.
11193
11194 2003-01-21  Nick Drochak <ndrochak@gol.com>
11195
11196         * cs-tokenizer.cs:
11197         * pending.cs:
11198         * typemanager.cs: Remove compiler warnings
11199
11200 2003-01-20  Duncan Mak  <duncan@ximian.com>
11201
11202         * AssemblyInfo.cs: Bump the version number to 0.19.
11203
11204 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11205
11206         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11207
11208 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11209
11210         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11211
11212 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11213
11214         * cs-parser.jay: Small fix: we were not comparing the constructor
11215         name correctly.   Thanks to Zoltan for the initial pointer.
11216
11217 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11218
11219         * cs-tokenizer.cs: Set file name when specified with #line
11220
11221 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11222
11223         * cs-parser.jay: Only perform the constructor checks here if we
11224         are named like the class;  This will help provider a better
11225         error.  The constructor path is taken when a type definition is
11226         not found, but most likely the user forgot to add the type, so
11227         report that rather than the constructor error.
11228
11229 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11230
11231         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11232         allocations.
11233
11234 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11235
11236         * cs-parser.jay: Add cleanup call.
11237
11238 2003-01-13  Duncan Mak  <duncan@ximian.com>
11239
11240         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11241         consistent with other methods.
11242
11243 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11244
11245         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11246
11247 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11248
11249         * attribute.cs: only set GuidAttr to true when we have a
11250         GuidAttribute.
11251
11252 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11253
11254         * ecore.cs:
11255         * expression.cs:
11256         * typemanager.cs: fixes to allow mcs compile corlib with the new
11257         Type.IsSubclassOf fix.
11258
11259 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11260
11261         * expression.cs (LocalVariableReference.DoResolve): Classify a
11262         constant as a value, not as a variable.   Also, set the type for
11263         the variable.
11264
11265         * cs-parser.jay (fixed_statement): take a type instead of a
11266         pointer_type, so we can produce a better error message later.
11267
11268         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11269         as an error.  
11270
11271         (For.DoEmit): Make inifinite loops have a
11272         non-conditional branch back.
11273
11274         (Fixed.DoEmit): First populate the pinned variables, then emit the
11275         statement, then clear the variables.  Before I was emitting the
11276         code once for each fixed piece.
11277
11278
11279 2003-01-08  Martin Baulig  <martin@ximian.com>
11280
11281         * statement.cs (FlowBranching.MergeChild): A break in a
11282         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11283
11284 2003-01-08  Martin Baulig  <martin@ximian.com>
11285
11286         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11287         lives in the same number space than `param_map'.  Fixes #36154.
11288
11289 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11290
11291         * cs-parser.jay (constructor_declaration): Set the
11292         Constructor.ModFlags before probing for it.  This makes the
11293         compiler report 514, 515 and 132 (the code was there, but got
11294         broken). 
11295
11296         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11297         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11298         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11299
11300 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11301
11302         * enum.cs: create the enum static fields using the enum type.
11303
11304 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11305
11306         * class.cs: don't try to create the ParamBuilder for the return
11307         type if it's not needed (and handle it breaking for the ms runtime
11308         anyway).
11309
11310 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11311
11312         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11313
11314 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11315
11316         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11317         the command.   This showed up while compiling the JANET source
11318         code, which used \r as its only newline separator.
11319
11320 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11321
11322         * class.cs (Method.Define): If we are an operator (because it
11323         reuses our code), then set the SpecialName and HideBySig.  #36128
11324
11325 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11326
11327         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11328         exception, report error 120 `object reference required'.
11329
11330         * driver.cs: Add --pause option, used during to measure the size
11331         of the process as it goes with --timestamp.
11332
11333         * expression.cs (Invocation.DoResolve): Do not allow methods with
11334         SpecialName to be invoked.
11335
11336 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11337
11338         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11339         number before adding it.
11340
11341 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11342
11343         * ecore.cs (StandardImplicitConversion): When in an unsafe
11344         context, we allow conversion between void * to any other pointer
11345         type. This fixes bug #35973.
11346
11347 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11348
11349         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11350         is not thrown when extensionless outputs are used 
11351
11352 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11353
11354         * rootcontext.cs: fixed compilation of corlib.
11355
11356 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11357
11358         * attribute.cs (Attributes.Contains): Add new method.
11359
11360         * class.cs (MethodCore.LabelParameters): if the parameter is an
11361         `out' parameter, check that no attribute `[In]' has been passed.
11362
11363         * enum.cs: Handle the `value__' name in an enumeration.
11364
11365 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11366
11367         * decl.cs: Added special case to allow overrides on "protected
11368         internal" methods
11369
11370 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11371
11372         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11373         since it makes much more sense.
11374
11375         (Attributes.ctor): Don't require a Location parameter.
11376
11377         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11378
11379         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11380         since we already have that information per attribute.
11381
11382         * everywhere : make appropriate changes.
11383
11384         * class.cs (LabelParameters): Write the code which actually
11385         applies attributes to the return type. We can't do this on the MS
11386         .NET runtime so we flag a warning in the case an exception is
11387         thrown.
11388
11389 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11390
11391         * const.cs: Handle implicit null conversions here too.
11392
11393 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11394
11395         * class.cs (MethodCore.LabelParameters): Remove the extra
11396         Type [] parameter since it is completely unnecessary. Instead
11397         pass in the method's attributes so that we can extract
11398         the "return" attribute.
11399
11400 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11401
11402         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11403         of ignoring it and letting the compile continue.
11404
11405         * typemanager.cs (ChangeType): use an extra argument to return an
11406         error condition instead of throwing an exception.
11407
11408 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11409
11410         * expression.cs (Unary.TryReduce): mimic the code for the regular
11411         code path.  Perform an implicit cast in the cases where we can
11412         implicitly convert to one of the integral types, and then reduce
11413         based on that constant.   This fixes bug #35483.
11414
11415 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11416
11417         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11418
11419 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11420
11421         * namespace.cs: fixed bug #35489.
11422
11423 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11424
11425         * class.cs: Remove some dead code.
11426
11427         * cs-parser.jay: Estimate the number of methods needed
11428         (RootContext.MethodCount);
11429
11430         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11431         numbers instead of StringBuilders.
11432
11433         * support.cs (PtrHashtable): Add constructor with initial size;
11434         We can now reduce reallocations of the method table.
11435
11436 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11437
11438         * attribute.cs (ApplyAttributes): Keep track of the emitted
11439         attributes on a per-target basis. This fixes bug #35413.
11440
11441 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11442
11443         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11444         default to the Windows 1252 encoding.
11445
11446         (UnixParseOption): Support version, thanks to Alp for the missing
11447         pointer. 
11448
11449         * AssemblyInfo.cs: Add nice assembly information.
11450
11451         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11452         (bug 35169).
11453
11454         * cs-parser.jay: Allow a trailing comma before the close bracked
11455         in the attribute_section production.
11456
11457         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11458         address of the instance was being taken, I will take this out,
11459         because we take the address of the object immediately here.
11460
11461 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11462
11463         * typemanager.cs (AreMultipleAllowed): Take care of the most
11464         obvious case where attribute type is not in the current assembly -
11465         stupid me ;-)
11466
11467 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11468
11469         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11470         definitions, instead of doing that afterwards.  
11471
11472         Also we use a nice little hack, depending on the constructor, we
11473         know if we are a "composed" name or a simple name.  Hence, we
11474         avoid the IndexOf test, and we avoid 
11475
11476         * codegen.cs: Add code to assist in a bug reporter to track down
11477         the source of a compiler crash. 
11478
11479 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11480
11481         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11482         types have been emitted for a given element and flag an error
11483         if something which does not have AllowMultiple set is used more
11484         than once.
11485
11486         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11487         attribute types and their corresponding AllowMultiple properties
11488
11489         (AreMultipleAllowed): Check the property for a given type.
11490
11491         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11492         property in the case we have a TypeContainer.
11493
11494         (Attributes.AddAttribute): Detect duplicates and just skip on
11495         adding them. This trivial fix catches a pretty gross error in our
11496         attribute emission - global attributes were being emitted twice!
11497
11498         Bugzilla bug #33187 is now fixed.
11499
11500 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11501
11502         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11503         instead of pp_and).
11504
11505         * expression.cs (Binary.ResolveOperator): I can only use the
11506         Concat (string, string, string) and Concat (string, string,
11507         string, string) if the child is actually a concatenation of
11508         strings. 
11509
11510 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11511
11512         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11513         context where we need a 2-character lookahead.
11514
11515         * pending.cs (PendingImplementation): Rework so we can keep track
11516         of interface types all the time, and flag those which were
11517         implemented by parents as optional.
11518
11519 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11520
11521         * expression.cs (Binary.ResolveOperator): Use
11522         String.Concat(string,string,string) or
11523         String.Concat(string,string,string,string) when possible. 
11524
11525         * typemanager: More helper methods.
11526
11527
11528 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11529
11530         * pending.cs: remove the bogus return from GetMissingInterfaces()
11531         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11532
11533 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11534
11535         * namespace.cs: avoid duplicated 'using xxx' being added to
11536         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11537         when we get more than one 'using' statement for the same namespace.
11538         Report a CS0105 warning for it.
11539
11540 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11541
11542         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11543         of calling getChar/putback, uses internal knowledge of it.    
11544
11545         (xtoken): Reorder tokenizer so most common patterns are checked
11546         first.  This reduces the compilation time in another 5% (from 8.11s
11547         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11548
11549         The parsing time is 22% of the compilation in mcs, and from that
11550         64% is spent on the tokenization process.  
11551
11552         I tried using a binary search for keywords, but this is slower
11553         than the hashtable.  Another option would be to do a couple of
11554         things:
11555
11556                 * Not use a StringBuilder, instead use an array of chars,
11557                   with a set value.  Notice that this way we could catch
11558                   the 645 error without having to do it *afterwards*.
11559
11560                 * We could write a hand-parser to avoid the hashtable
11561                   compares altogether.
11562
11563         The identifier consumption process takes 37% of the tokenization
11564         time.  Another 15% is spent on is_number.  56% of the time spent
11565         on is_number is spent on Int64.Parse:
11566
11567                 * We could probably choose based on the string length to
11568                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11569                   computations. 
11570
11571         Another 3% is spend on wrapping `xtoken' in the `token' function.
11572
11573         Handle 0xa0 as whitespace (#34752)
11574
11575 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11576
11577         * typemanager.cs (IsCLRType): New routine to tell whether a type
11578         is one of the builtin types.  
11579
11580         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11581         typecode in more places instead of doing pointer comparissions.
11582         We could leverage some knowledge about the way the typecodes are
11583         laid out.
11584
11585         New code to cache namespaces in assemblies, it is currently not
11586         invoked, to be used soon.
11587
11588         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11589
11590         * expression.cs (Binary.ResolveOperator): specially handle
11591         strings, and do not perform user-defined operator overloading for
11592         built-in types.
11593
11594 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11595
11596         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11597         internalcall as it is a pretty simple operation;  Avoid whenever
11598         possible to call Char.IsLetter.
11599
11600         (consume_identifier): Cut by half the number of
11601         hashtable calls by merging the is_keyword and GetKeyword behavior.
11602
11603         Do not short-circuit, because if we do, we
11604         report errors (ie, #if false && true would produce an invalid
11605         directive error);
11606
11607
11608 2002-11-24  Martin Baulig  <martin@ximian.com>
11609
11610         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11611         check constant ranges and report a CS0221.  Fixes #33186.
11612
11613 2002-11-24  Martin Baulig  <martin@ximian.com>
11614
11615         * cs-parser.jay: Make this work for uninitialized variable
11616         declarations in the `for' initializer.  Fixes #32416.
11617
11618 2002-11-24  Martin Baulig  <martin@ximian.com>
11619
11620         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11621         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11622
11623 2002-11-24  Martin Baulig  <martin@ximian.com>
11624
11625         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11626         argument; if true, we also check for user-defined conversions.
11627         This is only needed if both arguments are of a user-defined type.
11628         Fixes #30443, added test-175.cs.
11629         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11630
11631         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11632
11633 2002-11-24  Martin Baulig  <martin@ximian.com>
11634
11635         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11636         function to get the store opcode.
11637         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11638         only emit the Ldelema if the store opcode is Stobj.  You must run
11639         both test-34 and test-167 to test this.  Fixes #34529.
11640
11641 2002-11-23  Martin Baulig  <martin@ximian.com>
11642
11643         * ecore.cs (Expression.MemberLookup): Added additional
11644         `qualifier_type' argument which is used when we're being called
11645         from MemberAccess.DoResolve() and null if we're called from a
11646         SimpleName lookup.
11647         (Expression.MemberLookupFailed): New method to report errors; this
11648         does the CS1540 check and reports the correct error message.
11649
11650         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11651         argument for the CS1540 check and redone the way how we're dealing
11652         with private members.  See the comment in the source code for details.
11653         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11654         `closure_start_type' to `closure_qualifier_type' and check whether
11655         it's not null.  It was not this filter being broken, it was just
11656         being called with the wrong arguments.
11657
11658         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11659         and pass it the correct `qualifier_type'; this also does the error
11660         handling for us.
11661
11662 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11663
11664         * expression.cs (Invocation.EmitParams): If the we are dealing
11665         with a non-built-in value type, load its address as well.
11666
11667         (ArrayCreation): Use a a pretty constant instead
11668         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11669         static initializers.  
11670
11671         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11672         because they are not really value types, just glorified integers. 
11673
11674         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11675
11676         * ecore.cs: Remove redundant code for enumerations, make them use
11677         the same code path as everything else, fixes the casting issue
11678         with enumerations in Windows.Forms.
11679
11680         * attribute.cs: Do only cast to string if it is a string, the
11681         validation happens later.
11682
11683         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11684         people upgrade their corlibs.
11685
11686         * ecore.cs: Oops, enumerations were not following the entire code path
11687
11688 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11689
11690         * typemanager.cs (FilterWithClosure): Commented out the test for
11691         1540 in typemanager.cs, as it has problems when accessing
11692         protected methods from a parent class (see test-174.cs). 
11693
11694         * attribute.cs (Attribute.ValidateGuid): new method.
11695         (Attribute.Resolve): Use above.
11696
11697 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11698
11699         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11700
11701         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11702         handling for enumerations, as we only needed the TypeContainer
11703         functionality to begin with (this is required for the fix below to
11704         work for enums that reference constants in a container class for
11705         example). 
11706
11707         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11708
11709         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11710         a valid TypeBuilder to perform lookups on.o
11711
11712         * class.cs (InheritableMemberSignatureCompare): Use true in the
11713         call to GetGetMethod and GetSetMethod, because we are comparing
11714         the signature, and we need to get the methods *even* if they are
11715         private. 
11716
11717         (PropertyBase.CheckBase): ditto.
11718
11719         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11720         GotoCase.Resolve): Use Peel on EmpytCasts.
11721
11722         * ecore.cs (EmptyCast): drop child, add Peel method.
11723
11724 2002-11-17  Martin Baulig  <martin@ximian.com>
11725
11726         * ecore.cs (EmptyCast.Child): New public property.
11727
11728         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11729         label resolved to an EmptyCast.  Fixes #34162.
11730         (GotoCase.Resolve): Likewise.
11731         (Block.EmitMeta): Likewise.
11732
11733 2002-11-17  Martin Baulig  <martin@ximian.com>
11734
11735         * expression.cs (Invocation.BetterConversion): Prefer int over
11736         uint; short over ushort; long over ulong for integer literals.
11737         Use ImplicitConversionExists instead of StandardConversionExists
11738         since we also need to check for user-defined implicit conversions.
11739         Fixes #34165.  Added test-173.cs.
11740
11741 2002-11-16  Martin Baulig  <martin@ximian.com>
11742
11743         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11744         with the `true' and `false' literals.  Fixes #33151.
11745
11746 2002-11-16  Martin Baulig  <martin@ximian.com>
11747
11748         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11749         October 22nd; don't do the cs1540 check for static members.
11750
11751         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11752         now using our own filter here and doing the cs1540 check again.
11753
11754 2002-11-16  Martin Baulig  <martin@ximian.com>
11755
11756         * support.cs (InternalParameters): Don't crash if we don't have
11757         any fixed parameters.  Fixes #33532.
11758
11759 2002-11-16  Martin Baulig  <martin@ximian.com>
11760
11761         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11762         when looking up static methods to make this work on Windows.
11763         Fixes #33773.
11764
11765 2002-11-16  Martin Baulig  <martin@ximian.com>
11766
11767         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11768         a setter rather than using PropertyInfo.CanWrite.
11769
11770 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11771
11772         * class.cs: Allow acces to block member by subclasses. Fixes build
11773         breaker.
11774
11775 2002-11-14  Martin Baulig  <martin@ximian.com>
11776
11777         * class.cs (Constructor.Emit): Added the extern/block check.
11778         Fixes bug #33678.
11779
11780 2002-11-14  Martin Baulig  <martin@ximian.com>
11781
11782         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11783         iteration while looking for indexers, this is needed because the
11784         indexer may have a different name in our base classes.  Fixed the
11785         error reporting (no indexers at all, not get accessor, no
11786         overloaded match).  Fixes bug #33089.
11787         (IndexerAccess.DoResolveLValue): Likewise.
11788
11789 2002-11-14  Martin Baulig  <martin@ximian.com>
11790
11791         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11792         indexers.  Fixes the first part of bug #33089.
11793         (MethodSignature.InheritableMemberSignatureCompare): Added support
11794         for properties.
11795
11796 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11797
11798         * attribute.cs (Attribute.Resolve): Catch the
11799         NullReferenceException and report it since it isn't supposed to
11800         happen. 
11801
11802 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11803
11804         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11805         LogicalOr and LogicalAnd that can benefit from recursively
11806         handling EmitBranchable.  The code now should be nice for Paolo.
11807
11808 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11809
11810         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11811         the Type lookups, as we perform quite a number of lookups on
11812         non-Types.  This can be removed once we can deterministically tell
11813         whether we have a type or a namespace in advance.
11814
11815         But this might require special hacks from our corlib.
11816
11817         * TODO: updated.
11818
11819         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11820         and double which avoids a conversion from an integer to a double.
11821
11822         * expression.cs: tiny optimization, avoid calling IsConstant,
11823         because it effectively performs the lookup twice.
11824
11825 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11826
11827         But a bogus return here to keep the semantics of the old code
11828         until the Mono runtime is fixed.
11829
11830         * pending.cs (GetMissingInterfaces): New method used to remove all
11831         the interfaces that are already implemented by our parent
11832         classes from the list of pending methods. 
11833
11834         * interface.cs: Add checks for calls after ResolveTypeExpr.
11835
11836 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11837
11838         * class.cs (Class.Emit): Report warning 67: event not used if the
11839         warning level is beyond 3.
11840
11841         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11842         being a NullLiteral.
11843
11844         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11845         specifiers. 
11846
11847         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11848         path that might fail if a type can not be resolved.
11849
11850         * expression.cs (Binary.Emit): Emit unsigned versions of the
11851         operators. 
11852
11853         * driver.cs: use error 5.
11854
11855 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11856
11857         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11858
11859 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11860
11861         * cs-parser.jay (switch_section): A beautiful patch from Martin
11862         Baulig that fixed 33094.
11863
11864 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11865
11866         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11867         Check whether the base is abstract and report an error if so.
11868
11869         * expression.cs (IndexerAccess.DoResolveLValue,
11870         IndexerAccess.DoResolve): ditto. 
11871
11872         (Invocation.DoResolve): ditto.
11873
11874         (Invocation.FullMethodDesc): Improve the report string.
11875
11876         * statement.cs (Block): Eliminate IsVariableDefined as it is
11877         basically just a wrapper for GetVariableInfo.
11878
11879         * ecore.cs (SimpleName): Use new 
11880
11881         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11882         type, as we return the actual parameter ref/unref state on a
11883         different call.
11884
11885 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11886
11887         * support.cs: Return proper flags REF/OUT fixing the previous
11888         commit.  
11889
11890         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11891         not used to mean `ref' but `ref or out' in ParameterReference
11892
11893         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11894         full type signature instead of calling TypeManger.CSharpName
11895         ourselves. 
11896
11897         * support.cs (InternalParameters.ParameterDesc): Do not compare
11898         directly to the modflags, because REF/OUT will actually be bitsets
11899         if set. 
11900
11901         * delegate.cs (VerifyMethod): Check also the modifiers.
11902
11903         * cs-tokenizer.cs: Fix bug where floating point values with an
11904         exponent where a sign was missing was ignored.
11905
11906         * driver.cs: Allow multiple assemblies to be specified in a single
11907         /r: argument
11908
11909 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11910
11911         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11912         because identifiers after a parenthesis would end up in this kind
11913         of production, and we needed to desamiguate it for having casts
11914         like:
11915
11916                 (UserDefinedType *) xxx
11917
11918 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11919
11920         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11921         we should set on the Bindingflags.NonPublic, but not turn on
11922         private_ok.  private_ok controls whether a Private member is
11923         returned (this is chekced on the filter routine), while the
11924         BindingFlags.NonPublic just controls whether private/protected
11925         will be allowed.   This fixes the problem part of the problem of
11926         private properties being allowed to be used in derived classes.
11927
11928         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11929         so we can call the children DoResolveLValue method (this will
11930         properly signal errors on lvalue assignments to base properties)
11931
11932         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11933         getter are null, and we have a property info, we know that this
11934         happened because the lookup failed, so we report an error 122 for
11935         protection level violation.
11936
11937         We also silently return if setter and getter are null in the
11938         resolve functions, this condition only happens if we have flagged
11939         the error before.  This is the other half of the problem. 
11940
11941         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11942         not have accessibility information, that is why we were returning
11943         true in the filter function in typemanager.cs.
11944
11945         To properly report 122 (property is inaccessible because of its
11946         protection level) correctly, we report this error in ResolveAccess
11947         by failing if both the setter and the getter are lacking (ie, the
11948         lookup failed). 
11949
11950         DoResolve and DoLResolve have been modified to check for both
11951         setter/getter being null and returning silently, the reason being
11952         that I did not want to put the knowledge about this error in upper
11953         layers, like:
11954
11955         int old = Report.Errors;
11956         x = new PropertyExpr (...);
11957         if (old != Report.Errors)
11958                 return null;
11959         else
11960                 return x;
11961
11962         So the property expr is returned, but it is invalid, so the error
11963         will be flagged during the resolve process. 
11964
11965         * class.cs: Remove InheritablePropertySignatureCompare from the
11966         class, as we no longer depend on the property signature to compute
11967         whether it is possible to implement a method or not.
11968
11969         The reason is that calling PropertyInfo.GetGetMethod will return
11970         null (in .NET, in Mono it works, and we should change this), in
11971         cases where the Get Method does not exist in that particular
11972         class.
11973
11974         So this code:
11975
11976         class X { public virtual int A { get { return 1; } } }
11977         class Y : X { }
11978         class Z : Y { public override int A { get { return 2; } } }
11979
11980         Would fail in Z because the parent (Y) would not have the property
11981         defined.  So we avoid this completely now (because the alternative
11982         fix was ugly and slow), and we now depend exclusively on the
11983         method names.
11984
11985         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11986         reference method, instead of using the property.
11987
11988         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11989         routines are gone now.
11990
11991         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11992         names, they were incorrectly named.
11993
11994         * cs-tokenizer.cs: Return are more gentle token on failure. 
11995
11996         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11997         had an out-of-sync index variable, which caused it to remove from
11998         the list of pending methods the wrong method sometimes.
11999
12000 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12001
12002         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12003         CanWrite, because those refer to this particular instance of the
12004         property, and do not take into account the fact that we can
12005         override single members of a property.
12006
12007         Constructor requires an EmitContext.  The resolution process does
12008         not happen here, but we need to compute the accessors before,
12009         because the resolution does not always happen for properties.
12010
12011         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12012         subclass, before we did not update this flag, but we did update
12013         bindingflags. 
12014
12015         (GetAccessors): Drop this routine, as it did not work in the
12016         presence of partially overwritten set/get methods. 
12017
12018         Notice that this broke the cs1540 detection, but that will require
12019         more thinking. 
12020
12021 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12022
12023         * class.cs:
12024         * codegen.cs:
12025         * driver.cs: issue a warning instead of an error if we don't support
12026         debugging for the platform. Also ignore a couple of errors that may
12027         arise when trying to write the symbols. Undo my previous patch.
12028
12029 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12030
12031         * driver.cs: ignore /debug switch except for Unix platforms.
12032
12033 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12034
12035         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12036
12037 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12038
12039         * driver.cs: Do not make mcs-debug conditional, so we do not break
12040         builds that use it.
12041
12042         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12043         review this patch.  But basically after all the children variables
12044         have been merged, the value of "Breaks" was not being set to
12045         new_breaks for Switch blocks.  I think that it should be set after
12046         it has executed.  Currently I set this to the value of new_breaks,
12047         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12048         conservative, but I do not understand this code very well.
12049
12050         I did not break anything in the build, so that is good ;-)
12051
12052         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12053
12054 2002-10-20  Mark Crichton  <crichton@gimp.org>
12055
12056         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12057
12058 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12059
12060         * cfold.cs: Fixed compile blocker.
12061
12062 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12063
12064         * driver.cs: I was chekcing the key, not the file.
12065
12066 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12067
12068         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12069         message that we were generating - we just need to silently return
12070         a null.
12071
12072 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12073
12074         * class.cs (Event.Define): Change my previous commit, as this
12075         breaks the debugger.  This is a temporary hack, as it seems like
12076         the compiler is generating events incorrectly to begin with.
12077
12078         * expression.cs (Binary.ResolveOperator): Added support for 
12079         "U operator - (E x, E y)"
12080
12081         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12082         y)".
12083
12084         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12085         init-only variables, but this path did not take into account that
12086         there might be also instance readonly variables.  Correct this
12087         problem. 
12088
12089         This fixes bug 32253
12090
12091         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12092         delegates as well.
12093
12094         * driver.cs: Change the extension for modules to `netmodule'
12095
12096         * cs-parser.jay: Improved slightly the location tracking for
12097         the debugger symbols.
12098
12099         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12100         modifiers that were specified instead of the hardcoded value
12101         (FamAndAssem).  This was basically ignoring the static modifier,
12102         and others.  Fixes 32429.
12103
12104         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12105         fixed a bug in the process (32476)
12106
12107         * expression.cs (ArrayAccess.EmitAssign): Patch from
12108         hwang_rob@yahoo.ca that fixes bug 31834.3
12109
12110 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12111
12112         * driver.cs: Make the module extension .netmodule.
12113
12114 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12115
12116         * driver.cs: Report an error if the resource file is not found
12117         instead of crashing.
12118
12119         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12120         false, like Emit does.
12121
12122 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12123
12124         * typemanager.cs: Remove unused private member.  Also reported mcs
12125         bug to report this as a warning like csc.
12126
12127 2002-10-15  Martin Baulig  <martin@gnome.org>
12128
12129         * statement.cs (Statement.Emit): Made this a virtual method; emits
12130         the line number info and calls DoEmit().
12131         (Statement.DoEmit): New protected abstract method, formerly knows
12132         as Statement.Emit().
12133
12134         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12135
12136 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12137
12138         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12139         have fixed a remaining problem: not every AddXXXX was adding a
12140         fully qualified name.  
12141
12142         Now everyone registers a fully qualified name in the DeclSpace as
12143         being defined instead of the partial name.  
12144
12145         Downsides: we are slower than we need to be due to the excess
12146         copies and the names being registered this way.  
12147
12148         The reason for this is that we currently depend (on the corlib
12149         bootstrap for instance) that types are fully qualified, because
12150         we dump all the types in the namespace, and we should really have
12151         types inserted into the proper namespace, so we can only store the
12152         basenames in the defined_names array.
12153
12154 2002-10-10  Martin Baulig  <martin@gnome.org>
12155
12156         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12157         from bug #31834, see the bug report for a testcase which is
12158         miscompiled.
12159
12160 2002-10-10  Martin Baulig  <martin@gnome.org>
12161
12162         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12163         flow analysis code for this.
12164
12165         * statement.cs (Do, While, For): Tell the flow analysis code about
12166         infinite loops.
12167         (FlowBranching.UsageVector): Added support for infinite loops.
12168         (Block.Resolve): Moved the dead code elimination here and use flow
12169         analysis to do it.
12170
12171 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12172
12173         * class.cs (Field.Define): Catch cycles on struct type
12174         definitions. 
12175
12176         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12177         fields if the fields are static.  We only need to check instance
12178         fields. 
12179
12180         * expression.cs (As.DoResolve): Test for reference type.
12181
12182         * statement.cs (Using.ResolveExpression): Use
12183         ConvertImplicitRequired, not ConvertImplicit which reports an
12184         error on failture
12185         (Using.ResolveLocalVariableDecls): ditto.
12186
12187         * expression.cs (Binary.ResolveOperator): Report errors in a few
12188         places where we had to.
12189
12190         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12191
12192 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12193
12194         * expression.cs: Use StoreFromPtr instead of extracting the type
12195         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12196
12197         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12198         an enumeration value to a System.Enum, but System.Enum is not a
12199         value type, but an class type, so we need to box.
12200
12201         (Expression.ConvertExplicit): One codepath could return
12202         errors but not flag them.  Fix this.  Fixes #31853
12203
12204         * parameter.cs (Resolve): Do not allow void as a parameter type.
12205
12206 2002-10-06  Martin Baulig  <martin@gnome.org>
12207
12208         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12209         if it's a class type and not a struct.  Fixes #31815.
12210
12211 2002-10-06  Martin Baulig  <martin@gnome.org>
12212
12213         * statement.cs: Reworked the flow analysis code a bit to make it
12214         usable for dead code elimination.
12215
12216 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12217
12218         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12219
12220 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12221
12222         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12223         to fix the test 165, will investigate deeper.
12224
12225 2002-10-04  Martin Baulig  <martin@gnome.org>
12226
12227         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12228         finally blocks actually work.
12229         (Try.Resolve): We don't need to create a sibling for `finally' if
12230         there is no finally block.
12231
12232 2002-10-04  Martin Baulig  <martin@gnome.org>
12233
12234         * class.cs (Constructor.Define): The default accessibility for a
12235         non-default constructor is private, not public.
12236
12237 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12238
12239         * class.cs (Constructor): Make AllowedModifiers public, add
12240         EXTERN.
12241
12242         * cs-parser.jay: Perform the modifiers test here, as the
12243         constructor for the Constructor class usually receives a zero
12244         because of the way we create it (first we create, later we
12245         customize, and we were never checking the modifiers).
12246
12247         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12248         is a version of LookupTypeReflection that includes the type-name
12249         cache.  This can be used as a fast path for functions that know
12250         the fully qualified name and are only calling into *.GetType() to
12251         obtain a composed type.
12252
12253         This is also used by TypeManager.LookupType during its type
12254         composition.
12255
12256         (LookupType): We now also track the real type name, as sometimes
12257         we can get a quey for the real type name from things like
12258         ComposedCast.  This fixes bug 31422.
12259
12260         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12261         complete type fullname, it does not have to go through the type
12262         resolution system to obtain the composed version of the type (for
12263         obtaining arrays or pointers).
12264
12265         (Conditional.Emit): Use the EmitBoolExpression to
12266         generate nicer code, as requested by Paolo.
12267
12268         (ArrayCreation.CheckIndices): Use the patch from
12269         hwang_rob@yahoo.ca to validate the array initializers. 
12270
12271 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12272
12273         * class.cs (ConstructorInitializer.Emit): simplify code by using
12274         Invocation.EmitCall, and at the same time, fix the bugs in calling
12275         parent constructors that took variable arguments. 
12276
12277         * ecore.cs (Expression.ConvertNumericExplicit,
12278         Expression.ImplicitNumericConversion): Remove the code that
12279         manually wrapped decimal (InternalTypeConstructor call is now gone
12280         as well).
12281
12282         * expression.cs (Cast.TryReduce): Also handle decimal types when
12283         trying to perform a constant fold on the type.
12284
12285         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12286
12287         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12288         that only turned off an error report, and did nothing else. 
12289
12290 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12291
12292         * driver.cs: Handle and ignore /fullpaths
12293
12294 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12295
12296         * expression.cs (Binary.ResolveOperator): Catch the case where
12297         DoNumericPromotions returns true, 
12298
12299         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12300
12301 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12302
12303         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12304         report error 70.
12305
12306 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12307
12308         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12309         conversion exists, but it is also required that the conversion be
12310         performed.  This manifested in "(Type64Enum) 2".  
12311
12312         * class.cs (TypeManager.AddMethod): The fix is not to change
12313         AddEnum, because that one was using a fully qualified name (every
12314         DeclSpace derivative does), but to change the AddMethod routine
12315         that was using an un-namespaced name.  This now correctly reports
12316         the duplicated name.
12317
12318         Revert patch until I can properly fix it.  The issue
12319         is that we have a shared Type space across all namespaces
12320         currently, which is wrong.
12321
12322         Options include making the Namespace a DeclSpace, and merge
12323         current_namespace/current_container in the parser.
12324
12325 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12326
12327         * cs-parser.jay: Improve error reporting when we get a different
12328         kind of expression in local_variable_type and
12329         local_variable_pointer_type. 
12330
12331         Propagate this to avoid missleading errors being reported.
12332
12333         * ecore.cs (ImplicitReferenceConversion): treat
12334         TypeManager.value_type as a target just like object_type.   As
12335         code like this:
12336
12337         ValueType v = 1;
12338
12339         Is valid, and needs to result in the int 1 being boxed before it
12340         is assigned to the value type v.
12341
12342         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12343         to validate the enumeration name.
12344
12345         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12346         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12347         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12348
12349         * ecore.cs (TryImplicitIntConversion): When doing an
12350         implicit-enumeration-conversion, check if the type is 64-bits and
12351         perform a conversion before passing to EnumConstant.
12352
12353 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12354
12355         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12356         report ambiguous type references.  Unlike the MS version, we
12357         report what the ambiguity is.   Innovation at work ;-)
12358
12359         (DeclSpace.FindType): Require a location argument to
12360         display when we display an ambiguous error.
12361
12362         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12363
12364         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12365
12366         * expression.cs (EmitDynamicInitializers): Apply patch from
12367         hwang_rob@yahoo.ca that fixes the order in which we emit our
12368         initializers. 
12369
12370 2002-09-21  Martin Baulig  <martin@gnome.org>
12371
12372         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12373         delegate takes no arguments.
12374
12375 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12378         from integers.
12379
12380         * expression.cs: Extract the underlying type.
12381
12382         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12383
12384         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12385
12386 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * class.cs (TypeContainer.DefineType): We can not use the nice
12389         PackingSize with the size set to 1 DefineType method, because it
12390         will not allow us to define the interfaces that the struct
12391         implements.
12392
12393         This completes the fixing of bug 27287
12394
12395         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12396         means also structs.  This fixes part of the problem. 
12397         (Expresion.ImplicitReferenceConversionExists): ditto.
12398
12399         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12400         error if there were no errors reported during the type lookup
12401         process, to avoid duplicates or redundant errors.  Without this
12402         you would get an ambiguous errors plus a type not found.  We have
12403         beaten the user enough with the first error.  
12404
12405         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12406         reference. 
12407
12408         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12409         during the resolution process, stop the lookup, this avoids
12410         repeated error reports (same error twice).
12411
12412         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12413
12414         * typemanager.cs (LookupType): Redo the type lookup code to match
12415         the needs of System.Reflection.  
12416
12417         The issue is that System.Reflection requires references to nested
12418         types to begin with a "+" sign instead of a dot.  So toplevel
12419         types look like: "NameSpace.TopLevelClass", and nested ones look
12420         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12421         levels. 
12422
12423 2002-09-19  Martin Baulig  <martin@gnome.org>
12424
12425         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12426         says that a method always returns or always throws an exception,
12427         don't report the CS0161.
12428
12429         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12430         set `Returns = new_returns'.
12431
12432 2002-09-19  Martin Baulig  <martin@gnome.org>
12433
12434         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12435         to an enum constant, check for a CS0176.
12436
12437 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12438
12439         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12440         for operators that must be in pairs and report errors.
12441
12442         * ecore.cs (SimpleName.DoResolveType): During the initial type
12443         resolution process, when we define types recursively, we must
12444         check first for types in our current scope before we perform
12445         lookups in the enclosing scopes.
12446
12447         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12448
12449         (Invocation.VerifyArgumentsCompat): Call
12450         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12451         I thought we were supposed to always call this, but there are a
12452         few places in the code where we dont do it.
12453
12454 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12455
12456         * driver.cs: Add support in -linkres and -resource to specify the
12457         name of the identifier.
12458
12459 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12460
12461         * ecore.cs (StandardConversionExists): Sync with the conversion
12462         code: allow anything-* to void* conversions.
12463
12464         (FindMostSpecificSource): Use an Expression argument
12465         instead of a Type, because we might be handed over a Literal which
12466         gets a few more implicit conversions that plain types do not.  So
12467         this information was being lost.
12468
12469         Also, we drop the temporary type-holder expression when not
12470         required.
12471
12472 2002-09-17  Martin Baulig  <martin@gnome.org>
12473
12474         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12475         this is an explicit interface implementation.
12476
12477 2002-09-17  Martin Baulig  <martin@gnome.org>
12478
12479         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12480         different `IndexerName' attributes.
12481
12482         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12483         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12484         virtual CommonResolve().
12485
12486 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12487
12488         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12489         and convert that to the UnderlyingType.
12490
12491         * statement.cs (Foreach.Resolve): Indexers are just like variables
12492         or PropertyAccesses.
12493
12494         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12495         inside quoted strings, we were not doing this before.
12496
12497 2002-09-16  Martin Baulig  <martin@gnome.org>
12498
12499         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12500         resolve it.  This is needed for the definite assignment check of the
12501         instance expression, fixes bug #29846.
12502         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12503
12504 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12505
12506         * parameter.cs: Fix compile error.  Cannot reference static member
12507         from an instance object.  Is this an mcs bug?
12508
12509 2002-09-14  Martin Baulig  <martin@gnome.org>
12510
12511         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12512         multiple times.  Fixes bug #30295, added test-166.cs.
12513
12514 2002-09-14  Martin Baulig  <martin@gnome.org>
12515
12516         * statement.cs (Block.Emit): Don't emit unreachable code.
12517         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12518         `break' statements.
12519         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12520
12521 2002-09-14  Martin Baulig  <martin@gnome.org>
12522
12523         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12524         is set.
12525
12526 2002-09-14  Martin Baulig  <martin@gnome.org>
12527
12528         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12529         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12530         be false on the ms runtime.
12531
12532 2002-09-13  Martin Baulig  <martin@gnome.org>
12533
12534         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12535         the CS0038 error message.
12536
12537 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12538
12539         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12540         constant inside, return it.
12541
12542 2002-09-12  Martin Baulig  <martin@gnome.org>
12543
12544         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12545         implicit conversion can be done between enum types.
12546
12547         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12548         check whether an implicit conversion to the current enum's UnderlyingType
12549         exists and report an error if not.
12550
12551         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12552         without debugging support.
12553
12554         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12555         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12556
12557 2002-09-12  Martin Baulig  <martin@gnome.org>
12558
12559         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12560
12561         * ecore.cs (IMemberExpr.DeclaringType): New property.
12562         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12563         nonstatic member of an outer type (CS0038).
12564
12565 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * driver.cs: Activate the using-error detector at warning level
12568         4 (at least for MS-compatible APIs).
12569
12570         * namespace.cs (VerifyUsing): Small buglett fix.
12571
12572         * pending.cs (PendingImplementation): pass the container pointer. 
12573
12574         * interface.cs (GetMethods): Allow for recursive definition.  Long
12575         term, I would like to move every type to support recursive
12576         definitions, not the current ordering mechanism that we have right
12577         now.
12578
12579         The situation is this: Attributes are handled before interfaces,
12580         so we can apply attributes to interfaces.  But some attributes
12581         implement interfaces, we will now handle the simple cases
12582         (recursive definitions will just get an error).  
12583
12584         * parameter.cs: Only invalidate types at the end if we fail to
12585         lookup all types.  
12586
12587 2002-09-09  Martin Baulig  <martin@gnome.org>
12588
12589         * ecore.cs (PropertyExpr.Emit): Also check for
12590         TypeManager.system_int_array_get_length so this'll also work when
12591         compiling corlib.  Fixes #30003.
12592
12593 2002-09-09  Martin Baulig  <martin@gnome.org>
12594
12595         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12596         and throw an exception if we can't get the type's size.  Fixed #30040,
12597         added test-165.cs.
12598
12599 2002-09-09  Martin Baulig  <martin@gnome.org>
12600
12601         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12602
12603         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12604         context.  Fixes bug #30027.
12605
12606         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12607         virtual functions.  Fixes bug #30043, added test-164.cs.
12608
12609 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12610
12611         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12612
12613 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12614
12615         * driver.cs: Use an object to get the windows codepage since it's not a
12616         static property.
12617
12618 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12619
12620         * statement.cs (For.Emit): for infinite loops (test == null)
12621         return whether there is a break inside, not always "true".
12622
12623         * namespace.cs (UsingEntry): New struct to hold the name of the
12624         using definition, the location where it is defined, and whether it
12625         has been used in a successful type lookup.
12626
12627         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12628         strings.
12629
12630         * decl.cs: ditto.
12631
12632 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12633
12634         * attribute.cs : Fix incorrect code which relied on catching
12635         a NullReferenceException to detect a null being passed in
12636         where an object was expected.
12637
12638 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12639
12640         * statement.cs (Try): flag the catch variable as assigned
12641
12642         * expression.cs (Cast): Simplified by using ResolveType instead of
12643         manually resolving.
12644
12645         * statement.cs (Catch): Fix bug by using ResolveType.
12646
12647 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12648
12649         * expression.cs (BetterConversion): Special case for when we have
12650         a NullLiteral as the argument and we have to choose between string
12651         and object types - we choose string the way csc does.
12652
12653         * attribute.cs (Attribute.Resolve): Catch the
12654         NullReferenceException and report error #182 since the Mono
12655         runtime no more has the bug and having this exception raised means
12656         we tried to select a constructor which takes an object and is
12657         passed a null.
12658
12659 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12660
12661         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12662         message (1502, 1503) when we can't locate a method after overload
12663         resolution. This is much more informative and closes the bug
12664         Miguel reported.
12665
12666         * interface.cs (PopulateMethod): Return if there are no argument
12667         types. Fixes a NullReferenceException bug.
12668
12669         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12670         expressions too. Previously we were checking only in one place for
12671         positional arguments leaving out named arguments.
12672
12673         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12674         type to the enum type is not allowed. Remove code corresponding to
12675         that.
12676
12677         (ConvertNumericExplicit): Allow explicit conversions from
12678         the underlying type to enum type. This precisely follows the spec
12679         and closes a bug filed by Gonzalo.
12680
12681 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12682
12683         * compiler.csproj:
12684         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12685
12686 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12687
12688         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12689         it was important that we stored the right value after the
12690         reduction in `converted'.
12691
12692 2002-09-04  Martin Baulig  <martin@gnome.org>
12693
12694         * location.cs (Location.SymbolDocument): Use full pathnames for the
12695         source files.
12696
12697 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12698
12699         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12700         of the expression resolve mechanism, because that will catch the
12701         SimpleName error failures.
12702
12703         (Conditional): If we can not resolve the
12704         expression, return, do not crash.
12705
12706 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12707
12708         * cs-tokenizer.cs:
12709         (location): display token name instead of its number.
12710
12711 2002-08-28  Martin Baulig  <martin@gnome.org>
12712
12713         * expression.cs (Binary.ResolveOperator): Don't silently return
12714         but return an error if an operator cannot be applied between two
12715         enum types.
12716
12717 2002-08-28  Martin Baulig  <martin@gnome.org>
12718
12719         * class.cs (Constructor.Define): Set the permission attributes
12720         correctly instead of making all constructors public.
12721
12722 2002-08-28  Martin Baulig  <martin@gnome.org>
12723
12724         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12725         for private members before reporting a CS0103; if we find anything,
12726         it's a CS0122.
12727
12728 2002-08-28  Martin Baulig  <martin@gnome.org>
12729
12730         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12731         to check whether `closure_start_type == closure_invocation_type',
12732         we also need to check whether `m.DeclaringType == closure_invocation_type'
12733         before bypassing the permission checks.  We might be accessing
12734         protected/private members from the base class.
12735         (TypeManager.RealMemberLookup): Only set private_ok if private
12736         members were requested via BindingFlags.NonPublic.
12737
12738         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12739
12740         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12741         MethodGroupExpr.IsExplicitImpl if appropriate.
12742         (Invocation.DoResolve): Don't report the CS0120 for explicit
12743         interface implementations.
12744
12745 2002-08-27  Martin Baulig  <martin@gnome.org>
12746
12747         * expression.cs (Invocation.DoResolve): If this is a static
12748         method and we don't have an InstanceExpression, we must report
12749         a CS0120.
12750
12751 2002-08-25  Martin Baulig  <martin@gnome.org>
12752
12753         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12754         `==' between a valuetype and an object.
12755
12756 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12757
12758         * ecore.cs (TypeExpr): Provide a ToString method.
12759
12760 2002-08-24  Martin Baulig  <martin@gnome.org>
12761
12762         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12763         now called proggie.dbg and it's a binary file.
12764
12765 2002-08-23  Martin Baulig  <martin@gnome.org>
12766
12767         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12768
12769 2002-08-23  Martin Baulig  <martin@gnome.org>
12770
12771         * struct.cs (MyStructInfo.ctor): Make this work with empty
12772         structs; it's not allowed to use foreach() on null.
12773
12774 2002-08-23  Martin Baulig  <martin@gnome.org>
12775
12776         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12777         writer the full pathname of the generated assembly.
12778
12779 2002-08-23  Martin Baulig  <martin@gnome.org>
12780
12781         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12782         A `finally' block never returns or breaks; improved handling of
12783         unreachable code.
12784
12785 2002-08-23  Martin Baulig  <martin@gnome.org>
12786
12787         * statement.cs (Throw.Resolve): Allow `throw null'.
12788
12789 2002-08-23  Martin Baulig  <martin@gnome.org>
12790
12791         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12792         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12793         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12794         MemberLookup would return a wrong event if this is an explicit
12795         interface implementation and the class has an event with the same
12796         name.
12797
12798 2002-08-23  Martin Baulig  <martin@gnome.org>
12799
12800         * statement.cs (Block.AddChildVariableNames): New public method.
12801         (Block.AddChildVariableName): Likewise.
12802         (Block.IsVariableNameUsedInChildBlock): Likewise.
12803         (Block.AddVariable): Check whether a variable name has already
12804         been used in a child block.
12805
12806         * cs-parser.jay (declare_local_variables): Mark all variable names
12807         from the current block as being used in a child block in the
12808         implicit block.
12809
12810 2002-08-23  Martin Baulig  <martin@gnome.org>
12811
12812         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12813         find the symbol writer.
12814
12815         * driver.cs: csc also allows the arguments to /define being
12816         separated by commas, not only by semicolons.
12817
12818 2002-08-23  Martin Baulig  <martin@gnome.org>
12819
12820         * interface.cs (Interface.GetMembers): Added static check for events.
12821
12822 2002-08-15  Martin Baulig  <martin@gnome.org>
12823
12824         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12825         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12826
12827         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12828         why the MethodData.EmitDestructor() change was necessary.
12829
12830 2002-08-20  Martin Baulig  <martin@gnome.org>
12831
12832         * class.cs (TypeContainer.FindMembers): Added static check for events.
12833
12834         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12835
12836         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12837         use Type.GetEvents(), not Type.FindMembers().
12838
12839 2002-08-20  Martin Baulig  <martin@gnome.org>
12840
12841         * decl.cs (MemberCache): Added a special method cache which will
12842         be used for method-only searched.  This ensures that a method
12843         search will return a MethodInfo with the correct ReflectedType for
12844         inherited methods.      
12845
12846 2002-08-20  Martin Baulig  <martin@gnome.org>
12847
12848         * decl.cs (DeclSpace.FindMembers): Made this public.
12849
12850 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12851
12852         * delegate.cs: fixed build on windows.
12853         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12854
12855 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12856
12857         * ecore.cs (StandardConversionExists): Return a false
12858         if we are trying to convert the void type to anything else
12859         since that is not allowed.
12860
12861         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12862         we flag error 70 in the event an event is trying to be accessed
12863         directly from outside the declaring type.
12864
12865 2002-08-20  Martin Baulig  <martin@gnome.org>
12866
12867         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12868         MemberCache from typemanager.cs to decl.cs.
12869
12870 2002-08-19  Martin Baulig  <martin@gnome.org>
12871
12872         * class.cs (TypeContainer): Implement IMemberContainer.
12873         (TypeContainer.DefineMembers): Create the MemberCache.
12874         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12875         return public members if BindingFlags.Public was given, check
12876         whether members are static.
12877
12878 2002-08-16  Martin Baulig  <martin@gnome.org>
12879
12880         * decl.cs (DeclSpace.Define): Splitted this in Define and
12881         DefineMembers.  DefineMembers is called first and initializes the
12882         MemberCache.
12883
12884         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12885         DefineMembers() on all our DeclSpaces.
12886
12887         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12888         but call DefineMembers() on all nested interfaces.  We call their
12889         Define() in our new Define() function.
12890
12891         * interface.cs (Interface): Implement IMemberContainer.
12892         (Interface.Define): Moved all code except the attribute stuf to
12893         DefineMembers().
12894         (Interface.DefineMembers): Initialize the member cache.
12895
12896         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12897         need this anymore since we can use MemberCache.FindMembers directly.
12898
12899 2002-08-19  Martin Baulig  <martin@gnome.org>
12900
12901         * typemanager.cs (MemberCache): When creating the cache for an
12902         interface type, add all inherited members.
12903         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12904         to `out bool used_cache' and documented it.
12905         (TypeManager.MemberLookup): If we already used the cache in the first
12906         iteration, we don't need to do the interfaces check.
12907
12908 2002-08-19  Martin Baulig  <martin@gnome.org>
12909
12910         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12911         here from IMemberFinder and don't implement this interface anymore.
12912         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12913
12914         * typemanager.cs (IMemberFinder): This interface is now only used by
12915         classes which actually support the member cache.
12916         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12917         since we only put DeclSpaces into this Hashtable.
12918         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12919         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12920
12921 2002-08-16  Martin Baulig  <martin@gnome.org>
12922
12923         * typemanager.cs (ICachingMemberFinder): Removed.
12924         (IMemberFinder.MemberCache): New property.
12925         (TypeManager.FindMembers): Merged this with RealFindMembers().
12926         This function will never be called from TypeManager.MemberLookup()
12927         so we can't use the cache here, just the IMemberFinder.
12928         (TypeManager.MemberLookup_FindMembers): Check whether the
12929         IMemberFinder has a MemberCache and call the cache's FindMembers
12930         function.
12931         (MemberCache): Rewrote larger parts of this yet another time and
12932         cleaned it up a bit.
12933
12934 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12935
12936         * driver.cs (LoadArgs): Support quoting.
12937
12938         (Usage): Show the CSC-like command line arguments.
12939
12940         Improved a few error messages.
12941
12942 2002-08-15  Martin Baulig  <martin@gnome.org>
12943
12944         * typemanager.cs (IMemberContainer.Type): New property.
12945         (IMemberContainer.IsInterface): New property.
12946
12947         The following changes are conditional to BROKEN_RUNTIME, which is
12948         defined at the top of the file.
12949
12950         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12951         class'es members, but add all members from TypeHandle.ObjectType
12952         if we're an interface.
12953         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12954         is the current type.
12955         (MemberCache.CacheEntry.Container): Removed this field.
12956         (TypeHandle.GetMembers): Include inherited members.
12957
12958 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12959
12960         * typemanager.cs: fixed compilation and added a comment on a field that
12961         is never used.
12962
12963 2002-08-15  Martin Baulig  <martin@gnome.org>
12964
12965         * class.cs (ConstructorInitializer.Resolve): In the
12966         Expression.MemberLookup call, use the queried_type as
12967         invocation_type.
12968
12969         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12970         declared' attribute, it's always true.
12971         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12972         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12973         temporary wrapper for FindMembers which tells MemberLookup whether
12974         members from the base classes are included in the return value.
12975         This will go away soon.
12976         (TypeManager.MemberLookup): Use this temporary hack here; once the
12977         new MemberCache is completed, we don't need to do the DeclaredOnly
12978         looping here anymore since the MemberCache will take care of this.
12979         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12980         (MemberCache): When creating the MemberCache for a class, get
12981         members from the current class and all its base classes.
12982         (MemberCache.CacheEntry.Container): New field.  This is a
12983         temporary hack until the Mono runtime is fixed to distinguish
12984         between ReflectedType and DeclaringType.  It allows us to use MCS
12985         with both the MS runtime and the unfixed Mono runtime without
12986         problems and without accecting performance.
12987         (MemberCache.SearchMembers): The DeclaredOnly looping from
12988         TypeManager.MemberLookup is now done here.      
12989
12990 2002-08-14  Martin Baulig  <martin@gnome.org>
12991
12992         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12993         Type.GetFields on dynamic types but get the fields from the
12994         corresponding TypeContainer.
12995         (MyStructInfo.GetStructInfo): Added check for enum types.
12996
12997         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12998         (MemberList.SyncRoot): Implemented.
12999         (TypeManager.FilterWithClosure): No need to check permissions if
13000         closure_start_type == closure_invocation_type, don't crash if
13001         closure_invocation_type is null.
13002
13003 2002-08-13  Martin Baulig  <martin@gnome.org>
13004
13005         Rewrote TypeContainer.FindMembers to use a member cache.  This
13006         gives us a speed increase of about 35% for the self-hosting MCS
13007         build and of about 15-20% for the class libs (both on GNU/Linux).
13008
13009         * report.cs (Timer): New class to get enhanced profiling.  This
13010         whole class is "TIMER" conditional since it remarkably slows down
13011         compilation speed.
13012
13013         * class.cs (MemberList): New class.  This is an IList wrapper
13014         which we're now using instead of passing MemberInfo[]'s around to
13015         avoid copying this array unnecessarily.
13016         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13017         (ICachingMemberFinder, IMemberContainer): New interface.
13018         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13019         has already been checked, otherwise use it for the name comparision.
13020         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13021         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13022         if possible.  Returns a MemberList, not a MemberInfo [].
13023         (TypeHandle): New class, implements IMemberContainer.  We create
13024         one instance of this class per type, it contains a MemberCache
13025         which is used to do the member lookups.
13026         (MemberCache): New class.  Each instance of this class contains
13027         all members of a type and a name-based hash table.
13028         (MemberCache.FindMembers): This is our new member lookup
13029         function.  First, it looks up all members of the requested name in
13030         the hash table.  Then, it walks this list and sorts out all
13031         applicable members and returns them.
13032
13033 2002-08-13  Martin Baulig  <martin@gnome.org>
13034
13035         In addition to a nice code cleanup, this gives us a performance
13036         increase of about 1.4% on GNU/Linux - not much, but it's already
13037         half a second for the self-hosting MCS compilation.
13038
13039         * typemanager.cs (IMemberFinder): New interface.  It is used by
13040         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13041         Enum, Delegate or Interface.
13042         (TypeManager.finder_to_member_finder): New PtrHashtable.
13043         (TypeManager.finder_to_container): Removed.
13044         (TypeManager.finder_to_delegate): Removed.
13045         (TypeManager.finder_to_interface): Removed.
13046         (TypeManager.finder_to_enum): Removed.
13047
13048         * interface.cs (Interface): Implement IMemberFinder.
13049
13050         * delegate.cs (Delegate): Implement IMemberFinder.
13051
13052         * enum.cs (Enum): Implement IMemberFinder.
13053
13054         * class.cs (TypeContainer): Implement IMemberFinder.
13055
13056 2002-08-12  Martin Baulig  <martin@gnome.org>
13057
13058         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13059
13060 2002-08-12  Martin Baulig  <martin@gnome.org>
13061
13062         * ecore.cs (ITypeExpression): New interface for expressions which
13063         resolve to a type.
13064         (TypeExpression): Renamed to TypeLookupExpression.
13065         (Expression.DoResolve): If we're doing a types-only lookup, the
13066         expression must implement the ITypeExpression interface and we
13067         call DoResolveType() on it.
13068         (SimpleName): Implement the new ITypeExpression interface.
13069         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13070         hack, the situation that we're only looking up types can't happen
13071         anymore when this method is called.  Moved the type lookup code to
13072         DoResolveType() and call it.
13073         (SimpleName.DoResolveType): This ITypeExpression interface method
13074         is now doing the types-only lookup.
13075         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13076         (ResolveFlags): Added MaskExprClass.
13077
13078         * expression.cs (MemberAccess): Implement the ITypeExpression
13079         interface.
13080         (MemberAccess.DoResolve): Added support for a types-only lookup
13081         when we're called via ITypeExpression.DoResolveType().
13082         (ComposedCast): Implement the ITypeExpression interface.
13083
13084         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13085         Expression.Resolve() with ResolveFlags.Type instead.
13086
13087 2002-08-12  Martin Baulig  <martin@gnome.org>
13088
13089         * interface.cs (Interface.Define): Apply attributes.
13090
13091         * attribute.cs (Attribute.ApplyAttributes): Added support for
13092         interface attributes.
13093
13094 2002-08-11  Martin Baulig  <martin@gnome.org>
13095
13096         * statement.cs (Block.Emit): Only check the "this" variable if we
13097         do not always throw an exception.
13098
13099         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13100         whether the property has a set accessor.
13101
13102 2002-08-11  Martin Baulig  <martin@gnome.org>
13103
13104         Added control flow analysis support for structs.
13105
13106         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13107         with control flow analysis turned off.
13108         (IVariable): New interface.
13109         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13110         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13111         (FieldExpr.DoResolve): Resolve the instance expression with flow
13112         analysis turned off and do the definite assignment check after the
13113         resolving when we know what the expression will resolve to.
13114
13115         * expression.cs (LocalVariableReference, ParameterReference):
13116         Implement the new IVariable interface, only call the flow analysis
13117         code if ec.DoFlowAnalysis is true.
13118         (This): Added constructor which takes a Block argument.  Implement
13119         the new IVariable interface.
13120         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13121         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13122         This does the definite assignment checks for struct members.
13123
13124         * class.cs (Constructor.Emit): If this is a non-static `struct'
13125         constructor which doesn't have any initializer, call
13126         Block.AddThisVariable() to tell the flow analysis code that all
13127         struct elements must be initialized before control returns from
13128         the constructor.
13129
13130         * statement.cs (MyStructInfo): New public class.
13131         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13132         argument to this indexer.  If non-zero, check an individual struct
13133         member, not the whole struct.
13134         (FlowBranching.CheckOutParameters): Check struct members.
13135         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13136         overloaded versions of these methods which take an additional
13137         `int field_idx' argument to check struct members.
13138         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13139         overloaded versions of these methods which take an additional
13140         `string field_name' argument to check struct member.s
13141         (VariableInfo): Implement the IVariable interface.
13142         (VariableInfo.StructInfo): New public property.  Returns the
13143         MyStructInfo instance of the variable if it's a struct or null.
13144         (Block.AddThisVariable): New public method.  This is called from
13145         Constructor.Emit() for non-static `struct' constructor which do
13146         not have any initializer.  It creates a special variable for the
13147         "this" instance variable which will be checked by the flow
13148         analysis code to ensure that all of the struct's fields are
13149         initialized before control returns from the constructor.
13150         (UsageVector): Added support for struct members.  If a
13151         variable/parameter is a struct with N members, we reserve a slot
13152         in the usage vector for each member.  A struct is considered fully
13153         initialized if either the struct itself (slot 0) or all its
13154         members are initialized.
13155
13156 2002-08-08  Martin Baulig  <martin@gnome.org>
13157
13158         * driver.cs (Driver.MainDriver): Only report an error CS5001
13159         if there were no compilation errors.
13160
13161         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13162         `UnsafeContext' property to determine whether the parent is in
13163         unsafe context rather than checking the parent's ModFlags:
13164         classes nested in an unsafe class are unsafe as well.
13165
13166 2002-08-08  Martin Baulig  <martin@gnome.org>
13167
13168         * statement.cs (UsageVector.MergeChildren): Distinguish between
13169         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13170         we return.  Added test17() and test18() to test-154.cs.
13171
13172 2002-08-08  Martin Baulig  <martin@gnome.org>
13173
13174         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13175         Family access, make sure the invoking type isn't a subclass of the
13176         queried type (that'd be a CS1540).
13177
13178         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13179         this method which takes an additional `Type invocation_type'.
13180
13181         * expression.cs (BaseAccess.DoResolve): Use the base type as
13182         invocation and query type.
13183         (MemberAccess.DoResolve): If the lookup failed and we're about to
13184         report a CS0122, try a lookup with the ec.ContainerType - if this
13185         succeeds, we must report a CS1540.
13186
13187 2002-08-08  Martin Baulig  <martin@gnome.org>
13188
13189         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13190         (MethodGroupExpr): Implement the IMemberExpr interface.
13191
13192         * expression (MemberAccess.ResolveMemberAccess): No need to have
13193         any special code for MethodGroupExprs anymore, they're now
13194         IMemberExprs.   
13195
13196 2002-08-08  Martin Baulig  <martin@gnome.org>
13197
13198         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13199         Family, FamANDAssem and FamORAssem permissions.
13200         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13201
13202 2002-08-08  Martin Baulig  <martin@gnome.org>
13203
13204         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13205         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13206         or loop block.
13207
13208 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13209
13210         * driver.cs: implemented /resource option to embed managed resources.
13211
13212 2002-08-07  Martin Baulig  <martin@gnome.org>
13213
13214         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13215         (FieldBase.HasFieldInitializer): New public property.
13216         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13217         returns the field initializer and makes sure it is only resolved once.
13218         (TypeContainer.EmitFieldInitializers): Call
13219         FieldBase.GetInitializerExpression to get the initializer, this ensures
13220         that it isn't resolved multiple times.
13221
13222         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13223         the resolving process (SimpleName/MemberLookup) that we're currently
13224         emitting a field initializer (which must not access any instance members,
13225         this is an error CS0236).
13226
13227         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13228         argument, if the `IsFieldInitializer' flag is set, we must report and
13229         error CS0236 and not an error CS0120.   
13230
13231 2002-08-07  Martin Baulig  <martin@gnome.org>
13232
13233         * ecore.cs (IMemberExpr): New public interface.
13234         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13235         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13236         if the expression is an IMemberExpr.
13237
13238         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13239         to be null, implicitly default to `this' if we're non-static in
13240         this case.  Simplified the code a lot by using the new IMemberExpr
13241         interface.  Also fixed bug #28176 here.
13242
13243 2002-08-06  Martin Baulig  <martin@gnome.org>
13244
13245         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13246         ParameterReferences during semantic analysis so that we can do a
13247         type-only search when resolving Cast, TypeOf and SizeOf.
13248         (block): Pass the `current_local_parameters' to the Block's
13249         constructor.
13250
13251         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13252         argument to the constructor.
13253         (ConstructorInitializer.Resolve): Create a temporary implicit
13254         block with the parameters.
13255
13256         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13257         references here if we aren't doing a type-only search.
13258
13259         * statement.cs (Block): Added constructor which takes a
13260         `Parameters parameters' argument.
13261         (Block.Parameters): New public property.
13262
13263         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13264         to `Parameters' and made it public readonly.
13265
13266 2002-08-06  Martin Baulig  <martin@gnome.org>
13267
13268         * ecore.cs (Expression.Warning): Made this public as well.
13269
13270         * report.cs (Report.Debug): Print the contents of collections.
13271
13272 2002-08-06  Martin Baulig  <martin@gnome.org>
13273
13274         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13275         used to tell Resolve() which kinds of expressions it may return.
13276         (Expression.Resolve): Added overloaded version of this method which
13277         takes a `ResolveFlags flags' argument.  This can be used to tell
13278         Resolve() which kinds of expressions it may return.  Reports a
13279         CS0118 on error.
13280         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13281         ResolveFlags.SimpleName.
13282         (Expression.Error118): Added overloaded version of this method which
13283         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13284         which kinds of expressions are allowed.
13285
13286         * expression.cs (Argument.ResolveMethodGroup): New public method.
13287         Resolves an argument, but allows a MethodGroup to be returned.
13288         This is used when invoking a delegate.
13289
13290         * TODO: Updated a bit.
13291
13292 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13293
13294         Fixed compilation with csc.
13295
13296         * ecore.cs: Expression.Error made public. Is this correct? Should
13297         Warning be made public too?
13298
13299         * expression.cs: use ea.Location instead of ea.loc.
13300         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13301
13302 2002-08-06  Martin Baulig  <martin@gnome.org>
13303
13304         * ecore.cs (Expression.loc): Moved the location here instead of
13305         duplicating it in all derived classes.
13306         (Expression.Location): New public property.
13307         (Expression.Error, Expression.Warning): Made them non-static and
13308         removed the location argument.
13309         (Expression.Warning): Added overloaded version which takes an
13310         `int level' argument.
13311         (Expression.Error118): Make this non-static and removed the
13312         expression and location arguments.
13313         (TypeExpr): Added location argument to the constructor.
13314
13315         * expression.cs (StaticCallExpr): Added location argument to
13316         the constructor.
13317         (Indirection, PointerArithmetic): Likewise.
13318         (CheckedExpr, UnCheckedExpr): Likewise.
13319         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13320         (StringPtr): Likewise.
13321
13322
13323 2002-08-05  Martin Baulig  <martin@gnome.org>
13324
13325         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13326
13327         * assign.cs (Assign.DoResolve): Check whether the source
13328         expression is a value or variable.
13329
13330         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13331         while resolving the corresponding blocks.
13332
13333         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13334         an error, don't silently return null.
13335
13336         * statement.cs (Block.AddVariable): Do the error reporting here
13337         and distinguish between CS0128 and CS0136.
13338         (Block.DoResolve): Report all unused labels (warning CS0164).
13339         (LabeledStatement): Pass the location to the constructor.
13340         (LabeledStatement.HasBeenReferenced): New property.
13341         (LabeledStatement.Resolve): Set it to true here.
13342
13343         * statement.cs (Return.Emit): Return success even after reporting
13344         a type mismatch error (CS0126 or CS0127), this is what csc does and
13345         it avoids confusing the users with any consecutive errors.
13346
13347 2002-08-05  Martin Baulig  <martin@gnome.org>
13348
13349         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13350
13351         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13352
13353         * expression.cs (MemberAccess.DoResolve): Silently return if an
13354         error has already been reported.
13355
13356         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13357         error has already been reported.
13358
13359 2002-08-05  Martin Baulig  <martin@gnome.org>
13360
13361         * statement.cs (UsageVector): Only initialize the `parameters'
13362         vector if we actually have any "out" parameters.
13363
13364 2002-08-05  Martin Baulig  <martin@gnome.org>
13365
13366         * expression.cs (Binary.ResolveOperator): When combining delegates,
13367         they must have the same type.
13368
13369 2002-08-05  Martin Baulig  <martin@gnome.org>
13370
13371         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13372         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13373         work with the ms runtime and we also don't need it: if we're a
13374         PropertyBuilder and not in the `indexer_arguments' hash, then we
13375         are a property and not an indexer.
13376
13377         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13378         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13379         since the latter one doesn't work with the ms runtime.
13380
13381 2002-08-03  Martin Baulig  <martin@gnome.org>
13382
13383         Fixed bugs #27998 and #22735.
13384
13385         * class.cs (Method.IsOperator): New public field.
13386         (Method.CheckBase): Report CS0111 if there's already a method
13387         with the same parameters in the current class.  Report CS0508 when
13388         attempting to change the return type of an inherited method.
13389         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13390         and it's not marked abstract or extern.
13391         (PropertyBase): New abstract base class for Property and Indexer.
13392         (PropertyBase.CheckBase): Moved here from Property and made it work
13393         for indexers.
13394         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13395         the same so we can reuse it there.
13396         (Property, Indexer): Derive from PropertyBase.
13397         (MethodSignature.inheritable_property_signature_filter): New delegate
13398         to find properties and indexers.
13399
13400         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13401         argument and improved error reporting.
13402
13403         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13404         EmptyReadOnlyParameters and made it a property.
13405
13406         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13407         version of this method which takes a `PropertyInfo indexer'.
13408         (TypeManager.RegisterIndexer): New method.
13409
13410         * class.cs: Added myself as author of this file :-)
13411
13412 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13413
13414         * class.cs: fixed compilation on windoze.
13415
13416 2002-08-03  Martin Baulig  <martin@gnome.org>
13417
13418         * interface.cs (Interface.GetInterfaceBases): Check whether all
13419         base interfaces are at least as accessible than the current one.
13420
13421         * class.cs (TypeContainer.GetClassBases): Check whether base types
13422         are at least as accessible than the current type.
13423         (TypeContainer.AsAccessible): Implemented and made non-static.
13424         (MemberBase.CheckParameters): Report errors if the accessibility
13425         checks fail.
13426
13427         * delegate.cs (Delegate.Delegate): The default visibility is
13428         internal for top-level types and private for nested types.
13429         (Delegate.Define): Report errors if the accessibility checks fail.
13430
13431         * enum.cs (Enum.Enum): The default visibility is internal for
13432         top-level types and private for nested types.
13433         (Enum.DefineType): Compute the correct visibility.
13434
13435         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13436         function which takes a `bool is_toplevel' instead of a TypeContainer.
13437
13438         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13439         builtin type.
13440
13441 2002-08-02  Martin Baulig  <martin@gnome.org>
13442
13443         * expression.cs (LocalVariableReferenc): Added constructor which
13444         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13445         (LocalVariableReference.IsReadOnly): New property.
13446         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13447         variable is readonly, use our own readonly flag to do this; you can
13448         use the new constructor to get a writable reference to a read-only
13449         variable.
13450
13451         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13452         reference to the local variable.
13453
13454 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13455
13456         * rootcontext.cs (ResolveCore): Also include System.Exception
13457
13458         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13459         we reach an EmptyStatement.
13460
13461         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13462         is also fine.
13463
13464         * expression.cs (Binary.ResolveOperator): Check error result in
13465         two places.
13466
13467         use brtrue/brfalse directly and avoid compares to null.
13468
13469 2002-08-02  Martin Baulig  <martin@gnome.org>
13470
13471         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13472         Fixes bug #28407, added test-155.cs.
13473
13474 2002-08-01  Martin Baulig  <martin@gnome.org>
13475
13476         * class.cs (Event.EmitDefaultMethod): Make this work with static
13477         events.  Fixes #28311, added verify-3.cs.
13478
13479 2002-08-01  Martin Baulig  <martin@gnome.org>
13480
13481         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13482         `is_disposable' fields.
13483         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13484         `hm.is_disposable' if we're using the collection pattern.
13485         (Foreach.EmitCollectionForeach): Use the correct type for the
13486         enumerator's local variable, only emit the try/finally block if
13487         necessary (fixes #27713).
13488
13489 2002-08-01  Martin Baulig  <martin@gnome.org>
13490
13491         * ecore.cs (Expression.report118): Renamed to Error118 and made
13492         it public static.
13493
13494         * statement.cs (Throw.Resolve): Check whether the expression is of
13495         the correct type (CS0118) and whether the type derives from
13496         System.Exception (CS0155).
13497         (Catch.Resolve): New method.  Do the type lookup here and check
13498         whether it derives from System.Exception (CS0155).
13499         (Catch.CatchType, Catch.IsGeneral): New public properties.
13500
13501         * typemanager.cs (TypeManager.exception_type): Added.
13502
13503 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13504
13505         * driver.cs: Updated About function.
13506
13507 2002-07-31  Martin Baulig  <martin@gnome.org>
13508
13509         Implemented Control Flow Analysis.
13510
13511         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13512         (EmitContext.CurrentBranching): Added.
13513         (EmitContext.StartFlowBranching): Added.
13514         (EmitContext.EndFlowBranching): Added.
13515         (EmitContext.KillFlowBranching): Added.
13516         (EmitContext.IsVariableAssigned): Added.
13517         (EmitContext.SetVariableAssigned): Added.
13518         (EmitContext.IsParameterAssigned): Added.
13519         (EmitContext.SetParameterAssigned): Added.
13520         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13521         Added control flow analysis stuff here.
13522
13523         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13524         resolve the expression as lvalue.
13525         (LocalVariableReference.DoResolve): Check whether the variable has
13526         already been assigned.
13527         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13528         the parameter as assigned here.
13529         (ParameterReference.DoResolve): Check whether the parameter has already
13530         been assigned.
13531         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13532         expression as lvalue.
13533
13534         * statement.cs (FlowBranching): New class for the flow analysis code.
13535         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13536         (LabeledStatement.IsDefined): New public property.
13537         (LabeledStatement.AddUsageVector): New public method to tell flow
13538         analyis that the label may be reached via a forward jump.
13539         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13540         flow analysis.
13541         (VariableInfo.Number): New public field.  This is used by flow analysis
13542         to number all locals of a block.
13543         (Block.CountVariables): New public property.  This is the number of
13544         local variables in this block (including the locals from all parent
13545         blocks).
13546         (Block.EmitMeta): Number all the variables.
13547
13548         * statement.cs: Added flow analysis support to all classes.
13549
13550 2002-07-31  Martin Baulig  <martin@gnome.org>
13551
13552         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13553         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13554         then use this argument.
13555
13556         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13557
13558         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13559         use this to specify /define options.
13560
13561 2002-07-29  Martin Baulig  <martin@gnome.org>
13562
13563         * statement.cs (Fixed): Moved all code that does variable lookups
13564         and resolvings from Emit to Resolve.
13565
13566         * statement.cs (For): Moved all code that does variable lookups
13567         and resolvings from Emit to Resolve.
13568
13569         * statement.cs (Using): Moved all code that does variable lookups
13570         and resolvings from Emit to Resolve.
13571
13572 2002-07-29  Martin Baulig  <martin@gnome.org>
13573
13574         * attribute.cs (Attribute.Resolve): Explicitly catch a
13575         System.NullReferenceException when creating the
13576         CustromAttributeBuilder and report a different warning message.
13577
13578 2002-07-29  Martin Baulig  <martin@gnome.org>
13579
13580         * support.cs (ParameterData.ParameterName): Added method to
13581         get the name of a parameter.
13582
13583         * typemanager.cs (TypeManager.IsValueType): New public method.
13584
13585 2002-07-29  Martin Baulig  <martin@gnome.org>
13586
13587         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13588         is a flag which specifies that it's either ref or out.
13589         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13590         the out parameter to `out Parameter.Modifier mod', also set the
13591         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13592
13593         * support.cs (InternalParameters.ParameterModifier): Distinguish
13594         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13595         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13596
13597         * expression.cs (Argument.GetParameterModifier): Distinguish
13598         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13599         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13600
13601 2002-07-29  Martin Baulig  <martin@gnome.org>
13602
13603         * expression.cs (ParameterReference.ParameterReference): Added
13604         `Location loc' argument to the constructor.
13605
13606         * cs-parser.jay: Pass location to ParameterReference.
13607
13608 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13609
13610         * statement.cs (Try): Initialize the location.
13611
13612         * cs-parser.jay: pass location to Try.
13613
13614         * expression.cs (Unary.Reduce): Change the prototype to return
13615         whether a constant fold could be performed or not.  The result is
13616         returned in an out parameters.  In the case of Indirection and
13617         AddressOf, we want to perform the full tests.
13618
13619 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13620
13621         * statement.cs (Statement.Emit): Flag dead code.
13622
13623 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13624
13625         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13626
13627 2002-07-27  Martin Baulig  <martin@gnome.org>
13628
13629         * class.cs (MethodData.Define): Put back call to
13630         TypeManager.AddMethod(), accidentally commented this out.
13631
13632         * report.cs (Debug): New public method to print debugging information,
13633         this is `[Conditional ("DEBUG")]'.
13634
13635 2002-07-26  Martin Baulig  <martin@gnome.org>
13636
13637         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13638         (switch_statement): Push the current_block to the switch_stack and
13639         pop it again when we're done with the switch.
13640         (switch_section): The new block is a child of the current_block.
13641         Fixes bug #24007, added test-152.cs.
13642
13643 2002-07-27  Martin Baulig  <martin@gnome.org>
13644
13645         * expression.cs (Invocation.EmitArguments): When calling a varargs
13646         function with only its fixed arguments, we need to pass an empty
13647         array.
13648
13649 2002-07-27  Martin Baulig  <martin@gnome.org>
13650
13651         Mono 0.13 has been released.
13652
13653 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * driver.cs: Rename --resource to --linkres, because that is what
13656         we do currently, we dont support --resource yet.
13657
13658         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13659
13660 2002-07-25  Martin Baulig  <martin@gnome.org>
13661
13662         * class.cs (MethodData): New public class.  This is a `method builder'
13663         class for a method or one accessor of a Property/Indexer/Event.
13664         (MethodData.GetMethodFlags): Moved here from MemberBase.
13665         (MethodData.ApplyAttributes): Likewise.
13666         (MethodData.ApplyObsoleteAttribute): Likewise.
13667         (MethodData.ApplyConditionalAttribute): Likewise.
13668         (MethodData.ApplyDllImportAttribute): Likewise.
13669         (MethodData.CheckAbstractAndExternal): Likewise.
13670         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13671         (MethodData.Emit): Formerly known as Method.Emit().
13672         (MemberBase): Moved everything which was specific to a single
13673         accessor/method to MethodData.
13674         (Method): Create a new MethodData and call Define() and Emit() on it.
13675         (Property, Indexer, Event): Create a new MethodData objects for each
13676         accessor and call Define() and Emit() on them.
13677
13678 2002-07-25  Martin Baulig  <martin@gnome.org>
13679
13680         Made MethodCore derive from MemberBase to reuse the code from there.
13681         MemberBase now also checks for attributes.
13682
13683         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13684         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13685         as virtual.
13686         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13687         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13688         (MemberBase.ApplyAttributes): New virtual method; applies the
13689         attributes to a method or accessor.
13690         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13691         (MemberBase.ApplyConditionalAttribute): Likewise.
13692         (MemberBase.ApplyDllImportAttribute): Likewise.
13693         (MemberBase.CheckAbstractAndExternal): Likewise.
13694         (MethodCore.ParameterTypes): This is now a property instead of a
13695         method, it's initialized from DoDefineParameters().
13696         (MethodCore.ParameterInfo): Removed the set accessor.
13697         (MethodCore.DoDefineParameters): New protected virtual method to
13698         initialize ParameterTypes and ParameterInfo.
13699         (Method.GetReturnType): We can now simply return the MemberType.
13700         (Method.GetMethodFlags): Override the MemberBase version and add
13701         the conditional flags.
13702         (Method.CheckBase): Moved some code from Define() here, call
13703         DoDefineParameters() here.
13704         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13705         here to avoid some larger code duplication.
13706         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13707         ensure that abstract and external accessors don't declare a body.
13708
13709         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13710         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13711         lookup in the attribute's parent classes, so we need to abort as soon
13712         as we found the first match.
13713         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13714         the attribute has no arguments.
13715
13716         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13717         of a Method.
13718
13719 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13720
13721         * cs-parser.jay: reverted previous patch.
13722
13723 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13724
13725         * cs-parser.jay: fixed bug #22119.
13726
13727 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13728
13729         * attribute.cs: fixed compilation. The error was:
13730         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13731         be assigned to before control leaves the current method."
13732         [FIXME:  Filed as bug #28186: MCS must report this error.]
13733
13734 2002-07-25  Martin Baulig  <martin@gnome.org>
13735
13736         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13737         method to pull the condition name ouf of a Conditional attribute.
13738         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13739         the obsolete message and error flag out of an Obsolete attribute.
13740
13741         * class.cs (Method.GetMethodFlags): New public method to get the
13742         TypeManager.MethodFlags for this method.
13743         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13744         private methods.
13745         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13746         if we're overriding a virtual function, set the new private variable
13747         `parent_method'; call the new TypeManager.AddMethod().
13748
13749         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13750         the MethodBuilder and the Method in a PtrHashtable.
13751         (TypeManager.builder_to_method): Added for this purpose.
13752         (TypeManager.MethodFlags): Added IsObsoleteError.
13753         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13754         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13755         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13756         the message from the attribute.
13757
13758 2002-07-24  Martin Baulig  <martin@gnome.org>
13759
13760         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13761         preprocessor directives, ensure that the argument to #define/#undef is
13762         exactly one identifier and that it's actually an identifier.
13763
13764         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13765         did not work ....
13766
13767 2002-07-24  Martin Baulig  <martin@gnome.org>
13768
13769         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13770         initialize it to TypeManager.object_type in the constructor.
13771         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13772         of the `hm.get_current' method if we're using the collection pattern.
13773         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13774         for the explicit conversion to make it work when we're using the collection
13775         pattern and the `Current' property has a different return type than `object'.
13776         Fixes #27713.
13777
13778 2002-07-24  Martin Baulig  <martin@gnome.org>
13779
13780         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13781         does not match, but don't report any errors.  This method is called in
13782         order for all methods in a MethodGroupExpr until a matching method is
13783         found, so we don't want to bail out if the first method doesn't match.
13784         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13785         matches, report the 123.  Fixes #28070.
13786
13787 2002-07-24  Martin Baulig  <martin@gnome.org>
13788
13789         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13790         TypeManager.TypeToCoreType() to the top of the method so the
13791         following equality checks will work.  Fixes #28107.
13792
13793 2002-07-24  Martin Baulig  <martin@gnome.org>
13794
13795         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13796         operand is of type uint, and the other operand is of type sbyte,
13797         short or int, the operands are converted to type long." -
13798         Actually do what this comment already told us.  Fixes bug #28106,
13799         added test-150.cs.
13800
13801 2002-07-24  Martin Baulig  <martin@gnome.org>
13802
13803         * class.cs (MethodBase): New abstract class.  This is now a base
13804         class for Property, Indexer and Event to avoid some code duplication
13805         in their Define() and DefineMethods() methods.
13806         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13807         generic methods for Define() and DefineMethods().
13808         (FieldBase): Derive from MemberBase, not MemberCore.
13809         (Property): Derive from MemberBase, not MemberCore.
13810         (Property.DefineMethod): Moved all the code from this method to the
13811         new MethodBase.DefineAccessor(), just call it with appropriate
13812         argumetnts.
13813         (Property.Define): Call the new Property.DoDefine(), this does some
13814         sanity checks and we don't need to duplicate the code everywhere.
13815         (Event): Derive from MemberBase, not MemberCore.
13816         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13817         accessors, this will also make them work with interface events.
13818         (Indexer): Derive from MemberBase, not MemberCore.
13819         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13820         (Indexer.Define): Use the new MethodBase functions.
13821
13822         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13823         argument to the constructor.
13824         (Interface.FindMembers): Added support for interface events.
13825         (Interface.PopluateEvent): Implemented.
13826
13827         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13828
13829 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13830
13831         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13832         but this is required to check for a method name being the same as
13833         the containing class.  
13834
13835         Handle this now.
13836
13837 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13838
13839         * interface.cs: initialize variable.
13840
13841 2002-07-23  Martin Baulig  <martin@gnome.org>
13842
13843         Implemented the IndexerName attribute in interfaces.
13844
13845         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13846         name if this is an explicit interface implementation.
13847         (Indexer.InterfaceIndexerName): New public variable.  If we're
13848         implementing an interface indexer, this is the IndexerName in that
13849         interface.  Otherwise, it's the IndexerName.
13850         (Indexer.DefineMethod): If we're implementing interface indexer,
13851         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13852         and Pending.ImplementIndexer methods.
13853         (Indexer.Define): Also define the PropertyBuilder if we're
13854         implementing an interface indexer and this is neither an explicit
13855         interface implementation nor do the IndexerName match the one in
13856         the interface.
13857
13858         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13859         If a method is defined here, then we always need to create a proxy
13860         for it.  This is used when implementing interface indexers.
13861         (Pending.IsInterfaceIndexer): New public method.
13862         (Pending.ImplementIndexer): New public method.
13863         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13864         This is used when implementing interface indexers to define a proxy
13865         if necessary.
13866         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13867         define a proxy if necessary.
13868
13869         * interface.cs (Interface.IndexerName): New public variable.
13870         (Interface.PopulateIndexer): Set the IndexerName.
13871         (Interface.DefineIndexers): New private method.  Populate all the
13872         indexers and make sure their IndexerNames match.
13873
13874         * typemanager.cs (IndexerPropertyName): Added support for interface
13875         indexers.
13876
13877 2002-07-22  Martin Baulig  <martin@gnome.org>
13878
13879         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13880         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13881         ret if HasReturnLabel.
13882         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13883         variables.
13884
13885         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13886         and set the ec.LoopBeginTryCatchLevel.
13887         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13888         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13889         the current ec.TryCatchLevel, the branch goes out of an exception
13890         block.  In this case, we need to use Leave and not Br.
13891
13892 2002-07-22  Martin Baulig  <martin@gnome.org>
13893
13894         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13895         block unless the block does not always return or it is contained in
13896         another try { ... } catch { ... } block.  Fixes bug #26506.
13897         Added verify-1.cs to the test suite.
13898
13899 2002-07-22  Martin Baulig  <martin@gnome.org>
13900
13901         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13902         then we do not always return.  Fixes bug #24985.
13903
13904 2002-07-22  Martin Baulig  <martin@gnome.org>
13905
13906         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13907         lookup on a per-class level; ie. walk up the class hierarchy until we
13908         found at least one applicable method, then choose the best among them.
13909         Fixes bug #24463 and test-29.cs.
13910
13911 2002-07-22  Martin Baulig  <martin@gnome.org>
13912
13913         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13914         return types of the methods.  The return type is not part of the
13915         signature and we must not check it to make the `new' modifier work.
13916         Fixes bug #27999, also added test-147.cs.
13917         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13918
13919         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13920         on the method's return type.
13921
13922 2002-07-21  Martin Baulig  <martin@gnome.org>
13923
13924         * assign.cs: Make this work if the rightmost source is a constant and
13925         we need to do an implicit type conversion.  Also adding a few more tests
13926         to test-38.cs which should have caught this.
13927
13928         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13929         target in the makefile for this.  The makefile.gnu is primarily intended
13930         for end-users who don't want to debug the compiler.
13931
13932 2002-07-21  Martin Baulig  <martin@gnome.org>
13933
13934         * assign.cs: Improved the Assign class so it can now handle embedded
13935         assignments (X = Y = Z = something).  As a side-effect this'll now also
13936         consume less local variables.  test-38.cs now passes with MCS, added
13937         a few new test cases to that test.
13938
13939 2002-07-20  Martin Baulig  <martin@gnome.org>
13940
13941         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13942         instructions.  Fixes bug #27977, also added test-146.cs.
13943
13944 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13945
13946         * cs-tokenizer.cs: fixed getHex ().
13947
13948 2002-07-19  Martin Baulig  <martin@gnome.org>
13949
13950         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13951         not Type.GetType() to lookup the array type.  This is needed when
13952         we're constructing an array of a user-defined type.
13953         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13954         single-dimensional arrays, but also for single-dimensial arrays of
13955         type decimal.
13956
13957 2002-07-19  Martin Baulig  <martin@gnome.org>
13958
13959         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13960         this function is called, it's not allowed to share LocalBuilders
13961         among ILGenerators.
13962
13963 2002-07-19  Martin Baulig  <martin@gnome.org>
13964
13965         * expression.cs (Argument.Resolve): Report an error 118 when trying
13966         to pass a type as argument.
13967
13968 2002-07-18  Martin Baulig  <martin@gnome.org>
13969
13970         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13971         Conv_R_Un for the signed `long' type.
13972
13973 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13974
13975         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13976         `expr' for the temporary result, as that will fail if we do
13977         multiple resolves on the same expression.
13978
13979 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13980
13981         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13982         ec.TypeContainer for looking up aliases. 
13983
13984         * class.cs (TypeContainer): Remove LookupAlias from here.
13985
13986         * decl.cs (DeclSpace); Move here.
13987
13988 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13989
13990         * class.cs (FindMembers): Only call filter if the constructor
13991         bulider is not null.
13992
13993         Also handle delegates in `NestedTypes' now.  Now we will perform
13994         type lookups using the standard resolution process.  This also
13995         fixes a bug.
13996
13997         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13998         This uses Expressions (the limited kind that can be parsed by the
13999         tree) instead of strings.
14000
14001         * expression.cs (ComposedCast.ToString): Implement, used to flag
14002         errors since now we have to render expressions.
14003
14004         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14005         FormArrayType. 
14006
14007         * ecore.cs (SimpleName.ToString): ditto.
14008
14009         * cs-parser.jay: Instead of using strings to assemble types, use
14010         Expressions to assemble the type (using SimpleName, ComposedCast,
14011         MemberAccess).  This should fix the type lookups in declarations,
14012         because we were using a different code path for this.
14013
14014         * statement.cs (Block.Resolve): Continue processing statements
14015         even when there is an error.
14016
14017 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14018
14019         * class.cs (Event.Define): Also remove the `remove' method from
14020         the list of pending items.
14021
14022         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14023         generate more compact code. 
14024
14025 2002-07-17  Martin Baulig  <martin@gnome.org>
14026
14027         * const.cs (Const.LookupConstantValue): Add support for constant
14028         `unchecked' and `checked' expressions.
14029         Also adding test case test-140.cs for this.
14030
14031 2002-07-17  Martin Baulig  <martin@gnome.org>
14032
14033         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14034         check whether mi.ReturnType implements the IEnumerator interface; the
14035         `==' and the IsAssignableFrom() will fail in this situation.
14036
14037 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14038
14039         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14040         here too.
14041
14042 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14043
14044         * expression.cs: fixed bug #27811.
14045
14046 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14047
14048         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14049         Molaro: when we are a ref, the value already contains a pointer
14050         value, do not take the address of it.
14051
14052 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14053         * removed mb-parser.jay and mb-tokenizer.cs
14054
14055 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14056
14057         * expression.cs: check against the building corlib void type.
14058
14059 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14060
14061         * ecore.cs: fix for valuetype static readonly fields: when 
14062         initializing them, we need their address, not the address of a copy.
14063
14064 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14065
14066         * typemanager.cs: register also enum_type in corlib.
14067
14068 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14069
14070         * class.cs: allow calling this (but not base) initializers in structs.
14071
14072 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14073
14074         * ecore.cs: make sure we compare against the building base types
14075         in GetTypeSize ().
14076
14077 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14078
14079         * typemanager.cs: fix TypeToCoreType() to handle void and object
14080         (corlib gets no more typerefs after this change).
14081
14082 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14083
14084         * expression.cs (ArrayCreation.EmitArrayArguments): use
14085         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14086
14087         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14088         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14089         array indexes, the runtime actually forbids them.
14090
14091         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14092         for array arguments here.
14093
14094         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14095         instead of the default for ValueTypes.
14096
14097         (New.DoEmit): Use IsValueType instead of
14098         IsSubclassOf (value_type)
14099         (New.DoResolve): ditto.
14100         (Invocation.EmitCall): ditto.
14101
14102         * assign.cs (Assign): ditto.
14103
14104         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14105         Statements *are* currently doing part of their resolution during
14106         Emit.  
14107
14108         Expressions do always resolve during resolve, but statements are
14109         only required to propagate resolution to their children.
14110
14111 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14112
14113         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14114
14115         (LoadAssembly): Do not add the dll if it is already specified
14116
14117         (MainDriver): Add the System directory to the link path at the end,
14118         after all the other -L arguments. 
14119
14120         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14121         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14122         ldelem.u1) and using the opposite for sbytes.
14123
14124         This fixes Digger, and we can finally run it.
14125
14126         * driver.cs (UnixParseOption): Move the option parsing here.  
14127         (CSCParseOption): Implement CSC-like parsing of options.
14128
14129         We now support both modes of operation, the old Unix way, and the
14130         new CSC-like way.  This should help those who wanted to make cross
14131         platform makefiles.
14132
14133         The only thing broken is that /r:, /reference: and /lib: are not
14134         implemented, because I want to make those have the same semantics
14135         as the CSC compiler has, and kill once and for all the confussion
14136         around this.   Will be doing this tomorrow.
14137
14138         * statement.cs (Unsafe.Resolve): The state is checked during
14139         resolve, not emit, so we have to set the flags for IsUnsfe here.
14140
14141 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14142
14143         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14144         not catch the Error_ObjectRefRequired in SimpleName (as it is
14145         possible to have a class/instance variable name that later gets
14146         deambiguated), we have to check this here.      
14147
14148 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14149
14150         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14151         make static and put into Expression.
14152
14153         (Event.Define): Register the private field of the event with the 
14154         TypeManager so that GetFieldFromEvent can get at it.
14155
14156         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14157         keep track of the private field associated with an event which
14158         has no accessors.
14159
14160         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14161         private field.
14162
14163         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14164
14165 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14166
14167         * expression.cs (Binary.EmitBranchable): this routine emits the
14168         Binary expression in a branchable context.  This basically means:
14169         we need to branch somewhere, not just get the value on the stack.
14170
14171         This works together with Statement.EmitBoolExpression.
14172
14173         * statement.cs (Statement.EmitBoolExpression): Use
14174         EmitBranchable. 
14175
14176 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14177
14178         * statement.cs (For): Reduce the number of jumps in loops.
14179
14180         (For): Implement loop inversion for the For statement.
14181
14182         (Break): We can be breaking out of a Try/Catch controlled section
14183         (foreach might have an implicit try/catch clause), so we need to
14184         use Leave instead of Br.
14185
14186         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14187         now).  If the instace expression supports IMemoryLocation, we use
14188         the AddressOf method from the IMemoryLocation to extract the
14189         address instead of emitting the instance.
14190
14191         This showed up with `This', as we were emitting the instance
14192         always (Emit) instead of the Address of This.  Particularly
14193         interesting when This is a value type, as we dont want the Emit
14194         effect (which was to load the object).
14195
14196 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14197
14198         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14199
14200         * statement.cs (Checked): Set the CheckedState during the resolve
14201         process too, as the ConvCast operations track the checked state on
14202         the resolve process, and not emit.
14203
14204         * cs-parser.jay (namespace_member_declaration): Flag that we have
14205         found a declaration when we do.  This is used to flag error 1529
14206
14207         * driver.cs: Report ok when we display the help only.
14208
14209 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14210
14211         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14212
14213 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14214
14215         * cs-tokenizer.cs (define): We also have to track locally the
14216         defines.  AllDefines is just used for the Conditional Attribute,
14217         but we also need the local defines for the current source code. 
14218
14219 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14220
14221         * statement.cs (While, For, Do): These loops can exit through a
14222         Break statement, use this information to tell whether the
14223         statement is the last piece of code.
14224
14225         (Break): Flag that we break.
14226
14227         * codegen.cs (EmitContexts): New `Breaks' state variable.
14228
14229 2002-07-03  Martin Baulig  <martin@gnome.org>
14230
14231         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14232         modifiers in method declarations in structs.  Otherwise, you won't
14233         be able to override things like Object.Equals().
14234
14235 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14236
14237         * class.cs (Method, Property, Indexer): Do not allow the public
14238         modifier to be used in explicit interface implementations.
14239
14240         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14241         override modifiers in method declarations in structs
14242
14243 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14244
14245         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14246         integer or real overflow, report an error
14247
14248 2002-07-02  Martin Baulig  <martin@gnome.org>
14249
14250         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14251         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14252         to tell the runtime about our newly created System.Object and
14253         System.ValueType types.
14254
14255 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14258         struct instead of Ldarg/Starg.
14259
14260 2002-07-02  Martin Baulig  <martin@gnome.org>
14261
14262         * expression.cs (Indirection.Indirection): Call
14263         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14264
14265 2002-07-02  Martin Baulig  <martin@gnome.org>
14266
14267         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14268         ValueType, call TypeManager.TypeToCoreType() on it.
14269         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14270         the OpCodes.Newarr argument.
14271
14272 2002-07-02  Martin Baulig  <martin@gnome.org>
14273
14274         * expression.cs (Invocation.EmitCall): When compiling corlib,
14275         replace all calls to the system's System.Array type to calls to
14276         the newly created one.
14277
14278         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14279         System.Array methods.
14280         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14281         from the system's System.Array type which must be replaced.
14282
14283 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14284
14285         * typemanager.cs: load unverifiable_code_ctor so we can build
14286         corlib using the correct type. Avoid using GetTypeCode() with
14287         TypeBuilders.
14288         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14289         TypeManager.object_type to allow building corlib.
14290
14291 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14292
14293         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14294
14295 2002-07-01  Martin Baulig  <martin@gnome.org>
14296
14297         * class.cs: Make the last change actually work, we need to check
14298         whether `ifaces != null' to avoid a crash.
14299
14300 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14301
14302         * class.cs: when we build structs without fields that implement
14303         interfaces, we need to add the interfaces separately, since there is
14304         no API to both set the size and add the interfaces at type creation
14305         time.
14306
14307 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14308
14309         * expression.cs: the dimension arguments to the array constructors
14310         need to be converted if they are a long.
14311
14312 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14313
14314         * class.cs: don't emit ldarg.0 if there is no parent constructor
14315         (fixes showstopper for corlib).
14316
14317 2002-06-29  Martin Baulig  <martin@gnome.org>
14318
14319         MCS now compiles corlib on GNU/Linux :-)
14320
14321         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14322         ie. check for MethodImplOptions.InternalCall.
14323
14324         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14325         and TypeManager.attribute_type are null, so we must explicitly check
14326         whether parent is not null to find out whether it's an attribute type.
14327         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14328         and SetBuilder, not only if the property is neither abstract nor external.
14329         This is necessary to set the MethodImplOptions on the accessor methods.
14330         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14331         SetBuilder, see Property.Emit().
14332
14333         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14334         populate "System.Object", "System.ValueType" and "System.Attribute" since
14335         they've already been populated from BootCorlib_PopulateCoreTypes().
14336
14337 2002-06-29  Martin Baulig  <martin@gnome.org>
14338
14339         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14340         is the NullLiteral, we also need to make sure that target_type is not
14341         an enum type.   
14342
14343 2002-06-29  Martin Baulig  <martin@gnome.org>
14344
14345         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14346         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14347         before calling BootstrapCorlib_ResolveDelegate ().
14348
14349 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14350
14351         * statement.cs: fixed build-breaker. All tests passed ok.
14352
14353 2002-06-27  Martin Baulig  <martin@gnome.org>
14354
14355         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14356         for System.Decimal when compiling corlib.
14357
14358 2002-06-27  Martin Baulig  <martin@gnome.org>
14359
14360         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14361         switch blocks which contain nothing but a default clause.
14362
14363 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14364
14365        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14366
14367 2002-06-27  Martin Baulig  <martin@gnome.org>
14368
14369         * ecore.cs (PropertyExpr.PropertyExpr): Call
14370         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14371
14372         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14373         is already a TypeBuilder.
14374
14375 2002-06-27  Martin Baulig  <martin@gnome.org>
14376
14377         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14378         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14379         the "from an array-type to System.Array" case.  This makes it work
14380         when compiling corlib.
14381
14382 2002-06-27  Martin Baulig  <martin@gnome.org>
14383
14384         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14385         non-static PropertyExpr, set its InstanceExpression.  This makes
14386         the `ICollection.Count' property work in System/Array.cs.
14387
14388 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14389
14390         * driver.cs: Made error handling more consistent.  Errors now
14391         tracked by Report class, so many methods which used to return int
14392         now return void.  Main() now prints success/failure and 
14393         errors/warnings message.
14394
14395         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14396         the magic number return values (123 and 124).  Now, if the
14397         expected error occurs, the compiler exits with success (exit value
14398         0).  If the compilation completes without seeing that particular
14399         error, the compiler exits with failure (exit value 1).  The
14400         makefile in mcs/errors has been changed to handle the new behaviour.
14401
14402         * report.cs: Made 'expected error' number a property and renamed
14403         it from 'Probe' to 'ExpectedError'.
14404
14405         * genericparser.cs: Removed error handling support, since it is
14406         now all done by Report class.
14407
14408         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14409         class, so parse() no longer returns an int.
14410
14411         * namespace.cs: Use Report.Error instead of GenericParser.error
14412
14413 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14414
14415         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14416         TypeContainer.AddOperator): At the front of the list put the
14417         explicit implementations, so they get resolved/defined first. 
14418
14419 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14420
14421         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14422         interface type is implemented by this TypeContainer.  Used during
14423         explicit interface implementation.
14424
14425         (Property.Define, Indexer.Define, Method.Define): Validate that
14426         the given interface in the explicit implementation is one of the
14427         base classes for the containing type.
14428
14429         Also if we are explicitly implementing an interface, but there is
14430         no match in the pending implementation table, report an error.
14431
14432         (Property.Define): Only define the property if we are
14433         not explicitly implementing a property from an interface.  Use the
14434         correct name also for those properties (the same CSC uses,
14435         although that is really not needed).
14436
14437         (Property.Emit): Do not emit attributes for explicitly implemented
14438         properties, as there is no TypeBuilder.
14439
14440         (Indexer.Emit): ditto.
14441
14442         Hiding then means that we do not really *implement* a pending
14443         implementation, which makes code fail.
14444
14445 2002-06-22  Martin Baulig  <martin@gnome.org>
14446
14447         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14448         the return value of Object.GetType().  [FIXME: we need to do this whenever
14449         we get a type back from the reflection library].
14450
14451 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14452
14453         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14454
14455 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14456
14457         * attribute.cs: Return null if we can not look up the type.
14458
14459         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14460         the interface types found.
14461
14462         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14463         interface types found.
14464
14465         * typemanager.cs (GetInterfaces): Make this routine returns alll
14466         the interfaces and work around the lame differences between
14467         System.Type and System.Reflection.Emit.TypeBuilder in the results
14468         result for GetInterfaces.
14469
14470         (ExpandInterfaces): Given an array of interface types, expand and
14471         eliminate repeated ocurrences of an interface.  This expands in
14472         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14473         be IA, IB, IC.
14474
14475 2002-06-21  Martin Baulig  <martin@gnome.org>
14476
14477         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14478         on System.Enum.
14479
14480 2002-06-21  Martin Baulig  <martin@gnome.org>
14481
14482         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14483         and called with one of the core types, return the corresponding typebuilder for
14484         that type.
14485
14486         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14487         element type.
14488
14489 2002-06-21  Martin Baulig  <martin@gnome.org>
14490
14491         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14492         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14493         (Expression.ConvertReferenceExplicit): Likewise.
14494
14495         * expression.cs (ElementAccess.DoResolve): Likewise.
14496         (ElementAccess.DoResolveLValue): Likewise.
14497
14498 2002-06-10  Martin Baulig  <martin@gnome.org>
14499
14500         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14501         add the "value" parameter to the parameter list.
14502
14503         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14504         to our caller.
14505
14506 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14507
14508         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14509         the argument to an int, uint, long or ulong, per the spec.  Also
14510         catch negative constants in array creation.
14511
14512 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14513
14514         * class.cs: do not allow the same interface to appear twice in
14515         the definition list.
14516
14517 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14518
14519         * ecore.cs: don't use ldlen with System.Array.
14520
14521 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14522
14523         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14524
14525 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14526
14527         * modifiers.cs: produce correct field attributes for protected
14528         internal. Easy fix so miguel can work on ther harder stuff:-)
14529
14530 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * pending.cs: New file.  Move the code from class.cs here.
14533         Support clearning the pending flag for all methods (when not doing
14534         explicit interface implementation).
14535
14536 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14537
14538         * rootcontext.cs: added a couple more types needed to bootstrap.
14539
14540 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14543         constructor in the type, instead of any constructor in the type
14544         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14545         a bug in the Mono runtime when applying the params attribute). 
14546
14547 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14548         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14549
14550 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14551
14552         * expression.cs (Unary.ResolveOperator): Use TypeManager
14553         to resolve the type.
14554
14555 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14556
14557         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14558         attached.
14559
14560         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14561         with each member too.
14562
14563         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14564         field builders too - this takes care of the enum member case.
14565
14566 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14567
14568         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14569         address-of operator on both value types and pointers.
14570
14571 2002-06-10  Martin Baulig  <martin@gnome.org>
14572
14573         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14574         PropertyBuilder to the `property_builders' list.
14575
14576         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14577         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14578         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14579         find any indexers which are inherited from an interface.
14580
14581 2002-06-09  Martin Baulig  <martin@gnome.org>
14582
14583         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14584         the same type as the constant if necessary.  There's also a test-130.cs
14585         for this.
14586
14587         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14588
14589         * typemanager.cs (TypeManager.ChangeType): Previously known as
14590         Enum.ChangeEnumType().
14591
14592 2002-06-09  Martin Baulig  <martin@gnome.org>
14593
14594         * expression.cs (Cast.TryReduce): Added support for consts.
14595
14596 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14597
14598         * class.cs (Accessor): Hold attributes information so we can pass
14599         it along.
14600
14601         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14602         Modify to pass in attributes attached to the methods.
14603
14604         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14605
14606         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14607         to handle the Accessor kind :-)
14608
14609         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14610
14611 2002-06-08  Martin Baulig  <martin@gnome.org>
14612
14613         * expression.cs (Unary.TryReduceNegative): Added support for
14614         ULongConstants.
14615
14616 2002-06-08  Martin Baulig  <martin@gnome.org>
14617
14618         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14619         name can't be found in the `defined_names' - the caller will do a
14620         MemberLookup in this case and thus find methods in System.Enum
14621         such as Enum.IsDefined().
14622
14623 2002-06-08  Martin Baulig  <martin@gnome.org>
14624
14625         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14626         Convert.ChangeType() which works with TypeBuilder created types.
14627         (Enum.LookupEnumValue, Enum.Define): Use it here.
14628
14629         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14630         `TypeBuilder.BaseType != null' check.
14631         (TypeContainer.FindMembers): Only lookup parent members if we
14632         actually have a parent.
14633         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14634         (ConstructorInitializer.Resolve): Likewise.
14635
14636         * interface.cs (Interface.FindMembers): Added
14637         `TypeBuilder.BaseType != null' check.
14638
14639         * rootcontext.cs (RootContext.ResolveCore): Added
14640         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14641         classes_second_stage.
14642
14643         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14644         debug_type and trace_type when compiling with --nostdlib.       
14645
14646 2002-06-07  Martin Baulig  <martin@gnome.org>
14647
14648         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14649         (AddField): Set it to true when adding a non-static field.
14650         (DefineType): Use `have_nonstatic_fields' to find out whether we
14651         have non-static fields, not `Fields != null'.
14652
14653 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14654
14655         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14656         dereferencing a null on the static-field code path)
14657
14658 2002-05-30  Martin Baulig  <martin@gnome.org>
14659
14660         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14661         to take command line arguments.  Use reflection to call the new
14662         custom `Initialize' function on the symbol writer and pass it the
14663         command line arguments.
14664
14665         * driver.cs (--debug-args): New command line argument to pass command
14666         line arguments to the symbol writer.
14667
14668 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14669
14670         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14671         the target type for indexers and properties.  Thanks to Joe for
14672         catching this.
14673
14674 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14675
14676         * typemanager.cs (MethodFlags): returns the method flags
14677         (Obsolete/ShouldIgnore) that control warning emission and whether
14678         the invocation should be made, or ignored. 
14679
14680         * expression.cs (Invocation.Emit): Remove previous hack, we should
14681         not do this on matching a base type, we should do this based on an attribute
14682
14683         Only emit calls to System.Diagnostics.Debug and
14684         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14685         on the command line.
14686
14687         * rootcontext.cs: Global settings for tracing and debugging.
14688
14689         * cs-tokenizer.cs (define): New utility function to track
14690         defines.   Set the global settings for TRACE and DEBUG if found.
14691
14692 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14693
14694         * interface.cs (Populate*): Pass in the TypeContainer as well as
14695         the DeclSpace as parameters so that we can create EmitContexts and
14696         then use that to apply attributes etc.
14697
14698         (PopulateMethod, PopulateEvent, PopulateProperty)
14699         (PopulateIndexer): Apply attributes everywhere.
14700
14701         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14702         etc.
14703
14704         (ApplyAttributes): Update accordingly.
14705
14706         We now apply interface attributes for all members too.
14707
14708 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14709
14710         * class.cs (Indexer.Define); Correctly check if we are explicit
14711         implementation (instead of checking the Name for a ".", we
14712         directly look up if the InterfaceType was specified).
14713
14714         Delay the creation of the PropertyBuilder.
14715
14716         Only create the PropertyBuilder if we are not an explicit
14717         interface implementation.   This means that explicit interface
14718         implementation members do not participate in regular function
14719         lookups, and hence fixes another major ambiguity problem in
14720         overload resolution (that was the visible effect).
14721
14722         (DefineMethod): Return whether we are doing an interface
14723         implementation. 
14724
14725         * typemanager.cs: Temporary hack until we get attributes in
14726         interfaces (Ravi is working on that) and we get IndexerName
14727         support in interfaces.
14728
14729         * interface.cs: Register the indexers as properties.
14730
14731         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14732         warning, I have verified that this is a bug in the .NET runtime
14733         (JavaScript suffers of the same problem).
14734
14735         * typemanager.cs (MemberLookup): When looking up members for
14736         interfaces, the parent of an interface is the implicit
14737         System.Object (so we succeed in searches of Object methods in an
14738         interface method invocation.  Example:  IEnumerable x;  x.ToString
14739         ()) 
14740
14741 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14742
14743         * class.cs (Event): Events should also register if they do
14744         implement the methods that an interface requires.
14745
14746         * typemanager.cs (MemberLookup); use the new GetInterfaces
14747         method. 
14748
14749         (GetInterfaces): The code used to lookup interfaces for a type is
14750         used in more than one place, factor it here. 
14751
14752         * driver.cs: Track the errors at the bottom of the file, we kept
14753         on going.
14754
14755         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14756         instance if the method we are calling is static!
14757
14758 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14759
14760         * attribute.cs (ApplyAttributes): Make this function filter out
14761         the IndexerName attribute (as that attribute in reality is never
14762         applied) and return the string constant for the IndexerName
14763         attribute. 
14764
14765         * class.cs (TypeContainer.Emit): Validate that all the indexers
14766         have the same IndexerName attribute, and if so, set the
14767         DefaultName attribute on the class. 
14768
14769         * typemanager.cs: The return value might contain other stuff (not
14770         only methods).  For instance, consider a method with an "Item"
14771         property and an Item method.
14772
14773         * class.cs: If there is a problem with the parameter types,
14774         return. 
14775
14776 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14777
14778         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14779         looks at user defined conversion after making a call to 
14780         StandardConversionExists - we need this for overload resolution.
14781
14782         * expression.cs : Update accordingly the various method calls.
14783
14784         This fixes 2 bugs filed against implicit user defined conversions 
14785
14786 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14787
14788         * statement.cs: Track the result of the assignment.
14789
14790 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14791
14792         * expression.cs (MemberAccess): Improved error reporting for
14793         inaccessible members.
14794
14795 2002-05-22  Martin Baulig  <martin@gnome.org>
14796
14797         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14798         itself with debugging support.
14799
14800 2002-05-22  Martin Baulig  <martin@gnome.org>
14801
14802         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14803         Removed, this isn't needed anymore.
14804
14805 2002-05-20  Martin Baulig  <martin@gnome.org>
14806
14807         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14808         be underlying type for an enum.
14809
14810 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14811
14812         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14813         that splits out the loading of just the core types.
14814
14815         * rootcontext.cs (ResolveCore): Split the struct resolution in
14816         two, so we can load the enumeration underlying types before any
14817         enums are used.
14818
14819         * expression.cs (Is): Bandaid until we fix properly Switch (see
14820         bug #24985 for details).
14821
14822         * typemanager.cs (ImplementsInterface): The hashtable will contain
14823         a null if there are no interfaces implemented.
14824
14825 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14826
14827         * cs-parser.jay (indexer_declarator): It is fine to have array
14828         parameters
14829
14830 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14831
14832         * typemanager.cs: (RegisterBuilder): New function used to register
14833         TypeBuilders that implement interfaces.  Since
14834         TypeBuilder.GetInterfaces (as usual) does not work with lame
14835         Reflection.Emit. 
14836         (AddUserType): register interfaces.
14837
14838         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14839         dealing with TypeBuilder.  Also, arrays are showing up as
14840         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14841         methods can not be invoked on them!
14842
14843         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14844         (ImplicitReferenceConversionExists): Split out from
14845         StandardConversionExists. 
14846
14847         * expression.cs (As): We were only implementing one of the three
14848         cases for the as operator.  We now implement them all.
14849         (Is): Implement the various other cases for Is as well.
14850
14851         * typemanager.cs (CACHE): New define used to control if we want or
14852         not the FindMembers cache.  Seems to have a negative impact on
14853         performance currently
14854
14855         (MemberLookup): Nested types have full acess to
14856         enclosing type members
14857
14858         Remove code that coped with instance/static returns for events, we
14859         now catch this in RealFindMembers.
14860
14861         (RealFindMembers): only perform static lookup if the instance
14862         lookup did not return a type or an event.  
14863
14864 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14865
14866         * assign.cs (CompoundAssign): We pass more semantic information
14867         now to Compound Assignments than we did before: now we have all
14868         the information at hand, and now we resolve the target *before* we
14869         do the expression expansion, which allows the "CacheValue" method
14870         to have the effect we intended (before, a [x] += 1 would generate
14871         two differen ArrayAccess expressions from the ElementAccess,
14872         during the resolution process).
14873
14874         (CompoundAssign.DoResolve): Resolve target and original_source here.
14875
14876 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14877
14878         * expression.cs (ArrayAccess): dropped debugging information. 
14879
14880         * typemanager.cs: Small bug fix: I was always returning i_members,
14881         instead of one of i_members or s_members (depending on which had
14882         the content).
14883
14884         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14885         method is invoked before any code generation takes place, and it
14886         is a mechanism to inform that the expression will be invoked more
14887         than once, and that the method should use temporary values to
14888         avoid having side effects
14889
14890         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14891
14892         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14893         implementation.
14894
14895         * expression.cs (Indirection, ArrayAccess): Add support for
14896         CacheTemporaries in these two bad boys. 
14897
14898         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14899         ldobj or ldind_ref.  
14900         (StoreFromPtr): Handle stobj as well.
14901
14902         * expression.cs (UnaryMutator): Share more code.
14903
14904         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14905         down: I was not tracking the Filter function as well, which
14906         was affecting the results of the cache.
14907
14908 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14909
14910         * attribute.cs: Remove the hack to handle the CharSet property on
14911         StructLayouts. 
14912
14913 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14914
14915         * attribute.cs (DoResolve): More uglyness, we now only try to
14916         resolve the attribute partially, to extract the CharSet
14917         information (only if we are a StructLayout attribute).  Otherwise 
14918
14919         (GetExtraTypeInfo): Add some code to conditionally kill in the
14920         future this.   I am more and more convinced that the .NET
14921         framework has special code to handle the attribute setting on
14922         certain elements.
14923
14924         * expression.cs (IsParamsMethodApplicable): Revert my previous
14925         foreach change here, it was wrong.
14926
14927 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14928
14929         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14930         (pp_expr): do not abort on unknown input, just return.
14931         (eval): abort if there are pending chars.
14932
14933         * attribute.cs (Attribute.Resolve): Positional parameters are
14934         optional.  Deal with that case.
14935
14936         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14937         the Ansi/Unicode/Auto information for the type.
14938
14939         (TypeContainer.DefineType): instantiate the EmitContext here, as
14940         we will be using it during the type definition (to resolve
14941         attributes) and during the emit phase.
14942
14943         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14944         to pull type information out of the attributes
14945
14946         (Attribute.Resolve): track the constructor builder, and allow for
14947         multiple invocations (structs and classes will use this).
14948
14949         * ecore.cs (MemberLookupFinal): new version with all the
14950         parameters customizable.
14951
14952         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14953         constructors.  Return if the result value is null (as the error
14954         would have been flagged already by MemberLookupFinal)
14955
14956         Do not allow instances of abstract classes or interfaces to be
14957         created.
14958
14959         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14960         We have to compare the assembly property here when dealing with
14961         FamANDAssem and Assembly access modifiers, because we might be
14962         creating an assembly from *modules* (that means that we are not
14963         getting TypeBuilders for types defined in other modules that are
14964         part of this assembly).
14965
14966         (Method.Emit): If the method is marked abstract and has a body,
14967         emit an error. 
14968
14969         (TypeContainer.DefineMembers): If both the defined member and the
14970         parent name match are methods, then do not emit any warnings: let
14971         the Method.Define routine take care of flagging warnings.  But if
14972         there is a mismatch (method overrides something else, or method is
14973         overriwritten by something, then emit warning).
14974
14975         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14976         set to null, this means `do not check for the return type on the
14977         signature'. 
14978
14979         (Method.Define): set the return type for the method signature to
14980         null, so that we get methods with the same name and parameters and
14981         different return types.  This is used to flag warning 114 (you are
14982         hiding a method, and you probably want to use the new/override
14983         keywords instead).
14984
14985         * typemanager.cs (MemberLookup): Implemented proper access
14986         control, closing a long standing set of bug reports.  The problem
14987         was that the Framework only has two bits: Public and NonPublic,
14988         and NonPublic includes private and protected methods, but we need
14989         to enforce the FamANDAssem, FamOrAssem and Family. 
14990
14991 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14992
14993         * statement.cs (GotoCase): Return true: Ammounts to giving up
14994         knowledge on whether we return or not, and letting the other case
14995         be responsible for it.
14996
14997 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14998
14999         * driver.cs: Do not load directories for each file processed, only
15000         do it if there is a pattern.
15001
15002         * ecore.cs: Report readonly assigns here as well, as we might have
15003         been resolved only by MemberAccess.
15004
15005         (SimpleName.SimpleNameResolve): Also be useful for LValue
15006         resolution.   We need this to propagate assign to local readonly variables
15007
15008         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15009         do not want to reuse potential criteria memory.
15010
15011         * class.cs (MyEventBuilder): Set reflected_type;
15012
15013         * ecore.cs (Constantify): Added support for constifying bools.
15014
15015         (RootContext.LookupType): Added a cache for values looked up in
15016         the declaration space.
15017
15018         * typemanager.cs (FindMembers): Now is a front-end to
15019         RealFindMembers, and provides a two-level hashtable-based cache to
15020         the request.  
15021
15022         15% performance improvement: from 22.5 to 19.2 seconds.
15023
15024         * expression.cs (IsParamsMethodApplicable): use foreach.
15025         (Invocation.DoResolve): ditto.
15026         (New.DoResolve): ditto.
15027         (ArrayCreation.DoResolve): ditto.
15028
15029         * ecore.cs (FindMostEncompassingType): use foreach.
15030
15031         * delegate.cs (NewDelegate.DoResolve): Use foreach
15032
15033         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15034         (RemoveMethods): use foreach.
15035
15036         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15037         nested foreach statements instead of for, and also break out of
15038         the inner loop once a match is found.
15039
15040         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15041
15042 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15043
15044         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15045         we actually unwrap the expression to allow for extra information
15046         to be extracted. 
15047
15048         * expression.cs: Use Shr_Un on unsigned operations. 
15049
15050 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15051
15052         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15053         applicable operators was not being considered correctly. This closes
15054         the bug Miguel reported.
15055
15056 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15057
15058         * attribute.cs: check that the type derives from System.Attribute
15059         and report the correct error in that case (moved the duplicate code to
15060         its own method, too).
15061
15062 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15063
15064         * attribute.cs: lookup attribute type name as the spec says: first the
15065         bare attribute name and then name + "Attribute" (nant compiles with
15066         mcs after this fix).
15067
15068 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15069
15070         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15071         Because of the way we parse things, we should try to see if a
15072         UIntConstant can fit in an integer.
15073
15074 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15075
15076         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15077         when we are in an explicit context.
15078
15079         (ConvertReferenceExplicit): When converting from Iface type S to Class
15080         T make sure the rules are implemented as an OR.
15081
15082         * parameter.cs (ParameterType): Make it a property for now although the
15083         purpose really isn't anything immediate.
15084
15085         * expression.cs (Is*Applicable): Do better checking on the parameter type
15086         of a ref/out parameter. The ones from the system assemblies are already 
15087         marked with the correct type so we don't need to do any correction.
15088
15089         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15090         the object type is standard too so include that.
15091
15092 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15093
15094         * ecore.cs (StandardConversionExists): Augment with missing code:
15095         deal with IntConstant, LongConstants and Enumerations.
15096
15097         * assign.cs: Report the error, instead of failing silently
15098
15099         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15100         typecontainer that they are declared, because the
15101         typecontainer/namespace will have the list of using clauses that
15102         need to be applied.
15103
15104         Assembly Attributes were escaping the normal registration
15105         mechanism. 
15106
15107         (EmitCode): Apply attributes within an EmitContext that represents
15108         the container they were declared on.
15109
15110         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15111
15112 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15113
15114         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15115         Revamp completely - make much cleaner as we now operate only
15116         on a set of Types.
15117
15118         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15119         to implement the logic detailed in the spec more correctly.
15120
15121         (UserDefinedConversion): Update accordingly.
15122
15123 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15124
15125         * statement.cs: Return flow analysis information up.
15126
15127         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15128         and the default.
15129
15130         (token): Do not consume an extra character before calling
15131         decimal_digits.
15132
15133 2002-05-06  Piers Haken <piersh@friskit.com>
15134
15135         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15136
15137 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15140         EmitContext during the instance constructor initializer
15141         resolution, to stop access to instance variables.
15142
15143         This is mandated by the spec, last paragraph of the `constructor
15144         initializers' section. 
15145
15146 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * cs-parser.jay, class.cs (Accessor): new class used to represent
15149         an accessor (get or set).  In the past we used `null' to represent
15150         a missing accessor.  But this is ambiguous because there was no
15151         way to tell in abstract indexers/properties if one of them was
15152         specified.
15153
15154         Now there is a way of addressing that.
15155
15156         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15157         instead of FindMembers.
15158
15159         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15160         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15161
15162         * attribute.cs: Treat indexers and properties as the same in terms
15163         of applying attributes
15164
15165         * ecore.cs (FindMostEncompassedType): Use statically initialized
15166         EmptyExpressions()s like we do elsewhere to avoid creating useless
15167         objects (and we take this out of the tight loop).
15168
15169         (GetConversionOperators): Move the code to extract the actual
15170         operators to a separate routine to clean things up.
15171
15172 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15173
15174         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15175         events are always registered FieldBuilders.
15176
15177         * class.cs (FieldBase): New class shared by Fields 
15178
15179         * delegate.cs: If we are a toplevel delegate, use our full name.
15180         If we are a nested delegate, then only use our tail name.
15181
15182 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15183
15184         * expression.cs (IsApplicable): Ensure that we add the "&" to
15185         ref/out types before comparing it with the type of the argument.
15186
15187         (IsParamsMethodApplicable): Ditto.
15188
15189         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15190         silly me ;-)
15191
15192         * delegate.cs : Handle the case when we have more than one applicable
15193         method. Flag an error only when we finish checking all.
15194
15195 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15196
15197         * expression.cs: Add support for boolean static initializers.
15198
15199 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15200
15201         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15202
15203         * parameter.cs (ComputeParameterTypes,
15204         ComputeAndDefineParameterTypes): Better error handling: now we
15205         clear the `types' cache if we fail during any of the type lookups.
15206         We also return the status code correctly to our caller
15207
15208         * delegate.cs: If we fail to define a delegate, abort the extra
15209         steps. 
15210
15211         * expression.cs (Binary.ResolveOperator): for
15212         operator==(object,object) and operator !=(object, object) we also
15213         have to verify that there is an implicit conversion from one to
15214         the other.
15215
15216         (ArrayAccess.DoResolve): Array Access can operate on
15217         non-variables. 
15218
15219 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15220
15221         * assign.cs (CompoundAssign): A new class used as a "flag" that
15222         the assignment actually is happening as part of a compound
15223         assignment operator.
15224
15225         During compound assignment, a few new rules exist to enable things
15226         like:
15227
15228         byte b |= 1 + 2
15229
15230         From the spec:
15231
15232         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15233         to the type of x) if y is implicitly convertible to the type of x,
15234         and the operator is a builtin operator and the return type of the
15235         operator is explicitly convertible to the type of x. 
15236
15237         * rootcontext.cs: Reset warning level to 2.  4 catches various
15238         "interesting" features in mcs, we must clean this up at some
15239         point, but currently am trying to kill other bugs ;-)
15240
15241         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15242         in container classes as well.  
15243
15244         * expression.cs (Binary.ResolveOperator): Handle string case
15245         before anything else (as operator overloading does emit an error
15246         before doing anything else).
15247
15248         This code could go away when we move to a table driven model, but
15249         i could not come up with a good plan last night.
15250
15251 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15252
15253         * typemanager.cs (CSharpName): reimplementation using regex.
15254         * class.cs: added null check for fields in Emit
15255         * rootcontext.cs: set warninglevel to 4
15256
15257 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15258
15259         * typemanager.cs (CSharpName): reimplemented with Lupus
15260         suggestion.
15261
15262 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15263
15264         * statement.cs (If): correclty implement Resolve, because we were
15265         not catching sem errors in there.  The same process is needed
15266         everywhere else. 
15267         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15268
15269
15270         (Statement.Warning_DeadCodeFound): Factorize code.
15271         (While): Report dead code here too.
15272
15273         (Statement): Added Resolve virtual method to allow
15274         for resolution split from the emit code.
15275
15276 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15277
15278         * statement.cs (EmitBoolExpression): No longer try to resolve the
15279         expression here.    
15280         (MakeBoolean): New utility function that resolve, implicitly
15281         converts to boolean and tags the expression. 
15282
15283
15284         (If, Do): Implement dead code elimination.
15285         (While): Implement loop inversion
15286
15287         (Do, While, For, If): Resolve the expression prior to calling our
15288         code generation.
15289
15290 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15291
15292         * class.cs:
15293           - added method Report28 (warning: program has more than one entry point)
15294           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15295           - modified method Method.Define, the part at the end of the method
15296
15297         * rootcontext.cs: added static public Location EntryPointLocation;
15298           
15299         * ../errors/cs0028.cs : Add test case for the above warning.              
15300
15301         * typemanager.cs:
15302           - modified method CSharpName to allow arrays of primitive type to
15303             be printed nicely (e.g. instead of System.Int32[][] it now prints
15304             int[][])
15305           - added method CSharpSignature: returns the signature of a method
15306             in string format to be used in reporting errors, warnings, etc.
15307
15308         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15309         with String.Empty.
15310
15311 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15312
15313         * delegate.cs (Define): Fix extremely silly bug where I was
15314         setting the type of the 'object' parameter of the BeginInvoke
15315         method to System.IAsyncResult instead of System.Object ;-)
15316
15317 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15318
15319         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15320         here. 
15321
15322         (Constructor.Emit): return if we fail to initialize the
15323         constructor.  Another door closed!  
15324
15325         * expression.cs (New.DoResolve): Improve error message (from -6 to
15326         1501).  Use DeclaredOnly lookup to find the exact constructor.
15327
15328         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15329         loop.  This is useful.
15330
15331         * cs-parser.jay: Adjust the default parameters so that destructors
15332         have the proper signature.
15333
15334 2002-04-26  Martin Baulig  <martin@gnome.org>
15335
15336         * driver.cs (LoadAssembly): If `assembly' contains any characters
15337         which are only valid in path names and not in assembly names
15338         (currently slash, backslash and point), use Assembly.LoadFrom ()
15339         instead of Assembly.Load () on the `assembly' (before iteration
15340         over the link_paths).
15341
15342 2002-04-26  Martin Baulig  <martin@gnome.org>
15343
15344         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15345
15346 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15347
15348         * class.cs (Property): use the new typemanager.MemberLookup
15349
15350         (TypeContainer.MemberLookup): Implement using the
15351         TypeManager.MemberLookup now. 
15352
15353         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15354         and return MemberInfos, so that these can be used without an
15355         EmitContext (what we had before).
15356
15357 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15358
15359         * expression.cs: Fix the case where the argument to params if the
15360         type of the params.  I omitted handling this before.   Fixed
15361
15362 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15363
15364         * driver.cs: Call BootCorlib_PopulateCoreType
15365
15366         * class.cs (Property.CheckBase): Check for properties only, not
15367         for all members. 
15368
15369         * interface.cs: Temporary hack: try/catch around the
15370         CustomAttributeBuilder, because I am getting an exception that I
15371         do not understand.
15372
15373         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15374         types whose definitions are required to be there (attributes are
15375         defined before standard types).
15376
15377         Compute definitions as we boot the various types, as they are used
15378         immediately (value_type class will need object_type, but if we do
15379         not initialize object_type, we will pass a null, which will let
15380         the runtime pick the System.Object from the existing corlib, which
15381         is not what we want).
15382
15383 2002-04-22  Patrik Torstensson <totte@labs2.com>
15384
15385         * cs-tokenizer.cs: fixed a number of trim() issues.
15386
15387 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15388
15389         * expression.cs (Argument.Type): Ensure that we return the correct
15390         type when we have out or ref parameters [in which case we 
15391         append a "&"].
15392
15393 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15394
15395         * class.cs (Property, Indexer): Allow extern modifier in there. 
15396
15397         * typemanager.cs (InitBaseTypes): Initializes object_type and
15398         value_type, since those will be used early on during the bootstrap
15399         process to compile corlib.
15400
15401         (InitCoreTypes): Move code from here to InitBaseTypes.
15402
15403 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15404
15405         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15406         single-dimension arrays as using the ldlen opcode.  
15407
15408         Daniel Lewis discovered this optimization.  
15409
15410         * typemanager.cs: Add signature for System.Array::get_Length
15411
15412 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15413
15414         * statement.cs: report the error when the foreach does not apply to an
15415         array nor a collection.
15416
15417 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15418
15419         * expression.cs: Add implicit conversions to the operator ~.
15420
15421         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15422
15423         * typemanager.cs: Locate the decimal constructor.
15424
15425 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15426
15427         * attribute.cs: use the new property of TypeOf.
15428         * expression.cs: added 'get' property around typearg.
15429
15430         These changes fix a build breaker reported by NickD. Is this the
15431         correct way to fix?  If not, please, revert my changes and make it
15432         work :-).
15433
15434 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15435
15436         * attribute.cs: Add support for typeof in attribute invocations.
15437         I am not sure that this is right though.
15438
15439 2002-04-14  Duncan Mak  <duncan@ximian.com>
15440
15441         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15442         Binary.Operator.Division case.
15443
15444 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15445
15446         * class.cs (DefineType): Ensure that we do a proper check on
15447         attribute types and also register it with the TypeManager.
15448
15449         (TypeContainer.Targets): The default for attribute types is
15450         AttributeTargets.All.
15451
15452         * attribute.cs (ApplyAttributes): Registering the attribute type
15453         is done elsewhere, not when we discover we have a Usage attribute.
15454
15455 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15456
15457         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15458         and get rid of is_delegate parameter.
15459
15460         * everywhere : update.
15461
15462 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15463
15464         * cs-parser.jay (compilation_unit): Revamp completely to use
15465         some new ideas that I got from Rhys' grammar to solve the problems
15466         with assembly level attributes.
15467
15468         (outer_declaration): New grammar production.
15469
15470         (attribute_sections): Add.
15471
15472         (opt_attributes): Base on attribute_sections
15473
15474         (namespace_declaration): Allow opt_attributes to tackle the case
15475         when we have assembly level attributes - we are clever in this
15476         regard now ;-)
15477
15478         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15479         attributes in the non-global context.
15480
15481         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15482         instead of SetGlobalAttributes.
15483
15484         * class.cs, rootcontext.cs : Ensure we define and generate 
15485         attribute types before anything else.
15486
15487         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15488         and flag the new error -20 for the case when the attribute type
15489         does not have valid targets specified. csc does not catch this.
15490
15491         * ../errors/errors.txt : update for error # -20
15492
15493 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15494
15495         * support.cs (InternalParameters.ParameterModifier): Do some null
15496         checking and return sane values.
15497
15498         * class.cs (Method.Define): If we are a PInvoke method, ensure
15499         that we are static and extern. Report error # 601
15500
15501         * ../errors/cs0601.cs : Add test case for the above error.
15502
15503 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15504
15505         * rootcontext.cs (attribute_types): We need to keep type of
15506         all attribute types separately and emit code for them first.
15507
15508         (RegisterAttribute) : Implement.
15509
15510         * class.cs (DefineType): Check if the current Type is a custom
15511         attribute type and register it accordingly.
15512
15513         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15514         adding the first attribute twice and rename to
15515
15516         (SetGlobalAttributes): this.
15517
15518         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15519         lookups.
15520
15521         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15522         if we are processing global arguments. Hmm, I am unsure of this.
15523
15524 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15525
15526         * expression.cs: added static array of strings to avoid calling
15527         Enum.ToString () for Operator in Binary. Significant recover of
15528         performance.
15529
15530 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15531
15532         * class.cs (FindMembers): Allow the Builders of the various
15533         members to be null.  If they are skip them.  This only happens
15534         during the PInvoke declaration.
15535
15536 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15537
15538         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15539         failure, so we do not keep going afterwards.
15540
15541         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15542         wanted to pass `false' as the `is_delegate' argument.  If this is
15543         the case, why not use delegate_type == null to mean `is_delegate =
15544         false' and anything else as is_delegate = true.
15545
15546 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15547
15548         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15549         code for the section, not the beginning of the tests.
15550
15551 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15552
15553         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15554
15555         * expression.cs (Binary): same.  Warn about errors where we have
15556         Enum/Enum in operator + as well.
15557
15558 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15559
15560         * statement.cs:
15561                 - added support for switch(bool)
15562                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15563                 - add TableSwitchEmit() to handle table-based switch statements
15564
15565 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15566
15567         * expression.cs (Invocation.OverloadResolve): Factor out code which
15568         does parameter compatibility checking with arguments so that we can 
15569         re-use the code even from Delegate.VerifyApplicability
15570
15571         (VerifyArgumentsCompat): Move above code here.
15572
15573         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15574         and instead make a call to the above method.
15575
15576 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15577
15578         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15579         We use it to keep track of classes which are attribute types.
15580
15581 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * delegate.cs (Delegate.Define): Correctly define the types in the
15584         presence of fixed and array parameters.
15585
15586         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15587         doing FindMembers.
15588
15589         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15590         include NonPublic after the first iteration.
15591
15592         * class.cs (Indexer.CheckBase): Only check if both parents are
15593         non-null. 
15594
15595         * cs-parser.jay (accessor_body): If empty, set to null.
15596
15597         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15598         same code path here to resolve constants names that we did have in
15599         MemberAccess.DoResolve.  There is too much code duplicated here.
15600
15601 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15602
15603         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15604
15605         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15606         to MakeUnionSet.
15607
15608         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15609         tokens, numbers and strings.
15610
15611         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15612         parenthesis.
15613
15614         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15615         asyncronous parameters and the regular parameters.  
15616
15617         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15618         specify the target directory.
15619
15620         * expression.cs: (This.DoResolve): Simplify
15621         (As.Emit): Optimize, do not generate IsInst if the expression is
15622         always of the given type.
15623
15624         (Is.DoResolve): Bug fix, we were reporting both always/never for
15625         the is expression.
15626
15627         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15628         creating too many unnecessary arrays.
15629
15630 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15631
15632         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15633         fields instead of rolling our own initializer.   Takes care of all
15634         implicit conversions, and drops unnecessary static checks/argument.
15635
15636 2002-03-31  Dick Porter  <dick@ximian.com>
15637
15638         * driver.cs: use the GetDirectories() return values properly, and
15639         use "/" as path separator.
15640
15641 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15642
15643         * expression.cs (Unary): Optimize - - expr into expr.
15644         (Binary): Optimize a + (-b) into a -b.
15645
15646         * codegen.cs (CodeGen): Made all methods static.
15647
15648 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15649
15650         * rootcontext.cs: 
15651
15652         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15653         TypeBuilder property.
15654
15655         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15656         instead. 
15657
15658         * tree.cs: Removed the various RecordXXXX, and replaced with a
15659         single RecordDecl.  Removed all the accessor methods, and just
15660         left a single access point Type 
15661
15662         * enum.cs: Rename DefineEnum to DefineType.
15663
15664         * decl.cs: New abstract method `DefineType' used to unify the
15665         Defines for Enumerations, Interfaces, TypeContainers and
15666         Delegates.
15667
15668         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15669         LookupBaseClasses method that used to live in class.cs and
15670         interface.cs here, and renamed to FindType.
15671
15672         * delegate.cs: Implement DefineType.  Take advantage of the
15673         refactored pattern for locating the parent builder without taking
15674         the parent_builder argument (which we know does not work if we are
15675         nested, and triggering a toplevel definition).
15676
15677 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15678
15679         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15680         accessibility of a member has changed during override and report
15681         an error if so.
15682
15683         * class.cs (Method.Define, Property.Define): Only complain on
15684         overrides if the method is private, any other accessibility is
15685         fine (and since we just checked the permission is the same, we are
15686         good to go).
15687
15688         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15689         and elif are processed always.  The other pre-processing
15690         directives are only processed if we are "taking" the path
15691
15692 2002-03-29  Martin Baulig  <martin@gnome.org>
15693
15694         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15695         current location is not Null.
15696
15697         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15698         a separate method so we can profile it.
15699
15700         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15701         `span.Seconds' are just seconds, but no minutes or hours.
15702         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15703
15704 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15705
15706         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15707         Remove the gratuitous set of Final:
15708
15709                                 // If an interface implementation, then we can set Final.
15710                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15711                                     implementing.DeclaringType.IsInterface)
15712                                         flags |= MethodAttributes.Final;
15713
15714         I do not know what I was smoking when I used that.
15715
15716
15717         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15718         step into fixing the name resolution issues for delegates and
15719         unifying the toplevel name resolution.
15720
15721 2002-03-28  Martin Baulig  <martin@gnome.org>
15722
15723         * class.cs (Method.Emit): If we have a symbol writer, call its
15724         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15725         tell it about the current method.
15726
15727         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15728         writer that we're going to emit the first byte of IL code for a new
15729         statement (a new source line).
15730         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15731         EmitContext.Mark() before emitting any code.
15732
15733         * location.cs (SymbolDocument): Return null when we're Null.
15734
15735         * statement.cs (Statement): Moved the `Location loc' variable here.
15736         (Statement.EmitBoolExpression): If we have a symbol writer, call
15737         ec.Mark() before emitting any code to tell it that we're at the
15738         beginning of a new statement.
15739         (StatementExpression): Added `Location' argument to the constructor.
15740         (Block): Added public readonly variable `StartLocation' and public
15741         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15742         (Block): Added constructor which takes a start and end location.
15743         (Block.SetEndLocation): New method. This sets the end location.
15744         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15745         local variables we create.
15746         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15747         each statement and do also mark the begin and end of the block.
15748
15749         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15750         tell it the current lexer.Location, use Location.Null for the end of the
15751         block.
15752         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15753         current block, set its end location using SetEndLocation().
15754         (statement_expression): StatementExpression constructor now takes the
15755         lexer.Location as additional argument.
15756         (for_statement, declare_local_variables): Likewise.
15757         (declare_local_variables): When creating a new implicit block, use the
15758         new Block constructor and pass it the lexer.Location.
15759
15760 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15763         members also on the parent interfaces recursively.
15764
15765 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15766
15767         * report.cs: Use new formats, since Gonzalo finished the missing
15768         bits. 
15769
15770         * expression.cs (Binary.ResolveOperator): added missing operator|
15771         operator& and operator^ for bool/bool.
15772
15773         * cs-parser.jay: CheckDef now takes a Location argument that is
15774         used to report errors more precisly (instead of reporting the end
15775         of a definition, we try to track something which is a lot closer
15776         to the source of the problem).
15777
15778         * cs-tokenizer.cs: Track global token use, so we can properly flag
15779         the use of #define/#undef after the first token has been seen.
15780
15781         Also, rename the reportXXXX to Error_DescriptiveName
15782
15783         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15784         TypeContainer, so that Enum and Interface can use this too.
15785
15786         * class.cs (TypeContainer.LookupInterfaceOrClass,
15787         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15788         `builder' argument.  Typically this was used to pass the parent
15789         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15790         the definition).  
15791
15792         The problem is that a nested class could trigger the definition of
15793         a toplevel class, and the builder would be obviously wrong in that
15794         case. 
15795
15796         So we drop this argument, and we compute dynamically the
15797         TypeBuilder/ModuleBuilder (the correct information was available
15798         to us anyways from DeclSpace.Parent)
15799
15800         * interface.cs (Interface.DefineInterface): Drop builder
15801         parameter cleanup like class.cs
15802
15803         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15804         like class.cs
15805
15806         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15807         values. 
15808
15809         (Try.Emit): Propagate the returns value from the statement.
15810
15811         (Return.Emit): Even if we are leavning 
15812
15813         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15814
15815         * modifiers.cs: Fix the computation of MethodAttributes flags.
15816
15817 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15818
15819         * driver.cs: allow compilation of files that start with '/'.
15820         Add a default case when checking the argument of --target.
15821
15822 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15823
15824         * interface.cs: Implement the same search algorithm for types in
15825         the interface code.
15826
15827         * delegate.cs: Do not allow multiple definition.
15828
15829         * Recovered ChangeLog that got accidentally amputated
15830
15831         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15832
15833         * rootcontext.cs: Load manually enum to allow core classes to
15834         contain enumerations.
15835
15836         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15837         Update to new static methods in TypeManager.
15838
15839         * typemanager.cs (GetMethod, GetConstructor): Use our
15840         implementation of FindMembers to find the members, since during
15841         corlib compilation, the types are TypeBuilders and GetMethod and
15842         GetConstructor do not work.
15843
15844         Make all methods in TypeManager static.
15845
15846         (InitCodeHelpers): Split the functionality from
15847         the InitCodeTypes function.
15848
15849         * driver.cs: Call InitCodeHelpers after we have populated the
15850         types. 
15851
15852         * cs-parser.jay (delegate_declaration): we did not used to compute
15853         the delegate name correctly for void delegates.
15854
15855 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15856
15857         * rootcontext.cs (RootContext): Init the interface_resolve_order
15858         and type_container_resolve_order always.
15859
15860         (ResolveCore, BootstrapCorlib_ResolveClass,
15861         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15862         compiler when compiling with --nostdlib
15863
15864         * class.cs (TypeContainer.DefineType): Check that our parent is
15865         not null.  This test is most important when we are bootstraping
15866         the core types.
15867
15868         * codegen.cs: Split out the symbol writing code.
15869
15870 2002-03-25  Martin Baulig  <martin@gnome.org>
15871
15872         * driver.cs (-g): Made -g an alias for --debug.
15873
15874 2002-03-24  Martin Baulig  <martin@gnome.org>
15875
15876         * codegen.cs (SymbolWriter): New public variable. Returns the
15877         current symbol writer.
15878         (CodeGen): Added `bool want_debugging_support' argument to the
15879          constructor. If true, tell the ModuleBuild that we want debugging
15880         support and ask it for the ISymbolWriter.
15881         (Save): If we have a symbol writer, call it's Close() method after
15882         saving the assembly.
15883
15884         * driver.c (--debug): New command line argument to create a
15885         debugger information file.
15886
15887         * location.cs (SymbolDocument): New public property. Returns an
15888         ISymbolDocumentWriter object for the current source file or null
15889         if we don't have a symbol writer.
15890
15891 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15892
15893         * driver.cs (LoadAssembly): Correctly return when all the paths
15894         have been tried and not before.
15895
15896         * statement.cs (Switch.Emit): return the actual coverage for this
15897         statement (returns/not-returns)
15898
15899         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15900         switch of the statement if we are the last switch section.  That
15901         kills two problems: try/catch problems (we used to emit an empty
15902         nop at the end) and switch statements where all branches would
15903         return. 
15904
15905 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15906
15907         * driver.cs: Add default assemblies (the equivalent to the
15908         Microsoft CSC.RSP file)
15909
15910         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15911         also update tokens_seen and set it to false.
15912
15913         * driver.cs: Implement --recurse for Mike.
15914
15915         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15916         correctly splitting out the paths.
15917
15918 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15919
15920         * interface.cs (Interface.PopulateProperty): Instead of using
15921         `parent' as the declaration space for the set parameters, use
15922         `this' 
15923
15924         * support.cs (InternalParameters): InternalParameters constructor
15925         takes a DeclSpace instead of a TypeContainer.
15926
15927         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15928         types are being initialized, load the address of it before calling
15929         the function.  
15930
15931         (New): Provide a mechanism to disable the generation of local
15932         value type temporaries when the caller will be providing us with
15933         an address to store it.
15934
15935         (ArrayCreation.EmitDynamicInitializers): Use it.
15936
15937 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15938
15939         * expression.cs (Invocation.EmitArguments): Only probe for array
15940         property if there is more than one argument.  Sorry about that.
15941
15942         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15943         empty param arrays.
15944
15945         * class.cs (Method.LabelParameters): Fix incorrect code path that
15946         prevented the `ParamArrayAttribute' from being applied to the
15947         params attribute.
15948
15949 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * support.cs (ReflectionParameters): Correctly compute whether the
15952         last argument is a params array.  Fixes the problem with
15953         string.Split ('a')
15954
15955         * typemanager.cs: Make the assemblies array always be non-null
15956         (empty, but non-null)
15957
15958         * tree.cs (RecordDecl): New function that abstracts the recording
15959         of names.  This reports error 101, and provides a pointer to the
15960         previous declaration.  Fixes a crash in the compiler.
15961
15962         * cs-parser.jay (constructor_declaration): Update to new grammar,
15963         and provide a constructor_body that can be empty.
15964
15965 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15966
15967         * driver.cs: Add support for --resources.
15968
15969         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15970         Make all types for the various array helper methods be integer.
15971
15972         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15973         CheckState to ConvCast.
15974
15975         (ConvCast): Now it takes a `checked' state argument, to avoid
15976         depending on the emit context for the conversion, and just using
15977         the resolve time setting.
15978
15979         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15980         instead of Invocation.EmitArguments.  We do not emit the original
15981         arguments, instead we emit those which have been converted to
15982         unsigned int expressions.
15983
15984         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15985
15986         * codegen.cs: ditto.
15987
15988         * expression.cs (LocalVariableReference): Drop the use of the
15989         Store function that depended on the variable index.
15990
15991         * statement.cs (VariableInfo): Drop the `Idx' property from this
15992         class, as this is not taking into account the indexes for
15993         temporaries tat we generate during the execution, getting the
15994         indexes wrong.
15995
15996         * class.cs: First emit class initializers, then call the parent
15997         constructor. 
15998
15999         * expression.cs (Binary): Fix opcode emision.
16000         (UnaryMutator.EmitCode): Support checked code generation
16001
16002         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16003         matches for events for both the Static and Instance scans,
16004         pointing to the same element.   Fix that.
16005
16006 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16007
16008         * rootcontext.cs (ResolveTree): Always set the
16009         interface_resolve_order, because nested interfaces will be calling
16010         into us.
16011
16012         * class.cs (GetInterfaceOrClass): Track the same resolution
16013         process used by TypeManager.LookupType.  This fixes the nested
16014         type lookups in class declarations (separate path from
16015         LookupType). 
16016
16017         (TypeContainer.DefineType): Also define nested interfaces.
16018         (TypeContainer.RegisterOrder): New public function used to
16019         register the order in which child interfaces need to be closed.
16020
16021         Nested interfaces need to be closed after their parents have been
16022         created. 
16023
16024         * interface.cs (InterfaceAttr): Put all the logic for computing
16025         the interface attribute here. 
16026
16027         (DefineInterface): Register our interface order with the
16028         RootContext or with the TypeContainer depending on the case.
16029
16030 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16031
16032         * cs-parser.jay: rework foreach statement to work with the new
16033         changes to the policy on SimpleNames.
16034
16035         * report.cs: support Stacktrace on warnings as well.
16036
16037         * makefile: drop --unsafe and /unsafe from the compile.
16038
16039 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16040
16041         * ecore.cs (StandardConversionExists): Modify to take an Expression
16042         as the first parameter. Ensure we do null -> reference type conversion
16043         checking.
16044
16045         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16046         temporary Expression objects.
16047
16048 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16049
16050         * interface.cs: workaround bug in method overloading resolution
16051         (there is already a bugzilla bug for it).
16052
16053 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16054
16055         We could also solve this problem by having a separate path for
16056         performing type lookups, instead of DoResolve, we could have a
16057         ResolveType entry point, and only participating pieces of the
16058         production (simplename, deref, array) would implement this. 
16059
16060         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16061         signal SimpleName to only resolve type names and not attempt to
16062         resolve anything else.
16063
16064         * expression.cs (Cast): Set the flag.
16065
16066         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16067
16068         * class.cs: Only report 108 if there is no `new' modifier.
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-11  Miguel de Icaza  <miguel@ximian.com>
16078
16079         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16080         lookups here, instead of doing that at parse time.  This means
16081         that our grammar will not introduce `LocalVariableReferences' as
16082         expressions at this point.  That solves the problem of code like
16083         this:
16084
16085         class X {
16086            static void Main ()
16087            { int X = 1;
16088             { X x = null }}}
16089
16090         This is only half the fix.  The full fix requires parameters to
16091         also be handled in this way.
16092
16093         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16094         makes the use more obvious of the DeclSpace.  The
16095         ec.TypeContainer.TypeBuilder is now only used to pull the
16096         TypeBuilder for it.
16097
16098         My theory is that I can get rid of the TypeBuilder completely from
16099         the EmitContext, and have typecasts where it is used (from
16100         DeclSpace to where it matters).  
16101
16102         The only pending problem is that the code that implements Aliases
16103         is on TypeContainer, and probably should go in DeclSpace.
16104
16105         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16106         lookups here, instead of doing that at parse time.  This means
16107         that our grammar will not introduce `LocalVariableReferences' as
16108         expressions at this point.  That solves the problem of code like
16109         this:
16110
16111         class X {
16112            static void Main ()
16113            { int X = 1;
16114             { X x = null }}}
16115
16116         This is only half the fix.  The full fix requires parameters to
16117         also be handled in this way.
16118
16119         * class.cs (Property.DefineMethod): When implementing an interface
16120         method, set newslot, when implementing an abstract method, do not
16121         set the flag (before we tried never setting it, or always setting
16122         it, which is the difference).
16123         (Indexer.DefineMethod): same.
16124         (Method.DefineMethod): same.
16125
16126         * ecore.cs: Only set the status used flag if we get back a Field.
16127
16128         * attribute.cs: Temporary hack, so Paolo can keep working.
16129
16130 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16131
16132         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16133         the unmanaged type in the case we have a MarshalAs attribute.
16134
16135         (Resolve): Handle the case when we are parsing the special MarshalAs
16136         attribute [we need to store the unmanaged type to use later]
16137
16138         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16139         MarshalAs Attribute.
16140
16141         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16142         on parameters and accordingly set the marshalling info.
16143
16144 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16145
16146         * class.cs: Optimizing slightly by removing redundant code after
16147         we switched to the `NoTypes' return value.
16148         (Property.DefineMethod): use NoTypes here too.
16149
16150         This fixes the bug I introduced in my last batch of changes.
16151
16152 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16153
16154         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16155
16156         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16157         Enums since those are types too. 
16158
16159         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16160
16161         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16162         thanks to a call during the lookup process.
16163
16164 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16165
16166         * statement.cs (Foreach): Lots of work to accomodate a particular
16167         kind of foreach statement that I had not kept in mind.  It is
16168         possible to have foreachs on classes that provide a GetEnumerator
16169         method that return objects that implement the "pattern" for using
16170         a foreach, there is no need to support GetEnumerator
16171         specifically. 
16172
16173         This is needed to compile nant.
16174
16175         * decl.cs: Only report 114 if the member is not `Finalize' and if
16176         the warning level is at least 2.
16177
16178         * class.cs: Moved the compare function from Method to
16179         MethodSignature. 
16180
16181         (MethodSignature.InheritableMemberSignatureCompare): Add new
16182         filter function that is used to extract inheritable methods from a
16183         class. 
16184
16185         (Method.Define): Use the new `inheritable_method_signature_filter'
16186         delegate
16187
16188         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16189         command. 
16190
16191 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16192
16193         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16194
16195         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16196
16197         * expression.cs: Pass location information to
16198         ConvertImplicitStandard. 
16199
16200         * class.cs: Added debugging code to track return values from
16201         interfaces. 
16202
16203 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16204
16205         * expression.cs (Is.DoResolve): If either side of the `is' is an
16206         interface, do not flag the warning.
16207
16208         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16209         for interfaces
16210
16211         * report.cs: Allow for --fatal to be used with --probe.
16212
16213         * typemanager.cs (NoTypes): Move the definition for the empty Type
16214         array here. 
16215
16216         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16217         properties. 
16218         (TypeContainer.DefineProxy): New function used to proxy to parent
16219         implementations when implementing interfaces.
16220         (TypeContainer.ParentImplements): used to lookup if our parent
16221         implements a public function that is required by an interface.
16222         (TypeContainer.VerifyPendingMethods): Hook this up.
16223
16224         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16225         `modules' and `assemblies' arraylists into arrays.  We only grow
16226         these are the very early start up of the program, so this improves
16227         the speedof LookupType (nicely measured).
16228
16229         * expression.cs (MakeByteBlob): Replaced unsafe code with
16230         BitConverter, as suggested by Paolo.
16231
16232         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16233         folding of string concatenation, but if either side is a string,
16234         and the other is not, then return null, and let the runtime use
16235         the concatenation on the string plus the object (using
16236         `Object.ToString'). 
16237
16238 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16239
16240         Constant Folding has been implemented now.
16241
16242         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16243         the error instead on types that are not supported in one's
16244         complement. 
16245
16246         * constant.cs (Constant and all children): New set of functions to
16247         perform implict and explicit conversions.
16248
16249         * ecore.cs (EnumConstant): Implement the new functions to perform
16250         conversion by proxying to the child expression.
16251
16252         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16253         own separate setting that can not be turned off from the command
16254         line using --unchecked or --checked and is only controlled using
16255         the checked/unchecked statements and expressions.  This setting is
16256         used by the constant folder to flag errors.
16257
16258         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16259         ConstantCheckState as well.   
16260
16261         During Resolve, they also have to flag the state, because the
16262         constant folder runs completely in the Resolve phase.
16263
16264         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16265         well.
16266
16267 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16268
16269         * cfold.cs: New file, this file contains the constant folder.
16270
16271         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16272         argument to track whether we are using the resulting address to
16273         load or store a value and provide better error messages. 
16274
16275         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16276         new AddressOf arguments.
16277
16278         * statement.cs (Foreach.EmitCollectionForeach): Update
16279
16280         * expression.cs (Argument.Emit): Call AddressOf with proper
16281         arguments to track usage.
16282
16283         (New.DoEmit): Call AddressOf with new arguments.
16284
16285         (Unary.Emit): Adjust AddressOf call.
16286
16287 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16288
16289         * cs-parser.jay (member_access): Change the case for pre-defined types
16290         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16291         this suggestion.
16292
16293         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16294         a method body.
16295
16296         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16297         essentially like methods and apply attributes like MethodImplOptions to them too.
16298
16299         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16300         not being null.
16301
16302         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16303         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16304         is the DeclSpace.
16305
16306         * Update code everywhere accordingly.
16307
16308         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16309
16310         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16311
16312 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16313
16314         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16315         try performing lookups against those instead of jumping straight into using
16316         the 'using' clauses.
16317
16318         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16319
16320         (LookupType): Perform lookups in implicit parents too.
16321
16322         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16323         sequence as RootContext.LookupType. 
16324
16325         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16326         the various cases of namespace lookups into this method.
16327
16328 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16329
16330         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16331         in positional arguments)
16332
16333         * class.cs (Operator): Update the AllowedModifiers to contain
16334         extern. 
16335
16336         * cs-parser.jay: Update operator declaration to allow for the
16337         operator body to be empty.
16338
16339         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16340         values. 
16341
16342 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16343
16344         * class.cs (Method.Emit): Label parameters.
16345
16346         * driver.cs: Return 1 or 0 as the program exit code.
16347
16348 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16349
16350         * expression.cs: Special case the `null' object when trying to
16351         auto-compute the type, as anything can be explicitly converted to
16352         that. 
16353
16354         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16355         spotting this Paolo.
16356
16357         (Expression.ImplicitNumericConversion): Perform comparissions of
16358         the type using the underlying type in the case of an enumeration
16359         rather than using the enumeration type for the compare.
16360
16361         Cope with the underlying == type case, which is not possible to
16362         catch before. 
16363
16364         (Expression.ConvertNumericExplicit): Perform comparissions of
16365         the type using the underlying type in the case of an enumeration
16366         rather than using the enumeration type for the compare.
16367
16368         * driver.cs: If the user does not supply an extension, assume .exe
16369
16370         * cs-parser.jay (if_statement): Rewrote so that we can track the
16371         location for the if statement.
16372
16373         * expression.cs (Binary.ConstantFold): Only concat strings when
16374         the operation is "+", not everything ;-)
16375
16376         * statement.cs (Statement.EmitBoolExpression): Take a location
16377         argument. 
16378         (If, While, Do): Track location.
16379
16380         * expression.cs (Binary.ResolveOperator): In the object + string
16381         case, I was missing a call to ConvertImplicit
16382
16383 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16384
16385         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16386         Location arguments. Ensure we use RootContext.LookupType to do our work
16387         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16388
16389         * interface.cs (PopulateMethod): Handle the type of the parameter being
16390         null gracefully.
16391
16392         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16393         have a params method with no fixed arguments and a call is made with no
16394         arguments.
16395
16396 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16397
16398         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16399         the verbatim-string-literal
16400
16401         * support.cs (InternalParameters.ParameterModifier): handle null
16402         fixed parameters.
16403         (InternalParameters.ParameterType): ditto.
16404
16405         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16406         duplicating the name of the variable parameter.
16407         (GetParameterByName): Fix bug where we were not looking up array
16408         paramters if they were the only present (thanks Paolo!).
16409         (GetParameterInfo): We only have an empty set of types if both
16410         fixed and array are set to null.
16411         (GetParameterInfo-idx): Handle FixedParameter == null
16412
16413         * cs-parser.jay: Handle the case where there is no catch
16414         statements (missing null test).
16415
16416 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16417
16418         * driver.cs (MainDriver): Be conservative on our command line
16419         handling.
16420
16421         Catch DirectoryNotFoundException when calling GetFiles.
16422
16423         (SplitPathAndPattern): Used to split the input specification into
16424         a path and a pattern that we can feed to Directory.GetFiles.
16425
16426 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * statement.cs (Fixed): Implement the last case of the Fixed
16429         statement (string handling).
16430
16431         * expression.cs (StringPtr): New class used to return a char * to
16432         a string;  Used by the Fixed statement.
16433
16434         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16435
16436         * expression.cs (Binary.ResolveOperator): Remove redundant
16437         MemberLookup pn parent type.
16438         Optimize union call, we do not need a union if the types are the same.
16439         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16440         type.
16441
16442         Specialize the use of MemberLookup everywhere, instead of using
16443         the default settings. 
16444
16445         (StackAlloc): Implement stackalloc keyword.
16446
16447         * cs-parser.jay: Add rule to parse stackalloc.
16448
16449         * driver.cs: Handle /h, /help, /?
16450
16451         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16452         before we supported unsafe code.
16453
16454         * makefile: add --unsafe to the self compilation of mcs.
16455
16456 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * expression.cs (PointerArithmetic): New class that is used to
16459         perform pointer arithmetic.
16460         (Binary.Resolve): Handle pointer arithmetic
16461         Handle pointer comparission.
16462         (ArrayPtr): Utility expression class that is used to take the
16463         address of an array.
16464
16465         (ElementAccess): Implement array access for pointers
16466
16467         * statement.cs (Fixed): Implement fixed statement for arrays, we
16468         are missing one more case before we are done.
16469
16470         * expression.cs (Indirection): Implement EmitAssign and set the
16471         ExprClass to Variable.  This allows pointer dereferences to be
16472         treated as variables, and to have values assigned to them.
16473
16474         * ecore.cs (Expression.StoreFromPtr): New utility function to
16475         store values dereferencing.
16476
16477 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16478
16479         * expression.cs (Binary.ResolveOperator): Ensure that we are
16480         not trying to operate on a void type - this fixes the reported
16481         bug.
16482
16483         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16484         the parent implementation is sealed.
16485
16486         * ../errors/cs0239.cs : Add.
16487
16488         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16489
16490         * typemanager.cs (unverifiable_code_type): Corresponds to 
16491         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16492         which have unsafe code in them.
16493
16494         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16495         unsafe context.
16496
16497 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16498
16499         * cs-tokenizer.cs: Add support for @"litreal strings"
16500
16501         Make tokenizer accept pre-processor directives
16502         on any column (remove the old C-like limitation). 
16503
16504         * rootcontext.cs (EmitCode): Emit any global attributes.
16505         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16506
16507         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16508
16509         * cs-parser.jay: Add support for global attributes.  
16510
16511 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16512
16513         * expression.cs (Indirection): New helper class.  Unary will
16514         create Indirection classes to be able to implement the
16515         IMemoryLocation interface on it.
16516
16517 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16518
16519         * cs-parser.jay (fixed_statement): reference the right statement.
16520
16521         * statement.cs (Fixed.Emit): Finish implementing the fixed
16522         statement for the &x case.
16523
16524 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * class.cs (Property.Define, Method.Define): Remove newslot when
16527         `implementing'.  
16528
16529         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16530         wrong.  NewSlot should only be used if the `new' keyword is present.
16531
16532         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16533         locating our system dir.  Sorry about this.
16534
16535 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16536
16537         * driver.cs (GetSystemDir): Compute correctly the location of our
16538         system assemblies.  I was using the compiler directory instead of
16539         the library directory.
16540
16541 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16542
16543         * expression.cs (BetterFunction): Put back in what Miguel commented out
16544         since it is the correct fix. The problem is elsewhere ;-)
16545
16546         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16547         parameters of the parms method are themselves compatible or not !
16548
16549         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16550         to check that a class implements an interface before saying that an implicit
16551         conversion was allowed. Use ImplementsInterface to do the checking.
16552
16553 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16554
16555         * class.cs (Method.Define): Track whether we are an explicit
16556         implementation or not.  And only call DefineMethodOverride if we
16557         are an explicit implementation.
16558
16559         (Property.DefineMethod): Ditto.
16560
16561 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16562
16563         * expression.cs (BetterFunction): Catch hideous bug which was
16564          preventing us from detecting ambiguous calls due to implicit casts i.e
16565         cs0121.
16566
16567 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16568
16569         * support.cs (Pair): Remove un-needed method.  I figured why I was
16570         getting the error in cs-parser.jay, the variable in a foreach loop
16571         is readonly, and the compiler does not really treat this as a variable.
16572
16573         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16574         instead of EQUALS in grammar.  
16575
16576         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16577
16578         * expression.cs (Unary.DoResolve): Check whether the argument is
16579         managed or not.
16580
16581 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16582
16583         * support.cs: Api for Pair to set a value.  Despite the fact that
16584         the variables are public the MS C# compiler refuses to compile
16585         code that accesses the field if the variable is part of a foreach
16586         statement. 
16587
16588         * statement.cs (Fixed): Begin implementation of the fixed
16589         statement.
16590
16591         (Block.AddVariable): Return the VariableInfo on success and null
16592         on failure instead of true/false. 
16593
16594         * cs-parser.jay (foreach): Catch errors on variables already
16595         defined (we were ignoring this value before) and properly unwind
16596         the block hierarchy
16597
16598         (fixed_statement): grammar for the fixed statement.
16599
16600 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16601
16602         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16603         pointer types to be incretemented.
16604
16605         (SizeOf): Implement.
16606
16607         * cs-parser.jay (pointer_member_access): Implement
16608         expr->IDENTIFIER production.
16609
16610         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16611         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16612         on safe contexts.
16613
16614         (Unary): Implement indirection.
16615
16616         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16617         use in non-unsafe context).
16618
16619         (SimpleName.DoResolve): Check for pointers in field access on safe
16620         contexts. 
16621
16622         (Expression.LoadFromPtr): Factor the load-indirect code in this
16623         function.  This was duplicated in UnboxCast and ParameterReference
16624
16625 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16626
16627         * expression.cs (ComposedCast): report an error if a pointer cast
16628         is used in a safe region.
16629
16630         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16631         pointer type casts in unsafe context.
16632
16633         * codegen.cs (EmitContext): Set up IsUnsafe.
16634
16635         * cs-parser.jay (non_expression_type): Add productions for pointer
16636         casts. 
16637
16638         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16639         code.  We should not use force into static mode if the method is
16640         not virtual.  Fixes bug in MIS
16641
16642         * statement.cs (Do.Emit, While.Emit, For.Emit,
16643         Statement.EmitBoolExpression): Add support to Do and While to
16644         propagate infinite loop as `I do return' semantics.
16645
16646         Improve the For case to also test for boolean constants.
16647
16648         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16649         to the list of attributes we can add.
16650
16651         Remove `EmitContext' argument.
16652
16653         * class.cs (Method.Define): Apply parameter attributes.
16654         (Constructor.Define): Apply parameter attributes.
16655         (MethodCore.LabelParameters): Move here the core of labeling
16656         parameters. 
16657
16658         * support.cs (ReflectionParameters.ParameterModifier,
16659         InternalParameters.ParameterModifier): Use IsByRef on the type and
16660         only return the OUT bit for these parameters instead of in/out/ref
16661         flags.
16662
16663         This is because I miss-understood things.  The ParameterInfo.IsIn
16664         and IsOut represent whether the parameter has the [In] and [Out]
16665         attributes set.  
16666
16667 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * ecore.cs (FieldExpr.Emit): Release temporaries.
16670
16671         * assign.cs (LocalTemporary.Release): new function.
16672
16673         * codegen.cs (EmitContext.GetTemporaryStorage,
16674         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16675         temporary storage.  Now we can "put back" localbuilders when we
16676         are done with them
16677
16678 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16681         need to make a copy of the variable to generate verifiable code.
16682
16683 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16684
16685         * driver.cs: Compute dynamically the system directory.
16686
16687         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16688         Slower, but more generally useful.  Used by the abstract
16689         registering implementation. 
16690
16691         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16692         the rules for the special rule on Type/instances.  First check if
16693         we have the same name, and if so, try that special static path
16694         rather than the instance path.
16695
16696 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16697
16698         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16699         for, while and if.
16700
16701         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16702         Enum, ValueType, Delegate or Array for non-corlib compiles.
16703
16704         * cs-tokenizer.cs: Catch long identifiers (645)
16705
16706         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16707         piece of code.
16708
16709         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16710         fix, we were returning too early, so we were not registering
16711         pending methods from abstract classes.
16712
16713         Do not register pending methods if the class is abstract.
16714
16715         * expression.cs (Conditional.DoResolve): Report circular implicit
16716         conversions when we neecd to compute it for conditional
16717         expressions. 
16718
16719         (Is.DoResolve): If the expression is always of the provided type,
16720         flag warning 183.  If the expression can not ever be of the
16721         provided type flag warning 184.
16722
16723         * class.cs: Catch 169 as well.
16724
16725         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16726         read. 
16727
16728 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16729
16730         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16731
16732 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16733
16734         * interface.cs: (PopulateMethod): Check for pointers being defined
16735         only if the unsafe context is active.
16736         (PopulateProperty): ditto.
16737         (PopulateIndexer): ditto.
16738
16739         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16740         specified.  If pointers are present, make sure that they are
16741         present in an unsafe context.
16742         (Constructor, Constructor.Define): ditto.
16743         (Field, Field.Define): ditto.
16744         (Property, Property.Define): ditto.
16745         (Event, Event.Define): ditto.
16746
16747         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16748         hashtable if there are classes or structs defined.
16749
16750         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16751         code, as the constant resolution moved.
16752
16753         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16754         the metadata, so we can flag error 133. 
16755
16756         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16757         pointer is being declared in an unsafe context.
16758
16759 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16760
16761         * modifiers.cs (Modifiers.Check): Require a Location argument.
16762         Report error 227 for Unsafe use.
16763
16764         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16765
16766         * statement.cs (For.Emit): If the test is null, then report that
16767         we do `return', as we wont reach anything afterwards.
16768
16769         (Switch.SwitchGoverningType): Track the expression that matched
16770         the conversion.
16771
16772         * driver.cs: Allow negative numbers as an error code to flag.
16773
16774         * cs-parser.jay: Handle 1551.
16775
16776         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16777
16778 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * cs-parser.jay: Report 1518 (type declaration can only contain
16781         class, struct, interface, enum or delegate)
16782
16783         (switch_label): Report 1523 (keywords `case' or `default' must
16784         preced code)
16785
16786         (opt_switch_sections): Report 1522 (empty switch)
16787
16788         * driver.cs: Report 1515 (response file specified multiple times)
16789         Report 1516 (Source file specified multiple times).
16790
16791         * expression.cs (Argument.Resolve): Signal 1510
16792
16793         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16794         access not allowed in static code)
16795
16796 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16797
16798         * typemanager.cs (IsPointerType): Utility method which we are going
16799         to need a lot.
16800
16801         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16802         the object type, so we take care of that.
16803
16804         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16805
16806         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16807         added to non-params parameters :-)
16808
16809         * typemanager.cs (CSharpName): Include 'void' type too. 
16810
16811         (void_ptr_type): Include in the set of core types.
16812
16813         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16814         duplicating code.
16815
16816         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16817         an unsafe context.
16818
16819         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16820         completely forgotten about it.
16821
16822 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16823
16824         * cs-parser.jay (pointer_type): Add. This begins our implementation
16825         of parsing rules for unsafe code.
16826
16827         (unsafe_statement): Implement.
16828
16829         (embedded_statement): Modify to include the above.
16830
16831         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16832
16833         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16834         if the current context is an unsafe one.
16835
16836         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16837         are handled differently, we need separate rules for them.
16838
16839         (local_variable_declaration): Update to use local_variable_pointer_type
16840         to allow variable declarations of unmanaged pointer types.
16841
16842         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16843         in unsafe contexts.
16844
16845         * ../errors/cs0214.cs : Add.
16846
16847 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16848
16849         * makefile: remove 'response' file when cleaning.
16850
16851 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16852
16853         * cs-parser.jay: Report 1524.
16854
16855 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16856
16857         * typemanager.cs (RegisterMethod): drop checking if we have
16858         registered this from here
16859
16860 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16861
16862         * class.cs (Method.EmitDestructor): Implement calling our base
16863         destructor. 
16864
16865         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16866         value of InFinally.
16867
16868         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16869         this routine and will wrap the call in a try/catch block.  Deal
16870         with the case.
16871
16872 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * ecore.cs (Expression.MemberLookup): instead of taking a
16875         parameter `same_type' that was used to tell whether we could
16876         access private members we compute our containing type from the
16877         EmitContext.
16878
16879         (FieldExpr): Added partial support for volatile fields.  This does
16880         not work for volatile fields exposed from assemblies, as I can not
16881         figure out how to extract the modreq from it.
16882
16883         Updated all the source files to use this.
16884
16885         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16886         because it is referenced by MemberLookup very often. 
16887
16888 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16889
16890         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16891         TypeBuilder.GetCustomAttributes to retrieve what we need.
16892
16893         Get rid of redundant default_member_attr_type as this is the same as
16894         default_member_type which already exists.
16895
16896         * interface.cs, attribute.cs : Update accordingly.
16897
16898 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16899
16900         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16901         work for TYpeBuilders though.  Ravi, can you please fix this?
16902
16903         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16904
16905         * expression.cs (Argument.Emit): Handle the case of ref objects
16906         being passed to ref functions;  
16907
16908         (ParameterReference.EmitLoad): Loads the content of the pointer
16909         without dereferencing.
16910
16911 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16912
16913         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16914
16915 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16916
16917         * class.cs (Indexer.DefineMethod): Incorporate the interface
16918         type in the name of the method if we are doing explicit interface
16919         implementation.
16920
16921         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16922
16923         (BetterConversion): Fix extremely trivial bug where we were referring to
16924         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16925         again !
16926
16927         * ../errors/bug16.cs : Add although we have fixed it.
16928
16929 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16930
16931         * expression.cs (BaseIndexer): Begin implementation.
16932
16933         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16934
16935         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16936         production directly to remove a shift/reduce, and implement
16937         explicit interface implementation.
16938
16939         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16940         after a floating point suffix.
16941
16942         * expression.cs (DoNumericPromotions): Improved the conversion for
16943         uint/uint.  If we have a constant, we avoid doing a typecast to a
16944         larger type.
16945
16946         * class.cs (Indexer): Implement explicit interface implementation
16947         for indexers.
16948
16949 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16950
16951         * class.cs: make the default instance constructor public and hidebysig.
16952
16953 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16954
16955         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16956         so we can call it from elsewhere.
16957
16958         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16959         we emit it internally if the class has a defined indexer; otherwise the user
16960         emits it by decorating the class definition with the DefaultMemberAttribute.
16961
16962         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16963         attribute is not used on a type which defines an indexer.
16964
16965         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16966         character when we skip whitespace.
16967
16968         * ../errors/cs0646.cs : Add.
16969
16970 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16971
16972         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16973         again. 
16974
16975         * makefile: Add practical target `mcs3.exe' which builds the third
16976         generation compiler. 
16977
16978         * expression.cs (New): Fix structures constructor calling.
16979
16980         * class.cs (Property, Method, Indexer): Emit Final flag on the
16981         method if we are an interface implementation and we are not
16982         abstract. 
16983
16984         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16985         whether this property is referencing a `base' method.
16986
16987         * expression.cs (Invocation.EmitCall): take an extra argument:
16988         is_base, this is used to determine whether the `call' or
16989         `callvirt' opcode should be used.
16990
16991
16992         * delegate.cs: update EmitCall.
16993
16994         * class.cs (Method.Define): Set NewSlot for the cases where we are
16995         not implementing an interface method.
16996
16997         (Property.Define): ditto.
16998
16999 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17000
17001         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17002         'r'.  Allows mcs to parse itself fully.
17003
17004 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17005
17006         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17007         of the number of initializers that require the InitializeArray method.
17008
17009         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17010         update the above field where necessary.
17011
17012         (MakeByteBlob): Update accordingly.
17013
17014         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17015         greater than 2.
17016
17017         (EmitDynamicInitializers): Update in accordance with the new optimization.
17018
17019         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17020         same OpCode applies.
17021
17022         * cs-parser.jay : Fix some glaring errors I introduced.
17023
17024 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17025
17026         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17027         so that we can check for name clashes there too.
17028
17029         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17030         for interface indexers.
17031
17032         * interfaces.cs (Define): Emit the default member attribute.
17033
17034         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17035         variable was being referred to while setting the value ;-)
17036
17037 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17040         byte-by-byte information when we know the data is zero.
17041
17042         Make the block always a multiple of 4, because
17043         DefineInitializedData has a bug.
17044
17045         * assign.cs: Fix, we should assign from the temporary, not from
17046         the source. 
17047
17048         * expression.cs (MakeByteBlob): Fix my incorrect code.
17049
17050 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17051
17052         * typemanager.cs (EnumToUnderlying): This function is used to get
17053         the underlying type from an enumeration, because it does not
17054         always work. 
17055
17056         * constant.cs: Use the I4_S form for values between -128 and 127.
17057
17058         * statement.cs (Block.LookupLabel): Looks up a label.
17059         (Block): Drop support for labeled blocks.
17060
17061         (LabeledStatement): New kind of statement that represents a label
17062         only.
17063
17064         (Goto): Finally implement this bad boy.
17065
17066         * cs-parser.jay: Update to reflect new mechanism to implement
17067         labels.
17068
17069 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17070
17071         * codegen.cs (EmitContext.This): a codegen property that keeps the
17072         a single instance of this instead of creating many different this
17073         instances. 
17074
17075         * delegate.cs (Delegate.DoResolve): Update to use the property;
17076
17077         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17078
17079         * expression.cs (BaseAccess.DoResolve): Ditto.
17080
17081 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17082
17083         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17084         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17085
17086         (InitCoreTypes): Update accordingly.
17087
17088         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17089         so we can quickly store the state.
17090
17091         (ApplyAttributes): Set the correct implementation flags
17092         for InternalCall methods.
17093
17094 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17095
17096         * expression.cs (EmitCall): if a method is not virtual, then do
17097         not use callvirt on it.
17098
17099         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17100         user defined stuff) requires the use of stobj, which takes an
17101         address on the stack instead of an array and an index.  So emit
17102         the Ldelema operation for it.
17103
17104         (EmitStoreOpcode): Use stobj for valuetypes.
17105
17106         (UnaryMutator.EmitCode): Use the right 1 value depending on
17107         whether we are dealing with int64/uint64, float or doubles.
17108
17109         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17110         constructors that I implemented last night.
17111
17112         (Constructor.IsDefault): Fix to work properly for static
17113         constructors.
17114
17115         * cs-parser.jay (CheckDef): report method signature errors.
17116         Update error number 103 to be 132.
17117
17118         * decl.cs: New AdditionResult enumeration value: MethodExists.
17119         Although we do this check for methods later on in the semantic
17120         analysis, catching repeated default constructors is so easy that
17121         we catch these here. 
17122
17123         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17124         promotions code.
17125
17126         (ParameterReference.EmitAssign, Emit): handle
17127         bools as bytes.
17128
17129         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17130         (ArrayAccess.EmitStoreOpcode): ditto.
17131
17132         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17133
17134         * expression.cs (MakeByteBlob): Complete all the missing types
17135         (uint, short, ushort, byte, sbyte)
17136
17137         * class.cs: Only init instance field initializers on instance
17138         constructors. 
17139
17140         Rename `constructors' to instance_constructors. 
17141
17142         (TypeContainer.AddConstructor): Only add constructors to the list
17143         if it is not static.
17144
17145         Make sure that we handle default_static_constructor independently
17146         everywhere where we handle instance_constructors
17147
17148 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * class.cs: Do not lookup or create a base initializer for a
17151         static constructor.
17152
17153         (ConstructorInitializer.Resolve): use the proper type to lookup
17154         for constructors.
17155
17156         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17157
17158         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17159         in DeclSpace. 
17160
17161         * decl.cs: CloseType is now an virtual method, the default
17162         implementation just closes this type.
17163
17164 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17165
17166         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17167         to PreserveSig by default. Also emit HideBySig on such methods.
17168
17169         Basically, set the defaults to standard values.
17170
17171         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17172         argument, if candidate is better, it can't be worse than the best !
17173
17174         (Invocation): Re-write bits to differentiate between methods being
17175         applicable in their expanded form and their normal form - for params
17176         methods of course.
17177
17178         Get rid of use_standard everywhere as only standard conversions are allowed
17179         in overload resolution. 
17180
17181         More spec conformance.
17182
17183 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17184
17185         * driver.cs: Add --timestamp, to see where the compiler spends
17186         most of its time.
17187
17188         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17189         `this' in static code.
17190
17191         (SimpleName.DoResolve): Implement in terms of a helper function
17192         that allows static-references to be passed upstream to
17193         MemberAccess.
17194
17195         (Expression.ResolveWithSimpleName): Resolve specially simple
17196         names when called by MemberAccess to implement the special
17197         semantics. 
17198
17199         (Expression.ImplicitReferenceConversion): Handle conversions from
17200         Null to reference types before others, as Null's type is
17201         System.Object. 
17202
17203         * expression.cs (Invocation.EmitCall): Handle the special case of
17204         calling methods declared on a reference type from a ValueType
17205         (Base classes System.Object and System.Enum)
17206
17207         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17208         the left hand side is a TypeExpr, not on every enumeration. 
17209
17210         (Binary.Resolve): If types are reference types, then do a cast to
17211         object on operators != and == of both arguments.
17212
17213         * typemanager.cs (FindMembers): Extract instance and static
17214         members if requested.
17215
17216         * interface.cs (PopulateProperty): Use void_type instead of null
17217         as the return type for the setter method.
17218
17219         (PopulateIndexer): ditto.
17220
17221 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17222
17223         * support.cs (ReflectionParameters): Fix minor bug where we
17224         were examining the wrong parameter for the ParamArray attribute.
17225
17226         Cope with requests for the type of the parameter at position
17227         greater than the params parameter's. We now return the element
17228         type of the params array as that makes more sense.
17229
17230         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17231         accordingly as we no longer have to extract the element type
17232         ourselves.
17233
17234         (Invocation.OverloadResolve): Update.
17235
17236 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17239         against IEnumerator, test whether the return value is a descendant
17240         of the IEnumerator interface.
17241
17242         * class.cs (Indexer.Define): Use an auxiliary method to implement
17243         the other bits of the method definition.  Begin support for
17244         explicit interface implementation.
17245
17246         (Property.DefineMethod): Use TypeManager.void_type instead of null
17247         for an empty return value.
17248
17249 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17250
17251         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17252         dealing with a FieldExpr which is composed of a FieldBuilder, in
17253         the code path we did extract the constant, but we should have
17254         obtained the underlying value to be able to cast it (otherwise we
17255         end up in an infinite loop, this is what Ravi was running into).
17256
17257         (ArrayCreation.UpdateIndices): Arrays might be empty.
17258
17259         (MemberAccess.ResolveMemberAccess): Add support for section
17260         14.5.4.1 that deals with the special case of E.I when E is a type
17261         and something else, that I can be a reference to a static member.
17262
17263         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17264         handle a particular array type to create byte blobs, it is just
17265         something we dont generate byteblobs for.
17266
17267         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17268         arguments. 
17269
17270         * location.cs (Push): remove the key from the hashtable that we
17271         are about to add.   This happens for empty files.
17272
17273         * driver.cs: Dispose files after we have parsed them.
17274
17275         (tokenize): new function that only runs the tokenizer on its
17276         input, for speed testing.
17277
17278 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17279
17280         * class.cs (Event.Define): Define the private field only if there
17281         are no accessors defined.
17282
17283         * expression.cs (ResolveMemberAccess): If there is no associated
17284         field with the event, that means we have an event defined with its
17285         own accessors and we should flag error cs0070 since transforming
17286         ourselves into a field is not valid in that case.
17287
17288         * ecore.cs (SimpleName.DoResolve): Same as above.
17289
17290         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17291         and charset to sane values.
17292
17293 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17294
17295         * assign.cs (DoResolve): Perform check on events only if they 
17296         are being accessed outside the declaring type.
17297
17298         * cs-parser.jay (event_declarations): Update rules to correctly
17299         set the type of the implicit parameter etc.
17300
17301         (add_accessor, remove_accessor): Set current local parameters.
17302
17303         * expression.cs (Binary): For delegate addition and subtraction,
17304         cast the return value from the method into the appropriate delegate
17305         type.
17306
17307 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17308
17309         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17310         of these as the workaround is unnecessary.
17311
17312         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17313         delegate data - none of that is needed at all.
17314
17315         Re-write bits to extract the instance expression and the delegate method
17316         correctly.
17317
17318         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17319         on delegates too.
17320
17321         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17322         of attaching attributes instead of duplicating code everywhere.
17323
17324         * everywhere : Update code to do attribute emission using the above method.
17325
17326 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17327
17328         * expression.cs (IsParamsMethodApplicable): if there are not
17329         parameters, return immediately.
17330
17331         * ecore.cs: The 0 literal can be implicity converted to an enum
17332         type. 
17333
17334         (SimpleName.DoResolve): First lookup the type, then lookup the
17335         members. 
17336
17337         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17338         want to get its address.  If the InstanceExpression is not
17339         addressable, store the result in a temporary variable, then get
17340         the address of it.
17341
17342         * codegen.cs: Only display 219 errors on warning level or above. 
17343
17344         * expression.cs (ArrayAccess): Make it implement the
17345         IMemoryLocation interface.
17346
17347         (Binary.DoResolve): handle the operator == (object a, object b)
17348         and operator != (object a, object b) without incurring into a
17349         BoxedCast (because 5 != o should never be performed).
17350
17351         Handle binary enumerator operators.
17352
17353         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17354         value type, otherwise use Ldelem_ref.
17355
17356         Use precomputed names;
17357
17358         (AddressOf): Implement address of
17359
17360         * cs-parser.jay (labeled_statement): Fix recursive block
17361         addition by reworking the production.
17362
17363         * expression.cs (New.DoEmit): New has a special case:
17364                 
17365                  If we are dealing with a ValueType, we have a few
17366                  situations to deal with:
17367                 
17368                     * The target of New is a ValueType variable, that is
17369                       easy, we just pass this as the variable reference
17370                 
17371                     * The target of New is being passed as an argument,
17372                       to a boxing operation or a function that takes a
17373                       ValueType.
17374                 
17375                       In this case, we need to create a temporary variable
17376                       that is the argument of New.
17377
17378
17379 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17380
17381         * rootcontext.cs (LookupType): Check that current_type is not null before
17382         going about looking at nested types.
17383
17384         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17385         not implement the IAssignMethod interface any more.
17386
17387         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17388         where we tranform them into FieldExprs if they are being resolved from within
17389         the declaring type.
17390
17391         * ecore.cs (SimpleName.DoResolve): Do the same here.
17392
17393         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17394
17395         * ../errors/bug10.cs : Add.
17396
17397         * ../errors/cs0070.cs : Add.
17398
17399         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17400
17401         * assign.cs : Get rid of EventIsLocal everywhere.
17402
17403 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17404
17405         * ecore.cs (ConvertIntLiteral): finished the implementation.
17406
17407         * statement.cs (SwitchLabel): Convert the value we are using as a
17408         key before looking up the table.
17409
17410 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17411
17412         * codegen.cs (EmitTopBlock): Require a Location argument now.
17413
17414         * cs-parser.jay (constructor_declarator): We need to setup
17415         current_local_parameters before we parse the
17416         opt_constructor_initializer, to allow the variables to be bound
17417         to the constructor arguments.
17418
17419         * rootcontext.cs (LookupType): First lookup nested classes in our
17420         class and our parents before we go looking outside our class.
17421
17422         * expression.cs (ConstantFold): Extract/debox the values at the
17423         beginnning. 
17424
17425         * rootcontext.cs (EmitCode): Resolve the constants first before we
17426         resolve the types.  This is not really needed, but it helps debugging.
17427
17428         * statement.cs: report location.
17429
17430         * cs-parser.jay: pass location to throw statement.
17431
17432         * driver.cs: Small bug fix.
17433
17434         * report.cs: Updated format to be 4-zero filled digits.
17435
17436 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17437
17438         * expression.cs (CheckIndices): Fix minor bug where the wrong
17439         variable was being referred to ;-)
17440
17441         (DoEmit): Do not call EmitStaticInitializers when the 
17442         underlying type is System.Object.
17443
17444 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17445
17446         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17447         and do the usual workaround for SRE.
17448
17449         * class.cs (MyEventBuilder.EventType): New member to get at the type
17450         of the event, quickly.
17451
17452         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17453
17454         * assign.cs (Assign.DoResolve): Handle the case when the target
17455         is an EventExpr and perform the necessary checks.
17456
17457         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17458         interface.
17459
17460         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17461
17462         (EventExpr): Set the type in the constructor itself since we 
17463         are meant to be born fully resolved.
17464
17465         (EventExpr.Define): Revert code I wrote earlier.
17466                 
17467         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17468         instance expression is null. The instance expression is a This in that case
17469         or a null, depending on whether it is a static method or not.
17470
17471         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17472         refers to more than one method.
17473
17474         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17475         and accordingly flag errors.
17476
17477 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17478
17479         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17480
17481 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17482
17483         * location.cs (ToString): Provide useful rutine.
17484
17485 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17486
17487         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17488         objects, return the actual integral boxed.
17489
17490         * statement.cs (SwitchLabel): define an ILLabel for each
17491         SwitchLabel. 
17492
17493         (Switch.CheckSwitch): If the value is a Literal, extract
17494         the underlying literal.
17495
17496         Also in the unused hashtable we had, add the SwitchLabel so we can
17497         quickly look this value up.
17498
17499         * constant.cs: Implement a bunch of new constants.  Rewrite
17500         Literal based on this.  Made changes everywhere to adapt to this.
17501
17502         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17503         dereferencing array only once, and also copes with enumrations.
17504
17505         bytes are two bytes wide, not one.
17506
17507         (Cast): Perform constant conversions.
17508
17509         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17510         wrappers to the literals here.
17511
17512         * expression.cs (DoNumericPromotions): long literals can converted
17513         to ulong implicity (this is taken care of elsewhere, but I was
17514         missing this spot).
17515
17516         * ecore.cs (Expression.Literalize): Make the return type Literal,
17517         to improve type checking.
17518
17519         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17520
17521 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17522
17523         * literal.cs: Revert code from ravi that checked the bounds.  The
17524         bounds are sane by the definition of the type itself. 
17525
17526         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17527         need to actually look up in our parent hierarchy for interfaces
17528         implemented. 
17529
17530         * const.cs: Use the underlying type for enumerations
17531
17532         * delegate.cs: Compute the basename for the delegate creation,
17533         that should fix the delegate test case, and restore the correct
17534         Type Lookup semantics in rootcontext
17535
17536         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17537         referencing a nested type with the Reflection API is using the "+"
17538         sign. 
17539
17540         * cs-parser.jay: Do not require EOF token at the end.
17541
17542 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17543
17544         * rootcontext.cs (LookupType): Concatenate type names with
17545         a '.' instead of a '+' The test suite passes again.
17546
17547         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17548         field of the enumeration.
17549
17550         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17551         the case when the member is an EventExpr.
17552
17553         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17554         static has an associated instance expression.
17555
17556         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17557
17558         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17559
17560         * class.cs (Event.Define): Register event and perform appropriate checks
17561         for error #111.
17562
17563         We define the Add and Remove methods even if the use provides none because
17564         in that case, we provide default implementations ourselves.
17565
17566         Define a private field of the type of the event. This is done by the CSC compiler
17567         and we should be doing it too ;-)
17568
17569         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17570         More methods we use in code we generate.
17571
17572         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17573         is important.
17574
17575         (InitCoreTypes): Update accordingly for the above.
17576
17577         * class.cs (Event.Emit): Generate code for default accessors that we provide
17578
17579         (EmitDefaultMethod): Do the job in the above.
17580
17581         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17582         appropriate place.
17583
17584 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17585
17586         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17587         builders even if we were missing one.
17588
17589         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17590         pass the Basename as our class name instead of the Name.  The
17591         basename will be correctly composed for us.
17592
17593         * parameter.cs (Paramters): Now takes a Location argument.
17594
17595         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17596         make all the code call directly LookupType in RootContext and take
17597         this chance to pass the Location information everywhere.
17598
17599         * Everywhere: pass Location information.
17600
17601 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17602
17603         * class.cs (Constructor.Define): Updated way of detecting the
17604         length of the parameters.
17605
17606         (TypeContainer.DefineType): Use basename as the type name for
17607         nested types.
17608
17609         (TypeContainer.Define): Do not recursively define types here, as
17610         definition is taken care in order by the RootContext.
17611
17612         * tree.cs: Keep track of namespaces in a per-file basis.
17613
17614         * parameter.cs (Parameter.ComputeSignature): Update to use
17615         DeclSpace. 
17616
17617         (Parameters.GetSignature): ditto.
17618
17619         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17620         instead of a TypeContainer.
17621
17622         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17623         resolve names.  Because we need to be resolve in our context, not
17624         our parents.
17625
17626         * driver.cs: Implement response files.
17627
17628         * class.cs (TypeContainer.DefineType): If we are defined, do not
17629         redefine ourselves.
17630
17631         (Event.Emit): Emit the code for add/remove handlers.
17632         (Event.Define): Save the MethodBuilders for add/remove.
17633
17634         * typemanager.cs: Use pair here too.
17635
17636         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17637         DictionaryEntry requires the first argument to be non-null.  
17638
17639         (enum_declaration): Compute full name for registering the
17640         enumeration.
17641
17642         (delegate_declaration): Instead of using
17643         formal_parameter_list, use opt_formal_parameter_list as the list
17644         can be empty.
17645
17646         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17647         (EventParsing): New property that controls whether `add' and
17648         `remove' are returned as tokens or identifiers (for events);
17649
17650 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17651
17652         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17653         use MyEventBuilder only and let it wrap the real builder for us.
17654
17655         (MyEventBuilder): Revamp constructor etc.
17656
17657         Implement all operations that we perform on EventBuilder in precisely the same
17658         way here too.
17659
17660         (FindMembers): Update to use the EventBuilder member.
17661
17662         (Event.Emit): Update accordingly.
17663
17664 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17665
17666         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17667         by calling the appropriate methods.
17668
17669         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17670         useful.
17671
17672         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17673
17674 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17675
17676         * delegate.cs (Delegate.Populate): Check that the return type
17677         and various parameters types are indeed accessible.
17678
17679         * class.cs (Constructor.Define): Same here.
17680
17681         (Field.Define): Ditto.
17682
17683         (Event.Define): Ditto.
17684
17685         (Operator.Define): Check that the underlying Method defined itself
17686         correctly - so it's MethodBuilder should not be null.
17687
17688         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17689         expression happens to be null.
17690
17691         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17692         members but as of now we don't seem to be able to do anything really useful with it.
17693
17694         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17695         not the EventBuilder.
17696
17697 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17698
17699         * cs-tokenizer.cs: Add support for defines.
17700         Add support for #if, #elif, #else, #endif
17701
17702         (eval_var): evaluates a variable.
17703         (eval): stubbed for evaluating functions.
17704
17705         * cs-parser.jay: Pass the defines information
17706
17707         * driver.cs: Add --define command line option.
17708
17709         * decl.cs: Move MemberCore here.
17710
17711         Make it the base class for DeclSpace.  This allows us to catch and
17712         report 108 and 109 for everything now.
17713
17714         * class.cs (TypeContainer.Define): Extract all the members
17715         before populating and emit the warning 108 (new keyword required
17716         to override) instead of having each member implement this.
17717
17718         (MemberCore.Define): New abstract method, we will be using this in
17719         the warning reporting engine in Populate.
17720
17721         (Operator.Define): Adjust to new MemberCore protocol. 
17722
17723         * const.cs (Const): This does not derive from Expression, it is a
17724         temporary object we use to create fields, it is a MemberCore. 
17725
17726         * class.cs (Method.Define): Allow the entry point to be in a
17727         specific class.
17728
17729         * driver.cs: Rewrite the argument handler to clean it up a bit.
17730
17731         * rootcontext.cs: Made it just an auxiliary namespace feature by
17732         making everything static.
17733
17734         * driver.cs: Adapt code to use RootContext type name instead of
17735         instance variable.
17736
17737         * delegate.cs: Remove RootContext argument.
17738
17739         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17740         argument. 
17741
17742         * class.cs (Event.Define): The lookup can fail.
17743
17744         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17745
17746         * expression.cs: Resolve the this instance before invoking the code.
17747
17748 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17749
17750         * cs-parser.jay: Add a production in element_access that allows
17751         the thing to become a "type" reference.  This way we can parse
17752         things like "(string [])" as a type.
17753
17754         Note that this still does not handle the more complex rules of
17755         casts. 
17756
17757
17758         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17759
17760         * ecore.cs: (CopyNewMethods): new utility function used to
17761         assemble the list of methods from running FindMembers.
17762
17763         (MemberLookup): Rework FindMembers so that 
17764
17765 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17766
17767         * class.cs (TypeContainer): Remove Delegates who fail to be
17768         defined.
17769
17770         * delegate.cs (Populate): Verify that we dont get null return
17771         values.   TODO: Check for AsAccessible.
17772
17773         * cs-parser.jay: Use basename to emit error 574 (destructor should
17774         have the same name as container class), not the full name.
17775
17776         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17777         possible representation.  
17778
17779         Also implements integer type suffixes U and L.
17780
17781 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17782
17783         * expression.cs (ArrayCreation.DoResolve): We need to do the
17784         argument resolution *always*.
17785
17786         * decl.cs: Make this hold the namespace.  Hold the root context as
17787         well.
17788         (LookupType): Move here.
17789
17790         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17791
17792         * location.cs (Row, Name): Fixed the code, it was always returning
17793         references to the first file.
17794
17795         * interface.cs: Register properties defined through interfaces.
17796
17797         * driver.cs: Add support for globbing on the command line
17798
17799         * class.cs (Field): Make it derive from MemberCore as well.
17800         (Event): ditto.
17801
17802 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17803
17804         * class.cs (Event::Define): Check that the type of the event is a delegate
17805         type else flag error #66.
17806
17807         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17808         same.
17809
17810         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17811         values of EntryPoint, CharSet etc etc.
17812
17813         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17814
17815         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17816         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17817         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17818         which needs this to do its work.
17819
17820         * ../errors/cs0066.cs : Add.
17821
17822 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17823
17824         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17825         helper functions.
17826
17827         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17828         clears out the parameters field.
17829         (MemberSignatureCompare): Cleanup
17830
17831         (MemberCore): New base class used to share code between MethodCore
17832         and Property.
17833
17834         (RegisterRequiredImplementations) BindingFlags.Public requires
17835         either BindingFlags.Instace or Static.  Use instance here.
17836
17837         (Property): Refactored code to cope better with the full spec.
17838
17839         * parameter.cs (GetParameterInfo): Return an empty array instead
17840         of null on error.
17841
17842         * class.cs (Property): Abstract or extern properties have no bodies.
17843
17844         * parameter.cs (GetParameterInfo): return a zero-sized array.
17845
17846         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17847         method modifier validation to the typecontainer so we can reuse
17848         this on properties.
17849
17850         (MethodCore.ParameterTypes): return an empty sized array of types.
17851
17852         (Property.Define): Test property modifier validity.
17853
17854         Add tests for sealed/override too.
17855
17856         (Method.Emit): abstract or extern methods have no bodies.
17857
17858 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17859
17860         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17861         thing.
17862
17863         (Method::Define, ::Emit): Modify accordingly.
17864
17865         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17866
17867         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17868
17869         * makefile: Pass in /unsafe.
17870
17871 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17872
17873         * class.cs (MakeKey): Kill routine.
17874
17875         * class.cs (TypeContainer.Define): Correctly define explicit
17876         method implementations (they require the full interface name plus
17877         the method name).
17878
17879         * typemanager.cs: Deply the PtrHashtable here and stop using the
17880         lame keys.  Things work so much better.
17881
17882         This of course broke everyone who depended on `RegisterMethod' to
17883         do the `test for existance' test.  This has to be done elsewhere.
17884
17885         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17886         the object stupid Equals method (because, that like fails all over
17887         the place).  We still do not use it.
17888
17889         * class.cs (TypeContainer.SetRequiredInterface,
17890         TypeContainer.RequireMethods): Killed these two routines and moved
17891         all the functionality to RegisterRequiredImplementations.
17892
17893         (TypeContainer.RegisterRequiredImplementations): This routine now
17894         registers all the implementations required in an array for the
17895         interfaces and abstract methods.  We use an array of structures
17896         which can be computed ahead of time to reduce memory usage and we
17897         also assume that lookups are cheap as most classes will not
17898         implement too many interfaces.
17899
17900         We also avoid creating too many MethodSignatures.
17901
17902         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17903         clear the "pending" bit if we find that there are problems with
17904         the declaration.
17905
17906         (TypeContainer.VerifyPendingMethods): Update to report errors of
17907         methods that look like implementations but are not.
17908
17909         (TypeContainer.Define): Add support for explicit interface method
17910         implementation. 
17911
17912 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17913
17914         * typemanager.cs: Keep track of the parameters here instead of
17915         being a feature of the TypeContainer.
17916
17917         * class.cs: Drop the registration of parameters here, as
17918         InterfaceMethods are also interface declarations.
17919
17920         * delegate.cs: Register methods with the TypeManager not only with
17921         the TypeContainer.  This code was buggy.
17922
17923         * interface.cs: Full registation here.
17924
17925 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17926
17927         * expression.cs: Remove reducer for binary expressions, it can not
17928         be done this way.
17929
17930         * const.cs: Put here the code that used to go into constant.cs
17931
17932         * constant.cs: Put here the code for constants, this is a new base
17933         class for Literals.
17934
17935         * literal.cs: Make Literal derive from Constant.
17936
17937 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17938
17939         * statement.cs (Return.Emit): Report error 157 if the user
17940         attempts to return from a finally block.
17941
17942         (Return.Emit): Instead of emitting a return, jump to the end of
17943         the function.
17944
17945         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17946         LocalBuilder to store the result of the function.  ReturnLabel is
17947         the target where we jump.
17948
17949
17950 2001-12-09  Radek Doulik  <rodo@ximian.com>
17951
17952         * cs-parser.jay: remember alias in current namespace
17953
17954         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17955         namespaces
17956
17957         * class.cs (LookupAlias): lookup alias in my_namespace
17958
17959         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17960         aliases hashtable
17961         (LookupAlias): lookup alias in this and if needed in parent
17962         namespaces
17963
17964 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17965
17966         * support.cs: 
17967
17968         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17969         making things static.  I need this to avoid passing the
17970         TypeContainer when calling ParameterType.
17971
17972         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17973         that did string manipulation to compute the type and then call
17974         GetType.  Use Parameter.ParameterType instead.
17975
17976         * cs-tokenizer.cs: Consume the suffix for floating values.
17977
17978         * expression.cs (ParameterReference): figure out whether this is a
17979         reference parameter or not.  Kill an extra variable by computing
17980         the arg_idx during emission.
17981
17982         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17983         function that returns whether a parameter is an out/ref value or not.
17984
17985         (Parameter.ParameterType): The type of the parameter (base,
17986         without ref/out applied).
17987
17988         (Parameter.Resolve): Perform resolution here.
17989         (Parameter.ExternalType): The full type (with ref/out applied).
17990
17991         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17992         support for expressions on the using statement.
17993
17994 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17995
17996         * statement.cs (Using.EmitLocalVariableDecls): Split the
17997         localvariable handling of the using statement.
17998
17999         (Block.EmitMeta): Keep track of variable count across blocks.  We
18000         were reusing slots on separate branches of blocks.
18001
18002         (Try.Emit): Emit the general code block, we were not emitting it. 
18003
18004         Check the type of the declaration to be an IDisposable or
18005         something that can be implicity converted to it. 
18006
18007         Emit conversions if required.
18008
18009         * ecore.cs (EmptyExpression): New utility class.
18010         (Expression.ImplicitConversionExists): New utility function.
18011
18012 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18013
18014         * statement.cs (Using): Implement.
18015
18016         * expression.cs (LocalVariableReference): Support read only variables.
18017
18018         * statement.cs: Remove the explicit emit for the Leave opcode.
18019         (VariableInfo): Add a readonly field.
18020
18021 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * ecore.cs (ConvCast): new class used to encapsulate the various
18024         explicit integer conversions that works in both checked and
18025         unchecked contexts.
18026
18027         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18028         properly generate the overflow opcodes.
18029
18030 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18031
18032         * statement.cs: The correct type for the EmptyExpression is the
18033         element_type, not the variable type.  Ravi pointed this out.
18034
18035 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18036
18037         * class.cs (Method::Define): Handle PInvoke methods specially
18038         by using DefinePInvokeMethod instead of the usual one.
18039
18040         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18041         above to do the task of extracting information and defining the method.
18042
18043 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18044
18045         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18046         of the condition for string type.
18047
18048         (Emit): Move that here. 
18049
18050         (ArrayCreation::CheckIndices): Keep string literals in their expression
18051         form.
18052
18053         (EmitDynamicInitializers): Handle strings appropriately.
18054
18055 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18056
18057         * codegen.cs (EmitContext): Replace multiple variables with a
18058         single pointer to the current Switch statement.
18059
18060         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18061         EmitContext.
18062
18063 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18064
18065         * statement.cs 
18066
18067         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18068         default'.
18069
18070         (Foreach.Emit): Foreach on arrays was not setting
18071         up the loop variables (for break/continue).
18072
18073         (GotoCase): Semi-implented.
18074
18075 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18076
18077         * attribute.cs (CheckAttribute): Handle system attributes by using
18078         Attribute.GetAttributes to examine information we need.
18079
18080         (GetValidPlaces): Same here.
18081
18082         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18083
18084         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18085
18086         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18087
18088         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18089
18090         (Method::Emit): Handle the case when we are a PInvoke method.
18091
18092 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18093
18094         * expression.cs: Use ResolveWithSimpleName on compound names.
18095
18096 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18097
18098         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18099         before trying to reduce it.
18100
18101         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18102
18103         * constant.cs (LookupConstantValue): Implement.
18104
18105         (EmitConstant): Use the above in emitting the constant.
18106
18107         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18108         that are user-defined by doing a LookupConstantValue on them.
18109
18110         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18111         too, like above.
18112
18113 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18114
18115         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18116
18117         (BaseAccess.DoResolve): Implement.
18118
18119         (MemberAccess.DoResolve): Split this routine into a
18120         ResolveMemberAccess routine that can be used independently
18121
18122 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18123
18124         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18125         As that share bits of the implementation.  Is returns a boolean,
18126         while As returns the Type that is being probed.
18127
18128 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18129
18130         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18131         instead of a Literal - much easier.
18132
18133         (EnumInTransit): Remove - utterly useless :-)
18134
18135         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18136
18137         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18138
18139         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18140         chain when we have no associated expression.
18141
18142 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18143
18144         * constant.cs (Define): Use Location while reporting the errror.
18145
18146         Also emit a warning when 'new' is used and there is no inherited
18147         member to hide.
18148
18149         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18150         populated.
18151
18152         (LookupEnumValue): Implement to lookup an enum member's value and define it
18153         if necessary.
18154
18155         (Populate): Re-write accordingly to use the above routine.
18156
18157 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18158
18159         * expression.cs (This): Fix prototype for DoResolveLValue to
18160         override the base class DoResolveLValue.
18161
18162         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18163         declarations) 
18164
18165         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18166         (we need to load the address of the field here).  This fixes
18167         test-22. 
18168
18169         (FieldExpr.DoResolveLValue): Call the DoResolve
18170         function to initialize the Instance expression.
18171
18172         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18173         correctly the GetEnumerator operation on a value type.
18174
18175         * cs-parser.jay: Add more simple parsing error catches.
18176
18177         * statement.cs (Switch): Add support for string switches.
18178         Handle null specially.
18179
18180         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18181
18182 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18183
18184         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18185
18186         (declare_local_constant): New helper function.
18187
18188         * statement.cs (AddConstant): Keep a separate record of constants
18189
18190         (IsConstant): Implement to determine if a variable is a constant.
18191
18192         (GetConstantExpression): Implement.
18193
18194         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18195
18196         * statement.cs (IsVariableDefined): Re-write.
18197
18198 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18199
18200         * class.cs (TypeContainer::FindMembers): Look for constants
18201         in the case when we are looking for MemberTypes.Field
18202
18203         * expression.cs (MemberAccess::DoResolve): Check that in the
18204         case we are a FieldExpr and a Literal, we are not being accessed
18205         by an instance reference.
18206
18207         * cs-parser.jay (local_constant_declaration): Implement.
18208
18209         (declaration_statement): Implement for constant declarations.
18210
18211 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18212
18213         * statement.cs (Switch): Catch double defaults.
18214
18215         (Switch): More work on the switch() statement
18216         implementation.  It works for integral values now, need to finish
18217         string support.
18218
18219
18220 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18221
18222         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18223         integer literals into other integer literals.  To be used by
18224         switch. 
18225
18226 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18227
18228         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18229         some memory.
18230
18231         (EmitDynamicInitializers): Cope with the above since we extract data
18232         directly from ArrayData now.
18233
18234         (ExpectInitializers): Keep track of whether initializers are mandatory
18235         or not.
18236
18237         (Bounds): Make it a hashtable to prevent the same dimension being 
18238         recorded for every element in that dimension.
18239
18240         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18241         from being found.
18242
18243         Also fix bug which was causing the indices to be emitted in the reverse
18244         order.
18245
18246 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18247
18248         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18249         unfinished.  They do not work, because the underlying code is
18250         sloppy.
18251
18252 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18253
18254         * cs-parser.jay: Remove bogus fixme.
18255
18256         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18257         on Switch statement.
18258
18259 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18260
18261         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18262         the same. 
18263
18264         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18265         parameter. Apparently, any expression is allowed. 
18266
18267         (ValidateInitializers): Update accordingly.
18268
18269         (CheckIndices): Fix some tricky bugs thanks to recursion.
18270
18271         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18272         I was being completely brain-dead.
18273
18274         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18275         and re-write acordingly.
18276
18277         (DelegateInvocation): Re-write accordingly.
18278
18279         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18280
18281         (MakeByteBlob): Handle types more correctly.
18282
18283         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18284         initialization from expressions but it is incomplete because I am a complete
18285         Dodo :-|
18286
18287 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18290         on If.  Basically, we have to return `true' (ie, we do return to
18291         our caller) only if both branches of the if return.
18292
18293         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18294         short-circuit operators, handle them as short circuit operators. 
18295
18296         (Cast.DoResolve): Resolve type.
18297         (Cast.Cast): Take an expression as the target type.
18298
18299         * cs-parser.jay (cast_expression): Remove old hack that only
18300         allowed a limited set of types to be handled.  Now we take a
18301         unary_expression and we resolve to a type during semantic
18302         analysis.
18303
18304         Use the grammar productions from Rhys to handle casts (this is
18305         not complete like Rhys syntax yet, we fail to handle that corner
18306         case that C# has regarding (-x), but we will get there.
18307
18308 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18309
18310         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18311         field which is an array type.
18312
18313         * cs-parser.jay (declare_local_variables): Support array initialization too.
18314
18315         * typemanager.cs (MakeKey): Implement.
18316
18317         (everywhere): Use the above appropriately.
18318
18319         * cs-parser.jay (for_statement): Update for array initialization while
18320         declaring variables.
18321
18322         * ecore.cs : The error message was correct, it's the variable's names that
18323         were misleading ;-) Make the code more readable.
18324
18325         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18326         the correct type etc.
18327
18328         (ConvertExplicit): Handle Enum types by examining the underlying type.
18329
18330 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18331
18332         * parameter.cs (GetCallingConvention): Always return
18333         CallingConventions.Standard for now.
18334
18335 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18336
18337         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18338         and `r' after calling DoNumericPromotions.
18339
18340         * ecore.cs: Fix error message (the types were in the wrong order).
18341
18342         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18343         BindingFlags.Instance as well 
18344
18345         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18346         implicit int literal conversion in an empty cast so that we
18347         propagate the right type upstream.
18348
18349         (UnboxCast): new class used to unbox value types.
18350         (Expression.ConvertExplicit): Add explicit type conversions done
18351         by unboxing.
18352
18353         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18354         the target type before applying the implicit LongLiterals to ULong
18355         literal cast.
18356
18357 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18358
18359         * cs-parser.jay (for_statement): Reworked the way For works: now
18360         we declare manually any variables that are introduced in
18361         for_initializer to solve the problem of having out-of-band code
18362         emition (that is what got for broken).
18363
18364         (declaration_statement): Perform the actual variable declaration
18365         that used to be done in local_variable_declaration here.
18366
18367         (local_variable_declaration): Do not declare anything, just pass
18368         the information on a DictionaryEntry
18369
18370 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18371
18372         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18373         re-write of the logic to now make it recursive.
18374
18375         (UpdateIndices): Re-write accordingly.
18376
18377         Store element data in a separate ArrayData list in the above methods.
18378
18379         (MakeByteBlob): Implement to dump the array data into a byte array.
18380
18381 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18382
18383         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18384         into CheckIndices.
18385
18386         * constant.cs (Define): Implement.
18387
18388         (EmitConstant): Re-write fully.
18389
18390         Pass in location info.
18391
18392         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18393         respectively.
18394
18395         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18396         DictionaryEntry since we need location info too.
18397
18398         (constant_declaration): Update accordingly.
18399
18400         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18401         code into another method : UpdateIndices.
18402
18403 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18404
18405         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18406         some type checking etc.
18407
18408 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18409
18410         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18411         bits to provide dimension info if the user skips doing that.
18412
18413         Update second constructor to store the rank correctly.
18414
18415 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18416
18417         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18418         and try to implement.
18419
18420         * ../errors/cs0150.cs : Add.
18421
18422         * ../errors/cs0178.cs : Add.
18423
18424 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18425
18426         * statement.cs: Implement foreach on multi-dimensional arrays. 
18427
18428         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18429         name of the params argument.
18430
18431         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18432         initializing the array.
18433
18434         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18435         we can use this elsewhere.
18436
18437         * statement.cs: Finish implementation of foreach for single
18438         dimension arrays.
18439
18440         * cs-parser.jay: Use an out-of-band stack to pass information
18441         around, I wonder why I need this.
18442
18443         foreach_block: Make the new foreach_block the current_block.
18444
18445         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18446         function used to return a static Parameters structure.  Used for
18447         empty parameters, as those are created very frequently.
18448
18449         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18450
18451 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18452
18453         * interface.cs : Default modifier is private, not public. The
18454         make verify test passes again.
18455
18456 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18457
18458         * support.cs (ReflectionParameters): Fix logic to determine
18459         whether the last parameter is a params one. Test 9 passes again.
18460
18461         * delegate.cs (Populate): Register the builders we define with
18462         RegisterParameterForBuilder. Test 19 passes again.
18463
18464         * cs-parser.jay (property_declaration): Reference $6 instead
18465         of $$ to get at the location.
18466
18467         (indexer_declaration): Similar stuff.
18468
18469         (attribute): Ditto.
18470
18471         * class.cs (Property): Register parameters for the Get and Set methods
18472         if they exist. Test 23 passes again.
18473
18474         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18475         call to EmitArguments as we are sure there aren't any params arguments. 
18476         Test 32 passes again.
18477
18478         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18479         IndexOutOfRangeException. 
18480
18481         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18482         Test 33 now passes again.
18483
18484 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18485
18486         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18487         broke a bunch of things.  Will have to come up with a better way
18488         of tracking locations.
18489
18490         * statement.cs: Implemented foreach for single dimension arrays.
18491
18492 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18493
18494         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18495         an error.  This removes the lookup from the critical path.
18496
18497         * cs-parser.jay: Removed use of temporary_loc, which is completely
18498         broken. 
18499
18500 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18501
18502         * support.cs (ReflectionParameters.ParameterModifier): Report
18503         whether the argument is a PARAMS argument or not.
18504
18505         * class.cs: Set the attribute `ParamArrayAttribute' on the
18506         parameter argument.
18507
18508         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18509         and cons_param_array_attribute (ConstructorInfo for
18510         ParamArrayAttribute)., 
18511
18512         * codegen.cs: Emit the return using the `Return' statement, that
18513         way we can report the error correctly for missing return values. 
18514
18515         * class.cs (Method.Emit): Clean up.
18516
18517         * expression.cs (Argument.Resolve): Take another argument: the
18518         location where this argument is used.  Notice that this is not
18519         part of the "Argument" class as to reduce the size of the
18520         structure (we know the approximate location anyways).
18521
18522         Test if the argument is a variable-reference, if not, then
18523         complain with a 206.
18524
18525         (Argument.Emit): Emit addresses of variables.
18526
18527         (Argument.FullDesc): Simplify.
18528
18529         (Invocation.DoResolve): Update for Argument.Resolve.
18530
18531         (ElementAccess.DoResolve): ditto.
18532
18533         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18534         method should be virtual, as this method is always virtual.
18535
18536         (NewDelegate.DoResolve): Update for Argument.Resolve.
18537
18538         * class.cs (ConstructorInitializer.DoResolve): ditto.
18539
18540         * attribute.cs (Attribute.Resolve): ditto.
18541
18542 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18543
18544         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18545
18546         * expression.cs (ParameterReference): Drop IStackStorage and implement
18547         IAssignMethod instead. 
18548
18549         (LocalVariableReference): ditto.
18550
18551         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18552         IAssignMethod instead. 
18553
18554 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18555
18556         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18557         enumerations that are used in heavily used structures derive from
18558         byte in a laughable and pathetic attempt to reduce memory usage.
18559         This is the kind of pre-optimzations that you should not do at
18560         home without adult supervision.
18561
18562         * expression.cs (UnaryMutator): New class, used to handle ++ and
18563         -- separatedly from the other unary operators.  Cleans up the
18564         code, and kills the ExpressionStatement dependency in Unary.
18565
18566         (Unary): Removed `method' and `Arguments' from this class, making
18567         it smaller, and moving it all to SimpleCall, so I can reuse this
18568         code in other locations and avoid creating a lot of transient data
18569         strucutres when not required.
18570
18571         * cs-parser.jay: Adjust for new changes.
18572
18573 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18574
18575         * enum.cs (Enum.Populate): If there is a failure during
18576         definition, return
18577
18578         * cs-parser.jay (opt_enum_base): we used to catch type errors
18579         here, but this is really incorrect.  The type error should be
18580         catched during semantic analysis.
18581
18582 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18583
18584         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18585         current_local_parameters as expected since I, in my stupidity, had forgotten
18586         to do this :-)
18587
18588         * attribute.cs (GetValidPlaces): Fix stupid bug.
18589
18590         * class.cs (Method::Emit): Perform check on applicability of attributes.
18591
18592         (Constructor::Emit): Ditto.
18593
18594         (Field::Emit): Ditto.
18595
18596         (Field.Location): Store location information.
18597
18598         (Property, Event, Indexer, Operator): Ditto.
18599
18600         * cs-parser.jay (field_declaration): Pass in location for each field.
18601
18602         * ../errors/cs0592.cs : Add.
18603
18604 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18605
18606         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18607
18608         (InitCoreTypes): Update accordingly.
18609
18610         (RegisterAttrType, LookupAttr): Implement.
18611
18612         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18613         info about the same.
18614
18615         (Resolve): Update to populate the above as necessary.
18616
18617         (Error592): Helper.
18618
18619         (GetValidPlaces): Helper to the above.
18620
18621         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18622
18623         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18624
18625 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18626
18627         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18628
18629         * ../errors/cs0617.cs : Add.
18630
18631 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18632
18633         * enum.cs (Emit): Rename to Populate to be more consistent with what
18634         we expect it to do and when exactly it is called.
18635
18636         * class.cs, rootcontext.cs : Update accordingly.
18637
18638         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18639         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18640
18641         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18642
18643         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18644         of a fieldinfo using the above, when dealing with a FieldBuilder.
18645
18646 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18647
18648         * ../errors/cs0031.cs : Add.
18649
18650         * ../errors/cs1008.cs : Add.
18651
18652         * ../errrors/cs0543.cs : Add.
18653
18654         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18655         enum type.
18656
18657         (FindMembers): Implement.
18658
18659         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18660         enums and delegates too.
18661
18662         (enum_types): Rename to builder_to_enum.
18663
18664         (delegate_types): Rename to builder_to_delegate.
18665
18666         * delegate.cs (FindMembers): Implement.
18667
18668 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18669
18670         * typemanager.cs (IsEnumType): Implement.
18671
18672         * enum.cs (Emit): Re-write parts to account for the underlying type
18673         better and perform checking etc.
18674
18675         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18676         of the underlying type.
18677
18678         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18679         value
18680
18681         * enum.cs (error31): Helper to report error #31.
18682
18683         * cs-parser.jay (enum_declaration): Store location of each member too.
18684
18685         * enum.cs (member_to_location): New hashtable. 
18686
18687         (AddEnumMember): Update location hashtable.
18688
18689         (Emit): Use the location of each member while reporting errors.
18690
18691 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18692
18693         * cs-parser.jay: A for_initializer if is a
18694         local_variable_declaration really ammount to have an implicit
18695         block with the variable declaration and no initializer for for.
18696
18697         * statement.cs (For.Emit): Cope with null initializers.
18698
18699         This fixes the infinite loop on for initializers.
18700
18701 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18702
18703         * enum.cs: More cleanup.
18704
18705         * ecore.cs: Remove dead code.
18706
18707         * class.cs (Property.Emit): More simplification.
18708         (Event.Emit): ditto.
18709
18710         Reworked to have less levels of indentation.
18711
18712 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18713
18714         * class.cs (Property): Emit attributes.
18715
18716         (Field): Ditto.
18717
18718         (Event): Ditto.
18719
18720         (Indexer): Ditto.
18721
18722         (Operator): Ditto.
18723
18724         * enum.cs (Emit): Ditto.
18725
18726         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18727         Enums too.
18728
18729         * class.cs (Field, Event, etc.): Move attribute generation into the
18730         Emit method everywhere.
18731
18732         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18733         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18734         as we had no way of defining nested enums !
18735
18736         * rootcontext.cs : Adjust code accordingly.
18737
18738         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18739
18740 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18741
18742         * expression.cs (EvalConstantExpression): Move into ecore.cs
18743
18744         * enum.cs (Enum): Rename some members and make them public and readonly
18745         according to our convention.
18746
18747         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18748         nothing else.
18749
18750         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18751
18752         (Enum::Emit): Write a simple version for now which doesn't try to compute
18753         expressions. I shall modify this to be more robust in just a while.
18754
18755         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18756
18757         (TypeContainer::CloseType): Create the Enum types too.
18758
18759         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18760
18761         * expression.cs (EvalConstantExpression): Get rid of completely.
18762
18763         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18764         user-defined values and other cases.
18765
18766         (IsValidEnumLiteral): Helper function.
18767
18768         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18769         out there in the case we had a literal FieldExpr.
18770
18771         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18772
18773         (Literalize): Revamp a bit to take two arguments.
18774
18775         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18776
18777 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18778
18779         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18780
18781         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18782
18783         (Resolve): Use the above to ensure we have proper initializers.
18784
18785 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18786
18787         * expression.cs (Expression::EvalConstantExpression): New method to 
18788         evaluate constant expressions.
18789
18790         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18791
18792 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18795         in an array.
18796
18797         (Binary.ResolveOperator): Handle operator != (object a, object b)
18798         and operator == (object a, object b);
18799
18800         (Binary.DoNumericPromotions): Indicate whether the numeric
18801         promotion was possible.
18802
18803         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18804         Implement.  
18805
18806         Made the ArrayAccess implement interface IAssignMethod instead of
18807         IStackStore as the order in which arguments are passed reflects
18808         this.
18809
18810         * assign.cs: Instead of using expr.ExprClass to select the way of
18811         assinging, probe for the IStackStore/IAssignMethod interfaces.
18812
18813         * typemanager.cs: Load InitializeArray definition.
18814
18815         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18816         static data that can be used to initialize arrays. 
18817
18818 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * expression.cs: Handle operator== and operator!= for booleans.
18821
18822         (Conditioal.Reduce): Implement reducer for the ?: operator.
18823
18824         (Conditional.Resolve): Implement dead code elimination.
18825
18826         (Binary.Resolve): Catch string literals and return a new
18827         concatenated string.
18828
18829         (Unary.Reduce): Implement reduction of unary expressions.
18830
18831         * ecore.cs: Split out the expression core handling here.
18832
18833         (Expression.Reduce): New method used to perform constant folding
18834         and CSE.  This is needed to support constant-expressions. 
18835
18836         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18837         targets, and optimize for !x.
18838
18839 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18840
18841         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18842         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18843         set custom atttributes.
18844
18845         * literal.cs (Literal::GetValue): New abstract method to return the actual
18846         value of the literal, cast as an object.
18847
18848         (*Literal): Implement GetValue method.
18849
18850         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18851         expressions to the arraylist but objects of type Argument.
18852
18853         * class.cs (TypeContainer::Emit): Emit our attributes too.
18854
18855         (Method::Emit, Constructor::Emit): Ditto.
18856
18857         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18858         to be ignoring earlier.
18859
18860 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18861
18862         * attribute.cs (AttributeSection::Define): Implement to do the business
18863         of constructing a CustomAttributeBuilder.
18864
18865         (Attribute): New trivial class. Increases readability of code.  
18866
18867         * cs-parser.jay : Update accordingly.
18868
18869         (positional_argument_list, named_argument_list, named_argument): New rules
18870
18871         (attribute_arguments): Use the above so that we are more correct.
18872
18873 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18874
18875         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18876         to perform all checks for a method with a params parameter.
18877
18878         (Invocation::OverloadResolve): Update to use the above method and therefore
18879         cope correctly with params method invocations.
18880
18881         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18882         params too.
18883
18884         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18885         constructors in our parent too because we can't afford to miss out on 
18886         protected ones ;-)
18887
18888         * attribute.cs (AttributeSection): New name for the class Attribute
18889
18890         Other trivial changes to improve readability.
18891
18892         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18893         use the new class names.
18894
18895 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18896
18897         * class.cs (Method::Define): Complete definition for params types too
18898
18899         (Indexer::Define): Ditto.
18900
18901         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18902         Cope everywhere with a request for info about the array parameter.
18903
18904 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18905
18906         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18907
18908         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18909         local_variable_type to extract the string corresponding to the type.
18910
18911         (local_variable_type): Fixup the action to use the new helper method.
18912
18913         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18914         go.
18915
18916         * expression.cs : Clean out code which uses the above.
18917
18918 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18919
18920         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18921         and bale out if necessary by returning a false.
18922
18923         (RegisterProperty): Ditto.
18924
18925         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18926         and print out appropriate error messages.
18927
18928         * interface.cs (everywhere): Ditto.
18929
18930         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18931         location to constructor.
18932
18933         * class.cs (Property, Event, Indexer): Update accordingly.
18934
18935         * ../errors/cs111.cs : Added.
18936
18937         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18938         of a method, as laid down by the spec.
18939
18940         (Invocation::OverloadResolve): Use the above method.
18941
18942 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18943
18944         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18945         now take a TypeContainer and a Parameters object.
18946
18947         (ParameterData): Modify return type of ParameterModifier method to be 
18948         Parameter.Modifier and not a string.
18949
18950         (ReflectionParameters, InternalParameters): Update accordingly.
18951
18952         * expression.cs (Argument::GetParameterModifier): Same here.
18953
18954         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18955         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18956         symbol in it at all so maybe this is only for now.
18957
18958 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18959
18960         * support.cs (InternalParameters): Constructor now takes an extra argument 
18961         which is the actual Parameters class.
18962
18963         (ParameterDesc): Update to provide info on ref/out modifiers.
18964
18965         * class.cs (everywhere): Update call to InternalParameters to pass in
18966         the second argument too.
18967
18968         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18969         to return the modifier info [ref/out etc]
18970
18971         (InternalParameters, ReflectionParameters): Implement the above.
18972
18973         * expression.cs (Argument::ParameterModifier): Similar function to return
18974         info about the argument's modifiers.
18975
18976         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18977         too.
18978
18979         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18980         a new SetFormalParameters object which we pass to InternalParameters.
18981
18982 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18983
18984         * expression.cs (NewArray): Merge into the ArrayCreation class.
18985
18986 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18987
18988         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18989         NewUserdefinedArray into one as there wasn't much of a use in having
18990         two separate ones.
18991
18992         * expression.cs (Argument): Change field's name to ArgType from Type.
18993
18994         (Type): New readonly property which returns the proper type, taking into 
18995         account ref/out modifiers.
18996
18997         (everywhere): Adjust code accordingly for the above.
18998
18999         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19000         whether we are emitting for a ref or out parameter.
19001
19002         * expression.cs (Argument::Emit): Use the above field to set the state.
19003
19004         (LocalVariableReference::Emit): Update to honour the flag and emit the
19005         right stuff.
19006
19007         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19008
19009         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19010
19011         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19012
19013         (ReflectionParameters, InternalParameters): Implement the above method.
19014
19015         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19016         reporting errors.
19017
19018         (Invocation::FullMethodDesc): Ditto. 
19019
19020 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19021
19022         * cs-parser.jay: Add extra production for the second form of array
19023         creation. 
19024
19025         * expression.cs (ArrayCreation): Update to reflect the above
19026         change. 
19027
19028         * Small changes to prepare for Array initialization.
19029
19030 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19031
19032         * typemanager.cs (ImplementsInterface): interface might be null;
19033         Deal with this problem;
19034
19035         Also, we do store negative hits on the cache (null values), so use
19036         this instead of calling t.GetInterfaces on the type everytime.
19037
19038 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19039
19040         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19041
19042         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19043         split functionality out into different classes.
19044
19045         (New::FormArrayType): Move into NewBuiltinArray.
19046
19047         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19048         quite useless.
19049
19050         (NewBuiltinArray): New class to handle creation of built-in arrays.
19051
19052         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19053         account creation of one-dimensional arrays.
19054
19055         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19056
19057         (NewUserdefinedArray::DoResolve): Implement.
19058
19059         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19060
19061         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19062         we maintain inside the TypeManager. This is necessary to perform lookups on the
19063         module builder.
19064
19065         (LookupType): Update to perform GetType on the module builders too.     
19066
19067         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19068
19069         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19070
19071 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19072
19073         * expression.cs (New::DoResolve): Implement guts of array creation.
19074
19075         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19076
19077 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19078
19079         * expression.cs: Fix bug I introduced lsat night that broke
19080         Delegates. 
19081
19082         (Expression.Resolve): Report a 246 error (can not resolve name)
19083         if we find a SimpleName in the stream.
19084
19085         (Expression.ResolveLValue): Ditto.
19086
19087         (Expression.ResolveWithSimpleName): This function is a variant of
19088         ResolveName, this one allows SimpleNames to be returned without a
19089         warning.  The only consumer of SimpleNames is MemberAccess
19090
19091 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19092
19093         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19094         might arrive here.  I have my doubts that this is correct.
19095
19096         * statement.cs (Lock): Implement lock statement.
19097
19098         * cs-parser.jay: Small fixes to support `lock' and `using'
19099
19100         * cs-tokenizer.cs: Remove extra space
19101
19102         * driver.cs: New flag --checked, allows to turn on integer math
19103         checking. 
19104
19105         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19106         Threading.Monitor.Exit 
19107
19108 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19109
19110         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19111         Expression Class to be IndexerAccess.
19112
19113         Notice that Indexer::DoResolve sets the eclass to Value.
19114
19115 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19116
19117         * class.cs (TypeContainer::Emit): Emit code for indexers.
19118
19119         * assign.cs (IAssignMethod): New interface implemented by Indexers
19120         and Properties for handling assignment.
19121
19122         (Assign::Emit): Simplify and reuse code. 
19123
19124         * expression.cs (IndexerAccess, PropertyExpr): Implement
19125         IAssignMethod, clean up old code. 
19126
19127 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19128
19129         * typemanager.cs (ImplementsInterface): New method to determine if a type
19130         implements a given interface. Provides a nice cache too.
19131
19132         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19133         method.
19134
19135         (ConvertReferenceExplicit): Ditto.
19136
19137         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19138         various methods, with correct names etc.
19139
19140         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19141         Operator.UnaryNegation.
19142
19143         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19144         we have a unary plus or minus operator.
19145
19146         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19147         UnaryMinus.
19148
19149         * everywhere : update accordingly.
19150
19151         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19152         respectively.
19153
19154         * class.cs (Method::Define): For the case where we are implementing a method
19155         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19156         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19157
19158 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19159
19160         * interface.cs (FindMembers): Implement to work around S.R.E
19161         lameness.
19162
19163         * typemanager.cs (IsInterfaceType): Implement.
19164
19165         (FindMembers): Update to handle interface types too.
19166
19167         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19168         use IsAssignableFrom as that is not correct - it doesn't work.
19169
19170         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19171         and accordingly override EmitStatement.
19172
19173         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19174         using the correct logic :-)
19175
19176 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19177
19178         * ../errors/cs-11.cs : Add to demonstrate error -11 
19179
19180 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19181
19182         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19183         then pass this as a hint to ResolveLValue.
19184
19185         * expression.cs (FieldExpr): Add Location information
19186
19187         (FieldExpr::LValueResolve): Report assignment to readonly
19188         variable. 
19189
19190         (Expression::ExprClassFromMemberInfo): Pass location information.
19191
19192         (Expression::ResolveLValue): Add new method that resolves an
19193         LValue. 
19194
19195         (Expression::DoResolveLValue): Default invocation calls
19196         DoResolve. 
19197
19198         (Indexers): New class used to keep track of indexers in a given
19199         Type. 
19200
19201         (IStackStore): Renamed from LValue, as it did not really describe
19202         what this did.  Also ResolveLValue is gone from this interface and
19203         now is part of Expression.
19204
19205         (ElementAccess): Depending on the element access type
19206
19207         * typemanager.cs: Add `indexer_name_type' as a Core type
19208         (System.Runtime.CompilerServices.IndexerNameAttribute)
19209
19210         * statement.cs (Goto): Take a location.
19211
19212 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19213
19214         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19215         if two delegates are compatible.
19216
19217         (NewDelegate::DoResolve): Update to take care of the case when
19218         we instantiate a delegate from another delegate.
19219
19220         * typemanager.cs (FindMembers): Don't even try to look up members
19221         of Delegate types for now.
19222
19223 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19224
19225         * delegate.cs (NewDelegate): New class to take care of delegate
19226         instantiation.
19227
19228         * expression.cs (New): Split the delegate related code out into 
19229         the NewDelegate class.
19230
19231         * delegate.cs (DelegateInvocation): New class to handle delegate 
19232         invocation.
19233
19234         * expression.cs (Invocation): Split out delegate related code into
19235         the DelegateInvocation class.
19236
19237 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19238
19239         * expression.cs (New::DoResolve): Implement delegate creation fully
19240         and according to the spec.
19241
19242         (New::DoEmit): Update to handle delegates differently.
19243
19244         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19245         because of which we were printing out arguments in reverse order !
19246
19247         * delegate.cs (VerifyMethod): Implement to check if the given method
19248         matches the delegate.
19249
19250         (FullDelegateDesc): Implement.
19251
19252         (VerifyApplicability): Implement.
19253
19254         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19255         delegate invocations too.
19256
19257         (Invocation::Emit): Ditto.
19258
19259         * ../errors/cs1593.cs : Added.
19260
19261         * ../errors/cs1594.cs : Added.
19262
19263         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19264
19265 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19266
19267         * typemanager.cs (intptr_type): Core type for System.IntPtr
19268
19269         (InitCoreTypes): Update for the same.
19270
19271         (iasyncresult_type, asynccallback_type): Ditto.
19272
19273         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19274         correct.
19275
19276         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19277         too.
19278
19279         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19280         the builders for the 4 members of a delegate type :-)
19281
19282         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19283         type.
19284
19285         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19286
19287         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19288
19289 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19290
19291         * statement.cs (Break::Emit): Implement.   
19292         (Continue::Emit): Implement.
19293
19294         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19295         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19296         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19297         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19298         end loop
19299
19300         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19301         properties that track the label for the current loop (begin of the
19302         loop and end of the loop).
19303
19304 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19305
19306         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19307         use of emitting anything at all.
19308
19309         * class.cs, rootcontext.cs : Get rid of calls to the same.
19310
19311         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19312
19313         (Populate): Define the constructor correctly and set the implementation
19314         attributes.
19315
19316         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19317         have been defined.
19318
19319         (AddDelegateType): Implement.
19320
19321         (IsDelegateType): Implement helper method.
19322
19323         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19324
19325         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19326         and accordingly handle it.
19327
19328         * delegate.cs (Populate): Take TypeContainer argument.
19329         Implement bits to define the Invoke method. However, I still haven't figured out
19330         how to take care of the native int bit :-(
19331
19332         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19333         Qualify the name of the delegate, not its return type !
19334
19335         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19336         conversion.
19337
19338         (StandardConversionExists): Checking for array types turns out to be recursive.
19339
19340         (ConvertReferenceExplicit): Implement array conversion.
19341
19342         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19343
19344 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19345
19346         * cs-parser.jay (delegate_declaration): Store the fully qualified
19347         name as it is a type declaration.
19348
19349         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19350         readonly.
19351
19352         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19353         as TypeContainer::DefineType.
19354
19355         (Populate): Method in which all the definition of the various methods (Invoke)
19356         etc is done.
19357
19358         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19359         see.
19360
19361         (CloseDelegate): Finally creates the delegate.
19362
19363         * class.cs (TypeContainer::DefineType): Update to define delegates.
19364         (Populate, Emit and CloseType): Do the same thing here too.
19365
19366         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19367         delegates in all these operations.
19368
19369 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * expression.cs: LocalTemporary: a new expression used to
19372         reference a temporary that has been created.
19373
19374         * assign.cs: Handle PropertyAccess back here, so that we can
19375         provide the proper semantic access to properties.
19376
19377         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19378         a few more explicit conversions. 
19379
19380         * modifiers.cs: `NEW' modifier maps to HideBySig.
19381
19382         * expression.cs (PropertyExpr): Make this into an
19383         ExpressionStatement, and support the EmitStatement code path. 
19384
19385         Perform get/set error checking, clean up the interface.
19386
19387         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19388         them into toplevel access objects.
19389
19390 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19391
19392         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19393         SRE.
19394
19395         * typemanager.cs: Keep track here of our PropertyBuilders again to
19396         work around lameness in SRE.
19397
19398 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * expression.cs (LValue::LValueResolve): New method in the
19401         interface, used to perform a second resolution pass for LValues. 
19402
19403         (This::DoResolve): Catch the use of this in static methods.
19404
19405         (This::LValueResolve): Implement.
19406
19407         (This::Store): Remove warning, assigning to `this' in structures
19408         is 
19409
19410         (Invocation::Emit): Deal with invocation of
19411         methods on value types.  We need to pass the address to structure
19412         methods rather than the object itself.  (The equivalent code to
19413         emit "this" for structures leaves the entire structure on the
19414         stack instead of a pointer to it). 
19415
19416         (ParameterReference::DoResolve): Compute the real index for the
19417         argument based on whether the method takes or not a `this' pointer
19418         (ie, the method is static).
19419
19420         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19421         value types returned from functions when we need to invoke a
19422         method on the sturcture.
19423
19424
19425 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19426
19427         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19428         defining the type in the Modulebuilder or Typebuilder. This is to take
19429         care of nested types which need to be defined on the TypeBuilder using
19430         DefineNestedMethod.
19431
19432         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19433         methods in RootContext, only ported to be part of TypeContainer.
19434
19435         (TypeContainer::GetInterfaceOrClass): Ditto.
19436
19437         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19438
19439         * interface.cs (Interface::DefineInterface): New method. Does exactly
19440         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19441         too.
19442
19443         (Interface::GetInterfaces): Move from RootContext here and port.
19444
19445         (Interface::GetInterfaceByName): Same here.
19446
19447         * rootcontext.cs (ResolveTree): Re-write.
19448
19449         (PopulateTypes): Re-write.
19450
19451         * class.cs (TypeContainer::Populate): Populate nested types too.
19452         (TypeContainer::Emit): Emit nested members too.
19453
19454         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19455         instead just use the name argument passed in as it is already fully
19456         qualified.
19457
19458         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19459         to TypeContainer mapping to see if a type is user-defined.
19460
19461         * class.cs (TypeContainer::CloseType): Implement. 
19462
19463         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19464         the default constructor.
19465
19466         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19467         twice.
19468
19469         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19470
19471         * interface.cs (CloseType): Create the type here.
19472
19473         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19474         the hierarchy.
19475
19476         Remove all the methods which are now in TypeContainer.
19477
19478 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19479
19480         * delegate.cs (Define): Re-write bits to define the delegate
19481         correctly.
19482
19483 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19484
19485         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19486
19487         * expression.cs (ImplicitReferenceConversion): handle null as well
19488         as a source to convert to any reference type.
19489
19490         * statement.cs (Return): Perform any implicit conversions to
19491         expected return type.  
19492
19493         Validate use of return statement.  
19494
19495         * codegen.cs (EmitContext): Pass the expected return type here.
19496
19497         * class.cs (Method, Constructor, Property): Pass expected return
19498         type to EmitContext.
19499
19500 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19501
19502         * expression.cs: Make DoResolve take an EmitContext instead of a
19503         TypeContainer.
19504
19505         Replaced `l' and `location' for `loc', for consistency.
19506
19507         (Error, Warning): Remove unneeded Tc argument.
19508
19509         * assign.cs, literal.cs, constant.cs: Update to new calling
19510         convention. 
19511
19512         * codegen.cs: EmitContext now contains a flag indicating whether
19513         code is being generated in a static method or not.
19514
19515         * cs-parser.jay: DecomposeQI, new function that replaces the old
19516         QualifiedIdentifier.  Now we always decompose the assembled
19517         strings from qualified_identifier productions into a group of
19518         memberaccesses.
19519
19520 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19521
19522         * rootcontext.cs: Deal with field-less struct types correctly now
19523         by passing the size option to Define Type.
19524
19525         * class.cs: Removed hack that created one static field. 
19526
19527 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19528
19529         * statement.cs: Moved most of the code generation here. 
19530
19531 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19532
19533         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19534         seem very right.
19535
19536         (ElementAccess): Remove useless bits for now - keep checks as the spec
19537         says.
19538
19539 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19540
19541         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19542         and start performing checks according to the spec.
19543
19544 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19545
19546         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19547         rank_specifiers instead.
19548
19549         (rank_specifiers): Change the order in which the rank specifiers are stored
19550
19551         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19552
19553         * expression.cs (ElementAccess): Implement the LValue interface too.
19554
19555 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19556
19557         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19558         except that user defined conversions are not included.
19559
19560         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19561         perform the conversion of the return type, if necessary.
19562
19563         (New::DoResolve): Check whether we are creating an array or an object
19564         and accordingly do the needful.
19565
19566         (New::Emit): Same here.
19567
19568         (New::DoResolve): Implement guts of array creation.
19569
19570         (New::FormLookupType): Helper function.
19571
19572 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * codegen.cs: Removed most of the code generation here, and move the
19575         corresponding code generation bits to the statement classes. 
19576
19577         Added support for try/catch/finalize and throw.
19578
19579         * cs-parser.jay: Added support for try/catch/finalize.
19580
19581         * class.cs: Catch static methods having the flags override,
19582         virtual or abstract.
19583
19584         * expression.cs (UserCast): This user cast was not really doing
19585         what it was supposed to do.  Which is to be born in fully resolved
19586         state.  Parts of the resolution were being performed at Emit time! 
19587
19588         Fixed this code.
19589
19590 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19591
19592         * expression.cs: Implicity convert the result from UserCast.
19593
19594 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19595
19596         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19597         prevented it from working correctly. 
19598
19599         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19600         merely ConvertImplicit.
19601
19602 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19603
19604         * typemanager.cs: Make the LookupTypeContainer function static,
19605         and not per-instance.  
19606
19607         * class.cs: Make static FindMembers (the one that takes a Type
19608         argument). 
19609
19610         * codegen.cs: Add EmitForeach here.
19611
19612         * cs-parser.jay: Make foreach a toplevel object instead of the
19613         inline expansion, as we need to perform semantic analysis on it. 
19614
19615 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19616
19617         * expression.cs (Expression::ImplicitUserConversion): Rename to
19618         UserDefinedConversion.
19619
19620         (Expression::UserDefinedConversion): Take an extra argument specifying 
19621         whether we look for explicit user conversions too.
19622
19623         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19624
19625         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19626
19627         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19628         with the appropriate arguments.
19629
19630         * cs-parser.jay (cast_expression): Record location too.
19631
19632         * expression.cs (Cast): Record location info.
19633
19634         (Expression::ConvertExplicit): Take location argument.
19635
19636         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19637         to determine if we are doing explicit conversions.
19638
19639         (UserCast::Emit): Update accordingly.
19640
19641         (Expression::ConvertExplicit): Report an error if everything fails.
19642
19643         * ../errors/cs0030.cs : Add.
19644
19645 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19646
19647         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19648         virtual and newslot bits. 
19649
19650         * class.cs (TypeContainer::RegisterRequiredImplementations):
19651         Record methods we need.
19652
19653         (TypeContainer::MakeKey): Helper function to make keys for
19654         MethodBases, since the Methodbase key is useless.
19655
19656         (TypeContainer::Populate): Call RegisterRequiredImplementations
19657         before defining the methods.   
19658
19659         Create a mapping for method_builders_to_methods ahead of time
19660         instead of inside a tight loop.
19661
19662         (::RequireMethods):  Accept an object as the data to set into the
19663         hashtable so we can report interface vs abstract method mismatch.
19664
19665 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19666
19667         * report.cs: Make all of it static.
19668
19669         * rootcontext.cs: Drop object_type and value_type computations, as
19670         we have those in the TypeManager anyways.
19671
19672         Drop report instance variable too, now it is a global.
19673
19674         * driver.cs: Use try/catch on command line handling.
19675
19676         Add --probe option to debug the error reporting system with a test
19677         suite. 
19678
19679         * report.cs: Add support for exiting program when a probe
19680         condition is reached.
19681
19682 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19683
19684         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19685         we do a forcible conversion regardless of type, to check if 
19686         ForceConversion returns a null.
19687
19688         (Binary::error19): Use location to report error.
19689
19690         (Unary::error23): Use location here too.
19691
19692         * ../errors/cs0019.cs : Check in.
19693
19694         * ../errors/cs0023.cs : Check in.
19695
19696         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19697         case of a non-null MethodInfo object with a length of 0 !
19698
19699         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19700         an applicable member - according to the spec :-)
19701         Also fix logic to find members in base types.
19702
19703         (Unary::ResolveOperator): Same here.
19704
19705         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19706         as I was getting thoroughly confused between this and error19 :-)
19707
19708         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19709         (::FindMostEncompassedType): Implement.
19710         (::FindMostEncompassingType): Implement.
19711         (::StandardConversionExists): Implement.
19712
19713         (UserImplicitCast): Re-vamp. We now need info about most specific
19714         source and target types so that we can do the necessary conversions.
19715
19716         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19717         mathematical union with no duplicates.
19718
19719 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19720
19721         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19722         in order from base classes to child classes, so that we can in
19723         child classes look up in our parent for method names and
19724         attributes (required for handling abstract, virtual, new, override
19725         constructs: we need to instrospect our base class, and if we dont
19726         populate the classes in order, the introspection might be
19727         incorrect.  For example, a method could query its parent before
19728         the parent has any methods and would determine that the parent has
19729         no abstract methods (while it could have had them)).
19730
19731         (RootContext::CreateType): Record the order in which we define the
19732         classes.
19733
19734 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19735
19736         * class.cs (TypeContainer::Populate): Also method definitions can
19737         fail now, keep track of this.
19738
19739         (TypeContainer::FindMembers): Implement support for
19740         DeclaredOnly/noDeclaredOnly flag.
19741
19742         (Constructor::Emit) Return the ConstructorBuilder.
19743
19744         (Method::Emit) Return the MethodBuilder. 
19745         Check for abstract or virtual methods to be public.
19746
19747         * rootcontext.cs (RootContext::CreateType): Register all the
19748         abstract methods required for the class to be complete and the
19749         interface methods that must be implemented. 
19750
19751         * cs-parser.jay: Report error 501 (method requires body if it is
19752         not marked abstract or extern).
19753
19754         * expression.cs (TypeOf::Emit): Implement.
19755
19756         * typemanager.cs: runtime_handle_type, new global type.
19757
19758         * class.cs (Property::Emit): Generate code for properties.
19759
19760 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19761
19762         * expression.cs (Unary::ResolveOperator): Find operators on base type
19763         too - we now conform exactly to the spec.
19764
19765         (Binary::ResolveOperator): Same here.
19766
19767         * class.cs (Operator::Define): Fix minor quirk in the tests.
19768
19769         * ../errors/cs0215.cs : Added.
19770
19771         * ../errors/cs0556.cs : Added.
19772
19773         * ../errors/cs0555.cs : Added.
19774
19775 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19776
19777         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19778         single integer which is really efficient
19779
19780 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19781
19782         *  expression.cs (Expression::ImplicitUserConversion): Use location
19783         even in the case when we are examining True operators.
19784  
19785         * class.cs (Operator::Define): Perform extensive checks to conform
19786         with the rules for operator overloading in the spec.
19787
19788         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19789         some of the other conversions mentioned in the spec.
19790
19791         * typemanager.cs (array_type): New static member for the System.Array built-in
19792         type.
19793
19794         (cloneable_interface): For System.ICloneable interface.
19795
19796         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19797         we start resolving the tree and populating types.
19798
19799         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19800  
19801 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19802
19803         * expression.cs (Expression::ExprClassFromMemberInfo,
19804         Expression::Literalize): Create literal expressions from
19805         FieldInfos which are literals.
19806
19807         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19808         type casts, because they were wrong.  The test suite in tests
19809         caught these ones.
19810
19811         (ImplicitNumericConversion): ushort to ulong requires a widening
19812         cast. 
19813
19814         Int32 constant to long requires widening cast as well.
19815
19816         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19817         for integers because the type on the stack is not i4.
19818
19819 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19820
19821         * expression.cs (report118): require location argument. 
19822
19823         * parameter.cs: Do not dereference potential null value.
19824
19825         * class.cs: Catch methods that lack the `new' keyword when
19826         overriding a name.  Report warnings when `new' is used without
19827         anything being there to override.
19828
19829         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19830
19831         * class.cs: Only add constructor to hashtable if it is non-null
19832         (as now constructors can fail on define).
19833
19834         (TypeManager, Class, Struct): Take location arguments.
19835
19836         Catch field instance initialization in structs as errors.
19837
19838         accepting_filter: a new filter for FindMembers that is static so
19839         that we dont create an instance per invocation.
19840
19841         (Constructor::Define): Catch errors where a struct constructor is
19842         parameterless 
19843
19844         * cs-parser.jay: Pass location information for various new
19845         constructs. 
19846
19847         * delegate.cs (Delegate): take a location argument.
19848
19849         * driver.cs: Do not call EmitCode if there were problesm in the
19850         Definition of the types, as many Builders wont be there. 
19851
19852         * decl.cs (Decl::Decl): Require a location argument.
19853
19854         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19855         into integers, and find the most appropiate integer for it.
19856
19857         * literal.cs: Implement ULongLiteral.
19858
19859         * rootcontext.cs: Provide better information about the location of
19860         failure when CreateType fails.
19861
19862 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19863
19864         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19865         as well.
19866
19867         * expression.cs (Binary::CheckShiftArguments): Add missing type
19868         computation.
19869         (Binary::ResolveOperator): Add type to the logical and and logical
19870         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19871         before.
19872
19873         (Binary::DoNumericPromotions): In the case where either argument
19874         is ulong (and most signed types combined with ulong cause an
19875         error) perform implicit integer constant conversions as well.
19876
19877 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19878
19879         * expression.cs (UserImplicitCast): Method should always be
19880         non-null. 
19881         (Invocation::BetterConversion): Simplified test for IntLiteral.
19882
19883         (Expression::ImplicitNumericConversion): Split this routine out.
19884         Put the code that performs implicit constant integer conversions
19885         here. 
19886
19887         (Expression::Resolve): Become a wrapper around DoResolve so we can
19888         check eclass and type being set after resolve.
19889
19890         (Invocation::Badness): Remove this dead function
19891
19892         (Binary::ResolveOperator): Do not compute the expensive argumnets
19893         unless we have a union for it.
19894
19895         (Probe::Emit): Is needs to do an isinst and then
19896         compare against null.
19897
19898         (::CanConvert): Added Location argument.  If the Location argument
19899         is null (Location.Null), then we do not report errors.  This is
19900         used by the `probe' mechanism of the Explicit conversion.  We do
19901         not want to generate an error for something that the user
19902         explicitly requested to be casted.  But the pipeline for an
19903         explicit cast first tests for potential implicit casts.
19904
19905         So for now, if the Location is null, it means `Probe only' to
19906         avoid adding another argument.   Might have to revise this
19907         strategy later.
19908
19909         (ClassCast): New class used to type cast objects into arbitrary
19910         classes (used in Explicit Reference Conversions).
19911
19912         Implement `as' as well.
19913
19914         Reverted all the patches from Ravi below: they were broken:
19915
19916                 * The use of `level' as a mechanism to stop recursive
19917                   invocations is wrong.  That was there just to catch the
19918                   bug with a strack trace but not as a way of addressing
19919                   the problem.
19920
19921                   To fix the problem we have to *understand* what is going
19922                   on and the interactions and come up with a plan, not
19923                   just get things going.
19924
19925                 * The use of the type conversion cache that I proposed
19926                   last night had an open topic: How does this work across
19927                   protection domains.  A user defined conversion might not
19928                   be public in the location where we are applying the
19929                   conversion, a different conversion might be selected
19930                   (ie, private A->B (better) but public B->A (worse),
19931                   inside A, A->B applies, but outside it, B->A will
19932                   apply).
19933
19934                 * On top of that (ie, even if the above is solved),
19935                   conversions in a cache need to be abstract.  Ie, `To
19936                   convert from an Int to a Short use an OpcodeCast', not
19937                   `To convert from an Int to a Short use the OpcodeCast on
19938                   the variable 5' (which is what this patch was doing).
19939
19940 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19941
19942         * expression.cs (Invocation::ConversionExists): Re-write to use
19943         the conversion cache
19944
19945         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19946         cache all conversions done, not just user-defined ones.
19947
19948         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19949         to determine if a conversion exists instead of acutually trying to 
19950         perform the conversion. It's faster too.
19951
19952         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19953         and only then attempt the implicit conversion.
19954
19955 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19956
19957         * expression.cs (ConvertImplicit): Use a cache for conversions
19958         already found. Check level of recursion and bail out if necessary.
19959
19960 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19961
19962         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19963         Export standard methods that we expect for string operations.
19964
19965         * statement.cs (Block::UsageWarning): Track usage of variables and
19966         report the errors for not used variables.
19967
19968         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19969         operator. 
19970
19971 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19972
19973         * codegen.cs: remove unnneded code 
19974
19975         * expression.cs: Removed BuiltinTypeAccess class
19976
19977         Fix the order in which implicit conversions are
19978         done.  
19979
19980         The previous fixed dropped support for boxed conversions (adding a
19981         test to the test suite now)
19982
19983         (UserImplicitCast::CanConvert): Remove test for source being null,
19984         that code is broken.  We should not feed a null to begin with, if
19985         we do, then we should track the bug where the problem originates
19986         and not try to cover it up here.
19987
19988         Return a resolved expression of type UserImplicitCast on success
19989         rather than true/false.  Ravi: this is what I was talking about,
19990         the pattern is to use a static method as a "constructor" for
19991         objects. 
19992
19993         Also, do not create arguments until the very last minute,
19994         otherwise we always create the arguments even for lookups that
19995         will never be performed. 
19996
19997         (UserImplicitCast::Resolve): Eliminate, objects of type
19998         UserImplicitCast are born in a fully resolved state. 
19999
20000         * typemanager.cs (InitCoreTypes): Init also value_type
20001         (System.ValueType). 
20002
20003         * expression.cs (Cast::Resolve): First resolve the child expression.
20004
20005         (LValue): Add new method AddressOf to be used by
20006         the `&' operator.  
20007
20008         Change the argument of Store to take an EmitContext instead of an
20009         ILGenerator, because things like FieldExpr need to be able to call
20010         their children expression to generate the instance code. 
20011
20012         (Expression::Error, Expression::Warning): Sugar functions for
20013         reporting errors.
20014
20015         (Expression::MemberLookup): Accept a TypeContainer instead of a
20016         Report as the first argument.
20017
20018         (Expression::ResolvePrimary): Killed.  I still want to improve
20019         this as currently the code is just not right.
20020
20021         (Expression::ResolveMemberAccess): Simplify, but it is still
20022         wrong. 
20023
20024         (Unary::Resolve): Catch errors in AddressOf operators.
20025
20026         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20027         index to a byte for the short-version, or the compiler will choose
20028         the wrong Emit call, which generates the wrong data.
20029
20030         (ParameterReference::Emit, ::Store): same.
20031
20032         (FieldExpr::AddressOf): Implement.
20033
20034         * typemanager.cs: TypeManager: made public variable instead of
20035         property.
20036
20037         * driver.cs: document --fatal.
20038
20039         * report.cs (ErrorMessage, WarningMessage): new names for the old
20040         Error and Warning classes.
20041
20042         * cs-parser.jay (member_access): Turn built-in access to types
20043         into a normal simplename
20044
20045 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20046
20047         * expression.cs (Invocation::BetterConversion): Fix to cope
20048         with q being null, since this was introducing a bug.
20049
20050         * expression.cs (ConvertImplicit): Do built-in conversions first.
20051
20052 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20053
20054         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20055
20056 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20057
20058         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20059         I had introduced long ago (what's new ?).
20060
20061         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20062         the work of all the checking. 
20063         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20064         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20065
20066         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20067         that is the right way. 
20068
20069         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20070         overloading resolution. Use everywhere instead of cutting and pasting code.
20071
20072         (Binary::ResolveOperator): Use MakeUnionSet.
20073
20074         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20075         we have to convert to bool types. Not complete yet.
20076
20077 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20078
20079         * typemanager.cs (TypeManager::CSharpName): support ushort.
20080
20081         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20082         to provide an expression that performsn an implicit constant int
20083         conversion (section 6.1.6).
20084         (Expression::ConvertImplicitRequired): Reworked to include
20085         implicit constant expression conversions.
20086
20087         (Expression::ConvertNumericExplicit): Finished.
20088
20089         (Invocation::Emit): If InstanceExpression is null, then it means
20090         that we perform a call on this.
20091
20092 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * expression.cs (Unary::Emit): Remove some dead code.
20095         (Probe): Implement Resolve and Emit for `is'.
20096         (Expression::ConvertImplicitRequired): Attempt to do constant
20097         expression conversions here.  Maybe should be moved to
20098         ConvertImplicit, but I am not sure.
20099         (Expression::ImplicitLongConstantConversionPossible,
20100         Expression::ImplicitIntConstantConversionPossible): New functions
20101         that tell whether is it possible to apply an implicit constant
20102         expression conversion.
20103
20104         (ConvertNumericExplicit): Started work on explicit numeric
20105         conversions.
20106
20107         * cs-parser.jay: Update operator constants.
20108
20109         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20110         (Parameters::GetSignature): Hook up VerifyArgs here.
20111         (Parameters::VerifyArgs): Verifies that no two arguments have the
20112         same name. 
20113
20114         * class.cs (Operator): Update the operator names to reflect the
20115         ones that the spec expects (as we are just stringizing the
20116         operator names).
20117
20118         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20119         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20120         previous usage did only work for our methods.
20121         (Expression::ConvertImplicit): Handle decimal implicit numeric
20122         conversions as well.
20123         (Expression::InternalTypeConstructor): Used to invoke constructors
20124         on internal types for default promotions.
20125
20126         (Unary::Emit): Implement special handling for the pre/post
20127         increment/decrement for overloaded operators, as they need to have
20128         the same semantics as the other operators.
20129
20130         (Binary::ResolveOperator): ditto.
20131         (Invocation::ConversionExists): ditto.
20132         (UserImplicitCast::Resolve): ditto.
20133
20134 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20135
20136         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20137         operator, return after emitting body. Regression tests pass again !
20138
20139         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20140         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20141         (Invocation::OverloadResolve): Ditto.
20142         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20143
20144         * everywhere : update calls to the above methods accordingly.
20145
20146 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20147
20148         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20149
20150         * expression.cs (ExpressionStatement): New base class used for
20151         expressions that can appear in statements, so that we can provide
20152         an alternate path to generate expression that do not leave a value
20153         on the stack.
20154
20155         (Expression::Emit, and all the derivatives): We no longer return
20156         whether a value is left on the stack or not.  Every expression
20157         after being emitted leaves a single value on the stack.
20158
20159         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20160         facilties of ExpressionStatement if possible.
20161
20162         * cs-parser.jay: Update statement_expression.
20163
20164 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20165
20166         * driver.cs: Change the wording of message
20167
20168 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20169
20170         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20171         the type of the expression to the return type of the method if
20172         we have an overloaded operator match ! The regression tests pass again !
20173         (Unary::ResolveOperator): Ditto.
20174
20175         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20176         to find "op_Implicit", not "implicit" ;-)
20177         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20178         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20179
20180         * everywhere : Correct calls to the above accordingly.
20181
20182         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20183         (ConvertImplicit): Do user-defined conversion if it exists.
20184
20185 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20186
20187         * assign.cs: track location.
20188         (Resolve): Use implicit conversions on assignment.
20189
20190         * literal.cs: Oops.  Not good, Emit of short access values should
20191         pass (Bytes) or the wrong argument will be selected.
20192
20193         * expression.cs (Unary::Emit): Emit code for -expr.
20194
20195         (Unary::ResolveOperator): Handle `Substract' for non-constants
20196         (substract from zero from the non-constants).
20197         Deal with Doubles as well. 
20198
20199         (Expression::ConvertImplicitRequired): New routine that reports an
20200         error if no implicit conversion exists. 
20201
20202         (Invocation::OverloadResolve): Store the converted implicit
20203         expressions if we make them
20204
20205 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20206
20207         * class.cs (ConstructorInitializer): Take a Location argument.
20208         (ConstructorBaseInitializer): Same here.
20209         (ConstructorThisInitializer): Same here.
20210
20211         * cs-parser.jay : Update all calls accordingly.
20212
20213         * expression.cs (Unary, Binary, New): Take location argument.
20214         Update accordingly everywhere.
20215
20216         * cs-parser.jay : Update all calls to the above to take a location
20217         argument.
20218
20219         * class.cs : Ditto.
20220
20221 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20222
20223         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20224         (Invocation::BetterConversion): Same here
20225         (Invocation::ConversionExists): Ditto.
20226
20227         (Invocation::ConversionExists): Implement.
20228
20229 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20230
20231         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20232         Also take an additional TypeContainer argument.
20233
20234         * All over : Pass in TypeContainer as argument to OverloadResolve.
20235
20236         * typemanager.cs (CSharpName): Update to check for the string type and return
20237         that too.
20238
20239         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20240         a given method.
20241
20242 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20243
20244         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20245         (Invocation::BetterFunction): Implement.
20246         (Invocation::BetterConversion): Implement.
20247         (Invocation::ConversionExists): Skeleton, no implementation yet.
20248
20249         Okay, things work fine !
20250
20251 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20252
20253         * typemanager.cs: declare and load enum_type, delegate_type and
20254         void_type. 
20255
20256         * expression.cs (Expression::Emit): Now emit returns a value that
20257         tells whether a value is left on the stack or not.  This strategy
20258         might be reveted tomorrow with a mechanism that would address
20259         multiple assignments.
20260         (Expression::report118): Utility routine to report mismatches on
20261         the ExprClass.
20262
20263         (Unary::Report23): Report impossible type/operator combination
20264         utility function.
20265
20266         (Unary::IsIncrementableNumber): Whether the type can be
20267         incremented or decremented with add.
20268         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20269         complemented. 
20270         (Unary::ResolveOperator): Implement ++, !, ~,
20271
20272         (Invocation::Emit): Deal with new Emit convetion.
20273
20274         * All Expression derivatives: Updated their Emit method to return
20275         whether they leave values on the stack or not.
20276
20277         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20278         stack for expressions that are statements. 
20279
20280 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20281
20282         * expression.cs (LValue): New interface.  Must be implemented by
20283         LValue objects.
20284         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20285         LValue interface.
20286
20287         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20288         interface for generating code, simplifies the code.
20289
20290 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20291
20292         * expression.cs (everywhere): Comment out return statements in ::Resolve
20293         methods to avoid the warnings.
20294
20295 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20296
20297         * driver.cs (parse): Report error 2001 if we can not open the
20298         source file.
20299
20300         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20301         not resolve it.
20302
20303         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20304         object. 
20305
20306         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20307         otherwise nested blocks end up with the same index.
20308
20309         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20310
20311         * expression.cs:  Instead of having FIXMEs in the Resolve
20312         functions, throw exceptions so it is obvious that we are facing a
20313         bug. 
20314
20315         * cs-parser.jay (invocation_expression): Pass Location information.
20316
20317         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20318         Use a basename for those routines because .NET does not like paths
20319         on them. 
20320
20321         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20322         already defined.
20323
20324 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20325
20326         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20327         are loading the correct data types (throws an exception if not).
20328         (TypeManager::InitCoreTypes): Use CoreLookupType
20329
20330         * expression.cs (Unary::ResolveOperator): return the child
20331         expression for expressions which are just +expr.
20332         (Unary::ResolveOperator): Return negative literals for -LITERAL
20333         expressions (otherwise they are Unary {Literal}).
20334         (Invocation::Badness): Take into account `Implicit constant
20335         expression conversions'.
20336
20337         * literal.cs (LongLiteral): Implement long literal class.
20338         (IntLiteral): export the `Value' of the intliteral. 
20339
20340 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20341
20342         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20343
20344         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20345         instead of 'Operator'
20346
20347         * expression.cs (Binary::ResolveOperator): Update accordingly.
20348         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20349         and 'Minus'
20350
20351         * cs-parser.jay (unary_expression): Update to use the new names.
20352
20353         * gen-treedump.cs (GetUnary): Same here.
20354
20355         * expression.cs (Unary::Resolve): Implement.
20356         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20357         operators are found instead of making noise ;-)
20358         (Unary::ResolveOperator): New method to do precisely the same thing which
20359         Binary::ResolveOperator does for Binary expressions.
20360         (Unary.method, .Arguments): Add.
20361         (Unary::OperName): Implement.   
20362         (Unary::ForceConversion): Copy and Paste !
20363
20364         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20365         a unary operator.
20366
20367         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20368         for the inbuilt operators. Only overloading works for now ;-)
20369
20370 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20371
20372         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20373         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20374
20375         * expression.cs (This::Emit): Implement. 
20376         (This::Resolve): Implement.
20377         (TypeOf:Resolve): Implement.
20378         (Expression::ResolveSimpleName): Add an implicit this to instance
20379         field references. 
20380         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20381         Bind instance variable to Field expressions.
20382         (FieldExpr::Instance): New field used to track the expression that
20383         represents the object instance.
20384         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20385         binding 
20386         (FieldExpr::Emit): Implement.
20387
20388         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20389         the last instruction contains a return opcode to avoid generating
20390         the last `ret' instruction (this generates correct code, and it is
20391         nice to pass the peverify output).
20392
20393         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20394         initializer for static and instance variables.
20395         (Constructor::Emit): Allow initializer to be null in the case of
20396         static constructors.  Only emit initializer for instance
20397         constructors. 
20398
20399         (TypeContainer::FindMembers): Return a null array if there are no
20400         matches.
20401
20402         Also fix the code for the MemberTypes.Method branch, as it was not
20403         scanning that for operators (or tried to access null variables before).
20404
20405         * assign.cs (Assign::Emit): Handle instance and static fields. 
20406
20407         * TODO: Updated.
20408
20409         * driver.cs: Stop compilation if there are parse errors.
20410
20411         * cs-parser.jay (constructor_declaration): Provide default base
20412         initializer for non-static constructors.
20413         (constructor_declarator): Do not provide a default base
20414         initializers if none was specified.
20415         Catch the fact that constructors should not have parameters.
20416
20417         * class.cs: Do not emit parent class initializers for static
20418         constructors, that should be flagged as an error.
20419
20420 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20421
20422         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20423         Move back code into TypeContainer::Populate.
20424
20425 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20426
20427         * class.cs (TypeContainer::AddConstructor): Fix the check to
20428         compare against Name, not Basename. 
20429         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20430
20431         * cs-parser.jay : Update accordingly.
20432
20433         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20434         for methods, don't forget to look into the operators too.
20435         (RegisterMethodBuilder): Helper method to take care of this for
20436         methods, constructors and operators.
20437         (Operator::Define): Completely revamp.
20438         (Operator.OperatorMethod, MethodName): New fields.
20439         (TypeContainer::Populate): Move the registering of builders into
20440         RegisterMethodBuilder.
20441         (Operator::Emit): Re-write.
20442
20443         * expression.cs (Binary::Emit): Comment out code path to emit method
20444         invocation stuff for the case when we have a user defined operator. I am
20445         just not able to get it right !
20446
20447 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20448
20449         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20450         argument. 
20451
20452         (Expression::MemberLookup): Provide a version that allows to
20453         specify the MemberTypes and BindingFlags. 
20454
20455         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20456         so it was not fetching variable information from outer blocks.
20457
20458         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20459         Beforefieldinit as it was buggy.
20460
20461         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20462         that Ravi put here.  
20463
20464         * class.cs (Constructor::Emit): Only emit if block is not null.
20465         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20466         deal with this by semantically definining it as if the user had
20467         done it.
20468
20469         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20470         constructors as we now "emit" them at a higher level.
20471
20472         (TypeContainer::DefineDefaultConstructor): Used to define the
20473         default constructors if none was provided.
20474
20475         (ConstructorInitializer): Add methods Resolve and Emit. 
20476
20477         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20478
20479 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20480
20481         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20482         the default constructor builder with our hashtable for methodbuilders
20483         to methodcores.
20484
20485         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20486         and argument_count is 0 in which case we have a match.
20487         (Binary::ResolveOperator): More null checking and miscellaneous coding
20488         style cleanup.
20489
20490 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20491
20492         * rootcontext.cs (IsNameSpace): Compare against null.
20493
20494         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20495
20496         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20497         and Unary::Operator.
20498
20499         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20500         accordingly.
20501
20502         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20503         we have overloaded operators.
20504         (Binary::ResolveOperator): Implement the part which does the operator overload
20505         resolution.
20506
20507         * class.cs (Operator::Emit): Implement.
20508         (TypeContainer::Emit): Emit the operators we have too.
20509
20510         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20511         the case when we have a user-defined operator.
20512
20513 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20514
20515         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20516
20517 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20518
20519         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20520         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20521         (Constructor::Emit): Implement.
20522         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20523         if we have no work to do. 
20524         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20525         Emit method.
20526
20527         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20528         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20529
20530         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20531         of parent.parent.
20532
20533 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20534
20535         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20536         in the source.
20537         (Tree::RecordNamespace): Method to do what the name says ;-)
20538         (Tree::Namespaces): Property to get at the namespaces hashtable.
20539
20540         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20541         keep track.
20542
20543         * rootcontext.cs (IsNamespace): Fixed it :-)
20544
20545 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20546
20547         * class.cs (TypeContainer::FindMembers): Add support for
20548         constructors. 
20549         (MethodCore): New class that encapsulates both the shared aspects
20550         of a Constructor and a Method.  
20551         (Method, Constructor): Factored pieces into MethodCore.
20552
20553         * driver.cs: Added --fatal which makes errors throw exceptions.
20554         Load System assembly as well as part of the standard library.
20555
20556         * report.cs: Allow throwing exceptions on errors for debugging.
20557
20558         * modifiers.cs: Do not use `parent', instead use the real type
20559         container to evaluate permission settings.
20560
20561         * class.cs: Put Ravi's patch back in.  He is right, and we will
20562         have to cope with the
20563
20564 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20565
20566         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20567         FamORAssem, not FamANDAssem.
20568
20569 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20570
20571         * driver.cs: Added --parse option that only parses its input files
20572         and terminates.
20573
20574         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20575         incorrect.  IsTopLevel is not used to tell whether an object is
20576         root_types or not (that can be achieved by testing this ==
20577         root_types).  But to see if this is a top-level *class* (not
20578         necessarly our "toplevel" container). 
20579
20580 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20581
20582         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20583         parent instead of a direct call to GetType.
20584
20585 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20586
20587         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20588         Modifiers.TypeAttr. This should just be a call to that method.
20589
20590         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20591         object so that we can determine if we are top-level or not.
20592
20593         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20594         TypeContainer too.
20595
20596         * enum.cs (Enum::Define): Ditto.
20597
20598         * modifiers.cs (FieldAttr): Re-write.
20599
20600         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20601         (TypeContainer::HaveStaticConstructor): New property to provide access
20602         to precisely that info.
20603
20604         * modifiers.cs (MethodAttr): Re-write.
20605         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20606
20607         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20608         of top-level types as claimed.
20609
20610 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20611
20612         * expression.cs (MemberLookup): Fruitless attempt to lookup
20613         constructors.  Maybe I need to emit default constructors?  That
20614         might be it (currently .NET emits this for me automatically).
20615         (Invocation::OverloadResolve): Cope with Arguments == null.
20616         (Invocation::EmitArguments): new function, shared by the new
20617         constructor and us.
20618         (Invocation::Emit): Handle static and instance methods.  Emit
20619         proper call instruction for virtual or non-virtual invocations.
20620         (New::Emit): Implement.
20621         (New::Resolve): Implement.
20622         (MemberAccess:Resolve): Implement.
20623         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20624         to track instances.
20625         (FieldExpr::Resolve): Set type.
20626
20627         * support.cs: Handle empty arguments.
20628                 
20629         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20630         SimpleLookup): Auxiliary routines to help parse a qualifier
20631         identifier.  
20632
20633         Update qualifier_identifier rule.
20634
20635         * codegen.cs: Removed debugging messages.
20636
20637         * class.cs: Make this a global thing, this acts just as a "key" to
20638         objects that we might have around.
20639
20640         (Populate): Only initialize method_builders_to_methods once.
20641
20642         * expression.cs (PropertyExpr): Initialize type from the
20643         PropertyType. 
20644
20645         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20646         Resolve pattern.  Attempt to implicitly convert value to boolean.
20647         Emit code.
20648
20649         * expression.cs: Set the type for the int32/int32 argument case.
20650         (Binary::ResolveOperator): Set the return type to boolean for
20651         comparission operators
20652
20653         * typemanager.cs: Remove debugging print code.
20654
20655         (Invocation::Resolve): resolve type.
20656
20657         * class.cs: Allocate a MemberInfo of the correct size, as the code
20658         elsewhere depends on the test to reflect the correct contents.
20659
20660         (Method::) Keep track of parameters, due to System.Reflection holes
20661
20662         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20663         mapping here.
20664
20665         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20666         of the exact size and return that.
20667
20668         (Class::LookupMethodByBuilder): New function that maps
20669         MethodBuilders to its methods.  Required to locate the information
20670         on methods because System.Reflection bit us again.
20671
20672         * support.cs: New file, contains an interface ParameterData and
20673         two implementations: ReflectionParameters and InternalParameters
20674         used to access Parameter information.  We will need to grow this
20675         as required.
20676
20677         * expression.cs (Invocation::GetParameterData): implement a cache
20678         and a wrapper around the ParameterData creation for methods. 
20679         (Invocation::OverloadResolve): Use new code.
20680
20681 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20682
20683         * class.cs (TypeContainer::EmitField): Remove and move into 
20684         (Field::Define): here and modify accordingly.
20685         (Field.FieldBuilder): New member.
20686         (TypeContainer::Populate): Update accordingly.
20687         (TypeContainer::FindMembers): Implement.
20688
20689 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20690
20691         * statement.cs: (VariableInfo::VariableType): New field to be
20692         initialized with the full type once it is resolved. 
20693
20694 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20695
20696         * parameter.cs (GetParameterInfo): Use a type cache to compute
20697         things only once, and to reuse this information
20698
20699         * expression.cs (LocalVariableReference::Emit): Implement.
20700         (OpcodeCast::Emit): fix.
20701
20702         (ParameterReference::Resolve): Implement.
20703         (ParameterReference::Emit): Implement.
20704
20705         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20706         that are expressions need to stay as Expressions.
20707
20708         * typemanager.cs (CSharpName): Returns the C# name of a type if
20709         possible. 
20710
20711         * expression.cs (Expression::ConvertImplicit): New function that
20712         implements implicit type conversions.
20713
20714         (Expression::ImplicitReferenceConversion): Implements implicit
20715         reference conversions.
20716
20717         (EmptyCast): New type for transparent casts.
20718
20719         (OpcodeCast): New type for casts of types that are performed with
20720         a sequence of bytecodes.
20721
20722         (BoxedCast): New type used for casting value types into reference
20723         types.  Emits a box opcode.
20724
20725         (Binary::DoNumericPromotions): Implements numeric promotions of
20726         and computation of the Binary::Type.
20727
20728         (Binary::EmitBranchable): Optimization.
20729
20730         (Binary::Emit): Implement code emission for expressions.
20731
20732         * typemanager.cs (TypeManager): Added two new core types: sbyte
20733         and byte.
20734
20735 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20736
20737         * class.cs (TypeContainer::FindMembers): Method which does exactly
20738         what Type.FindMembers does, only we don't have to use reflection. No
20739         implementation yet.
20740
20741         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20742         typecontainer objects as we need to get at them.
20743         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20744
20745         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20746         typecontainer object.
20747
20748         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20749         of just a Report object.
20750
20751 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20752
20753         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20754         "remove_"
20755         (TypeContainer::Populate): Now define the delegates of the type too.
20756         (TypeContainer.Delegates): Property to access the list of delegates defined
20757         in the type.
20758
20759         * delegates.cs (Delegate::Define): Implement partially.
20760
20761         * modifiers.cs (TypeAttr): Handle more flags.
20762
20763 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20764
20765         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20766         and not <=
20767         (Operator::Define): Re-write logic to get types by using the LookupType method
20768         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20769         (Indexer::Define): Ditto.
20770         (Event::Define): Ditto.
20771         (Property::Define): Ditto.
20772
20773 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20774
20775         * class.cs (TypeContainer::Populate): Now define operators too. 
20776         (TypeContainer.Operators): New property to access the list of operators
20777         in a type.
20778         (Operator.OperatorMethodBuilder): New member to hold the method builder
20779         for the operator we are defining.
20780         (Operator::Define): Implement.
20781
20782 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20783
20784         * class.cs (Event::Define): Make the prefixes of the accessor methods
20785         addOn_ and removeOn_ 
20786
20787         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20788         of the location being passed in too. Ideally, this should go later since all
20789         error reporting should be done through the Report object.
20790
20791         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20792         (Populate): Iterate thru the indexers we have and define them too.
20793         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20794         for the get and set accessors.
20795         (Indexer::Define): Implement.
20796
20797 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20800         my previous implementation, did not work.
20801
20802         * typemanager.cs: Add a couple of missing types (the longs).
20803
20804         * literal.cs: Use TypeManager.bool_type instead of getting it.
20805
20806         * expression.cs (EventExpr): New kind of expressions.
20807         (Expressio::ExprClassFromMemberInfo): finish
20808
20809 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20810
20811         * assign.cs: Emit stores to static fields differently.
20812
20813 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20814
20815         * Merge in changes and adjust code to tackle conflicts. Backed out my
20816         code in Assign::Resolve ;-) 
20817
20818 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20819
20820         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20821         instead Report.Error and also pass in the location.
20822         (CSharpParser::Lexer): New readonly property to return the reference
20823         to the Tokenizer object.
20824         (declare_local_variables): Use Report.Error with location instead of plain 
20825         old error.
20826         (CheckDef): Ditto.
20827
20828         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20829         (Operator.CheckBinaryOperator): Ditto.
20830
20831         * cs-parser.jay (operator_declarator): Update accordingly.
20832
20833         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20834         (CheckBinaryOperator): Same here.
20835
20836         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20837         on the name without any prefixes of namespace names etc. This is because we
20838         already might have something already fully qualified like 
20839         'System.Console.WriteLine'
20840
20841         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20842
20843 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20844
20845         * cs-tokenizer.cs (location): Return a string which also contains
20846         the file name.
20847
20848         * expression.cs (ElementAccess): New class for expressions of the
20849         type 'element access.'
20850         (BaseAccess): New class for expressions of the type 'base access.'
20851         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20852         respectively.
20853
20854         * cs-parser.jay (element_access): Implement action.
20855         (base_access): Implement actions.
20856         (checked_expression, unchecked_expression): Implement.
20857
20858         * cs-parser.jay (local_variable_type): Correct and implement.
20859         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20860
20861         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20862
20863         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20864         name and the specifiers.
20865
20866         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20867
20868         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20869         making them all public ;-)
20870
20871         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20872         class anyways.
20873
20874 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20875
20876         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20877         PropertyExprs.
20878         (FieldExpr, PropertyExprs): New resolved expressions.
20879         (SimpleName::MemberStaticCheck): Perform static checks for access
20880         to non-static fields on static methods. Maybe this should be
20881         generalized for MemberAccesses. 
20882         (SimpleName::ResolveSimpleName): More work on simple name
20883         resolution. 
20884
20885         * cs-parser.jay (primary_expression/qualified_identifier): track
20886         the parameter index.
20887
20888         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20889         (EmitContext::EmitBoolExpression): Chain to expression generation
20890         instead of temporary hack.
20891         (::EmitStatementExpression): Put generic expression code generation.
20892
20893         * assign.cs (Assign::Emit): Implement variable assignments to
20894         local variables, parameters and fields.
20895
20896 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20897
20898         * statement.cs (Block::GetVariableInfo): New method, returns the
20899         VariableInfo for a variable name in a block.
20900         (Block::GetVariableType): Implement in terms of GetVariableInfo
20901
20902         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20903         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20904
20905 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20906
20907         * cs-parser.jay (operator_declaration): Continue on my quest : update
20908         to take attributes argument.
20909         (event_declaration): Ditto.
20910         (enum_declaration): Ditto.
20911         (indexer_declaration): Ditto.
20912
20913         * class.cs (Operator::Operator): Update constructor accordingly.
20914         (Event::Event): Ditto.
20915
20916         * delegate.cs (Delegate::Delegate): Same here.
20917
20918         * enum.cs (Enum::Enum): Same here.
20919
20920 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20921
20922         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20923
20924         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20925
20926         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20927         being passed around as an arraylist.
20928         (Attributes::AddAttribute): Method to add attribute sections.
20929
20930         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20931         (struct_declaration): Update accordingly.
20932         (constant_declaration): Update.
20933         (field_declaration): Update.
20934         (method_header): Update.
20935         (fixed_parameter): Update.
20936         (parameter_array): Ditto.
20937         (property_declaration): Ditto.
20938         (destructor_declaration): Ditto.
20939
20940         * class.cs (Struct::Struct): Update constructors accordingly.
20941         (Class::Class): Ditto.
20942         (Field::Field): Ditto.
20943         (Method::Method): Ditto.
20944         (Property::Property): Ditto.
20945         (TypeContainer::OptAttribute): update property's return type.
20946
20947         * interface.cs (Interface.opt_attributes): New member.
20948         (Interface::Interface): Update to take the extra Attributes argument.
20949
20950         * parameter.cs (Parameter::Parameter): Ditto.
20951
20952         * constant.cs (Constant::Constant): Ditto.
20953
20954         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20955         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20956         the attributes as a parameter.
20957         (InterfaceProperty): Update constructor call.
20958         (InterfaceEvent): Ditto.
20959         (InterfaceMethod): Ditto.
20960         (InterfaceIndexer): Ditto.
20961
20962         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20963         pass the attributes too.
20964         (interface_event_declaration): Ditto.
20965         (interface_property_declaration): Ditto.
20966         (interface_method_declaration): Ditto.
20967         (interface_declaration): Ditto.
20968
20969 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20970
20971         * class.cs (Method::Define): Track the "static Main" definition to
20972         create an entry point. 
20973
20974         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20975         EntryPoint if we find it. 
20976
20977         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20978         (EmitContext::ig): Make this variable public.
20979
20980         * driver.cs: Make the default output file be the first file name
20981         with the .exe extension.  
20982
20983         Detect empty compilations
20984
20985         Handle various kinds of output targets.  Handle --target and
20986         rename -t to --dumper.
20987
20988         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20989         methods inherited from Expression return now an Expression.  This
20990         will is used during the tree rewriting as we resolve them during
20991         semantic analysis.
20992
20993         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20994         the spec.  Missing entirely is the information about
20995         accessability of elements of it.
20996
20997         (Expression::ExprClassFromMemberInfo): New constructor for
20998         Expressions that creates a fully initialized Expression based on
20999         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21000         a Type.
21001
21002         (Invocation::Resolve): Begin implementing resolution of invocations.
21003
21004         * literal.cs (StringLiteral):  Implement Emit.
21005
21006 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21007
21008         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21009         member.
21010
21011 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21012
21013         * cs-parser.jay (attribute_arguments): Implement actions.
21014         (attribute): Fix bug in production. Implement action.
21015         (attribute_list): Implement.
21016         (attribute_target): Implement.
21017         (attribute_target_specifier, opt_target_specifier): Implement
21018         (CheckAttributeTarget): New method to check if the attribute target
21019         is valid.
21020         (attribute_section): Implement.
21021         (opt_attributes): Implement.
21022
21023         * attribute.cs : New file to handle attributes.
21024         (Attribute): Class to hold attribute info.
21025
21026         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21027         (attribute_section): Modify production to use 2 different rules to 
21028         achieve the same thing. 1 s/r conflict down !
21029         Clean out commented, useless, non-reducing dimension_separator rules.
21030
21031         * class.cs (TypeContainer.attributes): New member to hold list
21032         of attributes for a type.
21033         (Struct::Struct): Modify to take one more argument, the attribute list.
21034         (Class::Class): Ditto.
21035         (Field::Field): Ditto.
21036         (Method::Method): Ditto.
21037         (Property::Property): Ditto.
21038
21039         * cs-parser.jay (struct_declaration): Update constructor call to
21040         pass in the attributes too.
21041         (class_declaration): Ditto.
21042         (constant_declaration): Ditto.
21043         (field_declaration): Ditto.
21044         (method_header): Ditto.
21045         (fixed_parameter): Ditto.
21046         (parameter_array): Ditto.
21047         (property_declaration): Ditto.
21048
21049         * constant.cs (Constant::Constant): Update constructor similarly.
21050         Use System.Collections.
21051
21052         * parameter.cs (Parameter::Parameter): Update as above.
21053
21054 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21055
21056         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21057         (TypeContainer.delegates): New member to hold list of delegates.
21058
21059         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21060         this time as I seem to be on crack ;-)
21061
21062 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21063
21064         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21065         tell whether an identifier represents a namespace.
21066
21067         * expression.cs (NamespaceExpr): A namespace expression, used only
21068         temporarly during expression resolution.
21069         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21070         utility functions to resolve names on expressions.
21071
21072 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21073
21074         * codegen.cs: Add hook for StatementExpressions. 
21075
21076         * class.cs: Fix inverted test for static flag in methods.
21077
21078 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21079
21080         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21081         to make it coincide with MS' number.
21082         (Operator::CheckBinaryOperator): Ditto.
21083
21084         * ../errors/errors.txt : Remove error numbers added earlier.
21085
21086         * ../errors/cs1019.cs : Test case for error # 1019
21087
21088         * ../errros/cs1020.cs : Test case for error # 1020
21089
21090         * cs-parser.jay : Clean out commented cruft.
21091         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21092         used anywhere - non-reducing rule.
21093         (namespace_declarations): Non-reducing rule - comment out.
21094
21095         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21096         with TypeContainer::AddEnum.
21097
21098         * delegate.cs : New file for delegate handling classes.
21099         (Delegate): Class for declaring delegates.
21100
21101         * makefile : Update.
21102
21103         * cs-parser.jay (delegate_declaration): Implement.
21104
21105 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21106
21107         * class.cs (Event::Define): Implement.
21108         (Event.EventBuilder): New member.
21109
21110         * class.cs (TypeContainer::Populate): Update to define all enums and events
21111         we have.
21112         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21113         readonly fields for all these cases ?
21114
21115 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21116
21117         * class.cs (Property): Revamp to use the convention of making fields readonly.
21118         Accordingly modify code elsewhere.
21119
21120         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21121         the Define method of the Property class.
21122
21123         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21124         trivial bug.
21125         (TypeContainer::Populate): Update to define all the properties we have. Also
21126         define all enumerations.
21127
21128         * enum.cs (Define): Implement.
21129
21130 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21131
21132         * cs-parser.jay (overloadable_operator): The semantic value is an
21133         enum of the Operator class.
21134         (operator_declarator): Implement actions.
21135         (operator_declaration): Implement.
21136
21137         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21138         validity of definitions.
21139         (Operator::CheckBinaryOperator): Static method to check for binary operators
21140         (TypeContainer::AddOperator): New method to add an operator to a type.
21141
21142         * cs-parser.jay (indexer_declaration): Added line to actually call the
21143         AddIndexer method so it gets added ;-)
21144
21145         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21146         already taken care of by the MS compiler ?  
21147
21148 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21149
21150         * class.cs (Operator): New class for operator declarations.
21151         (Operator::OpType): Enum for the various operators.
21152
21153 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21154
21155         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21156         ostensibly handle this in semantic analysis.
21157
21158         * cs-parser.jay (general_catch_clause): Comment out
21159         (specific_catch_clauses, specific_catch_clause): Ditto.
21160         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21161         (catch_args, opt_catch_args): New productions.
21162         (catch_clause): Rewrite to use the new productions above
21163         (catch_clauses): Modify accordingly.
21164         (opt_catch_clauses): New production to use in try_statement
21165         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21166         and re-write the code in the actions to extract the specific and
21167         general catch clauses by being a little smart ;-)
21168
21169         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21170         Hooray, try and catch statements parse fine !
21171
21172 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21173
21174         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21175         string from the hashtable of variables.
21176
21177         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21178         I end up making that mistake ;-)
21179         (catch_clauses): Fixed gross error which made Key and Value of the 
21180         DictionaryEntry the same : $1 !!
21181
21182 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21183
21184         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21185
21186         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21187         when the add and remove accessors are specified. 
21188
21189 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21190
21191         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21192         information about indexer_declarator.
21193         (indexer_declarator): Implement actions.
21194         (parsing_indexer): New local boolean used to keep track of whether
21195         we are parsing indexers or properties. This is necessary because 
21196         implicit_parameters come into picture even for the get accessor in the 
21197         case of an indexer.
21198         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21199
21200         * class.cs (Indexer): New class for indexer declarations.
21201         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21202         (TypeContainer::indexers): New member to hold list of indexers for the
21203         type.
21204
21205 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21206
21207         * cs-parser.jay (add_accessor_declaration): Implement action.
21208         (remove_accessor_declaration): Implement action.
21209         (event_accessors_declaration): Implement
21210         (variable_declarators): swap statements for first rule - trivial.
21211
21212         * class.cs (Event): New class to hold information about event
21213         declarations.
21214         (TypeContainer::AddEvent): New method to add an event to a type
21215         (TypeContainer::events): New member to hold list of events.
21216
21217         * cs-parser.jay (event_declaration): Implement actions.
21218
21219 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21220
21221         * cs-parser.jay (dim_separators): Implement. Make it a string
21222         concatenating all the commas together, just as they appear.
21223         (opt_dim_separators): Modify accordingly
21224         (rank_specifiers): Update accordingly. Basically do the same
21225         thing - instead, collect the brackets here.
21226         (opt_rank_sepcifiers): Modify accordingly.
21227         (array_type): Modify to actually return the complete type string
21228         instead of ignoring the rank_specifiers.
21229         (expression_list): Implement to collect the expressions
21230         (variable_initializer): Implement. We make it a list of expressions
21231         essentially so that we can handle the array_initializer case neatly too.
21232         (variable_initializer_list): Implement.
21233         (array_initializer): Make it a list of variable_initializers
21234         (opt_array_initializer): Modify accordingly.
21235
21236         * expression.cs (New::NType): Add enumeration to help us
21237         keep track of whether we have an object/delegate creation
21238         or an array creation.
21239         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21240         members to hold data about array creation.
21241         (New:New): Modify to update NewType
21242         (New:New): New Overloaded contructor for the array creation
21243         case.
21244
21245         * cs-parser.jay (array_creation_expression): Implement to call
21246         the overloaded New constructor.
21247
21248 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21249
21250         * class.cs (TypeContainer::Constructors): Return member
21251         constructors instead of returning null.
21252
21253 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21254
21255         * typemanager.cs (InitCoreTypes): Initialize the various core
21256         types after we have populated the type manager with the user
21257         defined types (this distinction will be important later while
21258         compiling corlib.dll)
21259
21260         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21261         on Expression Classification.  Now all expressions have a method
21262         `Resolve' and a method `Emit'.
21263
21264         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21265         generation from working.     Also add some temporary debugging
21266         code. 
21267
21268 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21269
21270         * codegen.cs: Lots of code generation pieces.  This is only the
21271         beginning, will continue tomorrow with more touches of polish.  We
21272         handle the fundamentals of if, while, do, for, return.  Others are
21273         trickier and I need to start working on invocations soon.
21274
21275         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21276         s.InitStatement. 
21277
21278         * codegen.cs (EmitContext): New struct, used during code
21279         emission to keep a context.   Most of the code generation will be
21280         here. 
21281
21282         * cs-parser.jay: Add embedded blocks to the list of statements of
21283         this block.  So code generation proceeds in a top down fashion.
21284
21285 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21286
21287         * statement.cs: Add support for multiple child blocks.
21288
21289 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21290
21291         * codegen.cs (EmitCode): New function, will emit the code for a
21292         Block of code given a TypeContainer and its ILGenerator. 
21293
21294         * statement.cs (Block): Standard public readonly optimization.
21295         (Block::Block constructors): Link children. 
21296         (Block::Child): Child Linker.
21297         (Block::EmitVariables): Emits IL variable declarations.
21298
21299         * class.cs: Drop support for MethodGroups here, delay until
21300         Semantic Analysis.
21301         (Method::): Applied the same simplification that I did before, and
21302         move from Properties to public readonly fields.
21303         (Method::ParameterTypes): Returns the parameter types for the
21304         function, and implements a cache that will be useful later when I
21305         do error checking and the semantic analysis on the methods is
21306         performed.
21307         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21308         and made a method, optional argument tells whether this is a class
21309         or a structure to apply the `has-this' bit.
21310         (Method::GetCallingConvention): Implement, returns the calling
21311         convention. 
21312         (Method::Define): Defines the type, a second pass is performed
21313         later to populate the methods.
21314
21315         (Constructor::ParameterTypes): implement a cache similar to the
21316         one on Method::ParameterTypes, useful later when we do semantic
21317         analysis. 
21318
21319         (TypeContainer::EmitMethod):  New method.  Emits methods.
21320
21321         * expression.cs: Removed MethodGroup class from here.
21322
21323         * parameter.cs (Parameters::GetCallingConvention): new method.
21324
21325 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21326
21327         * class.cs (TypeContainer::Populate): Drop RootContext from the
21328         argument. 
21329
21330         (Constructor::CallingConvention): Returns the calling convention.
21331         (Constructor::ParameterTypes): Returns the constructor parameter
21332         types. 
21333
21334         (TypeContainer::AddConstructor): Keep track of default constructor
21335         and the default static constructor.
21336
21337         (Constructor::) Another class that starts using `public readonly'
21338         instead of properties. 
21339
21340         (Constructor::IsDefault): Whether this is a default constructor. 
21341
21342         (Field::) use readonly public fields instead of properties also.
21343
21344         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21345         track of static constructors;  If none is used, turn on
21346         BeforeFieldInit in the TypeAttributes. 
21347
21348         * cs-parser.jay (opt_argument_list): now the return can be null
21349         for the cases where there are no arguments. 
21350
21351         (constructor_declarator): If there is no implicit `base' or
21352         `this', then invoke the default parent constructor. 
21353
21354         * modifiers.cs (MethodAttr): New static function maps a set of
21355         modifiers flags into a MethodAttributes enum
21356         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21357         MethodAttr, TypeAttr to represent the various mappings where the
21358         modifiers are used.
21359         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21360
21361 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21362
21363         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21364         method arguments.
21365
21366         * interface.cs (PopulateIndexer): Implemented the code generator
21367         for interface indexers.
21368
21369 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21370
21371         * interface.cs (InterfaceMemberBase): Now we track the new status
21372         here.  
21373
21374         (PopulateProperty): Implement property population.  Woohoo!  Got
21375         Methods and Properties going today. 
21376
21377         Removed all the properties for interfaces, and replaced them with
21378         `public readonly' fields. 
21379
21380 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21381
21382         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21383         initialize their hashtables/arraylists only when they are needed
21384         instead of doing this always.
21385
21386         * parameter.cs: Handle refs and out parameters.
21387
21388         * cs-parser.jay: Use an ArrayList to construct the arguments
21389         instead of the ParameterCollection, and then cast that to a
21390         Parameter[] array.
21391
21392         * parameter.cs: Drop the use of ParameterCollection and use
21393         instead arrays of Parameters.
21394
21395         (GetParameterInfo): Use the Type, not the Name when resolving
21396         types. 
21397
21398 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21399
21400         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21401         and instead use public readonly fields.
21402
21403         * class.cs: Put back walking code for type containers.
21404
21405 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21406
21407         * class.cs (MakeConstant): Code to define constants.
21408
21409         * rootcontext.cs (LookupType): New function.  Used to locate types 
21410
21411
21412 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21413
21414         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21415         this System.Reflection code is.  Kudos to Microsoft
21416
21417         * typemanager.cs: Implement a type cache and avoid loading all
21418         types at boot time.  Wrap in LookupType the internals.  This made
21419         the compiler so much faster.  Wow.  I rule!
21420
21421         * driver.cs: Make sure we always load mscorlib first (for
21422         debugging purposes, nothing really important).
21423
21424         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21425         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21426
21427         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21428         on namespaces that have been imported using the `using' keyword.
21429
21430         * class.cs (TypeContainer::TypeAttr): Virtualize.
21431         (Class::TypeAttr): Return attributes suitable for this bad boy.
21432         (Struct::TypeAttr): ditto.
21433         Handle nested classes.
21434         (TypeContainer::) Remove all the type visiting code, it is now
21435         replaced with the rootcontext.cs code
21436
21437         * rootcontext.cs (GetClassBases): Added support for structs. 
21438
21439 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21440
21441         * interface.cs, statement.cs, class.cs, parameter.cs,
21442         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21443         Drop use of TypeRefs, and use strings instead.
21444
21445 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21446
21447         * rootcontext.cs: 
21448
21449         * class.cs (Struct::Struct): set the SEALED flags after
21450         checking the modifiers.
21451         (TypeContainer::TypeAttr): new property, returns the
21452         TypeAttributes for a class.  
21453
21454         * cs-parser.jay (type_list): Oops, list production was creating a
21455         new list of base types.
21456
21457         * rootcontext.cs (StdLib): New property.
21458         (GetInterfaceTypeByName): returns an interface by type name, and
21459         encapsulates error handling here.
21460         (GetInterfaces): simplified.
21461         (ResolveTree): Encapsulated all the tree resolution here.
21462         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21463         types. 
21464
21465         * driver.cs: Add support for --nostdlib, to avoid loading the
21466         default assemblies.
21467         (Main): Do not put tree resolution here. 
21468
21469         * rootcontext.cs: Beginning of the class resolution.
21470
21471 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21472
21473         * rootcontext.cs: Provide better error reporting. 
21474
21475         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21476
21477         * rootcontext.cs (CreateInterface): Handle the case where there
21478         are no parent interfaces.
21479
21480         (CloseTypes): Routine to flush types at the end.
21481         (CreateInterface): Track types.
21482         (GetInterfaces): Returns an array of Types from the list of
21483         defined interfaces.
21484
21485         * typemanager.c (AddUserType): Mechanism to track user types (puts
21486         the type on the global type hash, and allows us to close it at the
21487         end). 
21488
21489 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21490
21491         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21492         RecordInterface instead.
21493
21494         * cs-parser.jay: Updated to reflect changes above.
21495
21496         * decl.cs (Definition): Keep track of the TypeBuilder type that
21497         represents this type here.  Not sure we will use it in the long
21498         run, but wont hurt for now.
21499
21500         * driver.cs: Smaller changes to accomodate the new code.
21501
21502         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21503         when done. 
21504
21505         * rootcontext.cs (CreateInterface):  New method, used to create
21506         the System.TypeBuilder type for interfaces.
21507         (ResolveInterfaces): new entry point to resolve the interface
21508         hierarchy. 
21509         (CodeGen): Property, used to keep track of the code generator.
21510
21511 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21512
21513         * cs-parser.jay: Add a second production for delegate_declaration
21514         with `VOID'.
21515
21516         (enum_body): Put an opt_comma here instead of putting it on
21517         enum_body or enum_member_declarations so we can handle trailing
21518         commas on enumeration members.  Gets rid of a shift/reduce.
21519
21520         (type_list): Need a COMMA in the middle.
21521
21522         (indexer_declaration): Tell tokenizer to recognize get/set
21523
21524         * Remove old targets.
21525
21526         * Re-add the parser target.
21527
21528 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21529
21530         * cs-parser.jay: Add precendence rules for a number of operators
21531         ot reduce the number of shift/reduce conflicts in the grammar.
21532
21533 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21534
21535         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21536         and put it here.
21537
21538         Get rid of old crufty code.
21539
21540         * rootcontext.cs: Use this to keep track of the parsed
21541         representation and the defined types available to the program. 
21542
21543         * gen-treedump.cs: adjust for new convention.
21544
21545         * type.cs: Split out the type manager, and the assembly builder
21546         from here. 
21547
21548         * typemanager.cs: the type manager will live here now.
21549
21550         * cil-codegen.cs: And the code generator here. 
21551
21552 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21553
21554         * makefile: Fixed up for easy making.
21555
21556 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21557
21558         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21559         the 
21560
21561         (unary_expression): Expand pre_increment_expression and
21562         post_decrement_expression to reduce a shift/reduce.
21563
21564 2001-07-11  Simon Cozens
21565
21566         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21567
21568         Improve allow_keyword_as_indent name.
21569
21570 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21571
21572         * Adjustments for Beta2. 
21573
21574 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21575
21576         * decl.cs: Added `Define' abstract method.
21577         (InTransit): new property, used to catch recursive definitions. 
21578
21579         * interface.cs: Implement `Define'. 
21580
21581         * modifiers.cs: Map Modifiers.constants to
21582         System.Reflection.TypeAttribute flags.
21583
21584         * class.cs: Keep track of types and user-defined types.
21585         (BuilderInit): New method for creating an assembly
21586         (ResolveType): New function to launch the resolution process, only
21587         used by interfaces for now.
21588
21589         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21590         that are inserted into the name space. 
21591
21592 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21593
21594         * ARGH.  I have screwed up my tree so many times due to the use of
21595         rsync rather than using CVS.  Going to fix this at once. 
21596
21597         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21598         load types.
21599
21600 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21601
21602         * Experiment successful: Use System.Type rather that our own
21603         version of Type.  
21604
21605 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21606
21607         * cs-parser.jay: Removed nsAliases from here.
21608
21609         Use new namespaces, handle `using XXX;' 
21610
21611         * namespace.cs: Reimplemented namespace handling, use a recursive
21612         definition of the class.  Now we can keep track of using clauses
21613         and catch invalid using clauses.
21614
21615 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21616
21617         * gen-treedump.cs: Adapted for all the renaming.
21618
21619         * expression.cs (Expression): this class now has a Type property
21620         which returns an expression Type.
21621
21622         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21623         `Type', as this has a different meaning now in the base
21624
21625 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21626
21627         * interface.cs, class.cs: Removed from all the sources the
21628         references to signature computation, as we can not do method
21629         signature computation during the parsing time, as we are not
21630         trying to solve at that point distinguishing:
21631
21632         class X {
21633                 void a (Blah x) {}
21634                 void a (NS.Blah x) {}
21635         }
21636
21637         Which depending on the context might be valid or not, as we do not
21638         know if Blah is the same thing as NS.Blah at that point.
21639
21640         * Redid everything so the code uses TypeRefs now instead of
21641         Types.  TypeRefs are just temporary type placeholders, that need
21642         to be resolved.  They initially have a pointer to a string and the
21643         current scope in which they are used.  This is used later by the
21644         compiler to resolve the reference to an actual Type. 
21645
21646         * DeclSpace is no longer a CIR.Type, and neither are
21647         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21648         are all DeclSpaces, but no Types. 
21649
21650         * type.cs (TypeRefManager): This implements the TypeRef manager,
21651         which keeps track of all the types that need to be resolved after
21652         the parsing has finished. 
21653
21654 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21655
21656         * ARGH.  We are going to have to store `foreach' as a class rather
21657         than resolving it, as we need to verify error 1579 after name
21658         resolution.   *OR* we could keep a flag that says `This request to
21659         IEnumerator comes from a foreach statement' which we can then use
21660         to generate the error.
21661
21662 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21663
21664         * class.cs (TypeContainer.AddMethod): we now add methods to the
21665         MethodGroup instead of the method hashtable.  
21666
21667         * expression.cs: Add MethodGroup abstraction, which gets us one
21668         step closer to the specification in the way we handle method
21669         declarations.  
21670
21671         * cs-parser.jay (primary_expression): qualified_identifier now
21672         tried to match up an identifier to a local variable reference or
21673         to a parameter reference.
21674
21675         current_local_parameters is now a parser global variable that
21676         points to the current parameters for the block, used during name
21677         lookup.
21678
21679         (property_declaration): Now creates an implicit `value' argument to
21680         the set accessor.
21681
21682 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21683
21684         * parameter.cs: Do not use `param' arguments as part of the
21685         signature, per the spec.
21686
21687 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21688
21689         * decl.cs: Base class for classes, structs and interfaces.  This
21690         is the "Declaration Space" 
21691
21692         * cs-parser.jay: Use CheckDef for checking declaration errors
21693         instead of having one on each function.
21694
21695         * class.cs: Factor out some code for handling error handling in
21696         accordance to the "Declarations" section in the "Basic Concepts"
21697         chapter in the ECMA C# spec.
21698
21699         * interface.cs: Make all interface member classes derive from
21700         InterfaceMemberBase.
21701
21702 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21703
21704         * Many things: all interfaces are parsed and generated in
21705         gen-treedump.  Support for member variables, constructors,
21706         destructors, properties, constants is there.
21707
21708         Beginning of the IL backend, but very little done, just there for
21709         testing purposes. 
21710
21711 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21712
21713         * cs-parser.jay: Fix labeled statement.
21714
21715         * cs-tokenizer.cs (escape): Escape " and ' always.
21716         ref_line, ref_name: keep track of the line/filename as instructed
21717         by #line by the compiler.
21718         Parse #line.
21719
21720 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21721
21722         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21723         to match the values in System.CodeDOM.
21724
21725         Divid renamed to Divide.
21726
21727         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21728         statements. 
21729         (Statements.set): remove.
21730
21731         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21732         statements. 
21733
21734         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21735         falseStatements always have valid values. 
21736
21737         * cs-parser.jay: Use System.CodeDOM now.
21738